!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.f6=e():t.f6=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=204)}({0:function(t,e,n){"use strict";n.d(e,"e",(function(){return x})),n.d(e,"x",(function(){return w})),n.d(e,"l",(function(){return S})),n.d(e,"p",(function(){return g})),n.d(e,"q",(function(){return v})),n.d(e,"s",(function(){return O})),n.d(e,"u",(function(){return C})),n.d(e,"w",(function(){return P})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return j})),n.d(e,"i",(function(){return a})),n.d(e,"j",(function(){return s})),n.d(e,"k",(function(){return M})),n.d(e,"m",(function(){return h})),n.d(e,"n",(function(){return p})),n.d(e,"o",(function(){return m})),n.d(e,"a",(function(){return N})),n.d(e,"b",(function(){return _})),n.d(e,"c",(function(){return l})),n.d(e,"h",(function(){return L})),n.d(e,"r",(function(){return I})),n.d(e,"d",(function(){return D})),n.d(e,"v",(function(){return F})),n.d(e,"t",(function(){return X}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i={}.toString,o=function(t,e){return i.call(t)==="[object "+e+"]"},a=function(t){return o(t,"Function")},s=function(t){return null==t},u=function(t){return Array.isArray?Array.isArray(t):o(t,"Array")};function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var h=function(t){var e=c(t);return null!==t&&"object"===e||"function"===e};var l=function(t,e){if(t)if(u(t))for(var n=0,r=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?e*i+o(e,n)*(i-1):e},e.getLineSpaceing=o,e.getTextWidth=function(t,e){var n=i.getOffScreenContext(),o=0;if(r.isNil(t)||""===t)return o;if(n.save(),n.font=e,r.isString(t)&&t.includes("\n")){var a=t.split("\n");r.each(a,(function(t){var e=n.measureText(t).width;o1)for(var n=1;n=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,a=t.maxY;if(e){var s=Object(o.c)(e,[t.minX,t.minY]),u=Object(o.c)(e,[t.maxX,t.minY]),c=Object(o.c)(e,[t.minX,t.maxY]),h=Object(o.c)(e,[t.maxX,t.maxY]);n=Math.min(s[0],u[0],c[0],h[0]),i=Math.max(s[0],u[0],c[0],h[0]),r=Math.min(s[1],u[1],c[1],h[1]),a=Math.max(s[1],u[1],c[1],h[1])}var l=this.attrs;if(l.shadowColor){var f=l.shadowBlur,d=void 0===f?0:f,p=l.shadowOffsetX,g=void 0===p?0:p,v=l.shadowOffsetY,y=void 0===v?0:v,m=n-d+g,b=i+d+g,x=r-d+y,w=a+d+y;n=Math.min(n,m),i=Math.max(i,b),r=Math.min(r,x),a=Math.max(a,w)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:a,width:i-n,height:a-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1}}(i.a)},11:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelize=e.isString=void 0;e.isString=function(t){return"string"==typeof t};var r,i,o=/-(\w)/g;e.camelize=(r=function(t){return t.replace(o,(function(t,e){return e?e.toUpperCase():""}))},i=Object.create(null),function(t){return i[t]||(i[t]=r(t))})},110:function(t,e,n){var r=n(212),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,c=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:c})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),u=s-a;return s===a?e=0:r===s?e=(i-o)/u:i===s?e=2+(o-r)/u:o===s&&(e=4+(r-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?u/(s+a):u/(2-s-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,c=Math.max(a,s,u),h=c-Math.min(a,s,u),l=function(t){return(c-t)/6/h+.5};return 0===h?i=o=0:(o=h/c,e=l(a),n=l(s),r=l(u),a===c?i=r-n:s===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],h=(o=t,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));h.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[c]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,s,u=t[0]/360,c=t[1]/100,h=t[2]/100,l=c+h;switch(l>1&&(c/=l,h/=l),r=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(r=1-r),i=c+r*((n=1-h)-c),e){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},111:function(t,e){},112:function(t,e){},12:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},13:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNumber=e.isNaN=e.isNumber=void 0;e.isNumber=function(t){return"number"==typeof t};e.isNaN=function(t){return Number.isNaN(Number(t))};e.toNumber=function(t){var n=parseFloat(t);return e.isNaN(n)?t:n}},14:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.traverseTreeUp=e.scaleMatrix=e.getAdjMatrix=e.floydWarshall=e.getDegree=void 0;e.getDegree=function(t,e,n){for(var r=[],i=0;ie[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e};e.getAdjMatrix=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i};e.scaleMatrix=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n};e.traverseTreeUp=function(t,e){"function"==typeof e&&function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)}(t,e)}},15:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0&&e._call.call(null,t),e=e._next;--f}()}finally{f=0,function(){var t,e,n=h,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:h=e);l=t,C(r)}(),v=0}}function k(){var t=m.now(),e=t-g;e>1e3&&(y-=e,g=t)}function C(t){f||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(O,t-m.now()-y)),p&&(p=clearInterval(p))):(p||(g=m.now(),p=setInterval(k,1e3)),f=1,b(O)))}function E(t){return+t}function P(t){return t*t}function j(t){return t*(2-t)}function A(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function I(t){return t*t*t}function T(t){return--t*t*t+1}function N(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}M.prototype=S.prototype={constructor:M,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?x():+n)+(null==e?0:+e),this._next||l===this||(l?l._next=this:h=this,l=this),this._call=t,this._time=n,C()},stop:function(){this._call&&(this._call=null,this._time=1/0,C())}};var B=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),_=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),L=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),D=Math.PI,R=D/2;function F(t){return 1==+t?1:1-Math.cos(t*R)}function X(t){return Math.sin(t*R)}function Y(t){return(1-Math.cos(D*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function W(t){return z(1-+t)}function q(t){return 1-z(t)}function G(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function V(t){return 1-Math.sqrt(1-t*t)}function H(t){return Math.sqrt(1- --t*t)}function U(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Z=7.5625;function Q(t){return 1-K(1-t)}function K(t){return(t=+t)<4/11?Z*t*t:t<8/11?Z*(t-=6/11)*t+3/4:t<10/11?Z*(t-=9/11)*t+15/16:Z*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-K(1-t):K(t-1)+1)/2}var J=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),et=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),nt=2*Math.PI,rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),at=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function st(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ct="\\s*([+-]?\\d+)\\s*",ht="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ft=/^#([0-9a-f]{3,8})$/,dt=new RegExp("^rgb\\("+[ct,ct,ct]+"\\)$"),pt=new RegExp("^rgb\\("+[lt,lt,lt]+"\\)$"),gt=new RegExp("^rgba\\("+[ct,ct,ct,ht]+"\\)$"),vt=new RegExp("^rgba\\("+[lt,lt,lt,ht]+"\\)$"),yt=new RegExp("^hsl\\("+[ht,lt,lt]+"\\)$"),mt=new RegExp("^hsla\\("+[ht,lt,lt,ht]+"\\)$"),bt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xt(){return this.rgb().formatHex()}function wt(){return this.rgb().formatRgb()}function Mt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ft.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?St(e):3===n?new Et(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ot(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ot(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dt.exec(t))?new Et(e[1],e[2],e[3],1):(e=pt.exec(t))?new Et(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gt.exec(t))?Ot(e[1],e[2],e[3],e[4]):(e=vt.exec(t))?Ot(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=yt.exec(t))?It(e[1],e[2]/100,e[3]/100,1):(e=mt.exec(t))?It(e[1],e[2]/100,e[3]/100,e[4]):bt.hasOwnProperty(t)?St(bt[t]):"transparent"===t?new Et(NaN,NaN,NaN,0):null}function St(t){return new Et(t>>16&255,t>>8&255,255&t,1)}function Ot(t,e,n,r){return r<=0&&(t=e=n=NaN),new Et(t,e,n,r)}function kt(t){return t instanceof ut||(t=Mt(t)),t?new Et((t=t.rgb()).r,t.g,t.b,t.opacity):new Et}function Ct(t,e,n,r){return 1===arguments.length?kt(t):new Et(t,e,n,null==r?1:r)}function Et(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pt(){return"#"+At(this.r)+At(this.g)+At(this.b)}function jt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function At(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function It(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Nt(t,e,n,r)}function Tt(t){if(t instanceof Nt)return new Nt(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=Mt(t)),!t)return new Nt;if(t instanceof Nt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new Nt(a,s,u,t.opacity)}function Nt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Bt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function _t(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}at(ut,Mt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHsl:function(){return Tt(this).formatHsl()},formatRgb:wt,toString:wt}),at(Et,Ct,st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pt,formatHex:Pt,formatRgb:jt,toString:jt})),at(Nt,(function(t,e,n,r){return 1===arguments.length?Tt(t):new Nt(t,e,n,null==r?1:r)}),st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Nt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Nt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Et(Bt(t>=240?t-240:t+120,i,r),Bt(t,i,r),Bt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Lt=function(t){return function(){return t}};function Dt(t,e){return function(n){return t+n*e}}function Rt(t){return 1==(t=+t)?Ft:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Lt(isNaN(e)?n:e)}}function Ft(t,e){var n=e-t;return n?Dt(t,n):Lt(isNaN(t)?e:t)}var Xt=function t(e){var n=Rt(e);function r(t,e){var r=n((t=Ct(t)).r,(e=Ct(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ft(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Yt(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=ro&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Vt(n,r)})),o=Qt.lastIndex;return od.length?(f=te.c(o[l]),d=te.c(i[l]),d=te.a(d,f),d=te.b(d,f),e.fromAttrs.path=d,e.toAttrs.path=f):e.pathFormatted||(f=te.c(o[l]),d=te.c(i[l]),d=te.b(d,f),e.fromAttrs.path=d,e.toAttrs.path=f,e.pathFormatted=!0),r[l]=[];for(var p=0;p0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],ne(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ie=n(76),oe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ae(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function se(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(s.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var ue=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ie.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,h=a.clientY-t.clientY;u>120||c*c+h*h>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,ae(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||se(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ae(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ce=Object(o.a)(),he=ce&&"firefox"===ce.name;!function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(s.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new ue({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new re(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");s.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");s.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(he&&!Object(s.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(s.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))}}(a.a)},168:function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"distance",(function(){return h})),n.d(r,"isNumberEqual",(function(){return l})),n.d(r,"getBBoxByArray",(function(){return f})),n.d(r,"getBBoxRange",(function(){return d})),n.d(r,"piMod",(function(){return p}));var i=new Map;function o(t,e){i.set(t,e)}var a=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},s=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}};function u(t){return Math.min.apply(null,t)}function c(t){return Math.max.apply(null,t)}function h(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function l(t,e){return Math.abs(t-e)<.001}function f(t,e){var n=u(t),r=u(e);return{x:n,y:r,width:c(t)-n,height:c(e)-r}}function d(t,e,n,r){return{minX:u([t,n]),maxX:c([t,n]),minY:u([e,r]),maxY:c([e,r])}}function p(t){return(t+2*Math.PI)%(2*Math.PI)}n(47);function g(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function v(t,e,n){var r=t+n-2*e;if(l(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}var y=function(t,e,n,r,i,o){var a=v(t,n,i)[0],s=v(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(g(t,n,i,a)),void 0!==s&&c.push(g(e,r,o,s)),f(u,c)};function m(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function b(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,h=[];if(l(s,0))l(u,0)||(i=-c/u)>=0&&i<=1&&h.push(i);else{var f=u*u-4*s*c;l(f,0)?h.push(-u/(2*s)):f>0&&(o=(-u-(a=Math.sqrt(f)))/(2*s),(i=(-u+a)/(2*s))>=0&&i<=1&&h.push(i),o>=0&&o<=1&&h.push(o))}return h}var x=function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],h=b(t,n,i,a),l=b(e,r,o,s),d=0;dc&&(c=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,v=-1/0,y=[o,a];for(l=2*-Math.PI;l<=2*Math.PI;l+=Math.PI){var m=p+l;ov&&(v=b)}return{x:u,y:g,width:c-u,height:v-g}};function O(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function k(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=O(e,n.getCanvasBBox())),r&&(e=O(e,r.getCanvasBBox())),e}var C=n(39),E=n(40),P=n(0);function j(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(P.l)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),h=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(h-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}o("rect",a),o("image",a),o("circle",s),o("marker",s),o("polyline",(function(t){for(var e=t.attr().points,n=[],i=[],o=0;o=e&&t<=n},x=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,c=r.y-n.y,h=a*c-s*u,l=1/h;if(h*h>1e-4*(a*a+s*s)*(u*u+c*c)){var f=(i*c-o*u)*l,d=(i*s-o*a)*l;return b(f,0,1)&&b(d,0,1)?{x:t.x+f*a,y:t.y+f*s}:null}return null},w=function(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=[],s={x:n+i/2,y:r+o/2};a.push({x:n,y:r}),a.push({x:n+i,y:r}),a.push({x:n+i,y:r+o}),a.push({x:n,y:r+o}),a.push({x:n,y:r});for(var u=null,c=1;ce[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},A=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i},I=function(t,e){t.translate(e.x,e.y)},T=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=t.getCanvasBBox(),i=e.x-r.minX,o=e.y-r.minY,a=y(n,[["t",i,o]]);t.setMatrix(a)},N=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e;Object(u.f)(e)||(r=[e,e]),Object(u.f)(e)&&1===e.length&&(r=[e[0],e[0]]),n=y(n,[["s",r[0],r[1]]]),t.setMatrix(n)},B=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=y(n,[["r",e]]),t.setMatrix(n)},_=function(t,e,n){for(var r=[],i=0;i0!=o(u[1]-n)>0&&o(e-(n-s[1])*(s[0]-u[0])/(s[1]-u[1])-s[0])<0&&(r=!r)}return r},R=function(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=n(t),o=n(e);if(!R(i,o))return!1;var a=!1;if(Object(u.c)(e,(function(e){if(D(t,e[0],e[1]))return a=!0,!1})),a)return!0;if(Object(u.c)(t,(function(t){if(D(e,t[0],t[1]))return a=!0,!1})),a)return!0;var s=r(t),c=r(e),h=!1;return Object(u.c)(c,(function(t){if(function(t,e){var n=!1;return Object(u.c)(t,(function(t){if(x(t.from,t.to,e.from,e.to))return n=!0,!1})),n}(s,t))return h=!0,!1})),h},X=function(){function t(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}},t}(),Y=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},z=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),r=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=n/i,a=r/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},W=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=Y(r,n[a]),u=s[0],c=s[1],h=s[2],l=s[3];o[a]=x({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:c},{x:h,y:l}),o[a]&&(i+=1)}return[o,i]},q=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=Y(r,n[a]),u=s[0],c=s[1],h=s[2],l=s[3],f=z(e,new X(u,c,h,l));(f=Math.abs(f-.5))>=0&&f<=1&&(o+=1,i=f0){for(var r=0,i=t;re.x+e.width,i=t.y>e.y+e.height,o=t.y":.604998779296875,"/":.5,"?":.53699951171875},it=Math.PI,ot=Math.sin,at=Math.cos,st=ot(it/8),ut=at(it/8),ct=function(t,e){var n=t.getBBox(),r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),r=O(r,o),i=O(i,o)}var a=r.x,s=r.y,u=i.x,c=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:c,width:u-a,height:c-s}},ht=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group").getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e.getKeyShape().getBBox(),i=t.loopCfg||{},o=i.dist||2*Math.max(r.width,r.height),a=i.position||nt.defaultLoopPosition,s=[n[6],n[7]],u=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],h=r.height/2,l=r.height/2,f=h*st,d=h*ut,p=l*st,v=l*ut;if(u[0]===c[0]&&u[1]===c[1]){switch(a){case"top":u=[s[0]-f,s[1]-d],c=[s[0]+p,s[1]-v];break;case"top-right":h=r.height/2,l=r.width/2,u=[s[0]+(f=h*st),s[1]-(d=h*ut)],c=[s[0]+(v=l*ut),s[1]-(p=l*st)];break;case"right":h=r.width/2,l=r.width/2,u=[s[0]+(d=h*ut),s[1]-(f=h*st)],c=[s[0]+(v=l*ut),s[1]+(p=l*st)];break;case"bottom-right":h=r.width/2,l=r.height/2,u=[s[0]+(d=h*ut),s[1]+(f=h*st)],c=[s[0]+(p=l*st),s[1]+(v=l*ut)];break;case"bottom":h=r.height/2,l=r.height/2,u=[s[0]+(f=h*st),s[1]+(d=h*ut)],c=[s[0]-(p=l*st),s[1]+(v=l*ut)];break;case"bottom-left":h=r.height/2,l=r.width/2,u=[s[0]-(f=h*st),s[1]+(d=h*ut)],c=[s[0]-(v=l*ut),s[1]+(p=l*st)];break;case"left":h=r.width/2,l=r.width/2,u=[s[0]-(d=h*ut),s[1]+(f=h*st)],c=[s[0]-(v=l*ut),s[1]-(p=l*st)];break;case"top-left":h=r.width/2,l=r.height/2,u=[s[0]-(d=h*ut),s[1]-(f=h*st)],c=[s[0]-(p=l*st),s[1]-(v=l*ut)];break;default:h=r.width/2,l=r.width/2,u=[s[0]-(f=h*st),s[1]-(d=h*ut)],c=[s[0]+(p=l*st),s[1]-(v=l*ut)]}if(!1===i.clockwise){var y=[u[0],u[1]];u=[c[0],c[1]],c=[y[0],y[1]]}}var m=[u[0]-s[0],u[1]-s[1]],b=(h+o)/h,x=(l+o)/l;!1===i.clockwise&&(b=(l+o)/l,x=(h+o)/h);var w=g.c.scale([0,0],m,b),M=[s[0]+w[0],s[1]+w[1]],S=[c[0]-s[0],c[1]-s[1]],O=g.c.scale([0,0],S,x),k=[s[0]+O[0],s[1]+O[1]];return t.startPoint={x:u[0],y:u[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:M[0],y:M[1]},{x:k[0],y:k[1]}],t},lt=function(t,e,n,r,i){var o=[],a=t.getPoint(e);if(null===a)return{x:0,y:0,angle:0};if(e<1e-4)o=t.getStartTangent().reverse();else if(e>.9999)o=t.getEndTangent();else{var s=t.getPoint(e+1e-4);o.push([a.x,a.y]),o.push([s.x,s.y])}var u=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(u<0&&(u+=2*it),n&&(a.x+=at(u)*n,a.y+=ot(u)*n),r){var c=u-it/2;u>.5*it&&u<1.5*it&&(c-=it),a.x+=at(c)*r,a.y+=ot(c)*r}var h={x:a.x,y:a.y,angle:u};return i?(u>.5*it&&u<1.5*it&&(u-=it),Object(f.a)({rotate:u},h)):h},ft=function t(e,n){if(!1===n(e))return!1;if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return!1;return!0},dt=function(t,e){"function"==typeof e&&ft(t,e)},pt=function(t,e){"function"==typeof e&&function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!1!==n(e)}(t,e)},gt=function(t,e){return e*(rt[t]||1)},vt=function(t,e){var n=0,r=new RegExp("[一-龥]+");return t.split("").forEach((function(t){r.test(t)?n+=e:n+=gt(t,e)})),[n,e]},yt=function(t,e){var n=[],r={},i={};t.forEach((function(t){i[t.id]=t})),t.forEach((function(t,e){var o=Object(u.a)(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=r[o.id];if(a){if(o.children=a.children,r[o.id]=o,!(a=o).parentId)return void n.push(a);var s=r[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var c={id:a.parentId,children:[a]};r[a.parentId]=c,r[o.id]=o}}else if(Object(u.o)(t.parentId)){var h=r[t.parentId];if(h)h.children?h.children.push(o):h.children=[o],r[o.id]=o;else{var l={id:t.parentId,children:[o]};r[l.id]=l,r[o.id]=o}}else n.push(o),r[o.id]=o}));var o={};(e||[]).forEach((function(t){o[t.id]=t;var e=r[t.comboId];if(e){var n={id:t.id,comboId:t.comboId};e.children?e.children.push(n):e.children=[n],n.itemType="node",r[t.id]=n}}));var a=0;return n.forEach((function(t){t.depth=a+10,ft(t,(function(t){var e,n=r[t.id].itemType;e="node"===n?r[t.comboId]:r[t.parentId],t.depth=e&&"node"===n?a+1:a+10,a-1&&i.splice(u,1),a||(r={id:e,itemType:"node",comboId:n},o[e]={children:void 0}),e){var c=!1;if(n){var h=0;(t||[]).forEach((function(t){c||dt(t,(function(t){return n!==t.id||(c=!0,t.children?t.children.push(r):t.children=[r],h=t.depth,"node"===r.itemType?r.depth=h+2:r.depth=h+1,!1)}))}))}else n&&c||"node"===r.itemType||t.push(r);var l=r.depth;dt(r,(function(t){return"node"===t.itemType?l+=2:l+=1,t.depth=l,!0}))}return t},bt=function(t,e){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};return t&&0!==t.length?(t.forEach((function(t){var r=e.findById(t.id);if(r&&r.isVisible()){r.set("bboxCanvasCache",void 0);var i=r.getCanvasBBox();i.x&&n.minX>i.minX&&(n.minX=i.minX),i.y&&n.minY>i.minY&&(n.minY=i.minY),i.x&&n.maxXn&&(n=c),h>i&&(i=h)}return{x:Math.floor(e),y:Math.floor(r),width:Math.ceil(n)-Math.floor(e),height:Math.ceil(i)-Math.floor(r),minX:e,minY:r,maxX:n,maxY:i}},Tt=function(t,e,n,r,i){void 0===e&&(e=15),void 0===n&&(n="quadratic"),void 0===r&&(r=void 0),void 0===i&&(i=void 0);for(var o=t.length,a=2*e,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},c=[],h={},l=0;lh&&(l=h),t.zoom(l,a)}},t.prototype.getFormatPadding=function(){var t=this.graph.get("fitViewPadding");return Et(t)},t.prototype.focusPoint=function(t,e,n){var r=this,i=this.getViewCenter(),o=this.getPointByCanvas(i.x,i.y),a=this.graph.get("group").getMatrix();if(a||(a=[1,0,0,0,1,0,0,0,1]),e){var s=(o.x-t.x)*a[0],u=(o.y-t.y)*a[4],c=0,h=0,l=0,d=0;this.graph.get("canvas").animate((function(t){l=s*t,d=u*t,r.graph.translate(l-c,d-h),c=l,h=d}),Object(f.a)({},n))}else this.graph.translate((o.x-t.x)*a[0],(o.y-t.y)*a[4])},t.prototype.getPointByCanvas=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),k({x:t,y:e},n)},t.prototype.getPointByClient=function(t,e){var n=this.graph.get("canvas").getPointByClient(t,e);return this.getPointByCanvas(n.x,n.y)},t.prototype.getClientByPoint=function(t,e){var n=this.graph.get("canvas"),r=this.getCanvasByPoint(t,e),i=n.getClientByPoint(r.x,r.y);return{x:i.x,y:i.y}},t.prototype.getCanvasByPoint=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),O({x:t,y:e},n)},t.prototype.focus=function(t,e,n){if(Object(u.o)(t)&&(t=this.graph.findById(t)),t){var r=0,i=0;if(t.getType&&"edge"===t.getType()){var o=t.getSource().get("group").getMatrix(),a=t.getTarget().get("group").getMatrix();o&&a?(r=(o[6]+a[6])/2,i=(o[7]+a[7])/2):(o||a)&&(r=o?o[6]:a[6],i=o?o[7]:a[7])}else{var s=t.get("group").getMatrix();s||(s=[1,0,0,0,1,0,0,0,1]),r=s[6],i=s[7]}this.focusPoint({x:r,y:i},e,n)}},t.prototype.changeSize=function(t,e){var n=this.graph;if(!Object(u.k)(t)||!Object(u.k)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");n.set({width:t,height:e}),n.get("canvas").changeSize(t,e),n.get("plugins").forEach((function(r){if(r.get("gridContainer")){var i=n.get("minZoom");Object(Ot.b)(r.get("container"),{width:t+"px",height:e+"px"}),Object(Ot.b)(r.get("gridContainer"),{width:t/i+"px",height:e/i+"px",left:0,top:0})}}))},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}();function Bt(t){return(Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _t(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},n=e(t);if("string"!=typeof n)return n;for(var r=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;er.width&&(r.width=h.width+h.x),h.height+h.y>r.height&&(r.height=h.height+h.y)}}}return t.bbox=function(t,e,n){var r,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:n.width||0,height:n.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,r=2*a.r);break;case"text":a.text&&(i=vt(a.text,a.fontSize||12)[0],r=16,s.y+=r,s.height=r,s.width=i,t.attrs=Object(f.a)({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(r=a.height)}return r>=0&&(s.height=r),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,r),t.attrs=Object(f.a)(Object(f.a)({},t.attrs),t.bbox),t}function Dt(t){var e={},n=function(e){var n=function(t){return function(e){for(var n=t.length,r=[],i=0,o="";i0||(null===(i=n.children)||void 0===i?void 0:i.length)>0)for(var h=Math.max(null===(o=e.children)||void 0===o?void 0:o.length,null===(a=n.children)||void 0===a?void 0:a.length),l=n.children||[],f=e.children||[],d=0;d-1)return;n.push(i)}else s>-1&&n.splice(s,1)}else if(Object(u.o)(e)){var c=n.filter((function(t){return t.includes(o)}));c.length>0&&this.clearStates(c),(a=a.filter((function(t){return!t.includes(o)}))).push(i),this.set("states",a)}if(r){var h=this.get("model").type;r.setState(h,t,e,this)}},t.prototype.clearStates=function(t){var e=this,n=e.getStates(),r=e.get("shapeFactory"),i=e.get("model").type;t||(t=n),Object(u.o)(t)&&(t=[t]);var o=n.filter((function(e){return-1===t.indexOf(e)}));e.set("states",o),t.forEach((function(t){r.setState(i,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){return this.getStates().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,e){void 0===e&&(e=!1);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=n.x,a=n.y;t.x=isNaN(t.x)?n.x:t.x,t.y=isNaN(t.y)?n.y:t.y;var s=this.get("styles");if(t.stateStyles){var c=t.stateStyles;Object(u.r)(s,c),delete t.stateStyles}Object.assign(n,t),e?this.updatePosition(t):(o===t.x&&a===t.y||this.updatePosition(t),this.updateShape()),this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(){var t=this.get("shapeFactory"),e=this.get("model"),n=e.type;if(t.shouldUpdate(n)&&n===this.get("currentShape")){var r=this.getShapeCfg(e);t.baseUpdate(n,r,this),this.setOriginStyle()}else this.draw();this.restoreStates(t,n)},t.prototype.updatePosition=function(t){var e=this.get("model"),n=Object(u.j)(t.x)?e.x:t.x,r=Object(u.j)(t.y)?e.y:t.y,i=this.get("group");if(Object(u.j)(n)||Object(u.j)(r))return!1;e.x=n,e.y=r;var o=i.getMatrix();return(!o||o[6]!==n||o[7]!==r)&&(i.resetMatrix(),I(i,{x:n,y:r}),this.clearCache(),!0)},t.prototype.getBBox=function(){var t=this.get("bboxCache");return t||(t=this.calculateBBox(),this.set("bboxCache",t)),t},t.prototype.getCanvasBBox=function(){var t=this.get("bboxCanvasCache");return t||(t=this.calculateCanvasBBox(),this.set("bboxCanvasCache",t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").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}(),Gt={source:"start",target:"end"},Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.c)(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var n=Gt[t]+"Point",r=t+"Node",i=this.get(r);i&&!i.destroyed&&i.removeEdge(this),Object(u.n)(e)?(this.set(n,e),this.set(r,null)):(e.addEdge(this),this.set(r,e),this.set(n,null))},e.prototype.getLinkPoint=function(t,e,n){var r=Gt[t]+"Point",i=t+"Node",o=this.get(r);if(!o){var a=this.get(i),s=t+"Anchor",c=this.getPrePoint(t,n),h=e[s];Object(u.j)(h)||(o=a.getLinkPointByAnchor(h)),o=o||a.getLinkPoint(c),Object(u.j)(o.index)||this.set(t+"AnchorIndex",o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var n="source"===t?"target":"source";return this.getEndPoint(n)},e.prototype.getEndPoint=function(t){var e=t+"Node",n=Gt[t]+"Point",r=this.get(e);return r?r.get("model"):this.get(n)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),n=this.getEndPoint("target"),r=this.get("shapeFactory"),i=t.type;return r.getControlPoints(i,{startPoint:e,endPoint:n})},e.prototype.getEndCenter=function(t){var e=t+"Node",n=Gt[t]+"Point",r=this.get(e);if(r){var i=r.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(n)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e){var n=this.get("linkCenter"),r=t.prototype.getShapeCfg.call(this,e);if(n)r.startPoint=this.getEndCenter("source"),r.endPoint=this.getEndCenter("target");else{var i=r.controlPoints||this.getControlPointsByCenter(r);r.startPoint=this.getLinkPoint("source",e,i),r.endPoint=this.getLinkPoint("target",e,i)}return r.sourceNode=this.get("sourceNode"),r.targetNode=this.get("targetNode"),r},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("sourceNode"),n=this.get("targetNode");return e?delete t.sourceNode:t.source=this.get("startPoint"),n?delete t.targetNode:t.target=this.get("endPoint"),Object(u.o)(t.source)||Object(u.n)(t.source)||(t.source=t.source.getID()),Object(u.o)(t.target)||Object(u.n)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,e){void 0===e&&(e=!1);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("styles");if(t.stateStyles){var a=t.stateStyles;Object(u.r)(o,a),delete t.stateStyles}Object.assign(n,t),this.updateShape(),this.afterUpdate(),this.clearCache()},e.prototype.destroy=function(){var e=this.get("sourceNode"),n=this.get("targetNode");e&&!e.destroyed&&e.removeEdge(this),n&&!n.destroyed&&n.removeEdge(this),t.prototype.destroy.call(this)},e}(qt),Ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.c)(e,t),e.prototype.getNearestPoint=function(t,e){for(var n=0,r=t[0],i=E(t[0],e),o=0;o-1&&e.splice(n,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("anchorPointsCache",null)},e.prototype.isOnlyMove=function(t){if(!t)return!1;var e=!Object(u.j)(t.x),n=!Object(u.j)(t.y),r=Object.keys(t);return 1===r.length&&(e||n)||2===r.length&&e&&n},e}(qt),Ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.c)(e,t),e.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},e.prototype.getShapeCfg=function(t){var e=this.get("styles"),n=this.get("bbox");if(e&&n){var r=t,i={r:Math.hypot(n.height,n.width)/2||nt.defaultCombo.size[0]/2,width:n.width||nt.defaultCombo.size[0],height:n.height||nt.defaultCombo.size[1]};r.style=Object(f.a)(Object(f.a)(Object(f.a)({},e),t.style),i);var o=t.padding||nt.defaultCombo.padding;return Object(u.k)(o)?(i.r+=o,i.width+=2*o,i.height+=2*o):(i.r+=o[0],i.width+=o[1]+o[3]||2*o[1],i.height+=o[0]+o[2]||2*o[0]),this.set("sizeCache",i),r}return t},e.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var t=this.get("keyShape"),e=this.get("group"),n=ct(t,e);n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;var r=this.get("sizeCache"),i=this.get("bboxCache")||{},o=i.x,a=i.x;if(r)r.width=Math.max(r.width,n.width),r.height=Math.max(r.height,n.height),"circle"===t.get("type")?(n.width=2*r.r,n.height=2*r.r):(n.width=r.width,n.height=r.height),n.minX=n.centerX-n.width/2,n.minY=n.centerY-n.height/2,n.maxX=n.centerX+n.width/2,n.maxY=n.centerY+n.height/2;else n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;return n.x=n.minX,n.y=n.minY,n.x===o&&n.y===a||this.set("anchorPointsCache",null),n}},e.prototype.getChildren=function(){return{nodes:this.getNodes(),combos:this.getCombos()}},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.addChild=function(t){switch(t.getType()){case"node":this.addNode(t);break;case"combo":this.addCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.addCombo=function(t){return this.get("combos").push(t),!0},e.prototype.addNode=function(t){return this.get("nodes").push(t),!0},e.prototype.removeChild=function(t){switch(t.getType()){case"node":this.removeNode(t);break;case"combo":this.removeCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.removeCombo=function(t){if(t){var e=this.getCombos(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.isOnlyMove=function(t){return!1},e.prototype.getBBox=function(){return this.set("bboxCanvasCache",null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null),this.set("anchorPointsCache",null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}(Ht),Zt=function(){function t(t){this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var n=this.graph,r="vedge"===t?"edge":t,i=n.get(r+"Group")||n.get("group"),o=Object(u.w)(r),a=null,s=n.get(r+Object(u.w)("stateStyles"))||{},c=n.get("default"+o);e.stateStyles&&(s=e.stateStyles),c&&Object(u.c)(c,(function(t,n){Object(u.m)(t)&&!Object(u.f)(t)?e[n]=Object(u.b)({},t,e[n]):Object(u.f)(t)?e[n]=e[n]||Object(u.a)(c[n]):e[n]=e[n]||c[n]}));var h=n.get(r+"Mapper");if(h){var l=h(e);l.stateStyles&&(s=l.stateStyles,delete l.stateStyles),Object(u.c)(l,(function(t,n){Object(u.m)(t)&&!Object(u.f)(t)?e[n]=Object(u.b)({},e[n],t):e[n]=l[n]||e[n]}))}if(n.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var f=void 0,d=void 0;if(f=e.source,d=e.target,f&&Object(u.o)(f)&&(f=n.findById(f)),d&&Object(u.o)(d)&&(d=n.findById(d)),!f||!d)return void console.warn("The source or target node of edge "+e.id+" does not exist!");f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),d.getType&&"combo"===d.getType()&&(e.isComboEdge=!0),a=new Vt({model:e,source:f,target:d,styles:s,linkCenter:n.get("linkCenter"),group:i.addGroup()})}else if("node"===t)a=new Ht({model:e,styles:s,group:i.addGroup()});else if("combo"===t){var p=e.children,g=bt(p,n);isNaN(g.x)?isNaN(e.x)&&(e.x=100*Math.random()):e.x=g.x,isNaN(g.y)?isNaN(e.y)&&(e.y=100*Math.random()):e.y=g.y;var v=i.addGroup();v.setZIndex(e.depth);var y=(a=new Ut({model:e,styles:s,bbox:e.collapsed?bt([],n):g,group:v})).getModel();(p||[]).forEach((function(t){var e=n.findById(t.id);a.addChild(e),t.depth=y.depth+2})),e.collapsed&&setTimeout((function(){n.collapseCombo(a)}),16)}if(a)return n.get(t+"s").push(a),n.get("itemMap")[a.get("id")]=a,n.emit("afteradditem",{item:a,model:e}),a},t.prototype.updateItem=function(t,e){var n,r,i=this.graph;if(Object(u.o)(t)&&(t=i.findById(t)),t&&!t.destroyed){var o="";t.getType&&(o=t.getType());var a=i.get(o+"Mapper"),s=t.getModel(),c=t.isOnlyMove(e);if(a){var h=a(Object(u.b)({},s,e)),l=Object(u.b)({},s,h,e);h.stateStyles&&(t.set("styles",l.stateStyles),delete l.stateStyles),Object(u.c)(l,(function(t,n){e[n]=t}))}else Object(u.c)(e,(function(t,n){s[n]&&Object(u.m)(t)&&!Object(u.f)(t)&&(e[n]=Object(f.a)(Object(f.a)({},s[n]),e[n]))}));if(i.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===o){if(e.source){var d=e.source;Object(u.o)(d)&&(d=i.findById(d)),t.setSource(d)}if(e.target){var p=e.target;Object(u.o)(p)&&(p=i.findById(p)),t.setTarget(p)}t.update(e)}if("node"===o||"combo"===o){t.update(e,c);var g=t.getEdges(),v=xt(e);if(v&&"node"===o)Object(u.c)(g,(function(t){t.refresh()}));else if(v&&"combo"===o){var y=t.get("shapeFactory"),m=s.type||"circle";(void 0===s.animate||void 0===e.animate?null===(r=null===(n=y[m])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:s.animate||e.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&Object(u.c)(g,(function(t){t&&!t.destroyed&&t.refresh()}))}}),201):Object(u.c)(g,(function(t){t.refresh()}))}}i.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e){var n,r,i=this,o=this.graph;if(Object(u.o)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a=t.getModel(),s=bt(a.collapsed?[]:e,o);t.set("bbox",s),t.update({x:s.x,y:s.y});var c=t.get("shapeFactory"),h=a.type||"circle";(void 0===a.animate?null===(r=null===(n=c[h])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:a.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(t.getShapeCfg(a),i.updateComboEdges(t))}}),201):this.updateComboEdges(t)}},t.prototype.updateComboEdges=function(t){for(var e=t.getEdges()||[],n=0;n-1&&o.splice(a,1),"edge"===i){var s=n.get("v"+i+"s"),c=s.indexOf(t);c>-1&&s.splice(c,1)}var h=t.get("id");delete n.get("itemMap")[h];var l=n.get("comboTrees"),f=t.get("id");if("node"===i){var d=t.getModel().comboId;if(l&&d){var p=l,g=!1;l.forEach((function(t){g||dt(t,(function(t){if(t.id===f&&p){var e=p.indexOf(t);return p.splice(e,1),g=!0,!1}return p=t.children,!0}))}))}for(var v=(x=t.getEdges()).length-1;v>=0;v--)n.removeItem(x[v],!1);d&&n.updateCombo(d)}else if("combo"===i){var y,m=t.getModel().parentId,b=!1;(l||[]).forEach((function(t){b||dt(t,(function(t){return t.id!==f||(y=t,b=!0,!1)}))})),y.removed=!0,y&&y.children&&y.children.forEach((function(t){e.removeItem(t.id)}));var x;for(v=(x=t.getEdges()).length;v>=0;v--)n.removeItem(x[v],!1);m&&n.updateCombo(m)}t.destroy(),n.emit("afterremoveitem",{item:r})}},t.prototype.setItemState=function(t,e,n){var r=this.graph,i=e;Object(u.o)(n)&&(i=e+":"+n),t.hasState(i)===n&&n||Object(u.o)(n)&&t.hasState(i)||(r.emit("beforeitemstatechange",{item:t,state:i,enabled:n}),t.setState(e,n),r.autoPaint(),r.emit("afteritemstatechange",{item:t,state:i,enabled:n}))},t.prototype.priorityState=function(t,e){var n=this.graph,r=t;Object(u.o)(t)&&(r=n.findById(t)),this.setItemState(r,e,!1),this.setItemState(r,e,!0)},t.prototype.clearItemStates=function(t,e){var n=this.graph;Object(u.o)(t)&&(t=n.findById(t)),n.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),n.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;Object(u.o)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var n=this,r=this.graph;(t||[]).forEach((function(t){pt(t,(function(t){var r;return e.forEach((function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,r=e)})),r&&n.addItem("combo",r),!0}))}));var i=r.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var n=this,r=this.graph;if(Object(u.o)(t)&&(t=r.findById(t)),t){if(r.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&"node"===t.getType()){var i=t.getEdges();Object(u.c)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}else if(t.getType&&"combo"===t.getType()){var o=r.get("comboTrees"),a=t.get("id"),s=[],c=!1;(o||[]).forEach((function(t){c||t.children&&0!==t.children.length&&dt(t,(function(t){return t.id!==a||(s=t.children,c=!0,!1)}))})),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach((function(t){var i=r.findById(t.id);n.changeItemVisibility(i,e)}));i=t.getEdges();Object(u.c)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}return r.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),Qt=null,Kt=function(){function t(t){this.graph=t,this.cachedStates={enabled:{},disabled:{}},this.destroyed=!1}return t.checkCache=function(t,e,n){if(n[e]){var r=n[e].indexOf(t);r>=0&&n[e].splice(r,1)}},t.cacheState=function(t,e,n){n[e]||(n[e]=[]),n[e].push(t)},t.prototype.updateState=function(e,n,r){var i=this,o=t.checkCache,a=t.cacheState;if(!e.destroyed){var s=this.cachedStates,u=s.enabled,c=s.disabled;r?(o(e,n,c),a(e,n,u)):(o(e,n,u),a(e,n,c)),Qt&&clearTimeout(Qt),Qt=setTimeout((function(){Qt=null,i.updateGraphStates()}),16)}},t.prototype.updateStates=function(t,e,n){var r=this;Object(u.o)(e)?this.updateState(t,e,n):e.forEach((function(e){r.updateState(t,e,n)}))},t.prototype.updateGraphStates=function(){var t=this.graph.get("states"),e=this.cachedStates;Object(u.c)(e.disabled,(function(e,n){t[n]&&(t[n]=t[n].filter((function(t){return e.indexOf(t)<0&&!e.destroyed})))})),Object(u.c)(e.enabled,(function(e,n){if(t[n]){var r={};t[n].forEach((function(t){t.destroyed||(r[t.get("id")]=!0)})),e.forEach((function(e){if(!e.destroyed){var i=e.get("id");r[i]||(r[i]=!0,t[n].push(e))}}))}else t[n]=e})),this.graph.emit("graphstatechange",{states:t}),this.cachedStates={enabled:{},disabled:{}}},t.prototype.destroy=function(){this.graph=null,this.cachedStates=null,Qt&&clearTimeout(Qt),Qt=null,this.destroyed=!0},t}(),$t=n(40),Jt=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){if("\\"===t.charAt(0))return t.slice(1);var r=e[n];return 0===r&&(r="0"),r||""})):t},te=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's "+t.length);for(var n=0,r=t;n0?s-1:o-1,c=g.c.normalize([0,0],g.c.add([0,0],a[u].v,g.c.scale([0,0],a[s].v,-1)));a[s].p=g.c.add([0,0],a[s].p,g.c.scale([0,0],c,e))}return a.map((function(t){var e=t.p;return{x:e[0],y:e[1]}}))}var he=function(t,e,n){return(t.y-n.y)*(e.x-n.x)-(t.x-n.x)*(e.y-n.y)},le=function(t){var e=t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}}));if(e.sort((function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x})),1===e.length)return e;for(var n=[],r=0;r=2&&he(n[n.length-2],n[n.length-1],e[r])<=0;)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&he(i[i.length-2],i[i.length-1],e[r])<=0;)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)},fe={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function de(t,e,n){var r=!1,i=function(t,n){return e.cells[t+n*e.width]},o=function(t,e){var r=0;return i(t-1,e-1)>=n&&(r+=1),i(t,e-1)>n&&(r+=2),i(t-1,e)>n&&(r+=4),i(t,e)>n&&(r+=8),r},a=function(n,r){for(var i,a,s=n,u=r,c=0;c-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var h=o(s,u);switch(h){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: "+h),!0}}};this.march=function(){for(var t=0;tn&&15!==o(t,s)&&(r=a(t,s));return r}}var pe=function(t,e){var n=Number.POSITIVE_INFINITY,r=null;return t.forEach((function(t){var i=q(t,e);i>=0&&i0?t+1:t}),0);s*Math.pow(c+1,2)0;){var r=t.pop();if(0===t.length){n.push(r);break}var i=t.pop(),o=new X(r.x1,r.y1,i.x2,i.y2);pe(e,o)?(n.push(r),t.push(i)):t.push(o)}return n}(function(t,e,n,r){var i=[],o=[];o.push(t);for(var a=!0,s=0,u=function(t,e){var n=!1;return e.forEach((function(e){n||(U(t,{x:e.x1,y:e.y1})||U(t,{x:e.x2,y:e.y2}))&&(n=!0)})),n},c=function(t,e){for(var n=0,r=e;n=1;)f=me(n,h/=1.5,l,s),d=u(f,o)||u(f,i),p=c(f,e);!f||d||s&&p||(o.push(new X(t.x1,t.y1,f.x,f.y)),o.push(new X(f.x,f.y,t.x2,t.y2)),a=!0)};f(!0),a||f(!1)}}a||i.push(t),s+=1};!a&&o.length;)h()}for(;o.length;)i.push(o.pop());return i}(new X(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y),e,r,i))}var ve=function(t,e,n){var r=Object.assign(fe,n),i=G(t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}})));t=t.sort((function(t,e){return V({x:t.getModel().x,y:t.getModel().y},i)-V({x:e.getModel().x,y:e.getModel().y},i)}));var o=[],a=[];t.forEach((function(t){ge(t,e,o,r.maxRoutingIterations,r.morphBuffer).forEach((function(t){a.push(t)})),o.push(t)}));for(var s,u,c,h,l,f=function(t,e,n){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach((function(t){i.push(t.getBBox())})),e.forEach((function(t){i.push(t.getBBox())}));for(var o=0,a=i;or.maxX?s.maxX:r.maxX)+n,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+n}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}(t,a,r.nodeR0),d=(s=f.width,u=f.height,c=r.pixelGroupSize,h=Math.ceil(s/c),l=Math.ceil(u/c),{cells:new Float32Array(Math.max(0,h*l)).fill(0),width:h,height:l}),p=[],g=[],v=0;v1)for(m=Math.floor(y.length/r.skip);m<3&&r.skip>1;)r.skip-=1,m=Math.floor(y.length/r.skip);for(var b=0,x=0;x0))break;r.nonMemberInfluenceFactor*=.8}}return g};function ye(t,e,n,r,i,o){function a(t,e){var n=Math.floor((t-e)/o.pixelGroupSize);return n<0?0:n}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),c=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),h=function(t,e){return[Math.min(a(t.minX,e+r.minX),i.width),Math.min(a(t.minY,e+r.minY),i.height),Math.min(a(t.maxX,-e+r.minX),i.width),Math.min(a(t.maxY,-e+r.minY),i.height)]},l=function(t,e){for(var n=t.getBBox(),a=h(n,o.nodeR1),u=a[0],c=a[1],l=a[2],f=a[3],d=c;du.y?r?c.topLeft:c.bottomRight:r?c.topRight:c.bottomLeft:a.ys.x?r?c.topLeft:c.bottomRight:r?c.bottomLeft:c.topRight:o.x0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var n,r,i;switch(this.type){case"round-convex":i=ue((n=le(t)).map((function(t){return[t.x,t.y]})),this.padding),r=Object($t.b)(i);break;case"smooth-convex":2===(n=le(t)).length?(i=ue(n.map((function(t){return[t.x,t.y]})),this.padding),r=Object($t.b)(i)):n.length>2&&(i=ce(n.map((function(t){return[t.x,t.y]})),this.padding),r=ie(i));break;case"bubble":r=(n=ve(t,e,this.cfg.bubbleCfg)).length>=2&&ie(n)}return r},t.prototype.render=function(){this.group.addShape("path",{attrs:Object(f.a)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id}),this.group.toBack()},t.prototype.addMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var n=this;this.group.findById(this.id).remove(),t&&(this.members=t.map((function(t){return Object(u.o)(t)?n.graph.findById(t):t}))),e&&(this.nonMembers=e.map((function(t){return Object(u.o)(t)?n.graph.findById(t):t}))),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr(Object(f.a)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=Object(u.b)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map((function(t){return Object(u.o)(t)?e.graph.findById(t):t}))),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map((function(t){return Object(u.o)(t)?e.graph.findById(t):t}))),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,n,r=this,i=(e=Object(u.o)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))n=re(i.attr("path"));else{var o=i.getCanvasBBox();n=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return n=n.map((function(t){var e=r.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]})),F(n,re(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),xe=g.a.transform,we=function(t){function e(e){var n=t.call(this)||this;return n.cfg=Object(u.b)(n.getDefaultCfg(),e),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new v.Stack(n.cfg.maxStep),n.redoStack=new v.Stack(n.cfg.maxStep)),n}return Object(f.c)(e,t),e.prototype.init=function(){this.initCanvas();var t=new Nt(this),e=new St(this),n=new Zt(this),r=new Kt(this);this.set({viewController:t,modeController:e,itemController:n,stateController:r}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins(),Object(p.b)(this.onTick.bind(this))},e.prototype.initGroups=function(){var t=this.get("canvas"),e=this.get("canvas").get("el").id,n=t.addGroup({id:e+"-root",className:nt.rootContainerClassName});if(this.get("groupByTypes")){var r=n.addGroup({id:e+"-edge",className:nt.edgeContainerClassName}),i=n.addGroup({id:e+"-node",className:nt.nodeContainerClassName}),o=n.addGroup({id:e+"-combo",className:nt.comboContainerClassName});o.toBack(),this.set({nodeGroup:i,edgeGroup:r,comboGroup:o})}var a=n.addGroup({id:e+"-delegate",className:nt.delegateContainerClassName});this.set({delegateGroup:a}),this.set("group",n)},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.2,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[]}},e.prototype.set=function(t,e){return Object(u.n)(t)?this.cfg=Object(f.a)(Object(f.a)({},this.cfg),t):this.cfg[t]=e,this},e.prototype.get=function(t){return this.cfg[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){Object(u.o)(t)&&(t=this.findById(t));var n=this.get("itemController");e||(e=t.get("states")),n.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var n,r=this.get(t+"s");return Object(u.c)(r,(function(t,r){if(e(t,r))return n=t})),n},e.prototype.findAll=function(t,e){var n=[];return Object(u.c)(this.get(t+"s"),(function(t,r){e(t,r)&&n.push(t)})),n},e.prototype.findAllByState=function(t,e){return this.findAll(t,(function(t){return t.hasState(e)}))},e.prototype.translate=function(t,e){var n=this.get("group"),r=Object(u.a)(n.getMatrix());r||(r=[1,0,0,0,1,0,0,0,1]),r=xe(r,[["t",t,e]]),n.setMatrix(r),this.emit("viewportchange",{action:"translate",matrix:n.getMatrix()}),this.autoPaint()},e.prototype.moveTo=function(t,e){var n=this.get("group");T(n,{x:t,y:e}),this.emit("viewportchange",{action:"move",matrix:n.getMatrix()})},e.prototype.fitView=function(t){t&&this.set("fitViewPadding",t),this.get("viewController").fitView(),this.autoPaint()},e.prototype.fitCenter=function(){this.get("viewController").fitCenter(),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.updateBehavior=function(t,e,n){return this.get("modeController").updateBehavior(t,e,n),this},e.prototype.zoom=function(t,e){var n=this.get("group"),r=Object(u.a)(n.getMatrix()),i=this.get("minZoom"),o=this.get("maxZoom");r||(r=[1,0,0,0,1,0,0,0,1]),r=xe(r,e?[["t",-e.x,-e.y],["s",t,t],["t",e.x,e.y]]:[["s",t,t]]),i&&r[0]o||(n.setMatrix(r),this.emit("viewportchange",{action:"zoom",matrix:r}),this.autoPaint())},e.prototype.zoomTo=function(t,e){var n=t/this.getZoom();this.zoom(n,e)},e.prototype.focusItem=function(t,e,n){var r=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};n?o=n:void 0===n&&(o=this.get("animateCfg")),r.focus(t,i,o),this.autoPaint()},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!1}],o.nodes=[{id:r,visible:!0}];break;case"edge":i.nodes=[{id:r,visible:!1}],o.edges=[{id:r,visible:!0}];break;case"combo":i.nodes=[{id:r,visible:!1}],o.combos=[{id:r,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!0}],o.nodes=[{id:r,visible:!1}];break;case"edge":i.nodes=[{id:r,visible:!0}],o.edges=[{id:r,visible:!1}];break;case"combo":i.nodes=[{id:r,visible:!0}],o.combos=[{id:r,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var n=t;if(Object(u.o)(t)&&(n=this.findById(t)),!n&&Object(u.o)(t))console.warn("The item to be removed does not exist!");else if(n){var r="";if(n.getType&&(r=n.getType()),e&&this.get("enabledStack")){var i=Object(f.a)(Object(f.a)({},n.getModel()),{itemType:r}),o={};switch(r){case"node":o.nodes=[i],o.edges=[];for(var a=n.getEdges(),s=a.length-1;s>=0;s--)o.edges.push(Object(f.a)(Object(f.a)({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if("node"===r)n.getModel().comboId&&this.updateComboTree(n);if(this.get("itemController").removeItem(n),"combo"===r){var c=mt(this.get("comboTrees"));this.set("comboTrees",c)}}},e.prototype.addItem=function(t,e,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!r);var o=this.get("itemController");if(!function(t,e){if("node"===t||"combo"===t){if(e.id&&!Object(u.o)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c"+e.id+"%c is not a string.","font-size: 20px; color: red;",""),!1}else if(!("edge"!==t||e.source&&e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0}(t,e))return!1;if(!e.id||!this.findById(e.id)){var a,s=this.get("comboTrees");if(s||(s=[]),"combo"===t){var c=this.get("itemMap"),h=!1;if(s.forEach((function(n){h||pt(n,(function(n){if(e.parentId===n.id){h=!0;var r=Object(f.a)({id:e.id,depth:n.depth+2},e);n.children?n.children.push(r):n.children=[r],e.depth=r.depth,a=o.addItem(t,e)}var i=c[n.id];return h&&i&&i.getType&&"combo"===i.getType()&&o.updateCombo(i,n.children),!0}))})),!h){var l=Object(f.a)({id:e.id,depth:0},e);e.depth=l.depth,s.push(l),a=o.addItem(t,e)}this.set("comboTrees",s)}else if("node"===t&&Object(u.o)(e.comboId)&&s){var d;(d=this.findById(e.comboId))&&d.getType&&"combo"!==d.getType()&&console.warn("'"+e.comboId+"' is not a id of a combo in the graph, the node will be added without combo."),a=o.addItem(t,e);var p=this.get("itemMap"),g=!1,v=!1;(s||[]).forEach((function(t){v||g||pt(t,(function(t){if(t.id===e.id)return v=!0,!1;if(e.comboId===t.id&&!v){g=!0;var n=Object(u.a)(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],n.depth=t.depth+1}return g&&p[t.id].getType&&"combo"===p[t.id].getType()&&o.updateCombo(p[t.id],t.children),!0}))}))}else a=o.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(d=this.findById(e.comboId||e.parentId))&&d.getType&&"combo"===d.getType()&&d.addChild(a);var y=this.get("combos");if(y&&y.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var m=Object(f.a)(Object(f.a)({},a.getModel()),{itemType:t}),b={};switch(t){case"node":b.nodes=[m];break;case"edge":b.edges=[m];break;case"combo":b.combos=[m]}this.pushStack("add",{before:{},after:b})}return a}console.warn("This item exists already. Be sure the id %c"+e.id+"%c is unique.","font-size: 20px; color: red;","")},e.prototype.add=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!0),this.addItem(t,e,n,r)},e.prototype.updateItem=function(t,e,n){var r=this;void 0===n&&(n=!0);var i,o=this.get("itemController");i=Object(u.o)(t)?this.findById(t):t;var a=Object(u.a)(i.getModel()),s="";i.getType&&(s=i.getType());var c=Object(f.f)([],i.getStates());if("combo"===s&&Object(u.c)(c,(function(t){return r.setItemState(i,t,!1)})),o.updateItem(i,e),"combo"===s&&Object(u.c)(c,(function(t){return r.setItemState(i,t,!0)})),n&&this.get("enabledStack")){var h={nodes:[],edges:[],combos:[]},l={nodes:[],edges:[],combos:[]},d=Object(f.a)({id:a.id},e);switch(s){case"node":h.nodes.push(a),l.nodes.push(d);break;case"edge":h.edges.push(a),l.edges.push(d);break;case"combo":h.combos.push(a),l.combos.push(d)}"node"===s&&h.nodes.push(a),this.pushStack("update",{before:h,after:l})}},e.prototype.update=function(t,e,n){void 0===n&&(n=!0),this.updateItem(t,e,n)},e.prototype.setItemState=function(t,e,n){Object(u.o)(t)&&(t=this.findById(t)),this.get("itemController").setItemState(t,e,n);var r=this.get("stateController");Object(u.o)(n)?r.updateState(t,e+":"+n,!0):r.updateState(t,e,n)},e.prototype.priorityState=function(t,e){this.get("itemController").priorityState(t,e)},e.prototype.data=function(t){Mt(t),this.set("data",t)},e.prototype.render=function(){var t=this;this.set("comboSorted",!1);var e=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!e)throw new Error("data must be defined first");var n=e.nodes,r=void 0===n?[]:n,i=e.edges,o=void 0===i?[]:i,a=e.combos,s=void 0===a?[]:a;if(this.clear(!0),this.emit("beforerender"),Object(u.c)(r,(function(e){t.add("node",e,!1,!1)})),s&&0!==s.length){var c=yt(s,r);this.set("comboTrees",c),t.addCombos(s)}Object(u.c)(o,(function(e){t.add("edge",e,!1,!1)}));var h=t.get("animate");(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1);var l=t.get("layoutController");if(l){if(l.layout((function(){t.get("fitView")?t.fitView():t.get("fitCenter")&&t.fitCenter();t.autoPaint(),t.emit("afterrender"),(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",h)})),this.refreshPositions(),this.destroyed)return}else t.get("fitView")&&t.fitView(),t.get("fitCenter")&&t.fitCenter(),t.emit("afterrender"),t.set("animate",h);this.get("groupByTypes")||(s&&0!==s.length?this.sortCombos():e.nodes&&e.edges&&e.nodes.length=0;l--)h[l].destroyed&&h.splice(l,1);s&&(n.addCombos(s),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",a,t.edges),Object(u.c)(o,(function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&a.edges.indexOf(t)<0&&(delete o[e],n.remove(t,!1))})),this.set({nodes:a.nodes,edges:a.edges});var f=this.get("layoutController");return f&&(f.changeData(),n.get("animate")&&!f.getLayoutType()?n.positionsAnimate():n.autoPaint()),setTimeout((function(){r.set("localRefresh",i)}),16),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e){var n=this;this.set("comboSorted",!1);var r,i="";if(t){if(Object(u.o)(t))i=t,r={id:t};else{if(!(i=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");r=t}var o=e.map((function(t){var e=n.findById(t),r=e.getModel(),o="";e.getType&&(o=e.getType());var a={id:e.getID(),itemType:o};return"combo"===o?(a.parentId=i,r.parentId=i):"node"===o&&(a.comboId=i,r.comboId=i),a}));r.children=o,this.addItem("combo",r,!1),this.set("comboSorted",!1);var a=this.get("comboTrees");(a||[]).forEach((function(t){pt(t,(function(t){return t.id!==i||(t.itemType="combo",t.children=o,!1)}))})),a&&this.sortCombos()}},e.prototype.uncombo=function(t){var e=this,n=t;if(Object(u.o)(t)&&(n=this.findById(t)),!n||n.getType&&"combo"!==n.getType())console.warn("The item is not a combo!");else{var r=n.getModel().parentId,i=this.get("comboTrees");i||(i=[]);var o,a=this.get("itemMap"),s=n.get("id"),c=[],h=this.get("combos"),l=this.findById(r);if(i.forEach((function(i){o||pt(i,(function(i){if(i.id===s){o=i,n.getEdges().forEach((function(t){e.removeItem(t,!1)}));var u=h.indexOf(t);h.splice(u,1),delete a[s],n.destroy()}return!r||!o||i.id!==r||(l.removeCombo(n),-1!==(u=(c=i.children).indexOf(o))&&c.splice(u,1),o.children.forEach((function(t){var n=e.findById(t.id),i=n.getModel();n.getType&&"combo"===n.getType()?(t.parentId=r,delete t.comboId,i.parentId=r,delete i.comboId):n.getType&&"node"===n.getType()&&(t.comboId=r,i.comboId=r),l.addChild(n),c.push(t)})),!1)}))})),!r&&o){var f=i.indexOf(o);i.splice(f,1),o.children.forEach((function(t){t.parentId=void 0;var n=e.findById(t.id).getModel();delete n.parentId,delete n.comboId,"node"!==t.itemType&&i.push(t)}))}}},e.prototype.updateCombos=function(){var t=this,e=this.get("comboTrees"),n=this.get("itemController"),r=this.get("itemMap");(e||[]).forEach((function(e){pt(e,(function(e){if(!e)return!0;var i=r[e.id];if(i&&i.getType&&"combo"===i.getType()){var o=Object(f.f)([],i.getStates());Object(u.c)(o,(function(e){return t.setItemState(i,e,!1)})),n.updateCombo(i,e.children),Object(u.c)(o,(function(e){return t.setItemState(i,e,!0)}))}return!0}))})),this.sortCombos()},e.prototype.updateCombo=function(t){var e,n=this,r=t;if(Object(u.o)(t)&&(r=this.findById(t)),!r||r.getType&&"combo"!==r.getType())console.warn("The item to be updated is not a combo!");else{e=r.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach((function(t){pt(t,(function(t){if(!t)return!0;var r=a[t.id];if(e===t.id&&r&&r.getType&&"combo"===r.getType()){var i=Object(f.f)([],r.getStates());Object(u.c)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!1)})),o.updateCombo(r,t.children),Object(u.c)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!0)})),e&&(e=t.parentId)}return!0}))}))}},e.prototype.updateComboTree=function(t,e,n){void 0===n&&(n=!0);var r;this.set("comboSorted",!1);var i,o=(r=Object(u.o)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(r.getType&&(s=r.getType()),e&&"combo"===s){var c,h=this.get("comboTrees"),l=!0;if((h||[]).forEach((function(t){c||dt(t,(function(t){if(!c)return t.id===r.getID()&&(c=t),!0}))})),dt(c,(function(t){return t.id!==e||(l=!1,!1)})),!l)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(n&&this.get("enabledStack")){var f={},d={};"combo"===s?(f.combos=[{id:o.id,parentId:o.parentId}],d.combos=[{id:o.id,parentId:e}]):"node"===s&&(f.nodes=[{id:o.id,parentId:o.comboId}],d.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:f,after:d})}if(o.parentId||o.comboId){var p=this.findById(o.parentId||o.comboId);p&&p.removeChild(r)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(r));a&&((i=this.findById(a))&&i.removeChild(r));var g=mt(this.get("comboTrees"),o.id,e);this.set("comboTrees",g),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],n=[];return Object(u.c)(this.get("nodes"),(function(e){t.push(e.getModel())})),Object(u.c)(this.get("edges"),(function(t){e.push(t.getModel())})),Object(u.c)(this.get("combos"),(function(t){n.push(t.getModel())})),{nodes:t,edges:e,combos:n}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){if(this.emit("beforegraphrefresh"),this.get("animate"))this.positionsAnimate();else{var t=this.get("nodes"),e=this.get("edges"),n=this.get("edges");Object(u.c)(t,(function(t){t.refresh()})),Object(u.c)(e,(function(t){t.refresh()})),Object(u.c)(n,(function(t){t.refresh()}))}this.emit("aftergraphrefresh"),this.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if(Object(u.o)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(){var t=this;t.emit("beforeanimate");var e=t.get("animateCfg"),n=e.onFrame,r=t.getNodes(),i=r.map((function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}}));t.isAnimating()&&t.stopAnimate(),t.get("canvas").animate((function(e){Object(u.c)(i,(function(r){var i=t.findById(r.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model");if(!o){var s=i.getContainer().getMatrix();s||(s=[1,0,0,0,1,0,0,0,1]),o={x:s[6],y:s[7]},i.set("originAttrs",o)}if(n){var u=n(i,e,r,o);i.set("model",Object.assign(a,u))}else a.x=o.x+(r.x-o.x)*e,a.y=o.y+(r.y-o.y)*e}})),t.refreshPositions()}),{duration:e.duration,easing:e.easing,callback:function(){Object(u.c)(r,(function(t){t.set("originAttrs",null)})),e.callback&&e.callback(),t.emit("afteranimate"),t.animating=!1}})},e.prototype.refreshPositions=function(){this.emit("beforegraphrefreshposition");var t,e=this.get("nodes"),n=this.get("edges"),r=this.get("vedges"),i=this.get("combos"),o={};Object(u.c)(e,(function(e){t=e.getModel();var n=e.get("originAttrs");if(!n||t.x!==n.x||t.y!==n.y){var r=e.updatePosition({x:t.x,y:t.y});o[t.id]=r,t.comboId&&(o[t.comboId]=o[t.comboId]||r)}})),i&&0!==i.length&&this.updateCombos(),Object(u.c)(n,(function(t){var e=t.getSource().getModel(),n=t.getTarget();if(!Object(u.n)(n)){var r=n.getModel();(o[e.id]||o[r.id]||t.getModel().isComboEdge)&&t.refresh()}})),Object(u.c)(r,(function(t){t.refresh()})),this.emit("aftergraphrefreshposition"),this.autoPaint()},e.prototype.stopAnimate=function(){this.get("canvas").stopAnimate()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(t){return void 0===t&&(t=!1),this.get("canvas").clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t){var e=this.get("layoutController");Object(u.o)(t)&&(t={type:t});var n=this.get("layout"),r={};Object.assign(r,n,t),this.set("layout",r),e.isLayoutTypeSame(r)&&r.gpuEnabled===n.gpuEnabled?e.updateLayoutCfg(r):e.changeLayout(r)},e.prototype.destroyLayout=function(){this.get("layoutController").destroyLayout()},e.prototype.layout=function(){var t=this.get("layoutController"),e=this.get("layout");e&&t&&(e.workerEnabled?t.layout():t.layoutMethod?t.relayout(!0):t.layout())},e.prototype.collapseCombo=function(t){var e=this;if(Object(u.o)(t)&&(t=this.findById(t)),t){this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").collapseCombo(t),n.collapsed=!0;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||dt(t,(function(t){if(s&&t.depth<=n.depth)return!1;if(n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},h=[];r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget();if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||r.getModel().id===n.id){if((f=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var s=a.getModel();!a.isVisible();){if(!(a=e.findById(s.parentId||s.comboId))||!s.parentId&&!s.comboId)return;s=a.getModel()}var u=s.id;if(c[n.id+"-"+u])return void(c[n.id+"-"+u]+=f.size||1);var l=e.addItem("vedge",{source:n.id,target:u,isVEdge:!0},!1);c[n.id+"-"+u]=f.size||1,h.push(l)}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||a.getModel().id===n.id){var f;if((f=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var d=r.getModel();!r.isVisible();){if(!(r=e.findById(d.parentId||d.comboId))||!d.parentId&&!d.comboId)return;d=r.getModel()}var p=d.id;if(c[p+"-"+n.id])return void(c[p+"-"+n.id]+=f.size||1);l=e.addItem("vedge",{target:n.id,source:p,isVEdge:!0},!1);c[p+"-"+n.id]=f.size||1,h.push(l)}}})),h.forEach((function(t){var n=t.getModel();e.updateItem(t,{size:c[n.source+"-"+n.target]},!1)})),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t){var e=this;if(Object(u.o)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").expandCombo(t),n.collapsed=!1;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||dt(t,(function(t){if(s&&t.depth<=n.depth)return!1;if(n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},h={};r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget(),s=r.get("id"),u=a.get("id");if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||s===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(var l=a.getModel();!a.isVisible();){if(!(a=e.findById(l.comboId||l.parentId))||!l.parentId&&!l.comboId)return;l=a.getModel()}u=l.id;for(var f=r.getModel();!r.isVisible();){if(!(r=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;if(f.comboId===n.id||f.parentId===n.id)break;f=r.getModel()}if(s=f.id,u){if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(h[p],{size:c[p]},!1);var d=e.addItem("vedge",{source:s,target:u,isVEdge:!0},!1);c[p]=t.getModel().size||1,h[p]=d}}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||u===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(f=r.getModel();!r.isVisible();){if(!(r=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;f=r.getModel()}s=f.id;for(l=a.getModel();!a.isVisible();){if(!(a=e.findById(l.comboId||l.parentId))||!l.parentId&&!l.comboId)return;if(l.comboId===n.id||l.parentId===n.id)break;l=a.getModel()}if(u=l.id,s){var p;if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(h[p],{size:c[p]},!1);d=e.addItem("vedge",{target:u,source:s,isVEdge:!0},!1);c[p]=t.getModel().size||1,h[p]=d}}else(i.includes(r)||o.includes(r))&&(i.includes(a)||o.includes(a))&&r.isVisible()&&a.isVisible()&&t.show()}})),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})}},e.prototype.collapseExpandCombo=function(t){if(Object(u.o)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType())){for(var e=t.getModel(),n=this.findById(e.parentId);n;){var r=n.getModel();if(r.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(n=void 0);n=this.findById(r.parentId)}e.collapsed?this.expandCombo(t):this.collapseCombo(t),this.updateCombo(t)}},e.prototype.sortCombos=function(){var t=this;if(!this.get("comboSorted")){this.set("comboSorted",!0);var e=[],n={};(this.get("comboTrees")||[]).forEach((function(t){dt(t,(function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],n[t.id]=t.depth,!0}))})),(this.getEdges().concat(this.get("vedges"))||[]).forEach((function(t){var r=t.getModel(),i=n[r.source]||0,o=n[r.target]||0,a=Math.max(i,o);e[a]?e[a].push(r.id):e[a]=[r.id]})),e.forEach((function(e){if(e&&e.length)for(var n=e.length-1;n>=0;n--){var r=t.findById(e[n]);r&&r.toFront()}}))}},e.prototype.getNeighbors=function(t,e){var n=t;return Object(u.o)(t)&&(n=this.findById(t)),n.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=!1);var r=t;Object(u.o)(t)&&(r=this.findById(t));var i=this.get("degrees");i&&!n||(i=Object(v.getDegree)(this.save()),this.set("degrees",i));var o=i[r.getID()],a=0;if(!o)return 0;switch(e){case"in":a=o.inDegree;break;case"out":a=o.outDegree;break;case"all":a=o;break;default:a=o.degree}return a},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear())},e.prototype.pushStack=function(t,e,n){if(void 0===t&&(t="update"),void 0===n&&(n="undo"),this.get("enabledStack")){var r=e?Object(u.a)(e):{before:{},after:Object(u.a)(this.save())};"redo"===n?this.redoStack.push({action:t,data:r}):this.undoStack.push({action:t,data:r}),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix");return n&&t||(n=Object(v.getAdjMatrix)(this.save(),e),this.set("adjMatrix",n)),n},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix"),r=this.get("shortestPathMatrix");return n&&t||(n=Object(v.getAdjMatrix)(this.save(),e),this.set("adjMatrix",n)),r&&t||(r=Object(v.floydWarshall)(this.save(),e),this.set("shortestPathMatrix",r)),r},e.prototype.on=function(e,n,r){return t.prototype.on.call(this,e,n,r)},e.prototype.destroy=function(){this.clear(),this.clearStack(),this.get("itemController").destroy(),this.get("modeController").destroy(),this.get("viewController").destroy(),this.get("stateController").destroy(),this.get("canvas").destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null},e.prototype.createHull=function(t){if(t.members&&!(t.members.length<1)){var e=this.get("hullGroup"),n=this.get("hullMap");if(n||(n={},this.set("hullMap",n)),e&&!e.get("destroyed")||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),n[t.id])return console.warn("Existed hull id."),n[t.id];var r=e.addGroup({id:t.id+"-container"}),i=new be(this,Object(f.a)(Object(f.a)({},t),{group:r}));return n[i.id]=i,i}console.warn("Create hull failed! The members is empty.")},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e;e=Object(u.o)(t)?this.getHullById(t):t,delete this.get("hullMap")[e.id],e.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();t&&Object.keys(t).length&&(Object.keys(t).forEach((function(e){t[e].destroy()})),this.set("hullMap",{}))},e.prototype.onTick=function(t){this.get("layoutController").onTick(t),Object(p.b)(this.onTick.bind(this))},e}(d.a);function Me(t){return(Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Se=g.a.transform,Oe=["startArrow","endArrow"],ke={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},Ce={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:ke,combo:ke},Ee={options:{},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t){return Object(u.b)({labelCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}},descriptionCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}}},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){var n=this.drawShape(t,e);(n.set("className",this.itemType+"-shape"),t.label)&&this.drawLabel(t,e).set("className",this.itemType+"-label");return n},afterDraw:function(t,e,n){},drawShape:function(t,e){return null},drawLabel:function(t,e){var n=this.getOptions(t).labelCfg||{},r=this.getLabelStyle(t,n,e),i=r.rotate;delete r.rotate;var o=e.addShape("text",{attrs:r,draggable:!0,className:"text-shape",name:"text-shape"});if(i){var a=o.getBBox(),s=o.getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),r.rotateCenter)switch(r.rotateCenter){case"center":s=Se(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=Se(s,[["t",-r.x,-r.y],["r",i],["t",r.x,r.y]]);break;case"leftcenter":s=Se(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);break;default:s=Se(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=Se(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);o.setMatrix(s)}if(r.background){var u=this.drawLabelBg(t,e,o),c=this.itemType+"-label-bg";u.set("classname",c),o.toFront()}return o},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=Object(u.r)({},r,t.labelCfg),o=this.getLabelBgStyleByPosition(n,t,i,e);return e.addShape("rect",{name:"text-bg-shape",attrs:o})},getLabelStyleByPosition:function(t,e,n){return{text:t.label}},getLabelBgStyleByPosition:function(t,e,n,r){return{}},getLabelStyle:function(t,e,n){var r=this.getLabelStyleByPosition(t,e,n),i=this.itemType+"Label",o=nt[i]?nt[i].style:null;return Object(f.a)(Object(f.a)(Object(f.a)({},o),r),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e){this.updateShapeStyle(t,e),this.updateLabel(t,e)},updateShapeStyle:function(t,e){var n=e.getContainer(),r=e.getKeyShape(),i=Object(u.r)({},r.attr(),t.style),o=function(t){var e,o=i[t];if(Object(u.n)(o)){var a=n.find((function(e){return e.get("name")===t}));a&&a.attr(o)}else r.attr(((e={})[t]=o,e))};for(var a in i)o(a)},updateLabel:function(t,e){var n=e.getContainer(),r=this.getOptions({}).labelCfg,i=this.itemType+"-label",o=n.find((function(t){return t.get("className")===i})),a=this.itemType+"-label-bg",s=n.find((function(t){return t.get("classname")===a}));if(t.label||""===t.label)if(o){var c={};e.getModel&&(c=e.getModel().labelCfg);var h=Object(u.b)({},r,c,t.labelCfg),l=this.getLabelStyleByPosition(t,h,n),d=t.labelCfg?t.labelCfg.style:void 0,p=h.style&&h.style.background,g=Object(f.a)(Object(f.a)(Object(f.a)({},o.attr()),l),d),v=g.rotate;if(delete g.rotate,v){var y=[1,0,0,0,1,0,0,0,1];y=Se(y,[["t",-g.x,-g.y],["r",v],["t",g.x,g.y]]),o.resetMatrix(),o.attr(Object(f.a)(Object(f.a)({},g),{matrix:y}))}else o.resetMatrix(),o.attr(g);if(s)if(g.background){var m=this.getLabelBgStyleByPosition(o,t,h,n),b=Object(f.a)(Object(f.a)({},m),p);if(s.resetMatrix(),v){var x=[1,0,0,0,1,0,0,0,1];x=Se(x,[["t",-b.x,-b.y],["r",v],["t",b.x,b.y]]),b.matrix=x}s.attr(b)}else n.removeChild(s);else g.background&&((s=this.drawLabelBg(t,n,o)).set("classname",a),o.toFront())}else{this.drawLabel(t,n).set("className",i)}},afterUpdate:function(t,e){},setState:function(t,e,n){var r,i,o=n.get("keyShape");if(o&&!o.destroyed){var a=n.getType(),s=Object(u.g)(e)?t:t+":"+e,c=this.getStateStyle(s,n),h=n.getStateStyle(s);if(h||c){var l=Object(u.r)({},h||c),f=n.getContainer(),d={x:1,y:1,cx:1,cy:1};if("combo"===a&&(d.r=1,d.width=1,d.height=1),e){var p=function(t){var e,n=l[t];if(Object(u.n)(n)&&!Oe.includes(t)){var r=f.find((function(e){return e.get("name")===t}));r&&r.attr(n)}else o.attr(((e={})[t]=n,e))};for(var g in l)p(g)}else{var v=wt(n.getCurrentStatesStyle()),y=n.getModel(),m=Object(u.r)({},y.style,wt(n.getOriginStyle())),b=o.get("name"),x=o.attr(),w={};Object.keys(x).forEach((function(t){if("img"!==t){var e=x[t];e&&"object"===Me(e)?w[t]=Object(u.a)(e):w[t]=e}}));var M={},S=function(t){var e=l[t];if(Object(u.n)(e)&&!Oe.includes(t)){var n=f.find((function(e){return e.get("name")===t}));if(n){var r=Object(u.a)(n.attr());Object(u.c)(e,(function(e,i){if(t===b&&w[i]&&!d[i]){delete w[i];var s=m[t][i]||Ce[a][i];o.attr(i,s)}else if(r[i]||0===r[i]){delete r[i];var u=m[t][i]||Ce[a][i];n.attr(i,u)}})),M[t]=r}}else if(w[t]&&!d[t]){delete w[t];var i=m[t]||(m[b]?m[b][t]:void 0)||Ce[a][t];o.attr(t,i)}};for(var O in l)S(O);for(var g in b?M[b]=w:Object(u.r)(M,w),v)if(!d[g]){var k=v[g];Object(u.n)(k)&&!Oe.includes(g)||(b?(Object(u.r)(m[b],((i={})[g]=k,i)),delete m[g]):Object(u.r)(m,((r={})[g]=k,r)),delete v[g])}var C={};Object(u.b)(C,m,M,v);var E=!1,P=function(t){var e,n,r=C[t];if(Object(u.n)(r)&&!Oe.includes(t)){var i=f.find((function(e){return e.get("name")===t}));i&&(t===b&&("combo"===a&&(delete r.r,delete r.width,delete r.height),E=!0),i.attr(r))}else if(!E){var s=r||Ce[a][t];"combo"===a?b||o.attr(((e={})[t]=s,e)):o.attr(((n={})[t]=s,n))}};for(var j in C)P(j)}}}},getStateStyle:function(t,e){var n=e.getModel(),r=e.getType(),i=this.getOptions(n),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,c=n.stateStyles?n.stateStyles[t]:o&&o[t];return"combo"===r?Object(u.a)(c):Object(u.r)({},s,c)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){return this.getOptions(t).anchorPoints}},Pe={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:nt.nodeLabel.offset,getSize:function(t){var e=t.size||this.getOptions({}).size||nt.defaultNode.size;return Object(u.f)(e)&&1===e.length&&(e=[e[0],e[0]]),Object(u.f)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition;if("center"===n)return{x:0,y:0,text:t.label};var r=e.offset;Object(u.j)(r)&&(r=this.offset);var i,o=this.getSize(t),a=o[0],s=o[1];switch(n){case"top":i={x:0,y:0-s/2-r,textBaseline:"bottom"};break;case"bottom":i={x:0,y:s/2+r,textBaseline:"top"};break;case"left":i={x:0-a/2-r,y:0,textAlign:"right"};break;default:i={x:a/2+r,y:0,textAlign:"left"}}return i.text=t.label,i},getLabelBgStyleByPosition:function(t,e,n,r){if(!t)return{};var i=t.getBBox(),o=n.style&&n.style.background;if(!o)return{};var a,s=Et(o.padding),c=i.width+s[1]+s[3],h=i.height+s[0]+s[2],l=n.offset;return Object(u.j)(l)&&(l=this.offset),a={x:i.minX-s[3],y:i.minY-s[0]},a=Object(f.a)(Object(f.a)(Object(f.a)({},a),o),{width:c,height:h})},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);return e.addShape(n,{attrs:r,draggable:!0,name:"node-shape"})},updateLinkPoints:function(t,e){var n,r=this.getOptions(t).linkPoints,i=e.find((function(t){return"link-point-left"===t.get("className")})),o=e.find((function(t){return"link-point-right"===t.get("className")})),a=e.find((function(t){return"link-point-top"===t.get("className")})),s=e.find((function(t){return"link-point-bottom"===t.get("className")}));i&&(n=i.attr()),o&&!n&&(n=o.attr()),a&&!n&&(n=a.attr()),s&&!n&&(n=s.attr()),n||(n=r);var c=Object(u.r)({},n,t.linkPoints),h=c.fill,l=c.stroke,d=c.lineWidth,p=c.size/2;p||(p=c.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},v=g.left,y=g.right,m=g.top,b=g.bottom,x=this.getSize(t),w=x[0],M=x[1],S={r:p,fill:h,stroke:l,lineWidth:d};i?v||void 0===v?i.attr(Object(f.a)(Object(f.a)({},S),{x:-w/2,y:0})):i.remove():v&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:-w/2,y:0}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),o?(y||void 0===y||o.remove(),o.attr(Object(f.a)(Object(f.a)({},S),{x:w/2,y:0}))):y&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:w/2,y:0}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a?(m||void 0===m||a.remove(),a.attr(Object(f.a)(Object(f.a)({},S),{x:0,y:-M/2}))):m&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:0,y:-M/2}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s?b||void 0===b?s.attr(Object(f.a)(Object(f.a)({},S),{x:0,y:M/2})):s.remove():b&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:0,y:M/2}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},updateShape:function(t,e,n,r){e.get("keyShape").attr(Object(f.a)({},n)),this.updateLabel(t,e),r&&this.updateIcon(t,e)},updateIcon:function(t,e){var n=this,r=e.getContainer(),i=this.getOptions(t).icon,o=(t.icon?t.icon:{show:void 0}).show,a=r.find((function(t){return t.get("className")===n.type+"-icon"}));if(a)if(o||void 0===o){var s=Object(u.r)({},a.attr(),i),c=s.width,h=s.height;a.attr(Object(f.a)(Object(f.a)({},s),{x:-c/2,y:-h/2}))}else a.remove();else if(o){c=i.width,h=i.height;r.addShape("image",{attrs:Object(f.a)(Object(f.a)({},i),{x:-c/2,y:-h/2}),className:this.type+"-icon",name:this.type+"-icon"});var l=r.find((function(t){return"node-label"===t.get("className")}));l&&l.toFront()}}},je=Object(f.a)(Object(f.a)({},Ee),Pe);Wt.registerNode("single-node",je);var Ae={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:nt.defaultEdge.size,style:{x:0,y:0,stroke:nt.defaultEdge.style.stroke,lineAppendWidth:nt.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:nt.edgeLabel.style.fill,fontSize:nt.edgeLabel.style.fontSize}},stateStyles:Object(f.a)({},nt.edgeStateStyles)},getPath:function(t){var e=[];return Object(u.c)(t,(function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(u.r)({},e,n,t.style),i=t.size||nt.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),c=[o];s&&(c=c.concat(s)),c.push(a);var h=this.getPath(c);return Object(u.r)({},nt.defaultEdge.style,{stroke:nt.defaultEdge.color,lineWidth:i,path:h},r)},updateShapeStyle:function(t,e){var n=e.getContainer(),r={stroke:t.color},i=n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,c=this.getControlPoints(t),h=[a];c&&(h=h.concat(c)),h.push(s);var l=i.attr(),f=Object(u.r)({},r,l,t.style),d=t.sourceNode,p=t.targetNode,g={radius:f.radius};c||(g={source:d,target:p,offset:f.offset,radius:f.radius}),l.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),l.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var v=this.getPath(h,g),y=Object(u.r)(r,i.attr(),{lineWidth:o,path:v},t.style);i&&i.attr(y)},getLabelStyleByPosition:function(t,e,n){var r,i=e.position||this.labelPosition,o={},a=n&&n.find((function(t){return"edge-shape"===t.get("className")}));r="start"===i?0:"end"===i?1:.5;var s,c=e.refX||this.refX,h=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+c,o.y=t.startPoint.y+h,o.text=t.label,o;s=Object(u.j)(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var l=lt(a,r,c,h,s);return o.x=l.x,o.y=l.y,o.rotate=l.rotate,o.textAlign=this._getTextAlign(i,l.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e,n,r){if(!t)return{};var i=t.getBBox(),o=n.style&&n.style.background;if(!o)return{};var a,s=o.padding,c=i.width+s[1]+s[3],h=i.height+s[0]+s[2],l=n.position||this.labelPosition,d=Object(f.a)(Object(f.a)({},o),{width:c,height:h,x:i.minX-s[2],y:i.minY-s[0],rotate:0});a=Object(u.j)(n.autoRotate)?this.labelAutoRotate:n.autoRotate;var p,g=r&&r.find((function(t){return"edge-shape"===t.get("className")}));p="start"===l?0:"end"===l?1:.5;var v=n.refX||this.refX,y=n.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return d.x=e.startPoint.x+v-c/2,d.y=e.startPoint.y+y-h/2,d;var m=lt(g,p,v-c/2,y+h/2,a),b=m.angle;return b>.5*Math.PI&&b<1.5*Math.PI&&(m=lt(g,p,v+c/2,y+h/2,a)),a&&(d.x=m.x,d.y=m.y),d.rotate=m.rotate,d},_getTextAlign:function(t,e){var n="center";return e?(e%=2*Math.PI,"center"!==t&&(n=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),n):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},drawLabel:function(t,e){var n,r=this.options.labelCfg;n="undefined"!=typeof window&&void 0!==window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";var i=Object(u.b)({fontFamily:n},r,t.labelCfg),o=this.getLabelStyle(t,i,e),a=o.rotate;delete o.rotate;var s=e.addShape("text",{attrs:o,name:"text-shape"});if(a&&s.rotateAtStart(a),o.background){var c=this.drawLabelBg(t,e,s),h=this.itemType+"-label-bg";c.set("classname",h),s.toFront()}return s},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=Object(u.b)({},r,t.labelCfg),o=this.getLabelStyle(t,i,e).rotate,a=this.getLabelBgStyleByPosition(n,t,i,e);delete a.rotate;var s=e.addShape("rect",{name:"text-bg-shape",attrs:a});return o&&s.rotateAtStart(o),s}},Ie=Object(f.a)(Object(f.a)({},Ee),Ae);Wt.registerEdge("single-edge",Ie),Wt.registerEdge("line",{getControlPoints:function(){}},"single-edge"),Wt.registerEdge("spline",{getPath:function(t){return te(t)}},"single-edge"),Wt.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,n,r=t.startPoint,i=t.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2;if(void 0!==t.controlPoints){if(n=t.controlPoints[0],e=C(r,n,i),r.x<=i.x&&r.y>i.y?this.clockwise=e.x>n.x?0:1:r.x<=i.x&&r.yn.x?1:0:r.x>i.x&&r.y<=i.y?this.clockwise=e.y=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},s.to.keyword=function(t){return o[t.slice(0,3)]}},208:function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},209:function(t,e,n){"use strict";var r=n(210),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},211:function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(110),o=n(213),a={};Object.keys(i).forEach((function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach((function(n){var i=e[n];a[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"===r(n))for(var i=n.length,o=0;o1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))})),t.exports=a},212:function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},213:function(t,e,n){var r=n(110);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i2&&(n.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&n.push([i,s[0]]),"r"===u)n.push([i].concat(s));else for(;s.length>=e[u]&&(n.push([i].concat(s.splice(0,e[u]))),e[u]););return t})),n};var u=function(t,e){if(t.length!==e.length)return!1;var n=!0;return Object(r.c)(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n};function c(t,e,n){var r=null,i=n;return e=0;h--)a=o[h].index,"add"===o[h].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var d=i-(r=t.length);if(r0)){t[r]=e[r];break}n=l(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t}},29:function(t,e,n){"use strict";n.r(e),n.d(e,"getAdjMatrix",(function(){return r})),n.d(e,"breadthFirstSearch",(function(){return l})),n.d(e,"connectedComponent",(function(){return d})),n.d(e,"getDegree",(function(){return g})),n.d(e,"getInDegree",(function(){return v})),n.d(e,"getOutDegree",(function(){return y})),n.d(e,"detectCycle",(function(){return M})),n.d(e,"detectDirectedCycle",(function(){return it})),n.d(e,"detectAllCycles",(function(){return w})),n.d(e,"detectAllDirectedCycle",(function(){return x})),n.d(e,"detectAllUndirectedCycle",(function(){return b})),n.d(e,"depthFirstSearch",(function(){return m})),n.d(e,"dijkstra",(function(){return k})),n.d(e,"findAllPath",(function(){return P})),n.d(e,"findShortestPath",(function(){return E})),n.d(e,"floydWarshall",(function(){return j})),n.d(e,"labelPropagation",(function(){return A})),n.d(e,"louvain",(function(){return T})),n.d(e,"minimumSpanningTree",(function(){return R})),n.d(e,"pageRank",(function(){return F})),n.d(e,"getNeighbors",(function(){return u})),n.d(e,"Stack",(function(){return rt})),n.d(e,"GADDI",(function(){return nt}));var r=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))})),i},i=function(t,e){return t===e},o=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):""+this.value},t}(),a=function(){function t(t){void 0===t&&(t=i),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new o(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new o(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,i=void 0===r?void 0:r;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==n&&this.compare(o.value,n))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}(),s=function(){function t(){this.linkedList=new a}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}(),u=function(t,e,n){void 0===e&&(e=[]);var r=e.filter((function(e){return e.source===t||e.target===t}));if("target"===n){return r.filter((function(e){return e.source===t})).map((function(t){return t.target}))}if("source"===n){return r.filter((function(e){return e.target===t})).map((function(t){return t.source}))}return r.map((function(e){return e.source===t?e.target:e.source}))},c=function(t,e){return e.filter((function(e){return e.source===t||e.target===t}))},h=function(t){return void 0===t&&(t=0),t+"-"+(""+Math.random()).split(".")[1].substr(0,5)+(""+Math.random()).split(".")[1].substr(0,5)};var l=function(t,e,n){var r=function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n),i=new s,o=t.edges,a=void 0===o?[]:o;i.enqueue(e);for(var c="",h=function(){var t=i.dequeue();r.enter({current:t,previous:c}),u(t,a,"target").forEach((function(e){r.allowTraversal({previous:c,current:t,next:e})&&i.enqueue(e)})),r.leave({current:t,previous:c}),c=t};!i.isEmpty();)h()},f=function(t){for(var e=t.nodes,n=void 0===e?[]:e,r=t.edges,i=void 0===r?[]:r,o=[],a={},s={},c={},h=[],l=0,f=function t(e){s[e.id]=l,c[e.id]=l,l+=1,o.push(e),a[e.id]=!0;for(var r=u(e.id,i,"target").filter((function(t){return n.map((function(t){return t.id})).indexOf(t)>-1})),f=function(i){var o=r[i];if(s[o]||0===s[o])a[o]&&(c[e.id]=Math.min(c[e.id],s[o]));else{var u=n.filter((function(t){return t.id===o}));u.length>0&&t(u[0]),c[e.id]=Math.min(c[e.id],c[o])}},d=0;d0;){var g=o.pop();if(a[g.id]=!1,p.push(g),g===e)break}p.length>0&&h.push(p)}},d=0,p=n;d0&&t(o[0])}},c=0;c0;)f.push(s.pop());o.push(f)}}return o}(t)}var p=function(t){var e={},n=t.nodes,r=void 0===n?[]:n,i=t.edges,o=void 0===i?[]:i;return r.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),o.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},g=p,v=function(t,e){return p(t)[e]?p(t)[e].inDegree:0},y=function(t,e){return p(t)[e]?p(t)[e].outDegree:0};function m(t,e,n){!function t(e,n,r,i){i.enter({current:n,previous:r});var o=e.edges;u(n,void 0===o?[]:o,"target").forEach((function(o){i.allowTraversal({previous:r,current:n,next:o})&&t(e,o,n,i)})),i.leave({current:n,previous:r})}(t,e,"",function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n))}var b=function(t,e,n){var r,i;void 0===n&&(n=!0);for(var o=[],a=0,s=d(t,!1);a0;)for(var v=f.pop(),y=v.id,m=u(y,t.edges),b=function(r){var i,a=m[r],s=t.nodes.find((function(t){return t.id===a}));if(a===y)o.push(((i={})[a]=v,i));else if(a in g){if(!g[y].has(s)){for(var u=!0,c=[s,v],h=p[y];g[a].size&&!g[a].has(h)&&(c.push(h),h!==p[h.id]);)h=p[h.id];if(c.push(h),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var l={},d=1;d-1)return l;r.push(u),i.add(u);for(var f=h[u.id],d=0;d0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(u);else for(d=0;d-1}));y-1?g[v.id].push(c[b]):a.push(((i={})[v.id]=v,i))}}return{component:p,adjList:g,minIdx:s}},b=0;b=b})),w=f({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var M=m(w),S=M.minIdx,O=M.adjList,k=M.component;if(!(k.length>1))break;k.forEach((function(t){o[t.id]=new Set}));var C=s[S];if(e&&n&&-1===e.indexOf(C.id))return a;h(C,C,O),b=S+1}return a},w=function(t,e,n,r){return void 0===r&&(r=!0),e?x(t,n,r):b(t,n,r)},M=function(t){var e=null,n=t.nodes,r={},i={},o={},a={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var s={enter:function(t){var n=t.current,a=t.previous;if(o[n]){e={};for(var s=n,u=a;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else o[n]=n,delete i[n],r[n]=a},leave:function(t){var e=t.current;a[e]=e,delete o[e]},allowTraversal:function(t){var n=t.next;return!e&&!a[n]}};Object.keys(i).length;){m(t,Object.keys(i)[0],s)}return e},S=n(1),O=n(0),k=function(t,e,n,r){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],h={},l={},f={};o.forEach((function(t,n){var r=t.id;u.push(r),l[r]=1/0,r===e&&(l[r]=0)}));for(var d=o.length,p=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;ol[e.id]+s?(l[a]=l[e.id]+s,f[a]=[e.id]):l[a]===l[e.id]+s&&f[a].push(e.id)}))},g=0;g0&&h.length>0;){var d=h[h.length-1];if(d.length){var p=d.shift();if(p&&(s.push(p),c[p]=!0,f=r?u(p,a,"target"):u(p,a),h.push(f.filter((function(t){return!c[t]})))),s[s.length-1]===n){var g=s.map((function(t){return t}));l.push(g);v=s.pop();c[v]=!1,h.pop()}}else{var v=s.pop();c[v]=!1,h.pop()}}return l},j=function(t,e){for(var n=r(t,e),i=[],o=n.length,a=0;ai[a][u]+i[u][s]&&(i[a][s]=i[a][u]+i[u][s]);return i},A=function(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===i&&(i=1e3);var o=t.nodes,a=void 0===o?[]:o,s=t.edges,u=void 0===s?[]:s,c={},l={};a.forEach((function(t,e){var n=h();t.clusterId=n,c[n]={id:n,nodes:[t]},l[t.id]={node:t,idx:e}}));var f=r(t,e),d=[],p={};f.forEach((function(t,e){var n=0,r=a[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=a[e].id;p[r][i]=t}})),d.push(n)}));for(var g=0,v=function(){var t=!1;if(a.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],i=l[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r=0&&i.splice(o,1),i&&i.length){t=!0;var a=c[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),h=c[i[u]];h.nodes.push(e),e.clusterId=h.id}}})),!t)return"break";g++};g100);)y=v,m++,Object.keys(h).forEach((function(t){var e=0;u.forEach((function(r){var i=r.source,o=r.target,a=l[i].node.clusterId,s=l[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),h[t].sumTot=e})),a.forEach((function(t,e){var r,i=h[t.clusterId],o=0,a=d[e]/(2*g),s=0;i.nodes.forEach((function(t){var n=l[t.id].idx;s+=f[e][n]||0}));var c=s-i.sumTot*a,v=p[t.id];if(Object.keys(v).forEach((function(n){var i=l[n].node.clusterId;if(i!==t.clusterId){var s=h[i],u=s.nodes;if(u&&u.length){var d=0;u.forEach((function(t){var n=l[t.id].idx;d+=f[e][n]||0}));var p=d-s.sumTot*a-c;p>o&&(o=p,r=s)}}})),o>0){r.nodes.push(t);var y=t.clusterId;t.clusterId=r.id;var m=i.nodes.indexOf(t);i.nodes.splice(m,1);var b=0,x=0;u.forEach((function(t){var e=t.source,i=t.target,o=l[e].node.clusterId,a=l[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(b+=t[n]||1),(o===y&&a!==y||a===y&&o!==y)&&(x+=t[n]||1)})),r.sumTot=b,i.sumTot=x}}));var b={},x=0;Object.keys(h).forEach((function(t){var e=h[t];if(e.nodes&&e.nodes.length){var n=String(x+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),h[n]=e,b[t]=n,delete h[t],x++)}else delete h[t]})),a.forEach((function(t){t.clusterId&&b[t.clusterId]&&(t.clusterId=b[t.clusterId])}));var w=[],M={};u.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=l[e].node.clusterId,a=l[r].node.clusterId,s=o+"---"+a;if(M[s])M[s].weight+=i,M[s].count++;else{var u={source:o,target:a,weight:i,count:1};M[s]=u,w.push(u)}}));var S=[];return Object.keys(h).forEach((function(t){S.push(h[t])})),{clusters:S,clusterEdges:w}},N=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r0?n=r:null!==i&&i0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}(),L=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=i[0],u=new Set;u.add(s);var h=new _((function(t,n){return e?t.weight-n.weight:0}));for(c(s.id,a).forEach((function(t){h.insert(t)}));!h.isEmpty();){var l=h.delMin(),f=l.source,d=l.target;u.has(f)&&u.has(d)||(n.push(l),u.has(f)||(u.add(f),c(f,a).forEach((function(t){h.insert(t)}))),u.has(d)||(u.add(d),c(d,a).forEach((function(t){h.insert(t)}))))}return n},D=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=a.map((function(t){return t}));e&&s.sort((function(t,e){return t.weight-e.weight}));for(var u=new N(i.map((function(t){return t.id})));s.length>0;){var c=s.shift(),h=c.source,l=c.target;u.connected(h,l)||(n.push(c),u.union(h,l))}return n},R=function(t,e,n){return n?{prim:L,kruskal:D}[n](t,e):D(t,e)},F=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,i=1,o=0,a=1e3,s=t.nodes,c=void 0===s?[]:s,h=t.edges,l=void 0===h?[]:h,f=c.length,d={},p={},v=0;v0&&i>e;){o=0;for(v=0;v0&&(r+=p[w]/M)}d[m]=n*r,o+=d[m]}}o=(1-o)/f,i=0;for(v=0;v=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;rl||r.hasNode(o[h.to])||(e.labelp;v--){if("break"===g(v))break}if(f){var y=t.findMinLabel(l);o.dfsEdgeList.push(new W(h,d,"-1",y.edgeLabel,"-1"));var m=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[m]===o.dfsEdgeList[m]&&a(l[y.edgeLabel].projected)}var b={};f=!1;var x=0;s.forEach((function(e){var n=new G(e),o=t.findForwardPureEdges(r,n.edges[u[0]],c,n);o.length>0&&(f=!0,x=h,o.forEach((function(t){var n=t.label+"-"+i[t.to].label;b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var w=u.length,M=function(e){if(f)return"break";var n=u[e];s.forEach((function(e){var a=new G(e),s=t.findForwardRmpathEdges(r,a.edges[n],c,a);s.length>0&&(f=!0,x=o.dfsEdgeList[n].fromNode,s.forEach((function(t){var n=t.label+"-"+i[t.to].label;b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(v=0;v=0;l--){var f=e.findBackwardEdge(u,h.edges[r[l]],h.edges[r[0]],h);if(f){var d=e.dfsCode.dfsEdgeList[r[l]].fromNode+"-"+f.label;s[d]||(s[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[l]].fromNode,edgeLabel:f.label}),s[d].projected.push({graphId:t.graphId,edge:f,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(u,h.edges[r[0]],o,h).forEach((function(e){var n=i+"-"+e.label+"-"+c[e.to].label;a[n]||(a[n]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:c[e.to].label}),a[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var p=function(n){e.findForwardRmpathEdges(u,h.edges[r[n]],o,h).forEach((function(i){var o=e.dfsCode.dfsEdgeList[r[n]].fromNode+"-"+i.label+"-"+c[i.to].label;a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:c[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(l=0;li){var a=i;i=r,r=a}var h=t.label,l=n+"-"+r+"-"+h+"-"+i,f=r+"-"+h+"-"+i;if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[l]={graphId:n,nodeLabel1:r,edgeLabel:h,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]2*e)););if(d<2*e&&(a[r+"-"+f]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}uF[n][f]){l=!0;break}if(l)return B.splice(e,1),"continue";var p={};i.neighbors.forEach((function(t){var e=h[r.id+"-"+t.id];p[r.id+"-"+t.id]={start:d[r.id].idx,end:d[t.id].idx,distance:e}})),M=K(p,b,t,M);var g=[];Object.keys(p).forEach((function(t){if(I[t])g.push(I[t]);else{var e=M[t];I[t]=$(e,A,o,a),g.push(I[t])}})),g=g.sort((function(t,e){return e-t}));var v=!1;for(f=0;f=0;p--)f(p)}));var X=[];B.forEach((function(n){for(var r=d[n.id].idx,s=Q(t.nodes,u[r],r,o,i).neighbors,c=s.length,l=!1,f=function(r){if(s.length+1F[u][F[u].length-1])return s.splice(r,1),"continue";var p=I[c]?I[c]:function(t,e,n,r,i,o,a,s,u,c,h){var l,f=e.id+"-"+n.id;if(c&&c[f])return c[f];var d=h?h[f]:void 0;if(!d){var p=((l={})[f]={start:r[e.id].idx,end:r[n.id].idx,distance:i},l);d=(h=K(p,o,t,h))[f]}return $(d,a,s,u)}(t,n,i,d,f,b,A,o,a,I,M),g=T.id+"-"+u;if(pe&&(m=e)})),_[u]=m),d[i.id].degree=0;p--){var g=f(p);if("object"===U(g))return g.value}l||X.push({nodes:[n].concat(s)})}));var Y=k(e,T.id,!1).length,z={};n?(Object.keys(Y).forEach((function(t){var e=v[t].node[o];z[e]?z[e].push(Y[t]):z[e]=[Y[t]]})),Object.keys(z).forEach((function(t){z[t].sort((function(t,e){return t-e}))}))):z=F;for(var W=function(r){var i=X[r],s=i.nodes[0],u={},c={};i.nodes.forEach((function(t,e){c[t.id]={idx:e,node:t,degree:0};var n=t[o];u[n]?u[n]++:u[n]=1}));var h=[],l={};t.edges.forEach((function(t){c[t.source]&&c[t.target]&&(h.push(t),l[t[a]]?l[t[a]]++:l[t[a]]=1,c[t.source].degree++,c[t.target].degree++)}));for(var f=Object.keys(m).length,p=!1,g=0;g=0;g--){if("break"===M(g))break}if(w)return X.splice(r,1),"continue";i.edges=h;var S=k(i,i.nodes[0].id,!1).length;if(Object.keys(S).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!w){if(S[t]===1/0){var e=c[t].node[o];if(u[e]--,u[e]z[r][z[r].length-1]){e=c[t].node[o];if(u[e]--,u[e]=0;E--){var P=i.nodes[E],j=c[P.id].degree,A=P[o];if(j<_[A]){if(u[P[o]]--,u[P[o]]=0;I--){var N=h[I];if(!c[N.source]||!c[N.target]){h.splice(I,1);var B=N[a];if(l[B]--,c[N.source]&&c[N.source].degree--,c[N.target]&&c[N.target].degree--,m[B]&&l[B]=0;q--){if("break"===W(q))break}var G=X.length,V=function(t){var e=X[t],n={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=X[t],r={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&X.splice(t,1)},i=G-1;i>t;i--)r(i);G=X.length};for(q=0;q<=G-1;q++)V(q);return X}}},rt=function(){function t(t){void 0===t&&(t=10),this.linkedList=new a,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),it=M;e.default={getAdjMatrix:r,breadthFirstSearch:l,connectedComponent:d,getDegree:g,getInDegree:v,getOutDegree:y,detectCycle:M,detectDirectedCycle:it,detectAllCycles:w,detectAllDirectedCycle:x,detectAllUndirectedCycle:b,depthFirstSearch:m,dijkstra:k,findAllPath:P,findShortestPath:E,floydWarshall:j,labelPropagation:A,louvain:T,minimumSpanningTree:R,pageRank:F,getNeighbors:u,Stack:rt,GADDI:nt}},3:function(t,e,n){"use strict";n.r(e),n.d(e,"contains",(function(){return i})),n.d(e,"includes",(function(){return i})),n.d(e,"difference",(function(){return a})),n.d(e,"find",(function(){return x})),n.d(e,"findIndex",(function(){return w})),n.d(e,"firstValue",(function(){return M})),n.d(e,"flatten",(function(){return S})),n.d(e,"flattenDeep",(function(){return O})),n.d(e,"getRange",(function(){return E})),n.d(e,"pull",(function(){return I})),n.d(e,"pullAt",(function(){return N})),n.d(e,"reduce",(function(){return B})),n.d(e,"remove",(function(){return _})),n.d(e,"sortBy",(function(){return D})),n.d(e,"union",(function(){return F})),n.d(e,"uniq",(function(){return R})),n.d(e,"valuesOfKey",(function(){return X})),n.d(e,"head",(function(){return Y})),n.d(e,"last",(function(){return z})),n.d(e,"startsWith",(function(){return W})),n.d(e,"endsWith",(function(){return q})),n.d(e,"filter",(function(){return o})),n.d(e,"every",(function(){return G})),n.d(e,"some",(function(){return V})),n.d(e,"group",(function(){return Q})),n.d(e,"groupBy",(function(){return U})),n.d(e,"groupToMap",(function(){return Z})),n.d(e,"getWrapBehavior",(function(){return K})),n.d(e,"wrapBehavior",(function(){return $})),n.d(e,"number2color",(function(){return tt})),n.d(e,"parseRadius",(function(){return et})),n.d(e,"clamp",(function(){return nt})),n.d(e,"fixedBase",(function(){return rt})),n.d(e,"isDecimal",(function(){return ot})),n.d(e,"isEven",(function(){return at})),n.d(e,"isInteger",(function(){return st})),n.d(e,"isNegative",(function(){return ut})),n.d(e,"isNumberEqual",(function(){return ct})),n.d(e,"isOdd",(function(){return ht})),n.d(e,"isPositive",(function(){return lt})),n.d(e,"max",(function(){return k})),n.d(e,"maxBy",(function(){return ft})),n.d(e,"min",(function(){return C})),n.d(e,"minBy",(function(){return dt})),n.d(e,"mod",(function(){return pt})),n.d(e,"toDegree",(function(){return vt})),n.d(e,"toInteger",(function(){return yt})),n.d(e,"toRadian",(function(){return bt})),n.d(e,"forIn",(function(){return xt})),n.d(e,"has",(function(){return wt})),n.d(e,"hasKey",(function(){return Mt})),n.d(e,"hasValue",(function(){return Ot})),n.d(e,"keys",(function(){return g})),n.d(e,"isMatch",(function(){return v})),n.d(e,"values",(function(){return St})),n.d(e,"lowerCase",(function(){return Ct})),n.d(e,"lowerFirst",(function(){return Et})),n.d(e,"substitute",(function(){return Pt})),n.d(e,"upperCase",(function(){return jt})),n.d(e,"upperFirst",(function(){return At})),n.d(e,"getType",(function(){return Tt})),n.d(e,"isArguments",(function(){return Nt})),n.d(e,"isArray",(function(){return l})),n.d(e,"isArrayLike",(function(){return r})),n.d(e,"isBoolean",(function(){return Bt})),n.d(e,"isDate",(function(){return _t})),n.d(e,"isError",(function(){return Lt})),n.d(e,"isFunction",(function(){return c})),n.d(e,"isFinite",(function(){return Dt})),n.d(e,"isNil",(function(){return h})),n.d(e,"isNull",(function(){return Rt})),n.d(e,"isNumber",(function(){return it})),n.d(e,"isObject",(function(){return d})),n.d(e,"isObjectLike",(function(){return m})),n.d(e,"isPlainObject",(function(){return b})),n.d(e,"isPrototype",(function(){return Xt})),n.d(e,"isRegExp",(function(){return Yt})),n.d(e,"isString",(function(){return L})),n.d(e,"isType",(function(){return u})),n.d(e,"isUndefined",(function(){return zt})),n.d(e,"isElement",(function(){return Wt})),n.d(e,"requestAnimationFrame",(function(){return qt})),n.d(e,"clearAnimationFrame",(function(){return Gt})),n.d(e,"augment",(function(){return Ut})),n.d(e,"clone",(function(){return Qt})),n.d(e,"debounce",(function(){return Kt})),n.d(e,"memoize",(function(){return $t})),n.d(e,"deepMix",(function(){return te})),n.d(e,"each",(function(){return p})),n.d(e,"extend",(function(){return ee})),n.d(e,"indexOf",(function(){return ne})),n.d(e,"isEmpty",(function(){return ie})),n.d(e,"isEqual",(function(){return oe})),n.d(e,"isEqualWith",(function(){return ae})),n.d(e,"map",(function(){return se})),n.d(e,"mapValues",(function(){return ce})),n.d(e,"mix",(function(){return Ht})),n.d(e,"assign",(function(){return Ht})),n.d(e,"get",(function(){return he})),n.d(e,"set",(function(){return le})),n.d(e,"pick",(function(){return de})),n.d(e,"omit",(function(){return pe})),n.d(e,"throttle",(function(){return ge})),n.d(e,"toArray",(function(){return ve})),n.d(e,"toString",(function(){return kt})),n.d(e,"uniqueId",(function(){return me})),n.d(e,"noop",(function(){return be})),n.d(e,"identity",(function(){return xe})),n.d(e,"size",(function(){return we})),n.d(e,"Cache",(function(){return Me}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,e){return!!r(t)&&t.indexOf(e)>-1},o=function(t,e){if(!r(t))return t;for(var n=[],i=0;i-1;)j.call(t,o,1);return t},T=Array.prototype.splice,N=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var o=void 0,a=e[n];n!==i&&a===o||(o=a,T.call(t,a,1))}return t},B=function(t,e,n){if(!l(t)&&!b(t))return t;var r=n;return p(t,(function(t,n){r=e(r,t,n)})),r},_=function(t,e){var n=[];if(!r(t))return n;for(var i=-1,o=[],a=t.length;++ie[i])return 1;if(t[i]n?n:t},rt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},it=function(t){return u(t,"Number")},ot=function(t){return it(t)&&t%1!=0},at=function(t){return it(t)&&t%2==0},st=Number.isInteger?Number.isInteger:function(t){return it(t)&&t%1==0},ut=function(t){return it(t)&&t<0};function ct(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)0},ft=function(t,e){if(l(t)){var n,r,i=t[0];return n=c(e)?e(t[0]):t[0][e],p(t,(function(t){(r=c(e)?e(t):t[e])>n&&(i=t,n=r)})),i}},dt=function(t,e){if(l(t)){var n,r,i=t[0];return n=c(e)?e(t[0]):t[0][e],p(t,(function(t){(r=c(e)?e(t):t[e])e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,h)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},ve=function(t){return r(t)?Array.prototype.slice.call(t):[]},ye={},me=function(t){return ye[t=t||"g"]?ye[t]+=1:ye[t]=1,t+ye[t]},be=function(){},xe=function(t){return t};function we(t){return h(t)?0:r(t)?t.length:Object.keys(t).length}var Me=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},32:function(t,e,n){self,t.exports=function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){return void 0===t?e:t}t.r(e),t.d(e,{default:function(){return ue}});var r,i=Math.round,o=Math.abs,a=Date.now,s="compute",u="auto",c="manipulation",h="none",l="pan-x",f="pan-y",d=(r={},["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(t){return r[t]=!0})),r),p="touch",g=["x","y"],v=["clientX","clientY"],y=32,m="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1&&this.requireFail.splice(e,1),this}},{key:"hasRequireFailures",value:function(){return this.requireFail.length>0}},{key:"canRecognizeWith",value:function(t){return!!this.simultaneous[t.id]}},{key:"emit",value:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+C(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+C(n))}},{key:"tryEmit",value:function(t){if(this.canEmit())return this.emit(t);this.state=y}},{key:"canEmit",value:function(){for(var t=0;tthis.options.threshold||2&this.state)}}])&&function(t,e){for(var n=0;nthis.options.threshold||2&this.state)}},{key:"emit",value:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}W(V(o.prototype),"emit",this).call(this,t)}}])&&function(t,e){for(var n=0;ne.threshold&&i&e.direction}},{key:"attrTest",value:function(t){return N.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))}},{key:"emit",value:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=U(t.direction);e&&(t.additionalEvent=this.options.event+e),K(tt(o.prototype),"emit",this).call(this,t)}}])&&function(t,e){for(var n=0;nthis.options.threshold&&t.maxPointers===this.options.pointers&&o(e)>this.options.velocity&&4&t.eventType}},{key:"emit",value:function(t){var e=U(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}])&&function(t,e){for(var n=0;nn.time;if(this._input=t,!i||!r||12&t.eventType&&!o)this.reset();else if(1&t.eventType)this.reset(),this._timer=ht((function(){e.state=8,e.tryEmit()}),n.time,this);else if(4&t.eventType)return 8;return y}},{key:"reset",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"emit",value:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit("".concat(this.options.event,"up"),t):(this._input.timeStamp=a(),this.manager.emit(this.options.event,this._input)))}}])&&function(t,e){for(var n=0;n-1}St.prototype.defaults={event:"press",pointers:1,time:251,threshold:9};var kt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.manager=e,this.set(n)}var e;return(e=[{key:"set",value:function(t){t===s&&(t=this.compute()),this.actions=t.toLowerCase().trim()}},{key:"update",value:function(){this.set(this.manager.options.touchAction)}},{key:"compute",value:function(){var t=[];return x(this.manager.recognizers,(function(e){O(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(Ot(t,h))return h;var e=Ot(t,l),n=Ot(t,f);return e&&n?h:e||n?e?l:f:Ot(t,c)?c:u}(t.join(" "))}},{key:"preventDefaults",value:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,i=Ot(r,h)&&!d.none,o=Ot(r,f)&&!d["pan-y"],a=Ot(r,l)&&!d["pan-x"];if(i){var s=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(s&&u&&c)return}if(!a||!o)return i||o&&6&n||a&&24&n?this.preventSrc(e):void 0}}},{key:"preventSrc",value:function(t){this.manager.session.prevented=!0,t.preventDefault()}}])&&function(t,e){for(var n=0;n=o(e)?t<0?2:4:e<0?8:16}function At(t,e,n){return{x:e/t||0,y:n/t||0}}function It(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,s=1&e&&r-i==0,u=12&e&&r-i==0;n.isFirst=!!s,n.isFinal=!!u,s&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=Et(e)),i>1&&!n.firstMultiple?n.firstMultiple=Et(e):1===i&&(n.firstMultiple=!1);var s=n.firstInput,u=n.firstMultiple,c=u?u.center:s.center,h=e.center=Ct(r);e.timeStamp=a(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Pt(c,h),e.distance=lt(c,h),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=jt(e.deltaX,e.deltaY);var l,f,d=At(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=o(d.x)>o(d.y)?d.x:d.y,e.scale=u?(l=u.pointers,lt((f=r)[0],f[1],v)/lt(l[0],l[1],v)):1,e.rotation=u?function(t,e){return Pt(e[1],e[0],v)+Pt(t[1],t[0],v)}(u.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,a,s=t.lastInterval||e,u=e.timeStamp-s.timeStamp;if(8!==e.eventType&&(u>25||void 0===s.velocity)){var c=e.deltaX-s.deltaX,h=e.deltaY-s.deltaY,l=At(u,c,h);r=l.x,i=l.y,n=o(l.x)>o(l.y)?l.x:l.y,a=jt(c,h),t.lastInterval=e}else n=s.velocity,r=s.velocityX,i=s.velocityY,a=s.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=a}(n,e)}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function Tt(t){return t.trim().split(/\s+/g)}function Nt(t,e,n){x(Tt(e),(function(e){t.addEventListener(e,n,!1)}))}var Bt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=this;this.manager=e,this.callback=n,this.eventHandler=function(t){O(e.options.enable,[e])&&r.handler(t)},this.init()}var e;return(e=[{key:"handler",value:function(){}},{key:"init",value:function(){var t,e,n;t=this.manager,e=this.events||"",n=this.eventHandler,x(Tt(e),(function(e){t.on("origin_input:".concat(e),n)}))}},{key:"destroy",value:function(){removeManagerListeners(this.manager,this.events||"",this.eventHandler)}}])&&function(t,e){for(var n=0;nn[e]})):r.sort()),r}function Dt(t){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ft(t,e){return(Ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xt(t,e){return!e||"object"!==Dt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Yt(t){return(Yt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zt={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Wt="touchstart touchmove touchend touchcancel",qt=function(t){!function(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&&Ft(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){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}}(),function(){var t,e=Yt(n);if(r){var i=Yt(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return Xt(this,t)});function o(){var t;return Rt(this,o),o.prototype.evTarget=Wt,o.prototype.targetIds={},o.prototype.events=Wt,(t=i.apply(this,arguments)).evTarget=Wt,t.targetIds={},t}return(e=[{key:"handler",value:function(t){var e=zt[t.type],n=Gt.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:p,srcEvent:t})}}])&&function(t,e){for(var n=0;n\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=console.warn;return i&&i(r,n),t.apply(this,arguments)}}var ae=oe((function(t,e,n){for(var r=Object.keys(e),i=0;i=0&&(o="x",i="y");var a=0;u(t,(function(t){return a++,t.x>r.x&&(r.x=t.x),t.xr.y&&(r.y=t.y),t.y1?e*i+function(t,e){return e?e-t:.14*t}(e,n)*(i-1):e}function a(t,e){var n=Object(i.a)(),o=0;if(Object(r.e)(t)||""===t)return o;if(n.save(),n.font=e,Object(r.h)(t)&&t.includes("\n")){var a=t.split("\n");Object(r.a)(a,(function(t){var e=n.measureText(t).width;o=0;return n?o?2*Math.PI-r:r:o?r:2*Math.PI-r}function l(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}},40:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return m}));var r=n(0),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,o=/[^\s\,]+/gi;var a=function(t){var e=t||[];return Object(r.f)(e)?e:Object(r.o)(e)?(e=e.match(i),Object(r.c)(e,(function(t,n){if((t=t.match(o))[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}Object(r.c)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};function s(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}var u="\t\n\v\f\r   ᠎              \u2028\u2029",c=new RegExp("([a-z])["+u+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+u+"]*,?["+u+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+u+"]*,?["+u+"]*","ig");function l(t){if(!t)return null;if(Object(r.f)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(c,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(h,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}function f(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function d(t,e){return f(t)*f(e)?(t[0]*e[0]+t[1]*e[1])/(f(t)*f(e)):1}function p(t,e){return(t[0]*e[1]1&&(n*=Math.sqrt(y),i*=Math.sqrt(y));var m=n*n*(v*v)+i*i*(f*f),b=m?Math.sqrt((n*n*(i*i)-m)/m):1;a===s&&(b*=-1),isNaN(b)&&(b=0);var x=i?b*n*v/i:0,w=n?b*-i*f/n:0,M=(u+h)/2+Math.cos(o)*x-Math.sin(o)*w,S=(c+l)/2+Math.sin(o)*x+Math.cos(o)*w,O=[(f-x)/n,(v-w)/i],k=[(-1*f-x)/n,(-1*v-w)/i],C=p([1,0],O),E=p(O,k);return d(O,k)<=-1&&(E=Math.PI),d(O,k)>=1&&(E=0),0===s&&E>0&&(E-=2*Math.PI),1===s&&E<0&&(E+=2*Math.PI),{cx:M,cy:S,rx:g(t,[h,l])?0:n,ry:g(t,[h,l])?0:i,startAngle:C,endAngle:C+E,xRotation:o,arcFlag:a,sweepFlag:s}}function y(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function m(t){for(var e=[],n=null,r=null,i=null,o=0,s=(t=a(t)).length,u=0;u1){var S=[],O=0;if(Object.keys(b).forEach((function(t){var e=b[t]||0;Object(a.k)(e)&&(S.push({key:t,value:e,color:w[t]}),O+=e)})),O){var k=p-g;if(1===M)return void e.addShape("circle",{attrs:{r:v,x:0,y:0,stroke:S[0].color||s[0],lineWidth:k},name:"fan-shape-0"});var C=[v,0],E=0;S.forEach((function(t,n){var r=t.value/O;if(!(r<.001))if(r>.999&&(r=1),1!==r){t.percent=r,t.angle=r*Math.PI*2,t.beginAgnle=E,E+=t.angle,t.endAngle=E,t.arcBegin=C,t.arcEnd=[v*Math.cos(t.endAngle),-v*Math.sin(t.endAngle)];var i=t.angle>Math.PI?1:0,o=[["M",t.arcBegin[0],t.arcBegin[1]],["A",v,v,0,i,0,t.arcEnd[0],t.arcEnd[1]],["L",t.arcEnd[0],t.arcEnd[1]]];e.addShape("path",{attrs:{path:o,lineWidth:k,stroke:t.color||s[n%s.length]},name:"fan-shape-"+n}),C=t.arcEnd}else e.addShape("circle",{attrs:{r:v,x:0,y:0,stroke:t.color||s[n%s.length],lineWidth:k},name:"fan-shape-"+n})}))}}return this.drawLinkPoints(t,e),c},update:void 0},"circle");var u=function(t){var e=t.x,n=t.y;return{x:e,y:n,centerX:e,centerY:n,minX:e,minY:n,maxX:e,maxY:n,height:0,width:0}},c=function(t){for(var e=[],n={},r=t.length-1;r>=0;r--){var i=t[r];i.id=i.x+"|||"+i.y,n[i.id]=i,e.push(i)}return e},h=function(t){return c(t)},l=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},f=function(t,e,n){var r=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return 0===n&&0===r?0:n/e.width>r/e.height}(e,t);if(0===r){var i=t.centerX,o=t.centerY;return n.ye.x?i=t.maxX:n.xt.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},d=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},p=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},g=function(t,e){var n=t.x,r=t.y;return ne.maxX||re.maxY},v=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},y=function(t,e,n,r,i){return v(t,e)+v(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,r,i])},m=function t(e,n,r,i,o){void 0===o&&(o=0),e.unshift(n[i]),r[i]&&r[i]!==i&&o<=100&&t(e,n,r,r[i],o+1)},b=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=r.x-t.x,s=r.y-t.y,u=n.x-e.x,c=n.y-e.y,h=r.x-e.x,l=r.y-e.y;return(i*s-o*a)*(u*l-c*h)<=0&&(i*c-o*u)*(a*l-s*h)<=0},x=function(t,e,n){if(n.width||n.height){var r=p(n),i=r[0],o=r[1],a=r[2],s=r[3];return b(t,e,i,o)||b(t,e,i,s)||b(t,e,o,a)||b(t,e,a,s)}return!1},w=function(t,e,n,r){var i=[];return t.forEach((function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(x(t,e,n)||x(t,e,r))return;i.push(t)}})),c(i)},M=function(t,e){var n=[],r=t[0];return n.push("M"+r.x+" "+r.y),t.forEach((function(r,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)}(r,o,a)){var s=function(t,e,n,r){var i=v(t,e),o=v(n,e);return it.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,I).filter((function(t){return g(t,S)&&g(t,O)})))})),[{x:k.x,y:C.y},{x:C.x,y:k.y}].forEach((function(t){g(t,S)&&g(t,O)&&A.push(t)})),A.unshift(k),A.push(C);var T=function(t,e,n,r,i,o,a){var s=[],u=[e],c={},h={},l={};h[e.id]=0,l[e.id]=y(e,n,e);var f,d,p,g,b,x={};for(t.forEach((function(t){x[t.id]=t}));u.length;){if(f=void 0,d=1/0,u.forEach((function(t){l[t.id]<=d&&(d=l[t.id],f=t)})),f===n){var M=[];return m(M,x,c,n.id),M}g=f,b=void 0,(b=(p=u).indexOf(g))>-1&&p.splice(b,1),s.push(f),w(t,f,r,i).forEach((function(t){if(-1===s.indexOf(t)){-1===u.indexOf(t)&&u.push(t);var r=l[f.id]+v(f,t);h[t.id]&&r>=h[t.id]||(c[t.id]=f.id,h[t.id]=r,l[t.id]=h[t.id]+y(t,n,e,o,a))}}))}return[e,n]}(A=c(A),k,C,o,a,t,e);return T.unshift(t),T.push(e),h(T)},O={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,n,r,i){return h(S(t,e,n,r,i.offset))}},k=(Math.PI,function(t,e){var n=Math.round(Math.abs(t/e));return n<0?0:(t<0?-1:1)*n}),C=function(t,e){var n=e.x-t.x,r=e.y-t.y;return n||r?Math.atan2(r,n):0},E=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},P=function(t,e,n){for(var r=1/0,i=0,o=e.length;ic.minX&&e.xc.minY&&e.y0&&B>0&&(w=void 0,M=1/0,Object.keys(p).forEach((function(t){var e=p[t].id;m[e]<=M&&(M=m[e],w=p[e])})),w);){if(d.findIndex((function(t){return t.x===w.x&&t.y===w.y}))>-1)return I(w,v,c,e,t,h,s);delete p[w.id],g[w.id]=!0;for(b=0;bo.maxAllowedDirectionChange||u[C.id]||(p[C.id]||(p[C.id]=C),E=o.distFunc(w,C)+(isNaN(_[N])?s:_[N]),T=y[w.id]+E,y[C.id]&&T>=y[C.id]||(v[C.id]=w,y[C.id]=T,m[C.id]=T+P(C,d,o.distFunc)));B-=1}return o.fallbackRoute(t,e,n,r,o)};Object(o.q)("polyline",{options:{color:o.e.defaultEdge.color,size:o.e.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:o.e.defaultEdge.style.stroke,lineAppendWidth:o.e.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:o.e.edgeLabel.style.fill,fontSize:o.e.edgeLabel.style.fontSize}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:r({},o.e.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);return 0===n.radius&&delete n.radius,e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(a.r)({},e,n,t.style);t=this.getPathPoints(t),this.radius=r.radius,this.offset=r.offset;var i=t.startPoint,s=t.endPoint,u=this.getControlPoints(t),c=[i];u&&(c=c.concat(u)),c.push(s);var h=t.sourceNode,l=t.targetNode,f=r.radius,d=this.options.routeCfg,p=Object(a.r)({},d,t.routeCfg);p.offset=r.offset;var g=this.getPath(c,h,l,f,p);return(Object(a.f)(g)&&g.length<=1||Object(a.o)(g)&&-1===g.indexOf("L"))&&(g="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(s.x)||isNaN(s.y))&&(g="M0 0, L0 0"),Object(a.r)({},o.e.defaultEdge.style,r,{lineWidth:t.size,path:g})},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var r={stroke:t.color},i=n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,s=(t=this.getPathPoints(t)).startPoint,u=t.endPoint,c=this.getControlPoints(t),h=[s];c&&(h=h.concat(c)),h.push(u);var l=i.attr(),f=Object(a.r)({},r,l,t.style),d=t.sourceNode,p=t.targetNode,g=f.radius,v=this.options.routeCfg,y=Object(a.r)({},v,t.routeCfg);y.offset=f.offset;var m=this.getPath(h,d,p,g,y);(Object(a.f)(m)&&m.length<=1||Object(a.o)(m)&&-1===m.indexOf("L"))&&(m="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(u.x)||isNaN(u.y))&&(m="M0 0, L0 0"),l.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),l.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var b=Object(a.r)(r,i.attr(),{lineWidth:o,path:m},t.style);i&&i.attr(b)}},getPath:function(t,e,n,r,i){var s=i.offset,u=i.simple;if(!s||t.length>2){if(r)return M(t,r);var c=[];return Object(a.c)(t,(function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["L",t.x,t.y])})),c}var h=u?S(t[t.length-1],t[0],n,e,s):T(t[0],t[t.length-1],e,n,i);return h&&h.length?r?M(h,r):o.n.pointsToPolygon(h):"M0 0, L0 0"}},"single-edge")},415:function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(2),a=n(34),s=a.a.cloneEvent,u=a.a.isNaN,c=Math.abs,h={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,r=+t.clientY;if(!u(n)&&!u(r)){var i=n-e.x,o=r-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:n,y:r};var a=this.graph.get("width"),s=this.graph.get("height"),c=this.graph.get("canvas").getCanvasBBox();(c.minX<=a+this.scalableRange&&c.minX+i>a+this.scalableRange||c.maxX+this.scalableRange>=0&&c.maxX+this.scalableRange+i<0)&&(i=0),(c.minY<=s+this.scalableRange&&c.minY+o>s+this.scalableRange||c.maxY+this.scalableRange>=0&&c.maxY+this.scalableRange+o<0)&&(o=0),this.graph.translate(i,o)}},onDragStart:function(t){t.originalEvent;if(this.shouldBegin.call(this,t)){var e=t.target,n=e&&e.isCanvas&&e.isCanvas();if((this.allowDragOnItem||n)&&(this.origin={x:t.clientX,y:t.clientY},this.dragging=!1,this.enableOptimize)){for(var r=this.graph,i=r.getEdges(),o=0,a=i.length;o1?a.forEach((function(t){t.hasLocked()||e.targets.push(t)})):this.targets.push(n);var u=[];this.targets.forEach((function(t){u.push(Object(i.a)(t.getModel()))})),this.set("beforeDragNodes",u),this.origin={x:t.x,y:t.y},this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;this.origin&&this.shouldUpdate(this,t)&&(this.get("enableDelegate")?this.updateDelegate(t):this.targets.map((function(n){e.update(n,t)})))},onDragEnd:function(t){if(this.origin&&this.shouldEnd.call(this,t)){var e=t.item;if(e)e.getContainer().set("capture",!0);this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.updatePositions(t);var n=this.graph;if(n.get("enabledStack")){var r={before:{nodes:this.get("beforeDragNodes"),edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.targets.forEach((function(t){r.after.nodes.push(t.getModel())})),n.pushStack("update",Object(i.a)(r))}n.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.validationCombo(e)){this.updatePositions(t);var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var r=e.getModel();this.targets.map((function(t){t.getModel().comboId!==r.id&&n.updateComboTree(t,r.id)})),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.targets&&0!==this.targets.length&&(this.updatePositions(t),this.onlyChangeComboSize?e.updateCombos():this.targets.map((function(t){t.getModel().comboId&&e.updateComboTree(t)})))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.updatePositions(t);var n=this.graph,r=e.getModel().comboId;if(r){var i=n.findById(r);this.comboActiveState&&n.setItemState(i,this.comboActiveState,!1),this.targets.map((function(t){var e=t.getModel();r!==e.comboId&&n.updateComboTree(t,r)})),n.updateCombo(i)}else this.targets.map((function(t){t.getModel().comboId&&n.updateComboTree(t)}));n.emit("dragnodeend",{items:this.targets,targetItem:e})}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t){var e=this;this.targets&&0!==this.targets.length&&this.get("enableDelegate")&&this.targets.map((function(n){return e.update(n,t)}))},update:function(t,e){var n=this.origin,r=t.get("model"),i=t.get("id");this.point[i]||(this.point[i]={x:r.x||0,y:r.y||0});var o={x:e.x-n.x+this.point[i].x,y:e.y-n.y+this.point[i].y};this.get("updateEdge")?this.graph.updateItem(t,o,!1):t.updatePosition(o)},updateDelegate:function(t){this.graph;if(this.delegateRect){var e=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:e,y:n})}else{var o=this.graph.get("group"),a=Object(i.b)({},l.a.delegateStyle,this.delegateStyle),s=this.calculationGroupPosition(t),u=s.x,c=s.y,h=s.width,f=s.height,d=s.minX,p=s.minY;this.originPoint={x:u,y:c,width:h,height:f,minX:d,minY:p},this.delegateRect=o.addShape("rect",{attrs:Object(r.a)({width:h,height:f,x:u,y:c},a),name:"rect-delegate-shape"})}},calculationGroupPosition:function(t){var e=this.graph.findAllByState("node",this.selectedState);0===e.length&&e.push(t.item);for(var n=1/0,r=-1/0,i=1/0,o=-1/0,a=0;ar&&(r=h),l>o&&(o=l)}return{x:Math.floor(n),y:Math.floor(i),width:Math.ceil(r)-Math.floor(n),height:Math.ceil(o)-Math.floor(i),minX:n,minY:i}}},d={getDefaultCfg:function(){return{multiple:!0,selectedState:"selected"}},getEvents:function(){return{"node:tap":"onClick","combo:tap":"onClick","canvas:tap":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(n&&!n.destroyed){var r=n.getType(),o=e.graph,a=e.multiple,s=e.shouldUpdate;if(e.shouldBegin.call(e,t)){if(!a){var u=o.findAllByState(r,e.selectedState);Object(i.c)(u,(function(t){t!==n&&o.setItemState(t,e.selectedState,!1)}))}if(n.hasState(e.selectedState)){s.call(e,t)&&o.setItemState(n,e.selectedState,!1);var c=o.findAllByState("node",e.selectedState),h=o.findAllByState("combo",e.selectedState);o.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!1})}else{s.call(e,t)&&o.setItemState(n,e.selectedState,!0);c=o.findAllByState("node",e.selectedState),h=o.findAllByState("combo",e.selectedState);o.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!0})}}}},onCanvasClick:function(){var t=this,e=this.graph,n=e.findAllByState("node",this.selectedState);Object(i.c)(n,(function(n){e.setItemState(n,t.selectedState,!1)}));var r=e.findAllByState("combo",this.selectedState);Object(i.c)(r,(function(n){e.setItemState(n,t.selectedState,!1)})),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},p={firstScale:null,getDefaultCfg:function(){return{originScale:1,sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{pinchstart:"onPinch",pinchmove:"onPinch"}},onPinch:function(t){t.preventDefault&&t.preventDefault(),t.originalEvent.preventDefault&&t.originalEvent.preventDefault();var e=t.originalEvent.pointers;if(!(e.length<2)){"pinchstart"===t.type&&(this.firstScale=this.graph.getZoom());var n=t.originalEvent.scale||t.originalEvent.srcEvent.extra.scale,r=this.firstScale*n;this.currentScale=r;var i=this.get("minZoom")||this.graph.get("minZoom");if(!(r>(this.get("maxZoom")||this.graph.get("maxZoom"))||r.8*h?n.setItemState(t,e.activeState,!0):n.setItemState(t,e.activeState,!1)}))}Object(i.c)(this.targets,(function(n){e.updateCombo(n,t)}))}},updatePositions:function(t){var e=this;this.enableDelegate&&Object(i.c)(this.targets,(function(n){e.updateCombo(n,t)}))},onDrop:function(t){var e=this,n=t.item;if(n&&this.targets&&!n.destroyed){this.updatePositions(t);var r=this.graph,i=n.getModel();this.targets.map((function(t){t.getModel().parentId!==i.id?(e.activeState&&r.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t,i.id)):r.updateCombo(n)})),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){this.updatePositions(t);var n,r=this.graph,i=t.item.getModel().comboId;if(i){if(this.activeState){var o=r.findById(i);r.setItemState(o,this.activeState,!1)}this.targets.map((function(t){e.onlyChangeComboSize?r.updateCombo(t):i!==t.getID()&&(n=r.findById(i),i!==t.getModel().parentId&&r.updateComboTree(t,i))}))}else this.targets.map((function(t){e.onlyChangeComboSize?r.updateCombo(t):t.getModel().comboId&&r.updateComboTree(t)}));this.endComparison=!0,this.end(n,t)}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),r=this.graph;n&&this.activeState&&r.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var r=this.graph;if(this.delegateShape)r.get("delegateGroup").clear(),this.delegateShape=null;t&&this.activeState&&r.setItemState(t,this.activeState,!1),t||this.targets.map((function(t){n.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t)})),this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e){var n=this;if(!1!==e(t)&&t){var r=t.get("combos");Object(i.c)(r,(function(t){n.traverse(t,e)}));var o=t.get("nodes");Object(i.c)(o,(function(t){n.traverse(t,e)}))}},updateCombo:function(t,e){var n=this;this.traverse(t,(function(t){return!t.destroyed&&(n.updateSignleItem(t,e),!0)}))},updateSignleItem:function(t,e){var n=this.origin,r=this.graph,i=t.getModel(),o=t.get("id");this.point[o]||(this.point[o]={x:i.x,y:i.y});var a=e.x-n.x+this.point[o].x,s=e.y-n.y+this.point[o].y;r.updateItem(t,{x:a,y:s})},getParentCombo:function(t){var e=this.graph;if(t){var n=e.findById(t);if(n)return n}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var n=t.x-this.origin.x+this.originPoint.minX,i=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:n,y:i})}else{var o=e.get("delegateGroup"),a=null,s=(a=this.targets.length>1?y(this.targets):this.targets[0].getBBox()).x,u=a.y,c=a.width,h=a.height,f=a.minX,d=a.minY;this.originPoint={x:s,y:u,width:c,height:h,minX:f,minY:d};var p=Object(r.a)(Object(r.a)({},l.a.delegateStyle),this.delegateStyle);this.delegateShape=o.addShape("rect",{attrs:Object(r.a)({width:a.width,height:a.height,x:a.x,y:a.y},p),name:"combo-delegate-shape"})}}},"collapse-expand-combo":{getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return b.includes(this.trigger)?e=this.trigger:(e="dblclick",console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:"+e]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this.graph,r=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(n.collapseExpandCombo(i),r&&n.get("layout")?n.layout():n.refreshPositions())}}},"create-edge":{getDefaultCfg:function(){return{trigger:"tap",key:void 0,edgeConfig:{}}},getEvents:function(){var t;return x.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="tap",console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),this.key&&-1===w.indexOf(this.key.toLowerCase())&&(this.trigger=void 0,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===this.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===this.trigger&&(t={"node:tap":"onClick",mousemove:"updateEndPoint","edge:tap":"cancelCreating","canvas:tap":"cancelCreating","combo:tap":"onClick"}),this.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){if(!this.key||this.keydown){var e=t.item;e&&e.getID()!==this.source&&"node"===e.getType()||this.cancelCreating({item:this.edge,x:t.x,y:t.y})}},onClick:function(t){if(!this.key||this.keydown){var e=t.item,n=this.graph,i=e.getModel();if(this.addingEdge&&this.edge){if(!this.shouldEnd.call(this,t))return;var o={target:i.id};this.source===i.id&&(o.type="loop"),n.emit("beforecreateedge",{}),n.updateItem(this.edge,o),n.emit("aftercreateedge",{edge:this.edge}),this.edge.getKeyShape().set("capture",!0),this.edge=null,this.addingEdge=!1}else{if(!this.shouldBegin.call(this,t))return;this.edge=n.addItem("edge",Object(r.a)({source:i.id,target:i.id},this.edgeConfig),!1),this.source=i.id,this.addingEdge=!0,this.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){if(!this.key||this.keydown){var e={x:t.x,y:t.y};this.graph.findById(this.source)?this.addingEdge&&this.edge&&this.graph.updateItem(this.edge,{target:e},!1):this.addingEdge=!1}},cancelCreating:function(t){if(!this.key||this.keydown){var e=this.graph,n=t.item;if(this.addingEdge&&t.target&&t.target.isCanvas&&t.target.isCanvas())return e.removeItem(this.edge,!1),this.edge=null,void(this.addingEdge=!1);if(this.addingEdge&&this.edge===n){var r=!0;if(!e.get("groupByTypes"))for(var i=t.x,o=t.y,a=e.getNodes(),s=a.length,u=0;u=l.minX&&o<=l.maxY&&o>=l.minY){if(!this.shouldEnd.call(this,{x:t.x,y:t.y,canvasX:t.canvasX,canvasY:t.canvasY,clientX:t.clientX,clientY:t.clientY,item:c}))return;e.emit("beforecreateedge",{}),e.updateItem(this.edge,{target:h.id}),e.emit("aftercreateedge",{edge:this.edge}),r=!1;break}}r&&e.removeItem(this.edge,!1),this.edge=null,this.addingEdge=!1}}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.key.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.addingEdge&&this.edge&&(this.graph.removeItem(this.edge,!1),this.addingEdge=!1,this.edge=null),this.keydown=!1}}};Object(i.c)(S,(function(t,e){Object(o.o)(e,Object(r.a)(Object(r.a)({},t),M))}))},46:function(t,e,n){"use strict";n(28);var r=n(105);n.o(r,"ICanvas")&&n.d(e,"ICanvas",(function(){return r.ICanvas})),n.o(r,"IGroup")&&n.d(e,"IGroup",(function(){return r.IGroup})),n.o(r,"IShape")&&n.d(e,"IShape",(function(){return r.IShape}));var i=n(106);n.o(i,"ICanvas")&&n.d(e,"ICanvas",(function(){return i.ICanvas})),n.o(i,"IGroup")&&n.d(e,"IGroup",(function(){return i.IGroup})),n.o(i,"IShape")&&n.d(e,"IShape",(function(){return i.IShape}));var o=n(76);n.d(e,"Event",(function(){return o.a}));n(77),n(166),n(108),n(109),n(168),n(39),n(5),n(20),n(78)},47:function(t,e,n){"use strict";n.r(e),n.d(e,"create",(function(){return i})),n.d(e,"clone",(function(){return o})),n.d(e,"fromValues",(function(){return a})),n.d(e,"copy",(function(){return s})),n.d(e,"set",(function(){return u})),n.d(e,"add",(function(){return c})),n.d(e,"subtract",(function(){return h})),n.d(e,"multiply",(function(){return l})),n.d(e,"divide",(function(){return f})),n.d(e,"ceil",(function(){return d})),n.d(e,"floor",(function(){return p})),n.d(e,"min",(function(){return g})),n.d(e,"max",(function(){return v})),n.d(e,"round",(function(){return y})),n.d(e,"scale",(function(){return m})),n.d(e,"scaleAndAdd",(function(){return b})),n.d(e,"distance",(function(){return x})),n.d(e,"squaredDistance",(function(){return w})),n.d(e,"length",(function(){return M})),n.d(e,"squaredLength",(function(){return S})),n.d(e,"negate",(function(){return O})),n.d(e,"inverse",(function(){return k})),n.d(e,"normalize",(function(){return C})),n.d(e,"dot",(function(){return E})),n.d(e,"cross",(function(){return P})),n.d(e,"lerp",(function(){return j})),n.d(e,"random",(function(){return A})),n.d(e,"transformMat2",(function(){return I})),n.d(e,"transformMat2d",(function(){return T})),n.d(e,"transformMat3",(function(){return N})),n.d(e,"transformMat4",(function(){return B})),n.d(e,"rotate",(function(){return _})),n.d(e,"angle",(function(){return L})),n.d(e,"zero",(function(){return D})),n.d(e,"str",(function(){return R})),n.d(e,"exactEquals",(function(){return F})),n.d(e,"equals",(function(){return X})),n.d(e,"len",(function(){return z})),n.d(e,"sub",(function(){return W})),n.d(e,"mul",(function(){return q})),n.d(e,"div",(function(){return G})),n.d(e,"dist",(function(){return V})),n.d(e,"sqrDist",(function(){return H})),n.d(e,"sqrLen",(function(){return U})),n.d(e,"forEach",(function(){return Z}));var r=n(6);function i(){var t=new r.a(2);return r.a!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new r.a(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.a(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function l(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function f(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function v(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function m(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function M(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function O(t,e){return t[0]=-e[0],t[1]=-e[1],t}function k(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function C(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]}function P(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function j(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function A(t,e){e=e||1;var n=2*r.c()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function I(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function T(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function N(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function B(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function _(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function L(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function D(t){return t[0]=0,t[1]=0,t}function R(t){return"vec2("+t[0]+", "+t[1]+")"}function F(t,e){return t[0]===e[0]&&t[1]===e[1]}function X(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.b*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.b*Math.max(1,Math.abs(i),Math.abs(a))}var Y,z=M,W=h,q=l,G=f,V=x,H=w,U=S,Z=(Y=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a]*>/,a={tr:document.createElement("tbody"),tbody:r,thead:r,tfoot:r,td:i,th:i,"*":document.createElement("div")});var e=o.test(t)&&RegExp.$1;e&&e in a||(e="*");var n=a[e];t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t;var s=n.childNodes[0];return n.removeChild(s),s}function u(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}))},49:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(207),o=n(211),a=[].slice,s=["keyword","gray","hex"],u={};Object.keys(o).forEach((function(t){u[a.call(o[t].labels).sort().join("")]=t}));var c={};function h(t,e){if(!(this instanceof h))return new h(t,e);if(e&&e in s&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var n,r;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof h)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var l=i.get(t);if(null===l)throw new Error("Unable to parse color from string: "+t);this.model=l.model,r=o[this.model].channels,this.color=l.value.slice(0,r),this.valpha="number"==typeof l.value[r]?l.value[r]:1}else if(t.length){this.model=e||"rgb",r=o[this.model].channels;var f=a.call(t,0,r);this.color=p(f,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var g=d.sort().join("");if(!(g in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[g];var v=o[this.model].labels,y=[];for(n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return h.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+r(t));var n=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=n.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,c=1-u;return h.rgb(u*n.red()+c*i.red(),u*n.green()+c*i.green(),u*n.blue()+c*i.blue(),n.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach((function(t){if(-1===s.indexOf(t)){var e=o[t].channels;h.prototype[t]=function(){if(this.model===t)return new h(this);if(arguments.length)return new h(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new h(d(o[this.model][t].raw(this.color)).concat(n),t)},h[t]=function(n){return"number"==typeof n&&(n=p(a.call(arguments),e)),new h(n,t)}}})),t.exports=h},5:function(t,e,n){"use strict";n.d(e,"j",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"g",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(0);function i(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}n.d(e,"e",(function(){return r.j})),n.d(e,"d",(function(){return r.i})),n.d(e,"h",(function(){return r.o})),n.d(e,"f",(function(){return r.m})),n.d(e,"i",(function(){return r.r})),n.d(e,"a",(function(){return r.c})),n.d(e,"k",(function(){return r.w}));var o="undefined"!=typeof window&&void 0!==window.document;function a(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function s(t){return t.cfg.visible&&t.cfg.capture}},56:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=n(7),a=n(10),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name "+t+" exists already, it will be overridden"),a.isObject(e)){var n=function(t){function n(n){var r=t.call(this)||this,i=r,o={},a=i.getDefaultCfg();return Object.assign(o,a,e,n),Object.keys(o).forEach((function(t){var e=o[t];i[t]=e})),r}return i(n,t),n}(o.Base);s.set(t,n)}else s.set(t,e)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},57:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(n(7).Base);e.RandomLayout=o},6:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},7:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Base=void 0;var r=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}();e.Base=r},76:function(t,e,n){"use strict";var r=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}();e.a=r},77:function(t,e,n){"use strict";var r=n(1),i=n(79),o=n(5),a=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=Object(o.i)(r,e),n}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(i.a);e.a=a},78:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=null;function i(){if(!r){var t=document.createElement("canvas");t.width=1,t.height=1,r=t.getContext("2d")}return r}},79:function(t,e,n){"use strict";var r=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ut(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ct(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function ht(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function lt(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),h=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*h,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*h,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*h,t}function ft(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,h=3*o*s,l=3*u*a,f=u*o;return t[0]=e[0]*c+n[0]*h+r[0]*l+i[0]*f,t[1]=e[1]*c+n[1]*h+r[1]*l+i[1]*f,t[2]=e[2]*c+n[2]*h+r[2]*l+i[2]*f,t}function dt(t,e){e=e||1;var n=2*o.c()*Math.PI,r=2*o.c()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t}function pt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function gt(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function vt(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],h=i*c-o*u,l=o*s-r*c,f=r*u-i*s,d=i*f-o*l,p=o*h-r*f,g=r*l-i*h,v=2*a;return h*=v,l*=v,f*=v,d*=2,p*=2,g*=2,t[0]=s+h+d,t[1]=u+l+p,t[2]=c+f+g,t}function yt(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function mt(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function bt(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function xt(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&ut(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function wt(t){return t[0]=0,t[1]=0,t[2]=0,t}function Mt(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function St(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Ot(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=o.b*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=o.b*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=o.b*Math.max(1,Math.abs(i),Math.abs(u))}var kt,Ct=V,Et=H,Pt=U,jt=nt,At=rt,It=Y,Tt=it,Nt=(kt=F(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a0)}));return u.length>0?(Object(a.a)(u,(function(t){var e=t.getBBox();o.push(e.minX,e.maxX),s.push(e.minY,e.maxY)})),t=Object(i.q)(o),e=Object(i.p)(o),n=Object(i.q)(s),r=Object(i.p)(s)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,o=[],s=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(a.a)(u,(function(t){var e=t.getCanvasBBox();o.push(e.minX,e.maxX),s.push(e.minY,e.maxY)})),t=Object(i.q)(o),e=Object(i.p)(o),n=Object(i.q)(s),r=Object(i.p)(s)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(a.a)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e=0;o--){var s=t[o];if(Object(a.b)(s)&&(s.isGroup()?i=s.getShape(e,n,r):s.isHit(e,n)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),Object(a.j)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(a.a)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(a.a)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(a.a)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(o.a);e.a=u},81:function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(4),a=n(5),s=n(20),u=n(77),c=o.a.transform,h=["zIndex","capture","visible","type"],l=["repeat"];function f(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function d(t,e){var n={},r=e.attr();return Object(i.c)(t,(function(t,e){-1!==l.indexOf(e)||Object(i.h)(r[e],t)||(n[e]=t)})),n}function p(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return Object(i.c)(t,(function(t){n+rt.delay&&Object(i.c)(e.toAttrs,(function(e,n){a.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var g=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(i.r)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n0?r=p(r,M):n.addAnimator(this),r.push(M),this.set("animations",r),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(i.c)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(i.c)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(i.c)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var s=function(t){var s=o[t],c=s.get("name");if(c){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&n&&Object(a.g)(s,n))return"break";Object(i.f)(c)?Object(i.c)(c,(function(t){r.emitDelegateEvent(s,t,e)})):u.emitDelegateEvent(s,c,e)}},u=this,c=0;c2&&(n.push([i].concat(a.splice(0,2))),s="l",i="m"===i?"l":"L"),"o"===s&&1===a.length&&n.push([i,a[0]]),"r"===s)n.push([i].concat(a));else for(;a.length>=e[s]&&(n.push([i].concat(a.splice(0,e[s]))),e[s]););return t})),n},M=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},S=function(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o},O=function(t){if(!(t=w(t))||!t.length)return[["M",0,0]];var e,n,r=[],i=0,o=0,a=0,s=0,u=0;"M"===t[0][0]&&(a=i=+t[0][1],s=o=+t[0][2],u++,r[0]=["M",i,o]);for(var c=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),h=void 0,l=void 0,f=u,d=t.length;f1&&(n*=w=Math.sqrt(w),r*=w);var M=n*n,S=r*r,O=(o===a?-1:1)*Math.sqrt(Math.abs((M*S-M*x*x-S*b*b)/(M*x*x+S*b*b)));d=O*n*x/r+(t+s)/2,p=O*-r*b/n+(e+u)/2,l=Math.asin(((e-p)/r).toFixed(9)),f=Math.asin(((u-p)/r).toFixed(9)),l=tf&&(l-=2*Math.PI),!a&&f>l&&(f-=2*Math.PI)}var k=f-l;if(Math.abs(k)>g){var C=f,P=s,j=u;f=l+g*(a&&f>l?1:-1),s=d+n*Math.cos(f),u=p+r*Math.sin(f),y=E(s,u,n,r,i,0,a,P,j,[f,C,d,p])}k=f-l;var A=Math.cos(l),I=Math.sin(l),T=Math.cos(f),N=Math.sin(f),B=Math.tan(k/4),_=4/3*n*B,L=4/3*r*B,D=[t,e],R=[t+_*I,e-L*A],F=[s+_*N,u-L*T],X=[s,u];if(R[0]=2*D[0]-R[0],R[1]=2*D[1]-R[1],c)return[R,F,X].concat(y);for(var Y=[],z=0,W=(y=[R,F,X].concat(y).join().split(",")).length;z7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},d=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var p=0;p1?1:u<0?0:u)/2,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],l=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,d=0;d<12;d++){var p=c*h[d]+c,g=I(p,t,n,i,a),v=I(p,e,r,o,s),y=g*g+v*v;f+=l[d]*Math.sqrt(y)}return c*f},N=function(t,e,n,r,i,o,a,s){for(var u,c,h,l,f=[],d=[[],[]],p=0;p<2;++p)if(0===p?(c=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*a,h=3*n-3*t):(c=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*s,h=3*r-3*e),Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;(l=-h/c)>0&&l<1&&f.push(l)}else{var g=c*c-4*h*u,v=Math.sqrt(g);if(!(g<0)){var y=(-c+v)/(2*u);y>0&&y<1&&f.push(y);var m=(-c-v)/(2*u);m>0&&m<1&&f.push(m)}}for(var b,x=f.length,w=x;x--;)b=1-(l=f[x]),d[0][x]=b*b*b*t+3*b*b*l*n+3*b*l*l*i+l*l*l*a,d[1][x]=b*b*b*e+3*b*b*l*r+3*b*l*l*o+l*l*l*s;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=s,d[0].length=d[1].length=w+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}},B=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)Math.max(i,a)||Math.max(e,r)Math.max(o,s))){var u=(t-n)*(o-s)-(e-r)*(i-a);if(u){var c=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/u,h=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/u,l=+c.toFixed(2),f=+h.toFixed(2);if(!(l<+Math.min(t,n).toFixed(2)||l>+Math.max(t,n).toFixed(2)||l<+Math.min(i,a).toFixed(2)||l>+Math.max(i,a).toFixed(2)||f<+Math.min(e,r).toFixed(2)||f>+Math.max(e,r).toFixed(2)||f<+Math.min(o,s).toFixed(2)||f>+Math.max(o,s).toFixed(2)))return{x:c,y:h}}}},_=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},L=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=A,o},D=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:L(t,e,n,r),vb:[t,e,n,r].join(" ")}},R=function(t,e,n,r,i,o,a,s){Object(y.isArray)(t)||(t=[t,e,n,r,i,o,a,s]);var u=N.apply(null,t);return D(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},F=function(t,e,n,r,i,o,a,s,u){var c=1-u,h=Math.pow(c,3),l=Math.pow(c,2),f=u*u,d=f*u,p=t+2*u*(n-t)+f*(i-2*n+t),g=e+2*u*(r-e)+f*(o-2*r+e),v=n+2*u*(i-n)+f*(a-2*i+n),y=r+2*u*(o-r)+f*(s-2*o+r);return{x:h*t+3*l*u*n+3*c*u*u*i+d*a,y:h*e+3*l*u*r+3*c*u*u*o+d*s,m:{x:p,y:g},n:{x:v,y:y},start:{x:c*t+u*n,y:c*e+u*r},end:{x:c*i+u*a,y:c*o+u*s},alpha:90-180*Math.atan2(p-v,g-y)/Math.PI}},X=function(t,e,n){if(!function(t,e){return t=D(t),e=D(e),_(e,t.x,t.y)||_(e,t.x2,t.y)||_(e,t.x,t.y2)||_(e,t.x2,t.y2)||_(t,e.x,e.y)||_(t,e.x2,e.y)||_(t,e.x,e.y2)||_(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(R(t),R(e)))return n?0:[];for(var r=~~(T.apply(0,t)/8),i=~~(T.apply(0,e)/8),o=[],a=[],s={},u=n?0:[],c=0;c=0&&b<=1&&x>=0&&x<=1&&(n?u+=1:u.push({x:m.x,y:m.y,t1:b,t2:x}))}}return u},Y=function(t,e){return function(t,e,n){var r,i,o,a,s,u,c,h,l,f;t=P(t),e=P(e);for(var d=n?0:[],p=0,g=t.length;p=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r},q=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var l=i-(r=t.length);if(r0)){t[r]=e[r];break}n=U(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=U(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=U(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t},K=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}(); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var $=function(t,e){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function J(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;Object.create;var tt=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function he(t,e){return t[0]*e[0]+t[1]*e[1]}function le(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function fe(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function de(t,e){e=e||1;var n=2*ut()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function pe(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function ge(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function ve(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function ye(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function me(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function be(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function xe(t){return t[0]=0,t[1]=0,t}function we(t){return"vec2("+t[0]+", "+t[1]+")"}function Me(t,e){return t[0]===e[0]&&t[1]===e[1]}function Se(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))}var Oe,ke=oe,Ce=Ht,Ee=Ut,Pe=Zt,je=re,Ae=ie,Ie=ae,Te=(Oe=Yt(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function Fe(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function Xe(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=e[0],d=e[1],p=e[2],g=e[3],v=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return n[0]=f*r+d*a+p*c,n[1]=f*i+d*s+p*h,n[2]=f*o+d*u+p*l,n[3]=g*r+v*a+y*c,n[4]=g*i+v*s+y*h,n[5]=g*o+v*u+y*l,n[6]=m*r+b*a+x*c,n[7]=m*i+b*s+x*h,n[8]=m*o+b*u+x*l,n}function Ye(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function ze(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],l=h*a-s*c,f=-h*o+s*u,d=c*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,e[0]=l*p,e[1]=(-h*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=f*p,e[4]=(h*n-i*u)*p,e[5]=(-s*n+i*o)*p,e[6]=d*p,e[7]=(-c*n+r*u)*p,e[8]=(a*n-r*o)*p,e):null}var We=a.transform,qe=["zIndex","capture","visible","type"],Ge=["repeat"];function Ve(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function He(t,e){var n={},r=e.attr();return Object(y.each)(t,(function(t,e){-1!==Ge.indexOf(e)||Object(y.isEqual)(r[e],t)||(n[e]=t)})),n}function Ue(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,i=e.duration,o=Object.prototype.hasOwnProperty;return Object(y.each)(t,(function(t){n+rt.delay&&Object(y.each)(e.toAttrs,(function(e,n){o.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var Ze=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(y.mix)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return J(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n0?r=Ue(r,b):n.addAnimator(this),r.push(b),this.set("animations",r),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(y.each)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(y.each)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(y.each)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,i=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var o=function(t){var o=i[t],s=o.get("name");if(s){if((o.isGroup()||o.isCanvas&&o.isCanvas())&&n&&rt(o,n))return"break";Object(y.isArray)(s)?Object(y.each)(s,(function(t){r.emitDelegateEvent(o,t,e)})):a.emitDelegateEvent(o,s,e)}},a=this,s=0;s0)}));return a.length>0?(Object(y.each)(a,(function(t){var e=t.getBBox();i.push(e.minX,e.maxX),o.push(e.minY,e.maxY)})),t=Object(y.min)(i),e=Object(y.max)(i),n=Object(y.min)(o),r=Object(y.max)(o)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],o=[],a=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return a.length>0?(Object(y.each)(a,(function(t){var e=t.getCanvasBBox();i.push(e.minX,e.maxX),o.push(e.minY,e.maxY)})),t=Object(y.min)(i),e=Object(y.max)(i),n=Object(y.min)(o),r=Object(y.max)(o)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(y.each)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e=0;o--){var a=t[o];if(it(a)&&(a.isGroup()?i=a.getShape(e,n,r):a.isHit(e,n)&&(i=a)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),et(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(y.each)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(y.each)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(y.each)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(Ze);function $e(t){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Je,tn,en=0,nn=0,rn=0,on=0,an=0,sn=0,un="object"===("undefined"==typeof performance?"undefined":$e(performance))&&performance.now?performance:Date,cn="object"===("undefined"==typeof window?"undefined":$e(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function hn(){return an||(cn(ln),an=un.now()+sn)}function ln(){an=0}function fn(){this._call=this._time=this._next=null}function dn(t,e,n){var r=new fn;return r.restart(t,e,n),r}function pn(){an=(on=un.now())+sn,en=nn=0;try{!function(){hn(),++en;for(var t,e=Je;e;)(t=an-e._time)>=0&&e._call.call(null,t),e=e._next;--en}()}finally{en=0,function(){var t,e,n=Je,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Je=e);tn=t,vn(r)}(),an=0}}function gn(){var t=un.now(),e=t-on;e>1e3&&(sn-=e,on=t)}function vn(t){en||(nn&&(nn=clearTimeout(nn)),t-an>24?(t<1/0&&(nn=setTimeout(pn,t-un.now()-sn)),rn&&(rn=clearInterval(rn))):(rn||(on=un.now(),rn=setInterval(gn,1e3)),en=1,cn(pn)))}function yn(t){return+t}function mn(t){return t*t}function bn(t){return t*(2-t)}function xn(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function wn(t){return t*t*t}function Mn(t){return--t*t*t+1}function Sn(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}fn.prototype=dn.prototype={constructor:fn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?hn():+n)+(null==e?0:+e),this._next||tn===this||(tn?tn._next=this:Je=this,tn=this),this._call=t,this._time=n,vn()},stop:function(){this._call&&(this._call=null,this._time=1/0,vn())}};var On=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),kn=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Cn=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),En=Math.PI,Pn=En/2;function jn(t){return 1==+t?1:1-Math.cos(t*Pn)}function An(t){return Math.sin(t*Pn)}function In(t){return(1-Math.cos(En*t))/2}function Tn(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Nn(t){return Tn(1-+t)}function Bn(t){return 1-Tn(t)}function _n(t){return((t*=2)<=1?Tn(1-t):2-Tn(t-1))/2}function Ln(t){return 1-Math.sqrt(1-t*t)}function Dn(t){return Math.sqrt(1- --t*t)}function Rn(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}function Fn(t){return 1-Xn(1-t)}function Xn(t){return(t=+t)<4/11?7.5625*t*t:t<8/11?7.5625*(t-=6/11)*t+3/4:t<10/11?7.5625*(t-=9/11)*t+15/16:7.5625*(t-=21/22)*t+63/64}function Yn(t){return((t*=2)<=1?1-Xn(1-t):Xn(t-1)+1)/2}var zn=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),Wn=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),qn=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),Gn=2*Math.PI,Vn=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Gn);function i(t){return e*Tn(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*Gn)},i.period=function(n){return t(e,n)},i}(1,.3),Hn=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Gn);function i(t){return 1-e*Tn(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*Gn)},i.period=function(n){return t(e,n)},i}(1,.3),Un=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Gn);function i(t){return((t=2*t-1)<0?e*Tn(-t)*Math.sin((r-t)/n):2-e*Tn(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*Gn)},i.period=function(n){return t(e,n)},i}(1,.3),Zn=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Qn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Kn(){}var $n="\\s*([+-]?\\d+)\\s*",Jn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",er=/^#([0-9a-f]{3,8})$/,nr=new RegExp("^rgb\\("+[$n,$n,$n]+"\\)$"),rr=new RegExp("^rgb\\("+[tr,tr,tr]+"\\)$"),ir=new RegExp("^rgba\\("+[$n,$n,$n,Jn]+"\\)$"),or=new RegExp("^rgba\\("+[tr,tr,tr,Jn]+"\\)$"),ar=new RegExp("^hsl\\("+[Jn,tr,tr]+"\\)$"),sr=new RegExp("^hsla\\("+[Jn,tr,tr,Jn]+"\\)$"),ur={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function cr(){return this.rgb().formatHex()}function hr(){return this.rgb().formatRgb()}function lr(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=er.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fr(e):3===n?new vr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?dr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?dr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=nr.exec(t))?new vr(e[1],e[2],e[3],1):(e=rr.exec(t))?new vr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ir.exec(t))?dr(e[1],e[2],e[3],e[4]):(e=or.exec(t))?dr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ar.exec(t))?xr(e[1],e[2]/100,e[3]/100,1):(e=sr.exec(t))?xr(e[1],e[2]/100,e[3]/100,e[4]):ur.hasOwnProperty(t)?fr(ur[t]):"transparent"===t?new vr(NaN,NaN,NaN,0):null}function fr(t){return new vr(t>>16&255,t>>8&255,255&t,1)}function dr(t,e,n,r){return r<=0&&(t=e=n=NaN),new vr(t,e,n,r)}function pr(t){return t instanceof Kn||(t=lr(t)),t?new vr((t=t.rgb()).r,t.g,t.b,t.opacity):new vr}function gr(t,e,n,r){return 1===arguments.length?pr(t):new vr(t,e,n,null==r?1:r)}function vr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function yr(){return"#"+br(this.r)+br(this.g)+br(this.b)}function mr(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function br(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xr(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Mr(t,e,n,r)}function wr(t){if(t instanceof Mr)return new Mr(t.h,t.s,t.l,t.opacity);if(t instanceof Kn||(t=lr(t)),!t)return new Mr;if(t instanceof Mr)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new Mr(a,s,u,t.opacity)}function Mr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Sr(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Or(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Zn(Kn,lr,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:cr,formatHex:cr,formatHsl:function(){return wr(this).formatHsl()},formatRgb:hr,toString:hr}),Zn(vr,gr,Qn(Kn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new vr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new vr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yr,formatHex:yr,formatRgb:mr,toString:mr})),Zn(Mr,(function(t,e,n,r){return 1===arguments.length?wr(t):new Mr(t,e,n,null==r?1:r)}),Qn(Kn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Mr(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Mr(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new vr(Sr(t>=240?t-240:t+120,i,r),Sr(t,i,r),Sr(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var kr=function(t){return function(){return t}};function Cr(t,e){return function(n){return t+n*e}}function Er(t){return 1==(t=+t)?Pr:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):kr(isNaN(e)?n:e)}}function Pr(t,e){var n=e-t;return n?Cr(t,n):kr(isNaN(t)?e:t)}var jr=function t(e){var n=Er(e);function r(t,e){var r=n((t=gr(t)).r,(e=gr(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Pr(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ar(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=ro&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:_r(n,r)})),o=Fr.lastIndex;return of.length?(l=w(o[h]),f=w(i[h]),f=H(f,l),f=Q(f,l),e.fromAttrs.path=f,e.toAttrs.path=l):e.pathFormatted||(l=w(o[h]),f=w(i[h]),f=Q(f,l),e.fromAttrs.path=f,e.toAttrs.path=l,e.pathFormatted=!0),r[h]=[];for(var d=0;d0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],qr(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),Vr=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function Hr(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function Ur(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&rt(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var Zr=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(y.each)(Vr,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(y.each)(Vr,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new K(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,h=a.clientY-t.clientY;u>120||c*c+h*h>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,Hr(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||Ur(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{Hr(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),Qr=Object(at.a)(),Kr=Qr&&"firefox"===Qr.name,$r=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return J(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(y.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new Zr({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new Gr(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");nt&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");nt&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(Kr&&!Object(y.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(y.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(Ke),Jr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return J(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,o=t.maxY;if(e){var a=Ye(e,[t.minX,t.minY]),s=Ye(e,[t.maxX,t.minY]),u=Ye(e,[t.minX,t.maxY]),c=Ye(e,[t.maxX,t.maxY]);n=Math.min(a[0],s[0],u[0],c[0]),i=Math.max(a[0],s[0],u[0],c[0]),r=Math.min(a[1],s[1],u[1],c[1]),o=Math.max(a[1],s[1],u[1],c[1])}var h=this.attrs;if(h.shadowColor){var l=h.shadowBlur,f=void 0===l?0:l,d=h.shadowOffsetX,p=void 0===d?0:d,g=h.shadowOffsetY,v=void 0===g?0:g,y=n-f+p,m=i+f+p,b=r-f+v,x=o+f+v;n=Math.min(n,y),i=Math.max(i,m),r=Math.min(r,b),o=Math.max(o,x)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:o,width:i-n,height:o-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1},e}(Ze),ei=new Map;function ni(t,e){ei.set(t,e)}var ri=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},ii=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}},oi={}.toString,ai=function(t,e){return oi.call(t)==="[object "+e+"]"},si=function(t){return ai(t,"Function")},ui=function(t){return Array.isArray?Array.isArray(t):ai(t,"Array")};function ci(t){return(ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var hi=function(t){var e=ci(t);return null!==t&&"object"===e||"function"===e};var li=function(t,e){if(t)if(ui(t))for(var n=0,r=t.length;n(n-t)*(n-t)+(r-e)*(r-e)?vi(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var u=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(u,s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Si(t,e,n,r,i,o){var a,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var h=1/c,l=h/10,f=0;f<=c;f++){var d=f*h,p=[i.apply(null,t.concat([d])),i.apply(null,e.concat([d]))];(m=vi(u[0],u[1],p[0],p[1]))=0&&m=0?[i]:[]}function Ci(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Ei(t,e,n,r,i,o,a){var s=Oi(t,n,i,a),u=Oi(e,r,o,a),c=Mi.pointAt(t,e,n,r,a),h=Mi.pointAt(n,r,i,o,a);return[[t,e,c.x,c.y,s,u],[s,u,h.x,h.y,i,o]]}var Pi={box:function(t,e,n,r,i,o){var a=ki(t,n,i)[0],s=ki(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(Oi(t,n,i,a)),void 0!==s&&c.push(Oi(e,r,o,s)),mi(u,c)},length:function(t,e,n,r,i,o){return function t(e,n,r,i,o,a,s){if(0===s)return(vi(e,n,r,i)+vi(r,i,o,a)+vi(e,n,o,a))/2;var u=Ei(e,n,r,i,o,a,.5),c=u[0],h=u[1];return c.push(s-1),h.push(s-1),t.apply(null,c)+t.apply(null,h)}(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,s){return Si([t,n,i],[e,r,o],a,s,Oi)},pointDistance:function(t,e,n,r,i,o,a,s){var u=this.nearestPoint(t,e,n,r,i,o,a,s);return vi(u.x,u.y,a,s)},interpolationAt:Oi,pointAt:function(t,e,n,r,i,o,a){return{x:Oi(t,n,i,a),y:Oi(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return Ei(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var s=Ci(t,n,i,a),u=Ci(e,r,o,a);return xi(Math.atan2(u,s))}};function ji(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Ai(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function Ii(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,h=[];if(yi(s,0))yi(u,0)||(i=-c/u)>=0&&i<=1&&h.push(i);else{var l=u*u-4*s*c;yi(l,0)?h.push(-u/(2*s)):l>0&&(o=(-u-(a=Math.sqrt(l)))/(2*s),(i=(-u+a)/(2*s))>=0&&i<=1&&h.push(i),o>=0&&o<=1&&h.push(o))}return h}function Ti(t,e,n,r,i,o,a,s,u){var c=ji(t,n,i,a,u),h=ji(e,r,o,s,u),l=Mi.pointAt(t,e,n,r,u),f=Mi.pointAt(n,r,i,o,u),d=Mi.pointAt(i,o,a,s,u),p=Mi.pointAt(l.x,l.y,f.x,f.y,u),g=Mi.pointAt(f.x,f.y,d.x,d.y,u);return[[t,e,l.x,l.y,p.x,p.y,c,h],[c,h,g.x,g.y,d.x,d.y,a,s]]}function Ni(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;ic&&(c=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,v=-1/0,y=[o,a];for(l=2*-Math.PI;l<=2*Math.PI;l+=Math.PI){var m=p+l;ov&&(v=b)}return{x:u,y:g,width:c-u,height:v-g}};function Ri(t){if(t.length<2)return 0;for(var e=0,n=0;n1?e*r+function(t,e){return e?e-t:.14*t}(e,n)*(r-1):e}function qi(t,e){var n=function(){if(!zi){var t=document.createElement("canvas");t.width=1,t.height=1,zi=t.getContext("2d")}return zi}(),r=0;if(Object(y.isNil)(t)||""===t)return r;if(n.save(),n.font=e,Object(y.isString)(t)&&t.includes("\n")){var i=t.split("\n");Object(y.each)(i,(function(t){var e=n.measureText(t).width;r1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}Object(y.each)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};new RegExp("([a-z])[\t\n\v\f\r   ᠎              \u2028\u2029,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\t\n\v\f\r   ᠎              \u2028\u2029]*,?[\t\n\v\f\r   ᠎              \u2028\u2029]*)+)","ig"),new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\t\n\v\f\r   ᠎              \u2028\u2029]*,?[\t\n\v\f\r   ᠎              \u2028\u2029]*","ig");function Zi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Qi(t,e){return Zi(t)*Zi(e)?(t[0]*e[0]+t[1]*e[1])/(Zi(t)*Zi(e)):1}function Ki(t,e){return(t[0]*e[1]1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(l*l),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*f/r:0,m=n?g*-r*l/n:0,b=(s+c)/2+Math.cos(i)*v-Math.sin(i)*m,x=(u+h)/2+Math.sin(i)*v+Math.cos(i)*m,w=[(l-v)/n,(f-m)/r],M=[(-1*l-v)/n,(-1*f-m)/r],S=Ki([1,0],w),O=Ki(w,M);return Qi(w,M)<=-1&&(O=Math.PI),Qi(w,M)>=1&&(O=0),0===a&&O>0&&(O-=2*Math.PI),1===a&&O<0&&(O+=2*Math.PI),{cx:b,cy:x,rx:$i(t,[c,h])?0:n,ry:$i(t,[c,h])?0:r,startAngle:S,endAngle:S+O,xRotation:i,arcFlag:o,sweepFlag:a}}function to(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function eo(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(y.isNumberEqual)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),h=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(h-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}ni("rect",ri),ni("image",ri),ni("circle",ii),ni("marker",ii),ni("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i=t&&i<=t+n&&o>=e&&o<=e+r}function xo(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY=0&&a<.5*Math.PI?(r={x:u.minX,y:u.minY},i={x:u.maxX,y:u.maxY}):.5*Math.PI<=a&&a1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(l*l),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*f/r:0,y=n?g*-r*l/n:0,m=(s+c)/2+Math.cos(i)*v-Math.sin(i)*y,b=(u+h)/2+Math.sin(i)*v+Math.cos(i)*y,x=[(l-v)/n,(f-y)/r],w=[(-1*l-v)/n,(-1*f-y)/r],M=Ao([1,0],x),S=Ao(x,w);return jo(x,w)<=-1&&(S=Math.PI),jo(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:m,cy:b,rx:wo(t,[c,h])?0:n,ry:wo(t,[c,h])?0:r,startAngle:M,endAngle:M+S,xRotation:i,arcFlag:o,sweepFlag:a}}var To=Math.sin,No=Math.cos,Bo=Math.atan2,_o=Math.PI;function Lo(t,e,n,r,i,o,a){var s=e.stroke,u=e.lineWidth,c=Bo(r-o,n-i),h=new uu({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*No(_o/6)+","+10*To(_o/6)+" L0,0 L"+10*No(_o/6)+",-"+10*To(_o/6),stroke:s,lineWidth:u}});h.translate(i,o),h.rotateAtPoint(i,o,c),t.set(a?"startArrowShape":"endArrowShape",h)}function Do(t,e,n,r,i,o,a){var s=e.startArrow,u=e.endArrow,c=e.stroke,h=e.lineWidth,l=a?s:u,f=l.d,d=l.fill,p=l.stroke,g=l.lineWidth,y=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);ix?b:x,C=b>x?1:b/x,E=b>x?x/b:1;e.translate(y,m),e.rotate(S),e.scale(C,E),e.arc(0,0,k,w,M,1-O),e.scale(1/C,1/E),e.rotate(-S),e.translate(-y,-m)}break;case"Z":e.closePath()}if("Z"===f)s=u;else{var P=l.length;s=[l[P-2],l[P-1]]}}}}function Uo(t,e){var n=t.get("canvas");n&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(n.refreshElement(t,e,n),n.get("autoDraw")&&n.draw())))}function Zo(t){var e,n,r;if(t.destroyed)e=t._cacheCanvasBBox;else{var i=t.get("cacheCanvasBBox"),o=i&&!(!i.width||!i.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(r=a,e=(n=i)&&r?{minX:Math.min(n.minX,r.minX),minY:Math.min(n.minY,r.minY),maxX:Math.max(n.maxX,r.maxX),maxY:Math.max(n.maxY,r.maxY)}:n||r):o?e=i:s&&(e=a)}return e}var Qo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.onCanvasChange=function(t){Uo(this,t)},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),zo(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];co(t,(function(t){var r=t.cfg.cacheCanvasBBox;r&&t.cfg.isInView&&(e.push(r.minX,r.maxX),n.push(r.minY,r.maxY))}));var r=null;if(e.length){var i=Math.min.apply(null,e),o=Math.max.apply(null,e),a=Math.min.apply(null,n),s=Math.max.apply(null,n);r={minX:i,minY:a,x:i,y:a,maxX:o,maxY:s,width:o-i,height:s-a};var u=this.cfg.canvas;if(u){var c=u.getViewRange();this.set("isInView",xo(r,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",r)},e.prototype.draw=function(t,e){var n=this.cfg.children,r=!e||this.cfg.refresh;n.length&&r&&(t.save(),zo(t,this),this._applyClip(t,this.getClip()),Wo(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(Jr),Ko=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return Qo},e.prototype.onCanvasChange=function(t){Uo(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=function(t){return ei.get(t)}(t)(this),r=e/2,i=n.x-r,o=n.y-r,a=n.x+n.width+r,s=n.y+n.height+r;return{x:i,minX:i,y:o,minY:o,width:n.width+e,height:n.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),zo(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!xo(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),zo(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=xo(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&(oo(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.isStroke()&&n>0&&(oo(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var n=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(ti),$o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,u=o.r,c=i/2,h=mo(a,s,t,e);return r&&n?h<=u+c:r?h<=u:!!n&&(h>=u-c&&h<=u+c)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()},e}(Ko);function Jo(t,e,n,r){return t/(n*n)+e/(r*r)}var ta=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,c=o.rx,h=o.ry,l=(t-s)*(t-s),f=(e-u)*(e-u);return r&&n?Jo(l,f,c+a,h+a)<=1:r?Jo(l,f,c,h)<=1:!!n&&(Jo(l,f,c-a,h-a)>=1&&Jo(l,f,c+a,h+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,r,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(n,r),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(Ko);function ea(t){return t instanceof HTMLElement&&lo(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var na=null;var ra=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if(!(null==na?void 0:na.isMini())||(null==na?void 0:na.isMiniNative()))if(lo(t)){var r=null;(r=(null==na?void 0:na.isMiniNative())?null==na?void 0:na.get("container").createImage():new Image).onload=function(){if(e.destroyed)return!1;e.attr("img",r),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else(null==na?void 0:na.isMiniNative())||t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):ea(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))));else this.attr("img",t)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){var e=this.attr(),n=e.img,r=e.x,i=e.y,o=e.width,a=e.height,s=e.sx,u=e.sy,c=e.swidth,h=e.sheight;if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);(null==na?void 0:na.isMini())?t.drawImage(n,r,i,o,a):(n instanceof Image||ea(n))&&(oo(s)||oo(u)||oo(c)||oo(h)?t.drawImage(n,r,i,o,a):t.drawImage(n,s,u,c,h,r,i,o,a))},e}(Ko);function ia(t,e,n,r,i,o,a){var s=Math.min(t,n),u=Math.max(t,n),c=Math.min(e,r),h=Math.max(e,r),l=i/2;return o>=s-l&&o<=u+l&&a>=c-l&&a<=h+l&&Mi.pointToLine(t,e,n,r,o,a)<=i/2}var oa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&Fo(this,t,r,i,e,n),a&&Xo(this,t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){if(!n||!i)return!1;var o=this.attr();return ia(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};a&&a.d&&(u=Ro(n,r,i,o,e.startArrow.d)),s&&s.d&&(c=Ro(n,r,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,r+u.dy),t.lineTo(i-c.dx,o-c.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return Mi.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return Mi.pointAt(n,r,i,o,t)},e}(Ko),aa=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,sa=/[^\s\,]+/gi;var ua=function(t){var e=t||[];return ao(e)?e:lo(e)?(e=e.match(aa),co(e,(function(t,n){if((t=t.match(sa))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}co(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};var ca=new RegExp("([a-z])[\t\n\v\f\r   ᠎              \u2028\u2029,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\t\n\v\f\r   ᠎              \u2028\u2029]*,?[\t\n\v\f\r   ᠎              \u2028\u2029]*)+)","ig"),ha=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\t\n\v\f\r   ᠎              \u2028\u2029]*,?[\t\n\v\f\r   ᠎              \u2028\u2029]*","ig");var la=/[a-z]/;function fa(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function da(t){var e=function(t){if(!t)return null;if(ao(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(ca,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(ha,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;r=0){n=!0;break}}if(!n)return e;var o=[],a=0,s=0,u=0,c=0,h=0,l=e[0];"M"!==l[0]&&"m"!==l[0]||(u=a=+l[1],c=s=+l[2],h++,o[0]=["M",a,s]);r=h;for(var f=e.length;r1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(l*l),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*f/r:0,y=n?g*-r*l/n:0,m=(s+c)/2+Math.cos(i)*v-Math.sin(i)*y,b=(u+h)/2+Math.sin(i)*v+Math.cos(i)*y,x=[(l-v)/n,(f-y)/r],w=[(-1*l-v)/n,(-1*f-y)/r],M=va([1,0],x),S=va(x,w);return ga(x,w)<=-1&&(S=Math.PI),ga(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:m,cy:b,rx:ya(t,[c,h])?0:n,ry:ya(t,[c,h])?0:r,startAngle:M,endAngle:M+S,xRotation:i,arcFlag:o,sweepFlag:a}}function ba(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var xa={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},wa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return oo(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,r=this.attr(),i=r.x,o=r.y,a=r.symbol||"circle",s=this._getR(r);if(io(a))n=da(n=(t=a)(i,o,s));else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;n=t(i,o,s)}return n},e.prototype.createPath=function(t){Ho(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=xa,e}(Ko);function Ma(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Sa(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Oa(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o0!=Ma(s[1]-n)>0&&Ma(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var ka="undefined"!=typeof Float32Array?Float32Array:Array,Ca=Math.random;Math.PI;function Ea(){var t=new ka(9);return ka!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Pa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function ja(t){var e=new ka(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Aa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Ia(t,e,n,r,i,o,a,s,u){var c=new ka(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=u,c}function Ta(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function Na(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ba(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function _a(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=h*a-s*c,f=-h*o+s*u,d=c*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-h*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(h*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function La(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-s*c,t[1]=i*c-r*h,t[2]=r*s-i*a,t[3]=s*u-o*h,t[4]=n*h-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function Da(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function Ra(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1],p=n[2],g=n[3],v=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=f*r+d*a+p*c,t[1]=f*i+d*s+p*h,t[2]=f*o+d*u+p*l,t[3]=g*r+v*a+y*c,t[4]=g*i+v*s+y*h,t[5]=g*o+v*u+y*l,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*h,t[8]=m*o+b*u+x*l,t}function Fa(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+d*a+c,t[7]=f*i+d*s+h,t[8]=f*o+d*u+l,t}function Xa(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*u,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*u-f*o,t[6]=c,t[7]=h,t[8]=l,t}function Ya(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function za(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Wa(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function qa(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ga(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Va(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,h=r*a,l=r*s,f=i*a,d=i*s,p=i*u,g=o*a,v=o*s,y=o*u;return t[0]=1-l-p,t[3]=h-y,t[6]=f+v,t[1]=h+y,t[4]=1-c-p,t[7]=d-g,t[2]=f-v,t[5]=d+g,t[8]=1-c-l,t}function Ha(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,M=r*c-o*s,S=i*c-o*u,O=h*g-l*p,k=h*v-f*p,C=h*y-d*p,E=l*v-f*g,P=l*y-d*g,j=f*y-d*v,A=m*j-b*P+x*E+w*C-M*k+S*O;return A?(A=1/A,t[0]=(s*j-u*P+c*E)*A,t[1]=(u*C-a*j-c*k)*A,t[2]=(a*P-s*C+c*O)*A,t[3]=(i*P-r*j-o*E)*A,t[4]=(n*j-i*C+o*k)*A,t[5]=(r*C-n*P-o*O)*A,t[6]=(g*S-v*M+y*w)*A,t[7]=(v*x-p*S-y*b)*A,t[8]=(p*M-g*x+y*m)*A,t):null}function Ua(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Za(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Qa(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Ka(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function $a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function Ja(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function ts(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function es(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function ns(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],l=e[0],f=e[1],d=e[2],p=e[3],g=e[4],v=e[5],y=e[6],m=e[7],b=e[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-f)<=1e-6*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=1e-6*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=1e-6*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-y)<=1e-6*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(h-b)<=1e-6*Math.max(1,Math.abs(h),Math.abs(b))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var rs=Ra,is=$a;function os(){var t=new ka(2);return ka!=Float32Array&&(t[0]=0,t[1]=0),t}function as(t){var e=new ka(2);return e[0]=t[0],e[1]=t[1],e}function ss(t,e){var n=new ka(2);return n[0]=t,n[1]=e,n}function us(t,e){return t[0]=e[0],t[1]=e[1],t}function cs(t,e,n){return t[0]=e,t[1]=n,t}function hs(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function ls(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function fs(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function ds(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function ps(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function gs(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function vs(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ys(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ms(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function bs(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function xs(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function ws(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function Ms(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Ss(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function Os(t){var e=t[0],n=t[1];return e*e+n*n}function ks(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Cs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Es(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ps(t,e){return t[0]*e[0]+t[1]*e[1]}function js(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function As(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function Is(t,e){e=e||1;var n=2*Ca()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function Ts(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function Ns(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function Bs(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function _s(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function Ls(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function Ds(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function Rs(t){return t[0]=0,t[1]=0,t}function Fs(t){return"vec2("+t[0]+", "+t[1]+")"}function Xs(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ys(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))}var zs=Ss,Ws=ls,qs=fs,Gs=ds,Vs=ws,Hs=Ms,Us=Os,Zs=function(){var t=os();return function(e,n,r,i,o,a){var s,u;for(n||(n=2),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function nu(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function ru(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}!function(){var t,e=(t=new ka(3),ka!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}();function iu(t,e,n,r,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(ui)return!1;var c={x:t+n*Math.cos(u),y:e+n*Math.sin(u)};return mo(c.x,c.y,a,s)<=o/2}var ou=l.transform;var au=v({hasArc:function(t){for(var e=!1,n=t.length,r=0;r0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;sy?v:y;ru(w,w,ou(null,[["t",-p,-g],["r",-x],["s",1/(v>y?1:v/y),1/(v>y?y/v:1)]])),o=iu(0,0,M,m,b,e,w[0],w[1])}if(o)break}}return o}},r);function su(t,e,n){for(var r=!1,i=0;i=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var o=i[n];if(oo(o)||oo(n))return null;var a=o.length,s=i[n+1];return Bi.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",au.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,r,i=0,o=0,a=[],s=this.get("curve");s&&(co(s,(function(t,e){n=s[e+1],r=t.length,n&&(i+=Bi.length(t[r-2],t[r-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",i),0!==i?(co(s,(function(u,c){n=s[c+1],r=u.length,n&&((t=[])[0]=o/i,e=Bi.length(u[r-2],u[r-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/i,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var r=e[n-2].currentPoint,i=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},e}(Ko);function cu(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),Mi.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];co(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=Mi.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Ko);var fu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,u=o.width,c=o.height,h=o.radius;if(h){var l=!1;return n&&(l=function(t,e,n,r,i,o,a,s){return ia(t+i,e,t+n-i,e,o,a,s)||ia(t+n,e+i,t+n,e+r-i,o,a,s)||ia(t+n-i,e+r,t+i,e+r,o,a,s)||ia(t,e+r-i,t,e+i,o,a,s)||iu(t+n-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||iu(t+n-i,e+r-i,i,0,.5*Math.PI,o,a,s)||iu(t+i,e+r-i,i,.5*Math.PI,Math.PI,o,a,s)||iu(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(a,s,u,c,h,i,t,e)),!l&&r&&(l=bo(a,s,u,c,t,e)),l}var f=i/2;return r&&n?bo(a-f,s-f,u+f,c+f,t,e):r?bo(a,s,u,c,t,e):n?function(t,e,n,r,i,o,a){var s=i/2;return bo(t-s,e-s,n,i,o,a)||bo(t+n-s,e-s,i,r,o,a)||bo(t+s,e+r-s,n,i,o,a)||bo(t-s,e+s,i,r,o,a)}(a,s,u,c,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,r,i,o);else{var s=function(t){var e=0,n=0,r=0,i=0;return ao(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,[e,n,r,i]}(a),u=s[0],c=s[1],h=s[2],l=s[3];t.moveTo(n+u,r),t.lineTo(n+i-c,r),0!==c&&t.arc(n+i-c,r+c,c,-Math.PI/2,0),t.lineTo(n+i,r+o-h),0!==h&&t.arc(n+i-h,r+o-h,h,0,Math.PI/2),t.lineTo(n+l,r+o),0!==l&&t.arc(n+l,r+o-l,l,Math.PI/2,Math.PI),t.lineTo(n,r+u),0!==u&&t.arc(n+u,r+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(Ko),du=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Gi(t)},e.prototype._setText=function(t){var e=null;lo(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var r,i=this.attrs,o=i.textBaseline,a=i.x,s=i.y,u=1*i.fontSize,c=this._getSpaceingY(),h=Wi(i.text,i.fontSize,i.lineHeight);co(e,(function(e,i){r=s+i*(c+u)-h+u,"middle"===o&&(r+=h-u-(h-u)/2),"top"===o&&(r+=h-u),n?t.fillText(e,a,r):t.strokeText(e,a,r)}))},e.prototype._drawText=function(t,e){var n=this.attr(),r=n.x,i=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=n.text;e?t.fillText(a,r,i):t.strokeText(a,r,i)}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&(oo(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&(oo(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(Ko);function pu(t,e,n){var r,i,o=t.getTotalMatrix();if(o){var a=(r=[e,n,1],(i=o)?Ye(ze(i),r):r);return[a[0],a[1]]}return[e,n]}function gu(t,e,n){if(t.isCanvas&&t.isCanvas())return!0;if(!it(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var r=pu(t,e,n),i=r[0],o=r[1];if(t.isClipped(i,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&n>=a.minY&&n<=a.maxY}var vu=n(32),yu=n.n(vu);function mu(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function bu(t,e,n){if(n.bubbles){t.isCanvas(),0,n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var xu=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.panstartShape=null,this.panstartPoint=null,this.handleEvent=function(t){e.hammerRuntime.emit("origin_input:"+t.type,t)},this.canvas=t.canvas,this._initEvent()}return t.prototype._initEvent=function(){var t=this;this.hammerRuntime=new yu.a({},{inputClass:vu.TouchInput}),this.hammerRuntime.add(new yu.a.Pan({threshold:0,pointers:1})),this.hammerRuntime.add(new yu.a.Swipe).recognizeWith(this.hammerRuntime.get("pan")),this.hammerRuntime.add(new yu.a.Pinch({threshold:0,pointers:2})),this.hammerRuntime.add(new yu.a.Tap({event:"dbltap",taps:2})),this.hammerRuntime.add(new yu.a.Tap),this.hammerRuntime.add(new yu.a.Press({time:500})),this.hammerRuntime.on("panstart panmove panend pancancel",(function(e){e.srcEvent.extra=e;var n=t._getPointInfo(e),r=t._getShape(n,e);"panend"!==e.type&&"pancancel"!==e.type||t._onpanend(n,r,e),"panstart"===e.type&&(t.dragging&&(t.draggingShape=null,t.dragging=!1,t.panstartShape=null,t.panstartPoint=null),t._onpanstart(n,r,e)),"panmove"===e.type&&t._onpanmove(n,r,e),t.currentShape=r})),this.hammerRuntime.on("tap dbltap press swipe rotatestart rotatemove",(function(e){t._emitMobileEvent(e.type,e)})),this.hammerRuntime.on("pinchstart pinchmove pinchend pinchcancel",(function(e){"pinchend"!==e.type&&"pinchcancel"!==e.type?(e.srcEvent.extra={scale:e.scale},t._emitMobileEvent(e.type,e)):t._emitMobileEvent(e.type,e)}))},t.prototype._emitMobileEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e);this._emitEvent(t,e,n,r)},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new K(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){var n=e.srcEvent;return this.canvas.getShape(t.x,t.y,n)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t];if(i)i.call(this,n,r,e);else{var o=this.currentShape;"panstart"===t||"dragenter"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"panstart"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"panend"===t||"dragleave"===t?(o&&this._emitEvent(t,e,n,o,o,null),this._emitEvent(t,e,n,null,o,null),"panend"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}},t.prototype._onpanstart=function(t,e,n){this.panstartShape=e,this.panstartPoint=t,this.panstartTimeStamp=n.timeStamp,this._emitEvent("panstart",n,t,e,null,null)},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);this.currentShape=r},t.prototype._onpanend=function(t,e,n){var r=this.draggingShape;this.dragging&&(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)),this._emitEvent("panend",n,t,e),this.panstartShape=null,this.panstartPoint=null},t.prototype._onpanmove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.panstartPoint;if(a){var s=this.panstartShape,u=n.timeStamp-this.panstartTimeStamp,c=a.clientX-t.clientX,h=a.clientY-t.clientY;(u>120||c*c+h*h>40)&&(s&&s.get("draggable")?((o=this.panstartShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.panstartShape=null,this.panstartPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.panstartShape=null,this.panstartPoint=null):this._emitEvent("panmove",n,t,e))}}this._emitEvent("panmove",n,t,e)},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,mu(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||bu(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{mu(this.canvas,t,a)}},t.prototype.destroy=function(){this.canvas=null,this.currentShape=null,this.draggingShape=null,this.panstartPoint=null,this.panstartShape=null,this.panstartTimeStamp=null},t}(),wu=function(){function t(){}return t.prototype.set=function(t,e,n){switch(e){case"strokeStyle":t.setStrokeStyle(n);break;case"fillStyle":t.setFillStyle(n);break;case"lineWidth":t.setLineWidth(n);break;case"lineDash":t.setLineDash(n);break;case"globalAlpha":(n||0===n)&&(t.globalAlpha=n,t.setGlobalAlpha(n));break;case"fontSize":t.setFontSize(n);break;case"textAlign":t.setTextAlign(n);break;case"fontStyle":case"font":t.setFont(n);break;case"textBaseline":t.setTextBaseline(n);break;default:t[e]=n}return!0},t.prototype.get=function(t,e){return"globalAlpha"===e&&void 0===t[e]?1:"function"==typeof t[e]?t[e].bind(t):t[e]},t}(),Mu=n(103),Su=null;var Ou=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.text,o=e.fontSize,a=e.lineHeight,s=e.font;s||(s=Object(Mu.assembleFont)(e));var u,c=function(t,e){var n=0;if(oo(t)||""===t)return n;if(Su.save(),Su.font=e,lo(t)&&t.includes("\n")){var r=t.split("\n");co(r,(function(t){var e=Su.measureText(t).width;n=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.initDom=function(){if(this.isMini()){var e=this.get("context"),n=this.getPixelRatio();n>1&&e.scale(n,n)}else t.prototype.initDom.call(this)},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame(),this.get("context").clearRect(0,0,this.get("width"),this.get("height"))},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,r){if(!gu(e,n,r))return null;for(var i=null,o=e.getChildren(),a=o.length-1;a>=0;a--){var s=o[a];if(s.isGroup())i=t(s,n,r);else if(gu(s,n,r)){var u=s,c=pu(s,n,r),h=c[0],l=c[1];u.isInShape(h,l)&&(i=s)}if(i)break}return i}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=function(t){if(!t.length)return null;var e=[],n=[],r=[],i=[];return co(t,(function(t){var o=Zo(t);o&&(e.push(o.minX),n.push(o.minY),r.push(o.maxX),i.push(o.maxY))})),{minX:Math.min.apply(null,e),minY:Math.min.apply(null,n),maxX:Math.max.apply(null,r),maxY:Math.max.apply(null,i)}}(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&xo(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,n)));return t},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(yo.a)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=Object(yo.b)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),Object(yo.a)(e),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),zo(t,this),qo(this,n,r),Wo(t,n,r),t.restore()):e.length&&function t(e){for(var n=0;n'),u=n?n.backgroundColor:void 0,c=n?n.padding:void 0;c?Object(ju.k)(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var h=i+c[0]+c[2],l=o+c[1]+c[3],f=new Eu({container:s,height:h,width:l,quickHit:!0}),d=this.get("group").clone(),p=Object(ju.a)(d.getMatrix());p||(p=[1,0,0,0,1,0,0,0,1]);var g=(r.maxX+r.minX)/2,v=(r.maxY+r.minY)/2;Pu.a.translate(p,p,[-g,-v]),Pu.a.translate(p,p,[o/2+c[3],i/2+c[0]]),d.resetMatrix(),d.setMatrix(p),f.add(d);var y=f.get("el"),m="";e||(e="image/png"),setTimeout((function(){if("svg"===a){var n=y.cloneNode(!0),r=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",r);i.replaceChild(n,i.documentElement);var o=(new XMLSerializer).serializeToString(i);m="data:image/svg+xml;charset=utf8,"+encodeURIComponent(o)}else{var s=void 0,c=y.getContext("2d"),f=void 0;if(u){var d="undefined"!=typeof window?window.devicePixelRatio:1;s=c.getImageData(0,0,l*d,h*d),f=c.globalCompositeOperation,c.globalCompositeOperation="destination-over",c.fillStyle=u,c.fillRect(0,0,l,h)}m=y.toDataURL(e),u&&(c.clearRect(0,0,l,h),c.putImageData(s,0,0),c.globalCompositeOperation=f)}t&&t(m)}),16)},e.prototype.downloadFullImage=function(t,e,n){var r=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=Object(Ru.a)(''),c=n?n.backgroundColor:void 0,h=n?n.padding:void 0;h?Object(ju.k)(h)&&(h=[h,h,h,h]):h=[0,0,0,0];var l=o+h[0]+h[2],f=a+h[1]+h[3],d=new Eu({container:u,height:l,width:f}),p=this.get("group").clone(),g=Object(ju.a)(p.getMatrix());g||(g=[1,0,0,0,1,0,0,0,1]);var v=(i.maxX+i.minX)/2,y=(i.maxY+i.minY)/2;Pu.a.translate(g,g,[-v,-y]),Pu.a.translate(g,g,[a/2+h[3],o/2+h[0]]),p.resetMatrix(),p.setMatrix(g),d.add(p);var m=d.get("el");e||(e="image/png"),setTimeout((function(){var n="";if("svg"===s){var i=m.cloneNode(!0),o=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),a=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",o);a.replaceChild(i,a.documentElement);var u=(new XMLSerializer).serializeToString(a);n="data:image/svg+xml;charset=utf8,"+encodeURIComponent(u)}else{var h=void 0,d=m.getContext("2d"),p=void 0;if(c){var g="undefined"!=typeof window?window.devicePixelRatio:1;h=d.getImageData(0,0,f*g,l*g),p=d.globalCompositeOperation,d.globalCompositeOperation="destination-over",d.fillStyle=c,d.fillRect(0,0,f,l)}n=m.toDataURL(e),c&&(d.clearRect(0,0,f,l),d.putImageData(h,0,0),d.globalCompositeOperation=p)}var v=document.createElement("a"),y=(t||"graph")+("svg"===s?".svg":"."+e.split("/")[1]);r.dataURLToImage(n,s,v,y);var b=document.createEvent("MouseEvents");b.initEvent("click",!1,!1),v.dispatchEvent(b)}),16)},e.prototype.downloadImage=function(t,e,n){var r=this,i=this;i.isAnimating()&&i.stopAnimate();var o=i.get("canvas").getRenderer();e||(e="image/png");var a=(t||"graph")+("svg"===o?".svg":e.split("/")[1]),s=document.createElement("a");setTimeout((function(){var t=i.toDataURL(e,n);r.dataURLToImage(t,o,s,a);var u=document.createEvent("MouseEvents");u.initEvent("click",!1,!1),s.dispatchEvent(u)}),16)},e.prototype.dataURLToImage=function(t,e,n,r){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,c=new Uint8Array(u);u--;)c[u]=s.charCodeAt(u);var h=new Blob([c],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(h,r):n.addEventListener("click",(function(){n.download=r,n.href=window.URL.createObjectURL(h)}))}else n.addEventListener("click",(function(){n.download=r,n.href=t}))},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),n=e.indexOf(t);n>=0&&(t.destroyPlugin(),e.splice(n,1))},e.prototype.isMiniNative=function(){return"mini-native"===this.get("renderer")},e.prototype.isMini=function(){return this.get("renderer").startsWith("mini")},e.prototype.isBrowser=function(){return"canvas"===this.get("renderer")},e.prototype.setImageWaterMarker=function(t,e,n){var r=this,i=Object(ju.b)({},Iu.a.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.image,u=s.rotate,c=(s.x,s.y,s.width),h=s.height;if(this.isMini()&&this.isMiniNative(),this.isMiniNative()){n.width=o||this.get("width"),n.height=a||this.get("height");var l=n.getContext("2d"),f=(0,this.get("extra").createImage)();f.crossOrigin="anonymous",f.src=t,f.onload=function(){var t=c/f.width,e=h/f.height;l.rotate(-u*Math.PI/180);var i=l.createPattern(f,"repeat");l.fillStyle=i,l.scale(t,e),l.fillRect(2*-r.get("width"),-r.get("height"),10*r.get("width"),10*r.get("height")),r.get("waterGroup").addShape("image",{attrs:{img:n}})}}if(this.isBrowser()){var d=document.createElement("canvas");d.width=o||this.get("width"),d.height=a||this.get("height");var p=d.getContext("2d"),g=new Image;g.crossOrigin="anonymous",g.src=t,g.onload=function(){var t=c/g.width,e=h/g.height;p.rotate(-u*Math.PI/180);var n=p.createPattern(g,"repeat");p.fillStyle=n,p.scale(t,e),p.fillRect(2*-r.get("width"),-r.get("height"),10*r.get("width"),10*r.get("height"));var i=d.toDataURL();r.get("waterGroup").addShape("image",{attrs:{img:i}})}}},e.prototype.setTextWaterMarker=function(t,e){var n=this.get("container");Object(ju.o)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=Object(ju.b)({},Iu.a.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!r){var c={container:n,width:o,height:a,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h),r=new Eu(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var l=r.get("context"),f=u.rotate,d=u.fill,p=u.fontFamily,g=u.fontSize,v=u.baseline,y=u.x,m=u.y,b=u.lineHeight;l.rotate(-f*Math.PI/180),l.font=g+"px "+p,l.fillStyle=d,l.textBaseline=v;for(var x=t.length-1;x>=0;x--)l.fillText(t[x],y,m+x*b);if(l.rotate(f*Math.PI/180),s)n.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;";else{var w=document.querySelector(".g6-graph-watermarker");w||((w=document.createElement("div")).className="g6-graph-watermarker"),w.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;",n.appendChild(w)}},e.prototype.destroy=function(){Object(ju.c)(this.get("plugins"),(function(t){t.destroyPlugin()}));var e=this.get("tooltips");if(e)for(var n=0;n1)&&(t=1),t}function u(t){return t<=1?100*Number(t)+"%":t}function c(t){return 1===t.length?"0"+t:String(t)}function h(t,e,n){t=o(t,255),e=o(e,255),n=o(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),a=0,s=0,u=(r+i)/2;if(r===i)s=0,a=0;else{var c=r-i;switch(s=u>.5?c/(2-r-i):c/(r+i),r){case t:a=(e-n)/c+(e1&&(n-=1),n<1/6?t+6*n*(e-t):n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function f(t,e,n){t=o(t,255),e=o(e,255),n=o(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),a=0,s=r,u=r-i,c=0===r?0:u/r;if(r===i)a=0;else{switch(r){case t:a=(e-n)/u+(e>16,g:(65280&t)>>8,b:255&t}}(e)),this.originalInput=e;var i=b(e);this.originalInput=e,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,n=t.g/255,r=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=s(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.toHsv=function(){var t=f(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=f(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1===this.a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this.roundA+")"},t.prototype.toHsl=function(){var t=h(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=h(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1===this.a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this.roundA+")"},t.prototype.toHex=function(t){return void 0===t&&(t=!1),d(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),function(t,e,n,r,i){var o=[c(Math.round(t).toString(16)),c(Math.round(e).toString(16)),c(Math.round(n).toString(16)),c(p(r))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb("+t+", "+e+", "+n+")":"rgba("+t+", "+e+", "+n+", "+this.roundA+")"},t.prototype.toPercentageRgb=function(){var t=function(t){return Math.round(100*o(t,255))+"%"};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*o(t,255))};return 1===this.a?"rgb("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%)":"rgba("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%, "+this.roundA+")"},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+d(this.r,this.g,this.b,!1),e=0,n=Object.entries(y);e=0;return e||!r||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=a(n.l),new t(n)},t.prototype.brighten=function(e){void 0===e&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),new t(n)},t.prototype.darken=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=a(n.l),new t(n)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=a(n.s),new t(n)},t.prototype.saturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=a(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){void 0===n&&(n=50);var r=this.toRgb(),i=new t(e).toRgb(),o=n/100;return new t({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},t.prototype.analogous=function(e,n){void 0===e&&(e=6),void 0===n&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(new t(r));return o},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(new t({h:r,s:i,v:o})),o=(o+s)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb();return new t({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,i=[this],o=360/e,a=1;a=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function P(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(r=1),n&&5===e&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function j(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function A(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=new k(t),i=5;i>0;i-=1){var o=r.toHsv(),a=new k({h:E(o,i,!0),s:P(o,i,!0),v:j(o,i,!0)}).toHexString();n.push(a)}n.push(r.toHexString());for(var s=1;s<=4;s+=1){var u=r.toHsv(),c=new k({h:E(u,s),s:P(u,s),v:j(u,s)}).toHexString();n.push(c)}return"dark"===e.theme?C.map((function(t){var r=t.index,i=t.opacity;return new k(e.backgroundColor||"#141414").mix(n[r],100*i).toHexString()})):n}var I={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},T={},N={};Object.keys(I).forEach((function(t){T[t]=A(I[t]),T[t].primary=T[t][5],N[t]=A(I[t],{theme:"dark",backgroundColor:"#141414"}),N[t].primary=N[t][5]}));T.red,T.volcano,T.gold,T.orange,T.yellow,T.lime,T.green,T.cyan,T.blue,T.geekblue,T.purple,T.magenta,T.grey;var B=function(t,e,n){var r=i()(t),o=i()(e);return i()([(1-n)*r.red()+n*o.red(),(1-n)*r.green()+n*o.green(),(1-n)*r.blue()+n*o.blue()]).rgb()},_=function(t,e,n,r){return void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)"),"default"===n?function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="rgb(150, 150, 150)");var r=B(e,t,.05).rgb().toString(),o=B(e,t,.1).rgb().toString(),a=B(e,t,.2).rgb().toString(),s=B(e,t,.4).rgb().toString(),u=B(e,n,.02).rgb().toString(),c=B(e,n,.05).rgb().toString(),h=B(e,n,.1).rgb().toString(),l=B(e,n,.2).rgb().toString(),f=B(e,n,.3).rgb().toString(),d=A(t,{theme:"default",backgroundColor:e}),p=i()(t).hex().toLowerCase(),g=d.indexOf(p),v=t;return-1!==g&&(v=d[g+1]),{mainStroke:t,mainFill:o,activeStroke:t,activeFill:r,inactiveStroke:s,inactiveFill:r,selectedStroke:t,selectedFill:e,highlightStroke:v,highlightFill:a,disableStroke:f,disableFill:c,edgeMainStroke:f,edgeActiveStroke:t,edgeInactiveStroke:l,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:f,comboMainFill:u,comboActiveStroke:t,comboActiveFill:r,comboInactiveStroke:f,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:v,comboHighlightFill:u,comboDisableStroke:l,comboDisableFill:c}}(t,e,"rgb(150, 150, 150)"):function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#777");var r=B(e,t,.2).rgb().toString(),o=B(e,t,.3).rgb().toString(),a=B(e,t,.6).rgb().toString(),s=B(e,t,.8).rgb().toString(),u=B(e,n,.2).rgb().toString(),c=B(e,n,.25).rgb().toString(),h=B(e,n,.3).rgb().toString(),l=B(e,n,.4).rgb().toString(),f=B(e,n,.5).rgb().toString(),d=A(t,{theme:"dark",backgroundColor:e}),p=i()(t).hex().toLowerCase(),g=d.indexOf(p),v=t;return-1!==g&&(v=d[g+1]),{mainStroke:s,mainFill:r,activeStroke:t,activeFill:o,inactiveStroke:s,inactiveFill:r,selectedStroke:t,selectedFill:r,highlightStroke:t,highlightFill:a,disableStroke:f,disableFill:c,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:l,comboMainFill:c,comboActiveStroke:t,comboActiveFill:u,comboInactiveStroke:l,comboInactiveFill:c,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:v,comboHighlightFill:c,comboDisableStroke:l,comboDisableFill:u}}(t,e,"#777")},L=function(t,e,n,r){void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)");var i=[];return t.forEach((function(t){i.push(_(t,e,n,r))})),i}},84:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var r=n(56),i=function(){function t(t){var e=r.getLayoutByName(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.layoutInstance.init(t)},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}();e.Layout=i,e.Layouts=new Proxy({},{get:function(t,e){return r.getLayoutByName(e)},set:function(t,e,n){return r.registerLayout(e,n),!0}})}}).default})); //# sourceMappingURL=f6.js.map