1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1898624e"],{"01f9":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r("bd8b");e.default=function(t){return Array.isArray?Array.isArray(t):n.default(t,"Array")}},"0538":function(t,e,r){"use strict";var n=r("da84"),i=r("e330"),o=r("59ed"),a=r("861d"),s=r("1a2d"),c=r("f36a"),u=n.Function,f=i([].concat),h=i([].join),d={},l=function(t,e,r){if(!s(d,e)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";d[e]=u("C,a","return new C("+h(n,",")+")")}return d[e](t,r)};t.exports=u.bind||function(t){var e=o(this),r=e.prototype,n=c(arguments,1),i=function(){var r=f(n,c(arguments));return this instanceof i?l(e,r.length,r):e.apply(t,r)};return a(r)&&(i.prototype=r),i}},"067f":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={version:"3.5.2",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",customGroupContainerClassName:"custom-group-container",delegateContainerClassName:"delegate-container",defaultShapeFillColor:"#C6E5FF",defaultShapeStrokeColor:"#5B8FF9",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#595959",textAlign:"center",textBaseline:"middle"},offset:5},defaultNode:{type:"circle",style:{fill:"#C6E5FF",lineWidth:1,stroke:"#5B8FF9"},size:20,color:"#5B8FF9"},edgeLabel:{style:{fill:"#595959",textAlign:"center",textBaseline:"middle"}},defaultEdge:{type:"line",style:{stroke:"#e2e2e2"},size:1,color:"#e2e2e2"},comboLabel:{style:{fill:"#595959",textBaseline:"middle"},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:"#F3F9FF",lineWidth:1,stroke:"#A3B1BF",opacity:.8,r:5,width:20,height:10},size:[20,5],color:"#A3B1BF",padding:[25,20,15,20]},nodeStateStyle:{},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]}};e.default=n},"0dfa":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDegree=e.rotate=e.scale=e.move=e.translate=e.getAdjMatrix=e.floydWarshall=e.scaleMatrix=e.distance=e.getCircleCenterByPoints=e.invertMatrix=e.applyMatrix=e.getEllipseIntersectByPoint=e.getCircleIntersectByPoint=e.getRectIntersectByPoint=void 0;var n=r("e897"),i=o(r("01f9"));function o(t){return t&&t.__esModule?t:{default:t}}var a=function(t,e,r){return t>=e&&t<=r},s=function(t,e,r,n){var i=.001,o={x:r.x-t.x,y:r.y-t.y},s={x:e.x-t.x,y:e.y-t.y},c={x:n.x-r.x,y:n.y-r.y},u=s.x*c.y-s.y*c.x,f=u*u,h=s.x*s.x+s.y*s.y,d=c.x*c.x+c.y*c.y,l=null;if(f>i*h*d){var p=(o.x*c.y-o.y*c.x)/u,y=(o.x*s.y-o.y*s.x)/u;a(p,0,1)&&a(y,0,1)&&(l={x:t.x+p*s.x,y:t.y+p*s.y})}return l},c=function(t,e){var r=t.x,n=t.y,i=t.width,o=t.height,a=r+i/2,c=n+o/2,u=[],f={x:a,y:c};u.push({x:r,y:n}),u.push({x:r+i,y:n}),u.push({x:r+i,y:n+o}),u.push({x:r,y:n+o}),u.push({x:r,y:n});for(var h=null,d=1;d<u.length;d++)if(h=s(u[d-1],u[d],f,e),h)break;return h};e.getRectIntersectByPoint=c;var u=function(t,e){var r=t.x,n=t.y,i=t.r,o=e.x,a=e.y,s=o-r,c=a-n,u=Math.sqrt(s*s+c*c);if(u<i)return null;var f=Math.sign(s),h=Math.sign(c),d=Math.atan(c/s);return{x:r+Math.abs(i*Math.cos(d))*f,y:n+Math.abs(i*Math.sin(d))*h}};e.getCircleIntersectByPoint=u;var f=function(t,e){var r=t.rx,n=t.ry,i=t.x,o=t.y,a=e.x-i,s=e.y-o,c=Math.atan2(s/n,a/r);return c<0&&(c+=2*Math.PI),{x:i+r*Math.cos(c),y:o+n*Math.sin(c)}};e.getEllipseIntersectByPoint=f;var h=function(t,e,r){void 0===r&&(r=1);var i=[t.x,t.y,r];return e&&NaN!==e[0]||(e=n.mat3.create()),n.vec3.transformMat3(i,i,e),{x:i[0],y:i[1]}};e.applyMatrix=h;var d=function(t,e,r){void 0===r&&(r=1),e&&NaN!==e[0]||(e=n.mat3.create());var i=n.mat3.invert([],e);i||(i=n.mat3.create());var o=[t.x,t.y,r];return n.vec3.transformMat3(o,o,i),{x:o[0],y:o[1]}};e.invertMatrix=d;var l=function(t,e,r){var n=t.x-e.x,i=t.y-e.y,o=t.x-r.x,a=t.y-r.y,s=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,c=(t.x*t.x-r.x*r.x-r.y*r.y+t.y*t.y)/2,u=i*o-n*a;return{x:-(a*s-i*c)/u,y:-(n*c-o*s)/u}};e.getCircleCenterByPoints=l;var p=function(t,e){var r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)};e.distance=p;var y=function(t,e){var r=[];return t.forEach((function(t){var n=[];t.forEach((function(t){n.push(t*e)})),r.push(n)})),r};e.scaleMatrix=y;var g=function(t){for(var e=[],r=t.length,n=0;n<r;n+=1){e[n]=[];for(var i=0;i<r;i+=1)n===i?e[n][i]=0:0!==t[n][i]&&t[n][i]?e[n][i]=t[n][i]:e[n][i]=1/0}for(var o=0;o<r;o+=1)for(n=0;n<r;n+=1)for(i=0;i<r;i+=1)e[n][i]>e[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e};e.floydWarshall=g;var v=function(t,e){var r=t.nodes,n=t.edges,i=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach((function(t,e){o[t.id]=e;var r=[];i.push(r)})),n&&n.forEach((function(t){var r=t.source,n=t.target,a=o[r],s=o[n];i[a][s]=1,e||(i[s][a]=1)})),i};e.getAdjMatrix=v;var x=function(t,e){t.translate(e.x,e.y)};e.translate=x;var m=function(t,e){var r=t.getMatrix();r||(r=n.mat3.create());var i=t.getCanvasBBox(),o=e.x-i.minX,a=e.y-i.minY,s=(0,n.transform)(r,[["t",o,a]]);t.setMatrix(s)};e.move=m;var b=function(t,e){var r=t.getMatrix();r||(r=n.mat3.create());var o=e;(0,i.default)(e)||(o=[e,e]),(0,i.default)(e)&&1===e.length&&(o=[e[0],e[0]]),r=(0,n.transform)(r,[["s",o[0],o[1]]]),t.setMatrix(r)};e.scale=b;var S=function(t,e){var r=t.getMatrix();r||(r=n.mat3.create()),r=(0,n.transform)(r,[["r",e]]),t.setMatrix(r)};e.rotate=S;var w=function(t,e,r){for(var n=[],i=0;i<t;i++)n[i]=0;return r.forEach((function(t){t.source&&(n[e[t.source]]+=1),t.target&&(n[e[t.target]]+=1)})),n};e.getDegree=w},"131a":function(t,e,r){var n=r("23e7"),i=r("d2bb");n({target:"Object",stat:!0},{setPrototypeOf:i})},"262e":function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));r("131a");function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},"2caf":function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));r("4ae1"),r("d3b7"),r("f8c9"),r("131a"),r("3410");function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function i(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var o=r("7037"),a=r.n(o);function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){if(e&&("object"===a()(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}function u(t){var e=i();return function(){var r,i=n(t);if(e){var o=n(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return c(this,r)}}},3410:function(t,e,r){var n=r("23e7"),i=r("d039"),o=r("7b0b"),a=r("e163"),s=r("e177"),c=i((function(){a(1)}));n({target:"Object",stat:!0,forced:c,sham:!s},{getPrototypeOf:function(t){return a(o(t))}})},"4ae1":function(t,e,r){var n=r("23e7"),i=r("d066"),o=r("2ba4"),a=r("0538"),s=r("5087"),c=r("825a"),u=r("861d"),f=r("7c73"),h=r("d039"),d=i("Reflect","construct"),l=Object.prototype,p=[].push,y=h((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),g=!h((function(){d((function(){}))})),v=y||g;n({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,e){s(t),c(e);var r=arguments.length<3?t:s(arguments[2]);if(g&&!y)return d(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return o(p,n,e),new(o(a,t,n))}var i=r.prototype,h=f(u(i)?i:l),v=o(t,h,e);return u(v)?v:h}})},7037:function(t,e,r){function n(e){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?(t.exports=n=function(t){return typeof t},t.exports["default"]=t.exports,t.exports.__esModule=!0):(t.exports=n=function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports["default"]=t.exports,t.exports.__esModule=!0),n(e)}r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),t.exports=n,t.exports["default"]=t.exports,t.exports.__esModule=!0},7680:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};e.default=n},"7da3":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r("8937"),i={};function o(t){return i[t]||(i[t]=(0,n.upperFirst)(t)),i[t]}var a={defaultShapeType:"defaultType",className:null,getShape:function(t){var e=this,r=e[t]||e[e.defaultShapeType];return r},draw:function(t,e,r){var n=this.getShape(t),i=n.draw(e,r);return n.afterDraw&&n.afterDraw(e,r,i),i},baseUpdate:function(t,e,r){var n=this.getShape(t);n.update&&n.update(e,r),n.afterUpdate&&n.afterUpdate(e,r)},setState:function(t,e,r,n){var i=this.getShape(t);i.setState(e,r,n)},shouldUpdate:function(t){var e=this.getShape(t);return!!e.update},getControlPoints:function(t,e){var r=this.getShape(t);return r.getControlPoints(e)},getAnchorPoints:function(t,e){var r=this.getShape(t);return r.getAnchorPoints(e)}},s={options:{},draw:function(t,e){return this.drawShape(t,e)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e=this.options.anchorPoints,r=t.anchorPoints||e;return r}},c=function(){function t(){}return t.registerFactory=function(e,r){var n=o(e),i=a,s=Object.assign({},i,r);return t[n]=s,s.className=n,s},t.getFactory=function(e){var r=o(e);return t[r]},t.registerNode=function(e,r,n){var i=t.Node,o=n?i.getShape(n):s,a=Object.assign({},o,r);return a.type=e,a.itemType="node",i[e]=a,a},t.registerEdge=function(e,r,n){var i=t.Edge,o=n?i.getShape(n):s,a=Object.assign({},o,r);return a.type=e,a.itemType="edge",i[e]=a,a},t.registerCombo=function(e,r,n){var i=t.Combo,o=n?i.getShape(n):s,a=Object.assign({},o,r);return a.type=e,a.itemType="combo",i[e]=a,a},t}(),u=c;e.default=u,c.registerFactory("node",{defaultShapeType:"circle"}),c.registerFactory("edge",{defaultShapeType:"line"}),c.registerFactory("combo",{defaultShapeType:"circle"})},bd8b:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={}.toString,i=function(t,e){return n.call(t)==="[object "+e+"]"};e.default=i},c0b3:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getComboBBox=e.reconstructTree=e.plainCombosToTrees=e.getTextSize=e.getLetterWidth=e.radialLayout=e.traverseTreeUp=e.traverseTree=e.getLabelPosition=e.getLoopCfgs=e.getBBox=void 0;var n=r("9ab4"),i=r("e897"),o=u(r("067f")),a=r("0dfa"),s=u(r("7680")),c=r("8937");function u(t){return t&&t.__esModule?t:{default:t}}var f=Math.PI,h=Math.sin,d=Math.cos,l=h(f/8),p=d(f/8),y=function(t,e){var r=t.getBBox(),n={x:r.minX,y:r.minY},o={x:r.maxX,y:r.maxY};if(e){var s=e.getMatrix();s||(s=i.mat3.create()),n=(0,a.applyMatrix)(n,s),o=(0,a.applyMatrix)(o,s)}var c=n.x,u=n.y,f=o.x,h=o.y;return{x:c,y:u,minX:c,minY:u,maxX:f,maxY:h,width:f-c,height:h-u}};e.getBBox=y;var g=function(t){var e=t.sourceNode||t.targetNode,r=e.get("group"),n=r.getMatrix();n||(n=i.mat3.create());var a=e.getKeyShape(),s=a.getBBox(),c=t.loopCfg||{},u=c.dist||2*Math.max(s.width,s.height),f=c.position||o.default.defaultLoopPosition,h=[n[6],n[7]],d=[t.startPoint.x,t.startPoint.y],y=[t.endPoint.x,t.endPoint.y],g=s.height/2,v=s.height/2,x=g*l,m=g*p,b=v*l,S=v*p;if(d[0]===y[0]&&d[1]===y[1]){switch(f){case"top":d=[h[0]-x,h[1]-m],y=[h[0]+b,h[1]-S];break;case"top-right":g=s.height/2,v=s.width/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]+x,h[1]-m],y=[h[0]+S,h[1]-b];break;case"right":g=s.width/2,v=s.width/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]+m,h[1]-x],y=[h[0]+S,h[1]+b];break;case"bottom-right":g=s.width/2,v=s.height/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]+m,h[1]+x],y=[h[0]+b,h[1]+S];break;case"bottom":g=s.height/2,v=s.height/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]+x,h[1]+m],y=[h[0]-b,h[1]+S];break;case"bottom-left":g=s.height/2,v=s.width/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]-x,h[1]+m],y=[h[0]-S,h[1]+b];break;case"left":g=s.width/2,v=s.width/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]-m,h[1]+x],y=[h[0]-S,h[1]-b];break;case"top-left":g=s.width/2,v=s.height/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]-m,h[1]-x],y=[h[0]-b,h[1]-S];break;default:g=s.width/2,v=s.width/2,x=g*l,m=g*p,b=v*l,S=v*p,d=[h[0]-x,h[1]-m],y=[h[0]+b,h[1]-S]}if(!1===c.clockwise){var w=[d[0],d[1]];d=[y[0],y[1]],y=[w[0],w[1]]}}var C=[d[0]-h[0],d[1]-h[1]],B=(g+u)/g,M=(v+u)/v;!1===c.clockwise&&(B=(v+u)/v,M=(g+u)/g);var P=i.vec2.scale([],C,B),O=[h[0]+P[0],h[1]+P[1]],_=[y[0]-h[0],y[1]-h[1]],I=i.vec2.scale([],_,M),T=[h[0]+I[0],h[1]+I[1]];return t.startPoint={x:d[0],y:d[1]},t.endPoint={x:y[0],y:y[1]},t.controlPoints=[{x:O[0],y:O[1]},{x:T[0],y:T[1]}],t};e.getLoopCfgs=g;var v=function(t,e,r,i,o){var a=1e-4,s=[],c=t.getPoint(e);if(null===c)return{x:0,y:0,angle:0};if(e<a)s=t.getStartTangent().reverse();else if(e>1-a)s=t.getEndTangent();else{var u=t.getPoint(e+a);s.push([c.x,c.y]),s.push([u.x,u.y])}var l=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(l<0&&(l+=2*f),r&&(c.x+=d(l)*r,c.y+=h(l)*r),i){var p=l-f/2;l>.5*f&&l<1.5*f&&(p-=f),c.x+=d(p)*i,c.y+=h(p)*i}var y={x:c.x,y:c.y,angle:l};return o?(l>.5*f&&l<1.5*f&&(l-=f),(0,n.__assign)({rotate:l},y)):y};e.getLabelPosition=v;var x=function t(e,r){if(!1===r(e))return!1;if(e&&e.children)for(var n=e.children.length-1;n>=0;n--)if(!t(e.children[n],r))return!1;return!0},m=function t(e,r){if(e&&e.children)for(var n=e.children.length-1;n>=0;n--)if(!t(e.children[n],r))return;return!1!==r(e)},b=function(t,e){"function"===typeof e&&x(t,e)};e.traverseTree=b;var S=function(t,e){"function"===typeof e&&m(t,e)};e.traverseTreeUp=S;var w=function(t,e){var r=["V","TB","BT"],n={x:1/0,y:1/0},i={x:-1/0,y:-1/0},o="x",a="y";e&&r.indexOf(e)>=0&&(a="x",o="y");var s=0;b(t,(function(t){return s++,t.x>i.x&&(i.x=t.x),t.x<n.x&&(n.x=t.x),t.y>i.y&&(i.y=t.y),t.y<n.y&&(n.y=t.y),!0}));var c=2*f/s,u=i[a]-n[a];return 0===u||b(t,(function(e){var r=(e[a]-n[a])/u*(2*f-c)+c,i=Math.abs("x"===o?e.x-t.x:e.y-t.y);return e.x=i*Math.cos(r),e.y=i*Math.sin(r),!0})),t};e.radialLayout=w;var C=function(t,e){return e*(s.default[t]||1)};e.getLetterWidth=C;var B=function(t,e){var r=0,n=new RegExp("[一-龥]+");return t.split("").forEach((function(t){n.test(t)?r+=e:r+=C(t,e)})),[r,e]};e.getTextSize=B;var M=function(t,e){var r=[],n={},i={};t.forEach((function(t){i[t.id]=t})),t.forEach((function(t,e){var o=(0,c.clone)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo "+o.id+" can not be the same as the combo's id"),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo "+o.id+" does not exist!"),delete o.parentId);var a=n[o.id];if(a){if(o.children=a.children,n[o.id]=o,a=o,!a.parentId)return void r.push(a);var s=n[a.parentId];if(s)return void(s.children?s.children.push(o):s.children=[o]);var u={id:a.parentId,children:[a]};return n[a.parentId]=u,void(n[o.id]=o)}if((0,c.isString)(t.parentId)){var f=n[t.parentId];if(f)f.children?f.children.push(o):f.children=[o],n[o.id]=o;else{var h={id:t.parentId,children:[o]};n[h.id]=h,n[o.id]=o}}else r.push(o),n[o.id]=o}));var o={};return e&&e.forEach((function(t){o[t.id]=t;var e=n[t.comboId];if(e){var r={id:t.id,comboId:t.comboId};e.children?e.children.push(r):e.children=[r],r.itemType="node",n[t.id]=r}})),r.forEach((function(t){t.depth=0,x(t,(function(t){var e,r=n[t.id]["itemType"];e="node"===r?n[t["comboId"]]:n[t.parentId],t.depth=e?"node"===r?e.depth+1:e.depth+2:0;var i=o[t.id];return i&&(i.depth=t.depth),!0}))})),r};e.plainCombosToTrees=M;var P=function(t,e,r){var n,i=t,o={root:{children:t}},a=!1,s="root";t&&t.forEach((function(t){if(!a)return t.id===e?(n=t,"combo"===t.itemType?n.parentId=r:n.comboId=r,void(a=!0)):void b(t,(function(t){return o[t.id]={children:t.children},i=o[t.parentId||t.comboId||"root"].children,!t||!t.removed&&e!==t.id||!i||(s=t.parentId||t.comboId||"root",n=t,"combo"===t.itemType?n.parentId=r:n.comboId=r,a=!0,!1)}))})),i=o[s].children;var c=i?i.indexOf(n):-1;if(c>-1&&i.splice(c,1),a||(n={id:e,itemType:"node",comboId:r},o[e]={children:void 0}),e){var u=!1;if(r){var f=0;t&&t.forEach((function(t){u||b(t,(function(t){return r!==t.id||(u=!0,t.children?t.children.push(n):t.children=[n],f=t.depth,"node"===n.itemType?n.depth=f+2:n.depth=f+1,!1)}))}))}else r&&u||"node"===n.itemType||t.push(n);var h=n.depth;b(n,(function(t){return"node"===t.itemType?h+=2:h+=1,t.depth=h,!0}))}return t};e.reconstructTree=P;var O=function(t,e){var r={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0};return t&&0!==t.length?(t.forEach((function(t){var n=e.findById(t.id);if(n.isVisible()){n.set("bboxCanvasCache",void 0);var i=n.getCanvasBBox();i.x&&r.minX>i.minX&&(r.minX=i.minX),i.y&&r.minY>i.minY&&(r.minY=i.minY),i.x&&r.maxX<i.maxX&&(r.maxX=i.maxX),i.y&&r.maxY<i.maxY&&(r.maxY=i.maxY)}})),r.x=(r.minX+r.maxX)/2,r.y=(r.minY+r.maxY)/2,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,Object.keys(r).forEach((function(t){r[t]!==1/0&&r[t]!==-1/0||(r[t]=void 0)})),r):r};e.getComboBBox=O},d4ec:function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",(function(){return n}))},f694:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r("8937"),i=s(r("7da3")),o=r("c0b3"),a=r("0dfa");function s(t){return t&&t.__esModule?t:{default:t}}var c="bboxCache",u="bboxCanvasCache",f=["fillStyle","strokeStyle","path","points","img","symbol"],h=function(){function t(t){this._cfg={},this.destroyed=!1;var e={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(e,this.getDefaultCfg(),t);var r=this.get("model").id;r||(r=(0,n.uniqueId)(this.get("type")),this.get("model").id=r),this.set("id",r);var i=t.group;i&&(i.set("item",this),i.set("id",r)),this.init(),this.draw()}return t.prototype.calculateBBox=function(){var t=this.get("keyShape"),e=this.get("group"),r=(0,o.getBBox)(t,e);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},t.prototype.calculateCanvasBBox=function(){var t=this.get("keyShape"),e=this.get("group"),r=(0,o.getBBox)(t,e);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},t.prototype.drawInner=function(){var t=this,e=t.get("shapeFactory"),r=t.get("group"),n=t.get("model");if(r.clear(),e){t.updatePosition(n);var i=t.getShapeCfg(n),o=i.shape||i.type,a=e.draw(o,i,r);a&&(t.set("keyShape",a),a.set("isKeyShape",!0),a.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",o),this.restoreStates(e,o)}},t.prototype.setOriginStyle=function(t){var e={},r=this.get("group"),i=r.get("children"),o=this.getKeyShape(),a=this;(0,n.each)(i,(function(t){var r=t.get("name");if(r)e[r]=a.getShapeStyleByName(r);else{var n=o.get("name"),i=a.getShapeStyleByName();n?e[n]=i:Object.assign(e,i)}}));var s=this.getOriginStyle(),c={};c=t?(0,n.deepMix)({},s,e,t.style,{labelCfg:t.labelCfg}):(0,n.deepMix)({},s,e),a.set("originStyle",c)},t.prototype.restoreStates=function(t,e){var r=this,i=r.get("states");(0,n.each)(i,(function(n){t.setState(e,n,!0,r)}))},t.prototype.init=function(){var t=i.default.getFactory(this.get("type"));this.set("shapeFactory",t)},t.prototype.get=function(t){return this._cfg[t]},t.prototype.set=function(t,e){(0,n.isPlainObject)(t)?this._cfg=Object.assign({},this._cfg,t):this._cfg[t]=e},t.prototype.getDefaultCfg=function(){return{}},t.prototype.clearCache=function(){this.set(c,null),this.set(u,null)},t.prototype.beforeDraw=function(){},t.prototype.afterDraw=function(){},t.prototype.afterUpdate=function(){},t.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},t.prototype.getShapeStyleByName=function(t){var e=this,r=this.get("group"),i=this.getKeyShape();if(t&&(i=r.find((function(e){return e.get("name")===t}))),i){var o={},a=this.get("states");return a.map((function(t){var r=e.getStateStyle(t);for(var i in r)if((0,n.isPlainObject)(r[i])){var o=r[i];for(var a in o)f.includes(a)||f.push(a)}else f.includes(i)||f.push(i)})),(0,n.each)(i.attr(),(function(t,e){f.indexOf(e)<0&&(o[e]=t)})),o}return{}},t.prototype.getShapeCfg=function(t){var e=this.get("styles");if(e){var r=t;return r.style=Object.assign({},e,t.style),r}return t},t.prototype.getStateStyle=function(t){var e=this.get("styles"),r=e&&e[t];return r},t.prototype.getOriginStyle=function(){return this.get("originStyle")},t.prototype.getCurrentStatesStyle=function(){var t=this,e={};return(0,n.each)(t.getStates(),(function(r){Object.assign(e,t.getStateStyle(r))})),e},t.prototype.setState=function(t,e){var r=this.get("states"),i=this.get("shapeFactory"),o=t,a=t;(0,n.isString)(e)&&(o=t+":"+e,a=t+":");var s=r;if((0,n.isBoolean)(e)){var c=r.indexOf(a);if(e){if(c>-1)return;r.push(o)}else c>-1&&r.splice(c,1)}else if((0,n.isString)(e)){var u=r.filter((function(t){return t.includes(a)}));u.length>0&&this.clearStates(u),s=s.filter((function(t){return!t.includes(a)})),s.push(o),this.set("states",s)}if(i){var f=this.get("model"),h=f.shape||f.type;i.setState(h,t,e,this)}},t.prototype.clearStates=function(t){var e=this,r=e.getStates(),i=e.get("shapeFactory"),o=e.get("model"),a=o.shape||o.type;t||(t=r),(0,n.isString)(t)&&(t=[t]);var s=r.filter((function(e){return-1===t.indexOf(e)}));e.set("states",s),t.forEach((function(t){i.setState(a,t,!1,e)}))},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){var e=this.getStates();return e.indexOf(t)>=0},t.prototype.refresh=function(){var t=this.get("model");this.updatePosition(t),this.updateShape(),this.afterUpdate(),this.clearCache()},t.prototype.isOnlyMove=function(t){return!1},t.prototype.update=function(t){var e=this.get("model"),r={x:e.x,y:e.y};t.x=isNaN(t.x)?e.x:t.x,t.y=isNaN(t.y)?e.y:t.y;var i=this.get("styles");if(t.stateStyles){var o=t.stateStyles;(0,n.mix)(i,o),delete t.stateStyles}Object.assign(e,t);var a=this.isOnlyMove(t);a?this.updatePosition(t):(r.x===t.x&&r.y===t.y||this.updatePosition(t),this.updateShape()),this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(){var t=this.get("shapeFactory"),e=this.get("model"),r=e.shape||e.type;if(t.shouldUpdate(r)&&r===this.get("currentShape")){var n=this.getShapeCfg(e);t.baseUpdate(r,n,this)}else this.draw();this.setOriginStyle(e),this.restoreStates(t,r)},t.prototype.updatePosition=function(t){var e=this.get("model"),r=(0,n.isNil)(t.x)?e.x:t.x,i=(0,n.isNil)(t.y)?e.y:t.y,o=this.get("group");(0,n.isNil)(r)||(0,n.isNil)(i)||(o.resetMatrix(),(0,a.translate)(o,{x:r,y:i}),e.x=r,e.y=i,this.clearCache())},t.prototype.getBBox=function(){var t=this.get(c);return t||(t=this.calculateBBox(),this.set(c,t)),t},t.prototype.getCanvasBBox=function(){var t=this.get(u);return t||(t=this.calculateCanvasBBox(),this.set(u,t)),t},t.prototype.toFront=function(){var t=this.get("group");t.toFront()},t.prototype.toBack=function(){var t=this.get("group");t.toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),d=h;e.default=d},f8c9:function(t,e,r){var n=r("23e7"),i=r("da84"),o=r("d44e");n({global:!0},{Reflect:{}}),o(i.Reflect,"Reflect",!0)}}]);
|