Files
houyi-admin/dist/9711.a5e18e39.async.js
PC-202306242200\Administrator 23dc139a31 first commit
2026-03-28 23:25:01 +08:00

654 lines
1.3 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(self.webpackChunk=self.webpackChunk||[]).push([[9711],{3982:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var F=function(L,_){var I=L.nodes,T=L.edges,x=[],p={};if(!I)throw new Error("invalid nodes data!");return I&&I.forEach(function(v,g){p[v.id]=g;var d=[];x.push(d)}),T&&T.forEach(function(v){var g=v.source,d=v.target,c=p[g],s=p[d];!c&&c!==0||!s&&s!==0||(x[c][s]=1,_||(x[s][c]=1))}),x},k=F;N.default=k},71673:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),Object.defineProperty(N,"GADDIAsync",{enumerable:!0,get:function(){return k.GADDIAsync}}),Object.defineProperty(N,"connectedComponentAsync",{enumerable:!0,get:function(){return k.connectedComponentAsync}}),N.default=void 0,Object.defineProperty(N,"detectAllCyclesAsync",{enumerable:!0,get:function(){return k.detectAllCyclesAsync}}),Object.defineProperty(N,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return k.detectAllDirectedCycleAsync}}),Object.defineProperty(N,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return k.detectAllUndirectedCycleAsync}}),Object.defineProperty(N,"detectCycleAsync",{enumerable:!0,get:function(){return k.detectCycleAsync}}),N.detectDirectedCycleAsync=void 0,Object.defineProperty(N,"dijkstraAsync",{enumerable:!0,get:function(){return k.dijkstraAsync}}),Object.defineProperty(N,"findAllPathAsync",{enumerable:!0,get:function(){return k.findAllPathAsync}}),Object.defineProperty(N,"findShortestPathAsync",{enumerable:!0,get:function(){return k.findShortestPathAsync}}),Object.defineProperty(N,"floydWarshallAsync",{enumerable:!0,get:function(){return k.floydWarshallAsync}}),Object.defineProperty(N,"getAdjMatrixAsync",{enumerable:!0,get:function(){return k.getAdjMatrixAsync}}),Object.defineProperty(N,"getDegreeAsync",{enumerable:!0,get:function(){return k.getDegreeAsync}}),Object.defineProperty(N,"getInDegreeAsync",{enumerable:!0,get:function(){return k.getInDegreeAsync}}),Object.defineProperty(N,"getNeighborsAsync",{enumerable:!0,get:function(){return k.getNeighborsAsync}}),Object.defineProperty(N,"getOutDegreeAsync",{enumerable:!0,get:function(){return k.getOutDegreeAsync}}),Object.defineProperty(N,"labelPropagationAsync",{enumerable:!0,get:function(){return k.labelPropagationAsync}}),Object.defineProperty(N,"louvainAsync",{enumerable:!0,get:function(){return k.louvainAsync}}),Object.defineProperty(N,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return k.minimumSpanningTreeAsync}}),Object.defineProperty(N,"pageRankAsync",{enumerable:!0,get:function(){return k.pageRankAsync}});var k=F(19690),U=k.detectCycleAsync;N.detectDirectedCycleAsync=U;var L={getAdjMatrixAsync:k.getAdjMatrixAsync,connectedComponentAsync:k.connectedComponentAsync,getDegreeAsync:k.getDegreeAsync,getInDegreeAsync:k.getInDegreeAsync,getOutDegreeAsync:k.getOutDegreeAsync,detectCycleAsync:k.detectCycleAsync,detectDirectedCycleAsync:U,detectAllCyclesAsync:k.detectAllCyclesAsync,detectAllDirectedCycleAsync:k.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:k.detectAllUndirectedCycleAsync,dijkstraAsync:k.dijkstraAsync,findAllPathAsync:k.findAllPathAsync,findShortestPathAsync:k.findShortestPathAsync,floydWarshallAsync:k.floydWarshallAsync,labelPropagationAsync:k.labelPropagationAsync,louvainAsync:k.louvainAsync,minimumSpanningTreeAsync:k.minimumSpanningTreeAsync,pageRankAsync:k.pageRankAsync,getNeighborsAsync:k.getNeighborsAsync,GADDIAsync:k.GADDIAsync};N.default=L},39834:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=L(F(10780)),U=F(82890);function L(x){return x&&x.__esModule?x:{default:x}}function _(x){x===void 0&&(x={});var p=x,v=function(){},g=function(){var d={};return function(c){var s=c.next,m=s;return d[m]?!1:(d[m]=!0,!0)}}();return p.allowTraversal=x.allowTraversal||g,p.enter=x.enter||v,p.leave=x.leave||v,p}var I=function(p,v,g,d){d===void 0&&(d=!0);var c=_(g),s=new k.default,m=p.edges,M=m===void 0?[]:m;s.enqueue(v);for(var P="",R=function(){var Q=s.dequeue();c.enter({current:Q,previous:P}),(0,U.getNeighbors)(Q,M,d?"target":void 0).forEach(function(G){c.allowTraversal({previous:P,current:Q,next:G})&&s.enqueue(G)}),c.leave({current:Q,previous:P}),P=Q};!s.isEmpty();)R()},T=I;N.default=T},95482:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=_,N.detectStrongConnectComponents=N.detectConnectedComponents=void 0;var k=F(82890),U=function(T){for(var x=T.nodes,p=x===void 0?[]:x,v=T.edges,g=v===void 0?[]:v,d=[],c={},s=[],m=function j(Q){s.push(Q),c[Q.id]=!0;for(var G=(0,k.getNeighbors)(Q.id,g),W=function(J){var K=G[J];if(!c[K]){var ne=p.filter(function(se){return se.id===K});ne.length>0&&j(ne[0])}},H=0;H<G.length;++H)W(H)},M=0;M<p.length;M++){var P=p[M];if(!c[P.id]){m(P);for(var R=[];s.length>0;)R.push(s.pop());d.push(R)}}return d};N.detectConnectedComponents=U;var L=function(T){for(var x=T.nodes,p=x===void 0?[]:x,v=T.edges,g=v===void 0?[]:v,d=[],c={},s={},m={},M=[],P=0,R=function W(H){s[H.id]=P,m[H.id]=P,P+=1,d.push(H),c[H.id]=!0;for(var Z=(0,k.getNeighbors)(H.id,g,"target").filter(function(fe){return p.map(function(Ie){return Ie.id}).indexOf(fe)>-1}),J=function(Ie){var ye=Z[Ie];if(!s[ye]&&s[ye]!==0){var Ae=p.filter(function(Se){return Se.id===ye});Ae.length>0&&W(Ae[0]),m[H.id]=Math.min(m[H.id],m[ye])}else c[ye]&&(m[H.id]=Math.min(m[H.id],s[ye]))},K=0;K<Z.length;K++)J(K);if(m[H.id]===s[H.id]){for(var ne=[];d.length>0;){var se=d.pop();if(c[se.id]=!1,ne.push(se),se===H)break}ne.length>0&&M.push(ne)}},j=0,Q=p;j<Q.length;j++){var G=Q[j];!s[G.id]&&s[G.id]!==0&&R(G)}return M};N.detectStrongConnectComponents=L;function _(I,T){return T?L(I):U(I)}},53279:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.secondReg=N.dateReg=void 0;var F=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;N.secondReg=F;var k=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;N.dateReg=k},53838:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.getOutDegree=N.getInDegree=N.default=void 0;var F=function(I){var T={},x=I.nodes,p=x===void 0?[]:x,v=I.edges,g=v===void 0?[]:v;return p.forEach(function(d){T[d.id]={degree:0,inDegree:0,outDegree:0}}),g.forEach(function(d){T[d.source].degree++,T[d.source].outDegree++,T[d.target].degree++,T[d.target].inDegree++}),T},k=F;N.default=k;var U=function(I,T){var x=F(I);return x[T]?F(I)[T].inDegree:0};N.getInDegree=U;var L=function(I,T){var x=F(I);return x[T]?F(I)[T].outDegree:0};N.getOutDegree=L},94878:function(Mt,N,F){"use strict";function k(s){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},k(s)}Object.defineProperty(N,"__esModule",{value:!0}),N.detectAllUndirectedCycle=N.detectAllDirectedCycle=N.detectAllCycles=N.default=void 0;var U=x(F(98773)),L=T(F(95482)),_=F(82890);function I(s){if(typeof WeakMap!="function")return null;var m=new WeakMap,M=new WeakMap;return(I=function(R){return R?M:m})(s)}function T(s,m){if(!m&&s&&s.__esModule)return s;if(s===null||k(s)!=="object"&&typeof s!="function")return{default:s};var M=I(m);if(M&&M.has(s))return M.get(s);var P={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var j in s)if(j!=="default"&&Object.prototype.hasOwnProperty.call(s,j)){var Q=R?Object.getOwnPropertyDescriptor(s,j):null;Q&&(Q.get||Q.set)?Object.defineProperty(P,j,Q):P[j]=s[j]}return P.default=s,M&&M.set(s,P),P}function x(s){return s&&s.__esModule?s:{default:s}}var p=function(m){var M=null,P=m.nodes,R=P===void 0?[]:P,j={},Q={},G={},W={};R.forEach(function(J){Q[J.id]=J});for(var H={enter:function(K){var ne=K.current,se=K.previous;if(G[ne]){M={};for(var fe=ne,Ie=se;Ie!==ne;)M[fe]=Ie,fe=Ie,Ie=j[Ie];M[fe]=Ie}else G[ne]=ne,delete Q[ne],j[ne]=se},leave:function(K){var ne=K.current;W[ne]=ne,delete G[ne]},allowTraversal:function(K){var ne=K.next;return M?!1:!W[ne]}};Object.keys(Q).length;){var Z=Object.keys(Q)[0];(0,U.default)(m,Z,H)}return M},v=function(m,M,P){var R,j;P===void 0&&(P=!0);for(var Q=[],G=(0,L.default)(m,!1),W=0,H=G;W<H.length;W++){var Z=H[W];if(Z.length)for(var J=Z[0],K=J.id,ne=[J],se=(R={},R[K]=J,R),fe=(j={},j[K]=new Set,j);ne.length>0;)for(var Ie=ne.pop(),ye=Ie.id,Ae=(0,_.getNeighbors)(ye,m.edges),Se=function(ke){var Ge,tt=Ae[ke],He=m.nodes.find(function(xt){return xt.id===tt});if(tt===ye)Q.push((Ge={},Ge[tt]=Ie,Ge));else if(!(tt in fe))se[tt]=Ie,ne.push(He),fe[tt]=new Set([Ie]);else if(!fe[ye].has(He)){for(var ft=!0,Lt=[He,Ie],Jt=se[ye];fe[tt].size&&!fe[tt].has(Jt)&&(Lt.push(Jt),Jt!==se[Jt.id]);)Jt=se[Jt.id];if(Lt.push(Jt),M&&P?(ft=!1,Lt.findIndex(function(xt){return M.indexOf(xt.id)>-1})>-1&&(ft=!0)):M&&!P&&Lt.findIndex(function(xt){return M.indexOf(xt.id)>-1})>-1&&(ft=!1),ft){for(var Qe={},ut=1;ut<Lt.length;ut+=1)Qe[Lt[ut-1].id]=Lt[ut];Lt.length&&(Qe[Lt[Lt.length-1].id]=Lt[0]),Q.push(Qe)}fe[tt].add(Ie)}},we=0;we<Ae.length;we+=1)Se(we)}return Q};N.detectAllUndirectedCycle=v;var g=function(m,M,P){P===void 0&&(P=!0);for(var R=[],j=new Set,Q=[],G=[],W={},H={},Z=function(Jt){for(var Qe=[Jt];Qe.length>0;){var ut=Qe.pop();j.has(ut)&&(j.delete(ut),Q[ut.id].forEach(function(xt){Qe.push(xt)}),Q[ut.id].clear())}},J=function Lt(Jt,Qe,ut){var xt=!1;if(M&&P===!1&&M.indexOf(Jt.id)>-1)return xt;R.push(Jt),j.add(Jt);for(var dt=ut[Jt.id],pt=0;pt<dt.length;pt+=1){var wt=W[dt[pt]];if(wt===Qe){for(var mt={},ur=1;ur<R.length;ur+=1)mt[R[ur-1].id]=R[ur];R.length&&(mt[R[R.length-1].id]=R[0]),G.push(mt),xt=!0}else j.has(wt)||Lt(wt,Qe,ut)&&(xt=!0)}if(xt)Z(Jt);else for(var pt=0;pt<dt.length;pt+=1){var wt=W[dt[pt]];Q[wt.id].has(Jt)||Q[wt.id].add(Jt)}return R.pop(),xt},K=m.nodes,ne=K===void 0?[]:K,se=0;se<ne.length;se+=1){var fe=ne[se],Ie=fe.id;H[Ie]=se,W[se]=fe}if(M&&P)for(var ye=function(Jt){var Qe=M[Jt];H[ne[Jt].id]=H[Qe],H[Qe]=0,W[0]=ne.find(function(ut){return ut.id===Qe}),W[H[ne[Jt].id]]=ne[Jt]},se=0;se<M.length;se++)ye(se);for(var Ae=function(Jt){for(var Qe,ut,xt=1/0,dt=0;dt<Jt.length;dt+=1)for(var pt=Jt[dt],wt=0;wt<pt.length;wt++){var mt=H[pt[wt].id];mt<xt&&(xt=mt,ut=dt)}for(var ur=Jt[ut],Ir=[],dt=0;dt<ur.length;dt+=1){var Nr=ur[dt];Ir[Nr.id]=[];for(var Hr=0,It=(0,_.getNeighbors)(Nr.id,m.edges,"target").filter(function(Oe){return ur.map(function(Pr){return Pr.id}).indexOf(Oe)>-1});Hr<It.length;Hr++){var qt=It[Hr];qt===Nr.id&&!(P===!1&&M.indexOf(Nr.id)>-1)?G.push((Qe={},Qe[Nr.id]=Nr,Qe)):Ir[Nr.id].push(H[qt])}}return{component:ur,adjList:Ir,minIdx:xt}},Se=0;Se<ne.length;){var we=ne.filter(function(Lt){return H[Lt.id]>=Se}),Te=(0,L.detectStrongConnectComponents)({nodes:we,edges:m.edges}).filter(function(Lt){return Lt.length>1});if(Te.length===0)break;var ke=Ae(Te),Ge=ke.minIdx,tt=ke.adjList,He=ke.component;if(He.length>1){He.forEach(function(Lt){Q[Lt.id]=new Set});var ft=W[Ge];if(M&&P&&M.indexOf(ft.id)===-1)return G;J(ft,ft,tt),Se=Ge+1}else break}return G};N.detectAllDirectedCycle=g;var d=function(m,M,P,R){return R===void 0&&(R=!0),M?g(m,P,R):v(m,P,R)};N.detectAllCycles=d;var c=p;N.default=c},98773:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=_;var k=F(82890);function U(I){I===void 0&&(I={});var T=I,x=function(){},p=function(){var v={};return function(g){var d=g.next;return v[d]?!1:(v[d]=!0,!0)}}();return T.allowTraversal=I.allowTraversal||p,T.enter=I.enter||x,T.leave=I.leave||x,T}function L(I,T,x,p,v){v===void 0&&(v=!0),p.enter({current:T,previous:x});var g=I.edges,d=g===void 0?[]:g;(0,k.getNeighbors)(T,d,v?"target":void 0).forEach(function(c){p.allowTraversal({previous:x,current:T,next:c})&&L(I,c,T,p,v)}),p.leave({current:T,previous:x})}function _(I,T,x,p){p===void 0&&(p=!0),L(I,T,"",U(x),p)}},115:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=F(99938),U=F(13526),L=F(82890),_=function(v,g,d){for(var c=1/0,s,m=0;m<g.length;m++){var M=g[m].id;!d[M]&&v[M]<=c&&(c=v[M],s=g[m])}return s},I=function(v,g,d,c){var s=v.nodes,m=s===void 0?[]:s,M=v.edges,P=M===void 0?[]:M,R=[],j={},Q={},G={};m.forEach(function(se,fe){var Ie=se.id;R.push(Ie),Q[Ie]=1/0,Ie===g&&(Q[Ie]=0)});for(var W=m.length,H=function(fe){var Ie=_(Q,m,j),ye=Ie.id;if(j[ye]=!0,Q[ye]===1/0)return"continue";var Ae=[];d?Ae=(0,L.getOutEdgesNodeId)(ye,P):Ae=(0,L.getEdgesByNodeId)(ye,P),Ae.forEach(function(Se){var we=Se.target,Te=Se.source,ke=we===ye?Te:we,Ge=c&&Se[c]?Se[c]:1;Q[ke]>Q[Ie.id]+Ge?(Q[ke]=Q[Ie.id]+Ge,G[ke]=[Ie.id]):Q[ke]===Q[Ie.id]+Ge&&G[ke].push(Ie.id)})},Z=0;Z<W;Z++)H(Z);G[g]=[g];var J={};for(var K in Q)Q[K]!==1/0&&x(g,K,G,J);var ne={};for(var K in J)ne[K]=J[K][0];return{length:Q,path:ne,allPath:J}},T=I;N.default=T;function x(p,v,g,d){if(p===v)return[p];if(d[v])return d[v];for(var c=[],s=0,m=g[v];s<m.length;s++){var M=m[s],P=x(p,M,g,d);if(!P)return;for(var R=0,j=P;R<j.length;R++){var Q=j[R];(0,U.isArray)(Q)?c.push((0,k.__spreadArray)((0,k.__spreadArray)([],Q,!0),[v],!1)):c.push([Q,v])}}return d[v]=c,d[v]}},27538:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.findShortestPath=N.findAllPath=void 0;var k=L(F(115)),U=F(82890);function L(T){return T&&T.__esModule?T:{default:T}}var _=function(x,p,v,g,d){var c=(0,k.default)(x,p,g,d),s=c.length,m=c.path,M=c.allPath;return{length:s[v],path:m[v],allPath:M[v]}};N.findShortestPath=_;var I=function(x,p,v,g){var d;if(p===v)return[[p]];var c=x.edges,s=c===void 0?[]:c,m=[p],M=(d={},d[p]=!0,d),P=[],R=[],j=g?(0,U.getNeighbors)(p,s,"target"):(0,U.getNeighbors)(p,s);for(P.push(j);m.length>0&&P.length>0;){var Q=P[P.length-1];if(Q.length){var G=Q.shift();G&&(m.push(G),M[G]=!0,j=g?(0,U.getNeighbors)(G,s,"target"):(0,U.getNeighbors)(G,s),P.push(j.filter(function(Z){return!M[Z]})))}else{var W=m.pop();M[W]=!1,P.pop();continue}if(m[m.length-1]===v){var H=m.map(function(J){return J});R.push(H);var W=m.pop();M[W]=!1,P.pop()}}return R};N.findAllPath=I},26696:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=U(F(3982));function U(I){return I&&I.__esModule?I:{default:I}}var L=function(T,x){for(var p=(0,k.default)(T,x),v=[],g=p.length,d=0;d<g;d+=1){v[d]=[];for(var c=0;c<g;c+=1)d===c?v[d][c]=0:p[d][c]===0||!p[d][c]?v[d][c]=1/0:v[d][c]=p[d][c]}for(var s=0;s<g;s+=1)for(var d=0;d<g;d+=1)for(var c=0;c<g;c+=1)v[d][c]>v[d][s]+v[s][c]&&(v[d][c]=v[d][s]+v[s][c]);return v},_=L;N.default=_},96638:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=F(13526),U=F(99176),L=function(){function c(s,m,M,P,R){this.fromNode=s,this.toNode=m,this.nodeEdgeNodeLabel={nodeLabel1:M||U.VACANT_NODE_LABEL,edgeLabel:P||U.VACANT_EDGE_LABEL,nodeLabel2:R||U.VACANT_NODE_LABEL}}return c.prototype.equalTo=function(s){return this.fromNode===s.formNode&&this.toNode===s.toNode&&this.nodeEdgeNodeLabel===s.nodeEdgeNodeLabel},c.prototype.notEqualTo=function(s){return!this.equalTo(s)},c}(),_=function(){function c(){this.rmpath=[],this.dfsEdgeList=[]}return c.prototype.equalTo=function(s){var m=this.dfsEdgeList.length,M=s.length;if(m!==M)return!1;for(var P=0;P<m;P++)if(this.dfsEdgeList[P]!==s[P])return!1;return!0},c.prototype.notEqualTo=function(s){return!this.equalTo(s)},c.prototype.pushBack=function(s,m,M,P,R){return this.dfsEdgeList.push(new L(s,m,M,P,R)),this.dfsEdgeList},c.prototype.toGraph=function(s,m){s===void 0&&(s=U.VACANT_GRAPH_ID),m===void 0&&(m=!1);var M=new U.Graph(s,!0,m);return this.dfsEdgeList.forEach(function(P){var R=P.fromNode,j=P.toNode,Q=P.nodeEdgeNodeLabel,G=Q.nodeLabel1,W=Q.edgeLabel,H=Q.nodeLabel2;G!==U.VACANT_NODE_LABEL&&M.addNode(R,G),H!==U.VACANT_NODE_LABEL&&M.addNode(j,H),G!==U.VACANT_NODE_LABEL&&H!==G&&M.addEdge(void 0,R,j,W)}),M},c.prototype.buildRmpath=function(){this.rmpath=[];for(var s=void 0,m=this.dfsEdgeList.length,M=m-1;M>=0;M--){var P=this.dfsEdgeList[M],R=P.fromNode,j=P.toNode;R<j&&(s===void 0||j===s)&&(this.rmpath.push(M),s=R)}return this.rmpath},c.prototype.getNodeNum=function(){var s={};return this.dfsEdgeList.forEach(function(m){s[m.fromNode]||(s[m.fromNode]=!0),s[m.toNode]||(s[m.toNode]=!0)}),Object.keys(s).length},c}(),I=function(){function c(s){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!s){for(;s;){var m=s.edge;this.edges.push(m),this.nodesUsed[m.from]=1,this.nodesUsed[m.to]=1,this.edgesUsed[m.id]=1,s=s.preNode}this.edges=this.edges.reverse()}}return c.prototype.hasNode=function(s){return this.nodesUsed[s.id]===1},c.prototype.hasEdge=function(s){return this.edgesUsed[s.id]===1},c}(),T=function(){function c(s){var m=s.graphs,M=s.minSupport,P=M===void 0?2:M,R=s.minNodeNum,j=R===void 0?1:R,Q=s.maxNodeNum,G=Q===void 0?4:Q,W=s.top,H=W===void 0?10:W,Z=s.directed,J=Z===void 0?!1:Z,K=s.verbose,ne=K===void 0?!1:K;this.graphs=m,this.dfsCode=new _,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=P,this.top=H,this.directed=J,this.counter=0,this.maxNodeNum=G,this.minNodeNum=j,this.verbose=ne,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return c.prototype.findForwardRootEdges=function(s,m){var M=this,P=[],R=s.nodeMap;return m.edges.forEach(function(j){(M.directed||m.label<=R[j.to].label)&&P.push(j)}),P},c.prototype.findBackwardEdge=function(s,m,M,P){if(!this.directed&&m===M)return null;for(var R=s.nodeMap,j=R[M.to],Q=j.edges,G=Q.length,W=0;W<G;W++){var H=Q[W];if(!(P.hasEdge(H)||H.to!==m.from)){if(this.directed){if(R[m.from].label<R[M.to].label||R[m.from].label===R[M.to].label&&m.label<=H.label)return H}else if(m.label<H.label||m.label===H.label&&R[m.to].label<=R[M.to].label)return H}}return null},c.prototype.findForwardPureEdges=function(s,m,M,P){for(var R=[],j=m.to,Q=s.nodeMap[j].edges,G=Q.length,W=0;W<G;W++){var H=Q[W],Z=s.nodeMap[H.to];M<=Z.label&&!P.hasNode(Z)&&R.push(H)}return R},c.prototype.findForwardRmpathEdges=function(s,m,M,P){for(var R=[],j=s.nodeMap,Q=j[m.to].label,G=j[m.from],W=G.edges,H=W.length,Z=0;Z<H;Z++){var J=W[Z],K=j[J.to].label;m.to===J.to||M>K||P.hasNode(j[J.to])||(m.label<J.label||m.label===J.label&&Q<=K)&&R.push(J)}return R},c.prototype.getSupport=function(s){var m={};return s.forEach(function(M){m[M.graphId]||(m[M.graphId]=!0)}),Object.keys(m).length},c.prototype.findMinLabel=function(s){var m=void 0;return Object.keys(s).forEach(function(M){var P=s[M],R=P.nodeLabel1,j=P.edgeLabel,Q=P.nodeLabel2;if(!m){m={nodeLabel1:R,edgeLabel:j,nodeLabel2:Q};return}(R<m.nodeLabel1||R===m.nodeLabel1&&j<m.edgeLabel||R===m.nodeLabel1&&j===m.edgeLabel&&Q<m.nodeLabel2)&&(m={nodeLabel1:R,edgeLabel:j,nodeLabel2:Q})}),m},c.prototype.isMin=function(){var s=this,m=this.dfsCode;if(this.verbose&&console.log("isMin checking",m),m.dfsEdgeList.length===1)return!0;var M=this.directed,P=m.toGraph(U.VACANT_GRAPH_ID,M),R=P.nodeMap,j=new _,Q={};P.nodes.forEach(function(Z){var J=s.findForwardRootEdges(P,Z);J.forEach(function(K){var ne=R[K.to],se="".concat(Z.label,"-").concat(K.label,"-").concat(ne.label);Q[se]||(Q[se]={projected:[],nodeLabel1:Z.label,edgeLabel:K.label,nodeLabel2:ne.label});var fe={graphId:P.id,edge:K,preNode:null};Q[se].projected.push(fe)})});var G=this.findMinLabel(Q);if(G){j.dfsEdgeList.push(new L(0,1,G.nodeLabel1,G.edgeLabel,G.nodeLabel2));var W=function Z(J){for(var K=j.buildRmpath(),ne=j.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,se=j.dfsEdgeList[K[0]].toNode,fe={},Ie=!1,ye=0,Ae=M?-1:0,Se=function(dt){if(Ie)return"break";J.forEach(function(pt){var wt=new I(pt),mt=s.findBackwardEdge(P,wt.edges[K[dt]],wt.edges[K[0]],wt);mt&&(fe[mt.label]||(fe[mt.label]={projected:[],edgeLabel:mt.label}),fe[mt.label].projected.push({graphId:P.id,edge:fe,preNode:pt}),ye=j.dfsEdgeList[K[dt]].fromNode,Ie=!0)})},we=K.length-1;we>Ae;we--){var Te=Se(we);if(Te==="break")break}if(Ie){var ke=s.findMinLabel(fe);j.dfsEdgeList.push(new L(se,ye,U.VACANT_NODE_LABEL,ke.edgeLabel,U.VACANT_NODE_LABEL));var Ge=j.dfsEdgeList.length-1;return s.dfsCode.dfsEdgeList[Ge]!==j.dfsEdgeList[Ge]?!1:Z(fe[ke.edgeLabel].projected)}var tt={};Ie=!1;var He=0;J.forEach(function(xt){var dt=new I(xt),pt=s.findForwardPureEdges(P,dt.edges[K[0]],ne,dt);pt.length>0&&(Ie=!0,He=se,pt.forEach(function(wt){var mt="".concat(wt.label,"-").concat(R[wt.to].label);tt[mt]||(tt[mt]={projected:[],edgeLabel:wt.label,nodeLabel2:R[wt.to].label}),tt[mt].projected.push({graphId:P.id,edge:wt,preNode:xt})}))});for(var ft=K.length,Lt=function(dt){if(Ie)return"break";var pt=K[dt];J.forEach(function(wt){var mt=new I(wt),ur=s.findForwardRmpathEdges(P,mt.edges[pt],ne,mt);ur.length>0&&(Ie=!0,He=j.dfsEdgeList[pt].fromNode,ur.forEach(function(Ir){var Nr="".concat(Ir.label,"-").concat(R[Ir.to].label);tt[Nr]||(tt[Nr]={projected:[],edgeLabel:Ir.label,nodeLabel2:R[Ir.to].label}),tt[Nr].projected.push({graphId:P.id,edge:Ir,preNode:wt})}))})},we=0;we<ft;we++){var Jt=Lt(we);if(Jt==="break")break}if(!Ie)return!0;var Qe=s.findMinLabel(tt);j.dfsEdgeList.push(new L(He,se+1,U.VACANT_NODE_LABEL,Qe.edgeLabel,Qe.nodeLabel2));var ut=j.dfsEdgeList.length-1;return m.dfsEdgeList[ut]!==j.dfsEdgeList[ut]?!1:Z(tt["".concat(Qe.edgeLabel,"-").concat(Qe.nodeLabel2)].projected)},H="".concat(G.nodeLabel1,"-").concat(G.edgeLabel,"-").concat(G.nodeLabel2);return W(Q[H].projected)}},c.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var s=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,k.clone)(s))}},c.prototype.subGraphMining=function(s){var m=this,M=this.getSupport(s);if(!(M<this.minSupport)&&this.isMin()){this.report();var P=this.dfsCode.getNodeNum(),R=this.dfsCode.buildRmpath(),j=this.dfsCode.dfsEdgeList[R[0]].toNode,Q=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,G={},W={};s.forEach(function(H){for(var Z=m.graphs[H.graphId],J=Z.nodeMap,K=new I(H),ne=R.length-1;ne>=0;ne--){var se=m.findBackwardEdge(Z,K.edges[R[ne]],K.edges[R[0]],K);if(se){var fe="".concat(m.dfsCode.dfsEdgeList[R[ne]].fromNode,"-").concat(se.label);W[fe]||(W[fe]={projected:[],toNodeId:m.dfsCode.dfsEdgeList[R[ne]].fromNode,edgeLabel:se.label}),W[fe].projected.push({graphId:H.graphId,edge:se,preNode:H})}}if(!(P>=m.maxNodeNum)){var Ie=m.findForwardPureEdges(Z,K.edges[R[0]],Q,K);Ie.forEach(function(Ae){var Se="".concat(j,"-").concat(Ae.label,"-").concat(J[Ae.to].label);G[Se]||(G[Se]={projected:[],fromNodeId:j,edgeLabel:Ae.label,nodeLabel2:J[Ae.to].label}),G[Se].projected.push({graphId:H.graphId,edge:Ae,preNode:H})});for(var ye=function(Se){var we=m.findForwardRmpathEdges(Z,K.edges[R[Se]],Q,K);we.forEach(function(Te){var ke="".concat(m.dfsCode.dfsEdgeList[R[Se]].fromNode,"-").concat(Te.label,"-").concat(J[Te.to].label);G[ke]||(G[ke]={projected:[],fromNodeId:m.dfsCode.dfsEdgeList[R[Se]].fromNode,edgeLabel:Te.label,nodeLabel2:J[Te.to].label}),G[ke].projected.push({graphId:H.graphId,edge:Te,preNode:H})})},ne=0;ne<R.length;ne++)ye(ne)}}),Object.keys(W).forEach(function(H){var Z=W[H],J=Z.toNodeId,K=Z.edgeLabel;m.dfsCode.dfsEdgeList.push(new L(j,J,"-1",K,"-1")),m.subGraphMining(W[H].projected),m.dfsCode.dfsEdgeList.pop()}),Object.keys(G).forEach(function(H){var Z=G[H],J=Z.fromNodeId,K=Z.edgeLabel,ne=Z.nodeLabel2;m.dfsCode.dfsEdgeList.push(new L(J,j+1,U.VACANT_NODE_LABEL,K,ne)),m.subGraphMining(G[H].projected),m.dfsCode.dfsEdgeList.pop()})}},c.prototype.generate1EdgeFrequentSubGraphs=function(){var s=this.graphs,m=this.directed,M=this.minSupport,P=this.frequentSize1Subgraphs,R={},j={},Q={},G={};return Object.keys(s).forEach(function(W){var H=s[W],Z=H.nodeMap;H.nodes.forEach(function(J,K){var ne=J.label,se="".concat(W,"-").concat(ne);if(!Q[se]){var fe=R[ne]||0;fe++,R[ne]=fe}Q[se]={graphKey:W,label:ne},J.edges.forEach(function(Ie){var ye=ne,Ae=Z[Ie.to].label;if(!m&&ye>Ae){var Se=Ae;Ae=ye,ye=Se}var we=Ie.label,Te="".concat(W,"-").concat(ye,"-").concat(we,"-").concat(Ae),ke="".concat(ye,"-").concat(we,"-").concat(Ae);if(!j[ke]){var Ge=j[ke]||0;Ge++,j[ke]=Ge}G[Te]={graphId:W,nodeLabel1:ye,edgeLabel:we,nodeLabel2:Ae}})})}),Object.keys(R).forEach(function(W){var H=R[W];if(!(H<M)){var Z={nodes:[],edges:[]};Z.nodes.push({id:"0",label:W}),P.push(Z)}}),P},c.prototype.run=function(){var s=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var m=this.graphs,M=this.directed,P={};Object.keys(m).forEach(function(R){var j=m[R],Q=j.nodeMap;j.nodes.forEach(function(G){var W=s.findForwardRootEdges(j,G);W.forEach(function(H){var Z=Q[H.to],J="".concat(G.label,"-").concat(H.label,"-").concat(Z.label);P[J]||(P[J]={projected:[],nodeLabel1:G.label,edgeLabel:H.label,nodeLabel2:Z.label});var K={graphId:R,edge:H,preNode:null};P[J].projected.push(K)})})}),Object.keys(P).forEach(function(R){var j=P[R],Q=j.projected,G=j.nodeLabel1,W=j.edgeLabel,H=j.nodeLabel2;s.dfsCode.dfsEdgeList.push(new L(0,1,G,W,H)),s.subGraphMining(Q),s.dfsCode.dfsEdgeList.pop()})}},c}(),x=function(s,m,M,P){var R={};return Object.keys(s).forEach(function(j,Q){var G=s[j],W=new U.Graph(Q,!0,m),H={};G.nodes.forEach(function(Z,J){W.addNode(J,Z[M]),H[Z.id]=J}),G.edges.forEach(function(Z,J){var K=H[Z.source],ne=H[Z.target];W.addEdge(-1,K,ne,Z[P])}),W&&W.getNodeNum()&&(R[W.id]=W)}),R},p=function(s,m,M){var P=[];return s.forEach(function(R){var j={nodes:[],edges:[]};R.nodes.forEach(function(Q){var G;j.nodes.push((G={id:"".concat(Q.id)},G[m]=Q.label,G))}),R.edges.forEach(function(Q){var G;j.edges.push((G={source:"".concat(Q.from),target:"".concat(Q.to)},G[M]=Q.label,G))}),P.push(j)}),P},v="cluster",g=function(s){var m=s.graphs,M=s.directed,P=M===void 0?!1:M,R=s.nodeLabelProp,j=R===void 0?v:R,Q=s.edgeLabelProp,G=Q===void 0?v:Q,W=x(m,P,j,G),H=s.minSupport,Z=s.maxNodeNum,J=s.minNodeNum,K=s.verbose,ne=s.top,se={graphs:W,minSupport:H,maxNodeNum:Z,minNodeNum:J,top:ne,verbose:K,directed:P},fe=new T(se);fe.run();var Ie=p(fe.frequentSubgraphs,j,G);return Ie},d=g;N.default=d},99176:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.VACANT_NODE_LABEL=N.VACANT_NODE_ID=N.VACANT_GRAPH_ID=N.VACANT_EDGE_LABEL=N.VACANT_EDGE_ID=N.Node=N.Graph=N.Edge=N.AUTO_EDGE_ID=void 0;var F=-1;N.VACANT_EDGE_ID=F;var k=-1;N.VACANT_NODE_ID=k;var U="-1";N.VACANT_EDGE_LABEL=U;var L="-1";N.VACANT_NODE_LABEL=L;var _=-1;N.VACANT_GRAPH_ID=_;var I="-1";N.AUTO_EDGE_ID=I;var T=function(){function v(g,d,c,s){g===void 0&&(g=F),d===void 0&&(d=k),c===void 0&&(c=k),s===void 0&&(s=U),this.id=g,this.from=d,this.to=c,this.label=s}return v}();N.Edge=T;var x=function(){function v(g,d){g===void 0&&(g=k),d===void 0&&(d=L),this.id=g,this.label=d,this.edges=[],this.edgeMap={}}return v.prototype.addEdge=function(g){this.edges.push(g),this.edgeMap[g.id]=g},v}();N.Node=x;var p=function(){function v(g,d,c){g===void 0&&(g=k),d===void 0&&(d=!0),c===void 0&&(c=!1),this.id=g,this.edgeIdAutoIncrease=d,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=c}return v.prototype.getNodeNum=function(){return this.nodes.length},v.prototype.addNode=function(g,d){if(!this.nodeMap[g]){var c=new x(g,d);this.nodes.push(c),this.nodeMap[g]=c,this.nodeLabelMap[d]||(this.nodeLabelMap[d]=[]),this.nodeLabelMap[d].push(g)}},v.prototype.addEdge=function(g,d,c,s){if((this.edgeIdAutoIncrease||g===void 0)&&(g=this.counter++),!(this.nodeMap[d]&&this.nodeMap[c]&&this.nodeMap[c].edgeMap[g])){var m=new T(g,d,c,s);if(this.edges.push(m),this.edgeMap[g]=m,this.nodeMap[d].addEdge(m),this.edgeLabelMap[s]||(this.edgeLabelMap[s]=[]),this.edgeLabelMap[s].push(m),!this.directed){var M=new T(g,c,d,s);this.nodeMap[c].addEdge(M),this.edgeLabelMap[s].push(M)}}},v}();N.Graph=p},28961:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=F(99938),U=T(F(26696)),L=T(F(96638)),_=T(F(115)),I=F(82890);function T(G){return G&&G.__esModule?G:{default:G}}var x=function(W,H,Z,J){Z===void 0&&(Z="cluster"),J===void 0&&(J=2);var K=[],ne=W.nodes;return H.forEach(function(se,fe){K.push(p(ne,se,fe,Z,J))}),K},p=function(W,H,Z,J,K){var ne=[Z],se=[],fe={};return H.forEach(function(Ie,ye){if(Ie<=K&&Z!==ye){ne.push(ye),se.push(W[ye]);var Ae=W[ye][J];fe[Ae]?(fe[Ae].count++,fe[Ae].dists.push(Ie)):fe[Ae]={count:1,dists:[Ie]}}}),Object.keys(fe).forEach(function(Ie){fe[Ie].dists=fe[Ie].dists.sort(function(ye,Ae){return ye-Ae})}),{nodeIdx:Z,nodeId:W[Z].id,nodeIdxs:ne,neighbors:se,neighborNum:ne.length-1,nodeLabelCountMap:fe}},v=function(W,H,Z,J,K){var ne=Math.ceil(Z/H),se={},fe=0;return J.forEach(function(Ie,ye){for(var Ae=0,Se=0,we=Ie.nodeIdxs,Te=Ie.neighborNum-1;Ae<ne;){for(var ke=we[1+Math.floor(Math.random()*Te)],Ge=0;(se["".concat(ye,"-").concat(ke)]||se["".concat(ke,"-").concat(ye)])&&(ke=Math.floor(Math.random()*H),Ge++,!(Ge>2*H)););if(Ge<2*H&&(se["".concat(ye,"-").concat(ke)]={start:ye,end:ke,distance:K[ye][ke]},Ae++,fe++,fe>=Z))return se;if(Se++,Se>2*H)break}if(Ae<ne){var tt=ne-Ae;ne=(ne+tt)/(H-ye-1)}}),se},g=function(W,H,Z,J){var K=Z.nodes;return J||(J={}),Object.keys(W).forEach(function(ne){var se,fe;if(!(J&&J[ne])){J[ne]={nodes:[],edges:[]};var Ie=W[ne],ye=(se=H[Ie.start])===null||se===void 0?void 0:se.nodeIdxs,Ae=(fe=H[Ie.end])===null||fe===void 0?void 0:fe.nodeIdxs;if(!(!ye||!Ae)){var Se=new Set(Ae),we=ye.filter(function(He){return Se.has(He)});if(!(!we||!we.length)){for(var Te={},ke=we.length,Ge=0;Ge<ke;Ge++){var tt=K[we[Ge]];J[ne].nodes.push(tt),Te[tt.id]=!0}Z.edges.forEach(function(He){Te[He.source]&&Te[He.target]&&J[ne].edges.push(He)})}}}}),J},d=function(W,H,Z,J){var K,ne,se={};W.nodes.forEach(function(Ie){se[Ie.id]=Ie});var fe=0;return!(!((K=H==null?void 0:H.edges)===null||K===void 0)&&K.length)||((ne=H==null?void 0:H.nodes)===null||ne===void 0?void 0:ne.length)<2?0:(W.edges.forEach(function(Ie){var ye=se[Ie.source][Z],Ae=se[Ie.target][Z],Se=H==null?void 0:H.nodes[0][Z],we=H==null?void 0:H.nodes[1][Z],Te=H==null?void 0:H.edges[0][J];Ie[J]===Te&&(ye===Se&&Ae===we||ye===we&&Ae===Se)&&fe++}),fe)},c=function(W,H,Z){for(var J=1/0,K=0,ne=function(Ie){var ye=W[Ie],Ae=Object.keys(ye).sort(function(He,ft){return ye[He]-ye[ft]}),Se=10,we=[];Ae.forEach(function(He,ft){we[ft%Se]||(we[ft%Se]={graphs:[],totalCount:0,aveCount:0}),we[ft%Se].graphs.push(He),we[ft%Se].totalCount+=ye[He]});var Te=0,ke=[];we.forEach(function(He){var ft=He.totalCount/He.graphs.length;He.aveCount=ft,ke.push(ft);var Lt=0,Jt=He.length;He.graphs.forEach(function(Qe,ut){var xt=ye[Qe];He.graphs.forEach(function(dt,pt){ut!==pt&&(Lt+=Math.abs(xt-ye[dt]))})}),Lt/=Jt*(Jt-1)/2,Te+=Lt}),Te/=we.length;var Ge=0;ke.forEach(function(He,ft){ke.forEach(function(Lt,Jt){ft!==Jt&&(Ge+=Math.abs(He-Lt))}),Ge/=ke.length*(ke.length-1)/2});var tt=Ge-Te;J<tt&&(J=tt,K=Ie)},se=0;se<H;se++)ne(se);return{structure:Z[K],structureCountMap:W[K]}},s=function(W,H){var Z={},J={};return W.forEach(function(K,ne){Z[K.id]={idx:ne,node:K,degree:0,inDegree:0,outDegree:0};var se=K[H];J[se]||(J[se]=[]),J[se].push(K)}),{nodeMap:Z,nodeLabelMap:J}},m=function(W,H,Z){var J={},K={};return W.forEach(function(ne,se){J["".concat(I.uniqueId)]={idx:se,edge:ne};var fe=ne[H];K[fe]||(K[fe]=[]),K[fe].push(ne);var Ie=Z[ne.source];Ie&&(Ie.degree++,Ie.outDegree++);var ye=Z[ne.target];ye&&(ye.degree++,ye.inDegree++)}),{edgeMap:J,edgeLabelMap:K}},M=function(W,H,Z){var J=H.length,K={};return H.forEach(function(ne,se){for(var fe=Z?0:se+1,Ie=W[se].id,ye=fe;ye<J;ye++)if(se!==ye){var Ae=W[ye].id,Se=ne[ye];K["".concat(Ie,"-").concat(Ae)]=Se,Z||(K["".concat(Ae,"-").concat(Ie)]=Se)}}),K},P=function(W,H,Z,J,K,ne,se,fe,Ie,ye,Ae){var Se,we="".concat(H.id,"-").concat(Z.id);if(ye&&ye[we])return ye[we];var Te=Ae?Ae[we]:void 0;if(!Te){var ke=(Se={},Se[we]={start:J[H.id].idx,end:J[Z.id].idx,distance:K},Se);Ae=g(ke,ne,W,Ae),Te=Ae[we]}return d(Te,se,fe,Ie)},R=function(W,H,Z,J){var K,ne,se,fe=(K=W[H])===null||K===void 0?void 0:K.degree,Ie=(ne=W[H])===null||ne===void 0?void 0:ne.inDegree,ye=(se=W[H])===null||se===void 0?void 0:se.outDegree;return W[H]===void 0&&(fe=1/0,Ie=1/0,ye=1/0,J[H].forEach(function(Ae){var Se=Z[Ae.id].degree;fe>Se&&(fe=Se);var we=Z[Ae.id].inDegree;Ie>we&&(Ie=we);var Te=Z[Ae.id].outDegree;ye>Te&&(ye=Te)}),W[H]={degree:fe,inDegree:Ie,outDegree:ye}),{minPatternNodeLabelDegree:fe,minPatternNodeLabelInDegree:Ie,minPatternNodeLabelOutDegree:ye}},j=function(W,H,Z,J,K,ne,se){var fe;if(Z===void 0&&(Z=!1),ne===void 0&&(ne="cluster"),se===void 0&&(se="cluster"),!(!W||!W.nodes)){var Ie=W.nodes.length;if(Ie){var ye=(0,U.default)(W,Z),Ae=(0,U.default)(H,Z),Se=M(W.nodes,ye,Z),we=M(H.nodes,Ae,Z),Te=s(W.nodes,ne),ke=Te.nodeMap,Ge=Te.nodeLabelMap,tt=s(H.nodes,ne),He=tt.nodeMap,ft=tt.nodeLabelMap;m(W.edges,se,ke);var Lt=m(H.edges,se,He).edgeLabelMap,Jt=[];Ae==null||Ae.forEach(function(jr){Jt=Jt.concat(jr)}),K||(K=Math.max.apply(Math,(0,k.__spreadArray)((0,k.__spreadArray)([],Jt,!1),[2],!1))),J||(J=K);var Qe=x(W,ye,ne,J),ut=x(H,Ae,ne,J),xt=Math.min(100,Ie*(Ie-1)/2),dt=v(J,Ie,xt,Qe,ye),pt=g(dt,Qe,W),wt=10,mt=1,ur=1,Ir=4,Nr={graphs:pt,nodeLabelProp:ne,edgeLabelProp:se,minSupport:mt,minNodeNum:ur,maxNodeNum:Ir,directed:Z},Hr=(0,L.default)(Nr).slice(0,wt),It=Hr.length,qt=[];Hr.forEach(function(jr,xn){qt[xn]={},Object.keys(pt).forEach(function(vn){var un=pt[vn],Wn=d(un,jr,ne,se);qt[xn][vn]=Wn})});var ar=c(qt,It,Hr),Oe=ar.structure,Pr=ar.structureCountMap,Cr=H.nodes[0],Gr=[],mr=(fe=H.nodes[0])===null||fe===void 0?void 0:fe[ne],rn=-1/0;H.nodes.forEach(function(jr){var xn=jr[ne],vn=Ge[xn];(vn==null?void 0:vn.length)>rn&&(rn=vn.length,Gr=vn,mr=xn,Cr=jr)});var Sr={},qr={},Rn={},yn={},zr={},Rt={};Object.keys(ft).forEach(function(jr,xn){zr[jr]=[],Z&&(Rt[jr]=[]);var vn=-1/0,un=ft[jr],Wn={};un.forEach(function(b){var S=we["".concat(Cr.id,"-").concat(b.id)];if(S&&zr[jr].push(S),vn<S&&(vn=S),Wn["".concat(Cr.id,"-").concat(b.id)]={start:0,end:He[b.id].idx,distance:S},Z){var X=we["".concat(b.id,"-").concat(Cr.id)];X&&Rt[jr].push(X)}}),zr[jr]=zr[jr].sort(function(b,S){return b-S}),Z&&(Rt[jr]=Rt[jr].sort(function(b,S){return b-S})),qr=g(Wn,ut,H,qr);var Y=[];if(Object.keys(Wn).forEach(function(b){if(Rn[b]){Y.push(Rn[b]);return}var S=qr[b];Rn[b]=d(S,Oe,ne,se),Y.push(Rn[b])}),Y=Y.sort(function(b,S){return S-b}),yn["".concat(Cr.id,"-").concat(jr)]=Y,jr!==mr)for(var ie=(Gr==null?void 0:Gr.length)||0,ee=function(S){var X=Gr[S],pe=Qe[ke[X.id].idx],Me=pe.nodeLabelCountMap[jr],me=ft[jr].length;if(!Me||Me.count<me)return Gr.splice(S,1),"continue";for(var Le=!1,st=0;st<me;st++)if(Me.dists[st]>zr[jr][st]){Le=!0;break}if(Le)return Gr.splice(S,1),"continue";var qe={};pe.neighbors.forEach(function(Ft){var er=Se["".concat(X.id,"-").concat(Ft.id)];qe["".concat(X.id,"-").concat(Ft.id)]={start:ke[X.id].idx,end:ke[Ft.id].idx,distance:er}}),pt=g(qe,Qe,W,pt);var Nt=[];Object.keys(qe).forEach(function(Ft){if(Pr[Ft]){Nt.push(Pr[Ft]);return}var er=pt[Ft];Pr[Ft]=d(er,Oe,ne,se),Nt.push(Pr[Ft])}),Nt=Nt.sort(function(Ft,er){return er-Ft});for(var nr=!1,st=0;st<me;st++)if(Nt[st]<Y[st]){nr=!0;break}if(nr)return Gr.splice(S,1),"continue"},C=ie-1;C>=0;C--)ee(C)});var zt=[];Gr==null||Gr.forEach(function(jr){for(var xn=ke[jr.id].idx,vn=p(W.nodes,ye[xn],xn,ne,K),un=vn.neighbors,Wn=un.length,Y=!1,ie=Wn-1;ie>=0;ie--){if(un.length+1<H.nodes.length){Y=!0;return}var ee=un[ie],C=ee[ne];if(!ft[C]||!ft[C].length){un.splice(ie,1);continue}if(!zr[C]||!zr[C].length){un.splice(ie,1);continue}var b="".concat(jr.id,"-").concat(ee.id),S=Se[b],X=zr[C].length-1,pe=zr[C][X];if(S>pe){un.splice(ie,1);continue}if(Z){var Me="".concat(ee.id,"-").concat(jr.id),me=Se[Me];X=Rt[C].length-1;var Le=Rt[C][X];if(me>Le){un.splice(ie,1);continue}}var st=Pr[b]?Pr[b]:P(W,jr,ee,ke,S,Qe,Oe,ne,se,Pr,pt),qe="".concat(Cr.id,"-").concat(C),Nt=yn[qe][yn[qe].length-1];if(st<Nt){un.splice(ie,1);continue}var nr=R(Sr,C,He,ft),Ft=nr.minPatternNodeLabelDegree,er=nr.minPatternNodeLabelInDegree,Ur=nr.minPatternNodeLabelOutDegree;if(ke[ee.id].degree<Ft){un.splice(ie,1);continue}}Y||zt.push({nodes:[jr].concat(un)})});var Vt=(0,_.default)(H,Cr.id,!1).length,hr={};Z?(Object.keys(Vt).forEach(function(jr){var xn=He[jr].node[ne];hr[xn]?hr[xn].push(Vt[jr]):hr[xn]=[Vt[jr]]}),Object.keys(hr).forEach(function(jr){hr[jr].sort(function(xn,vn){return xn-vn})})):hr=zr;for(var Ar=zt.length,en=function(xn){var vn=zt[xn],un=vn.nodes[0],Wn={},Y={};vn.nodes.forEach(function(In,at){Y[In.id]={idx:at,node:In,degree:0,inDegree:0,outDegree:0};var D=In[ne];Wn[D]?Wn[D]++:Wn[D]=1});var ie=[],ee={};W.edges.forEach(function(In){Y[In.source]&&Y[In.target]&&(ie.push(In),ee[In[se]]?ee[In[se]]++:ee[In[se]]=1,Y[In.source].degree++,Y[In.target].degree++,Y[In.source].outDegree++,Y[In.target].inDegree++)});for(var C=Object.keys(Lt).length,b=!1,S=0;S<C;S++){var X=Object.keys(Lt)[S];if(!ee[X]||ee[X]<Lt[X].length){b=!0;break}}if(b)return zt.splice(xn,1),"continue";var pe=ie.length;if(pe<H.edges.length)return zt.splice(xn,1),"break";for(var Me=!1,me=function(at){var D=ie[at],te=D[se],xe=Lt[te];if(!xe||!xe.length)return ee[te]--,xe&&ee[te]<xe.length?(Me=!0,"break"):(ie.splice(at,1),Y[D.source].degree--,Y[D.target].degree--,Y[D.source].outDegree--,Y[D.target].inDegree--,"continue");var be=Y[D.source].node[ne],De=Y[D.target].node[ne],Xe=!1;if(xe.forEach(function(Je){var lt=He[Je.source].node,Tt=He[Je.target].node;lt[ne]===be&&Tt[ne]===De&&(Xe=!0),!Z&&lt[ne]===De&&Tt[ne]===be&&(Xe=!0)}),!Xe)return ee[te]--,xe&&ee[te]<xe.length?(Me=!0,"break"):(ie.splice(at,1),Y[D.source].degree--,Y[D.target].degree--,Y[D.source].outDegree--,Y[D.target].inDegree--,"continue")},S=pe-1;S>=0;S--){var Le=me(S);if(Le==="break")break}if(Me)return zt.splice(xn,1),"continue";vn.edges=ie;var st=(0,_.default)(vn,vn.nodes[0].id,!1).length;if(Object.keys(st).reverse().forEach(function(In){if(!(In===vn.nodes[0].id||Me)){if(st[In]===1/0){var at=Y[In].node[ne];if(Wn[at]--,Wn[at]<ft[at].length){Me=!0;return}var D=vn.nodes.indexOf(Y[In].node);vn.nodes.splice(D,1),Y[In]=void 0;return}var te=ke[In].node[ne];if(!hr[te]||!hr[te].length||st[In]>hr[te][hr[te].length-1]){var at=Y[In].node[ne];if(Wn[at]--,Wn[at]<ft[at].length){Me=!0;return}var D=vn.nodes.indexOf(Y[In].node);vn.nodes.splice(D,1),Y[In]=void 0}}}),Me)return zt.splice(xn,1),"continue";for(var qe=!0,Nt=0;qe&&!Me;){qe=!1;var nr=Z?Y[un.id].degree<He[Cr.id].degree||Y[un.id].inDegree<He[Cr.id].inDegree||Y[un.id].outDegree<He[Cr.id].outDegree:Y[un.id].degree<He[Cr.id].degree;if(nr){Me=!0;break}if(Wn[un[ne]]<ft[un[ne]].length){Me=!0;break}for(var Ft=vn.nodes.length,er=Ft-1;er>=0;er--){var Ur=vn.nodes[er],Ct=Y[Ur.id].degree,Kt=Y[Ur.id].inDegree,lr=Y[Ur.id].outDegree,Dr=Ur[ne],br=R(Sr,Dr,He,ft),sa=br.minPatternNodeLabelDegree,ea=br.minPatternNodeLabelInDegree,gn=br.minPatternNodeLabelOutDegree,Tn=Z?Ct<sa||Kt<ea||lr<gn:Ct<sa;if(Tn){if(Wn[Ur[ne]]--,Wn[Ur[ne]]<ft[Ur[ne]].length){Me=!0;break}vn.nodes.splice(er,1),Y[Ur.id]=void 0,qe=!0}}if(Me||!qe&&Nt!==0)break;pe=ie.length;for(var ra=pe-1;ra>=0;ra--){var Zn=ie[ra];if(!Y[Zn.source]||!Y[Zn.target]){ie.splice(ra,1);var Vr=Zn[se];if(ee[Vr]--,Y[Zn.source]&&(Y[Zn.source].degree--,Y[Zn.source].outDegree--),Y[Zn.target]&&(Y[Zn.target].degree--,Y[Zn.target].inDegree--),Lt[Vr]&&ee[Vr]<Lt[Vr].length){Me=!0;break}qe=!0}}Nt++}if(Me||Me||vn.nodes.length<H.nodes.length||ie.length<H.edges.length)return zt.splice(xn,1),"continue"},Fr=Ar-1;Fr>=0;Fr--){var Cn=en(Fr);if(Cn==="break")break}for(var Sn=zt.length,oa=function(xn){var vn=zt[xn],un={};vn.edges.forEach(function(ie){var ee="".concat(ie.source,"-").concat(ie.target,"-").concat(ie.label);un[ee]?un[ee]++:un[ee]=1});for(var Wn=function(ee){var C=zt[ee],b={};C.edges.forEach(function(X){var pe="".concat(X.source,"-").concat(X.target,"-").concat(X.label);b[pe]?b[pe]++:b[pe]=1});var S=!0;Object.keys(b).length!==Object.keys(un).length?S=!1:Object.keys(un).forEach(function(X){b[X]!==un[X]&&(S=!1)}),S&&zt.splice(ee,1)},Y=Sn-1;Y>xn;Y--)Wn(Y);Sn=zt.length},Fr=0;Fr<=Sn-1;Fr++)oa(Fr);return zt}}},Q=j;N.default=Q},35470:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=L(F(3982)),U=F(82890);function L(T){return T&&T.__esModule?T:{default:T}}var _=function(x,p,v,g){p===void 0&&(p=!1),v===void 0&&(v="weight"),g===void 0&&(g=1e3);var d=x.nodes,c=d===void 0?[]:d,s=x.edges,m=s===void 0?[]:s,M={},P={};c.forEach(function(ne,se){var fe=(0,U.uniqueId)();ne.clusterId=fe,M[fe]={id:fe,nodes:[ne]},P[ne.id]={node:ne,idx:se}});var R=(0,k.default)(x,p),j=[],Q={};R.forEach(function(ne,se){var fe=0,Ie=c[se].id;Q[Ie]={},ne.forEach(function(ye,Ae){if(ye){fe+=ye;var Se=c[Ae].id;Q[Ie][Se]=ye}}),j.push(fe)});for(var G=0,W=function(){var se=!1;if(c.forEach(function(fe){var Ie={};Object.keys(Q[fe.id]).forEach(function(tt){var He=Q[fe.id][tt],ft=P[tt].node,Lt=ft.clusterId;Ie[Lt]||(Ie[Lt]=0),Ie[Lt]+=He});var ye=-1/0,Ae=[];if(Object.keys(Ie).forEach(function(tt){ye<Ie[tt]?(ye=Ie[tt],Ae=[tt]):ye===Ie[tt]&&Ae.push(tt)}),!(Ae.length===1&&Ae[0]===fe.clusterId)){var Se=Ae.indexOf(fe.clusterId);if(Se>=0&&Ae.splice(Se,1),Ae&&Ae.length){se=!0;var we=M[fe.clusterId],Te=we.nodes.indexOf(fe);we.nodes.splice(Te,1);var ke=Math.floor(Math.random()*Ae.length),Ge=M[Ae[ke]];Ge.nodes.push(fe),fe.clusterId=Ge.id}}}),!se)return"break";G++};G<g;){var H=W();if(H==="break")break}Object.keys(M).forEach(function(ne){var se=M[ne];(!se.nodes||!se.nodes.length)&&delete M[ne]});var Z=[],J={};m.forEach(function(ne){var se=ne.source,fe=ne.target,Ie=ne[v]||1,ye=P[se].node.clusterId,Ae=P[fe].node.clusterId,Se="".concat(ye,"---").concat(Ae);if(J[Se])J[Se].weight+=Ie,J[Se].count++;else{var we={source:ye,target:Ae,weight:Ie,count:1};J[Se]=we,Z.push(we)}});var K=[];return Object.keys(M).forEach(function(ne){K.push(M[ne])}),{clusters:K,clusterEdges:Z}},I=_;N.default=I},12575:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=F(13526),U=T(F(3982)),L=T(F(48083)),_=F(24246),I=F(99505);function T(d){return d&&d.__esModule?d:{default:d}}var x=function(c,s,m,M){for(var P=s.length,R=2*M,j=0,Q=0;Q<P;Q++)for(var G=c[Q].clusterId,W=0;W<P;W++){var H=c[W].clusterId;if(G===H){var Z=s[Q][W]||0,J=m[Q]||0,K=m[W]||0;j+=Z-J*K/R}}return j*=1/R,j},p=function(c,s){c===void 0&&(c=[]);for(var m=c.length,M=new L.default([]),P=0;P<m;P++)M=M.add(new L.default(s[P]));var R=M.avg(m);R.normalize();for(var j=0,P=0;P<m;P++){var Q=new L.default(s[P]),G=Q.squareEuclideanDistance(R);j+=G}var W=[];c.forEach(function(){W.push([])});for(var P=0;P<m;P++){var Q=new L.default(s[P]);c[P].clusterInertial=0;for(var H=0;H<m;H++){if(P===H){W[P][H]=0;continue}var Z=new L.default(s[H]);W[P][H]=Q.squareEuclideanDistance(Z),c[P].clusterInertial+=W[P][H]}}for(var J=0,K=2*m*j,P=0;P<m;P++)for(var ne=c[P].clusterId,H=0;H<m;H++){var se=c[H].clusterId;if(!(P===H||ne!==se)){var fe=c[P].clusterInertial*c[H].clusterInertial/Math.pow(K,2)-W[P][H]/K;J+=fe}}return Number(J.toFixed(4))},v=function(c,s,m,M,P,R,j,Q,G){s===void 0&&(s=!1),m===void 0&&(m="weight"),M===void 0&&(M=1e-4),P===void 0&&(P=!1),R===void 0&&(R=void 0),j===void 0&&(j=[]),Q===void 0&&(Q=["id"]),G===void 0&&(G=1);var W=c.nodes,H=W===void 0?[]:W,Z=c.edges,J=Z===void 0?[]:Z,K=[];if(P){H.forEach(function(pt,wt){pt.properties=pt.properties||{},pt.originIndex=wt});var ne=[];H.every(function(pt){return pt.hasOwnProperty("nodeType")})&&(ne=Array.from(new Set(H.map(function(pt){return pt.nodeType}))),H.forEach(function(pt){pt.properties.nodeType=ne.findIndex(function(wt){return wt===pt.nodeType})}));var se=(0,_.getAllProperties)(H,R);K=(0,I.oneHot)(se,j,Q)}var fe=1,Ie={},ye={};H.forEach(function(pt,wt){var mt=String(fe++);pt.clusterId=mt,Ie[mt]={id:mt,nodes:[pt]},ye[pt.id]={node:pt,idx:wt}});var Ae=(0,U.default)(c,s),Se=[],we={},Te=0;Ae.forEach(function(pt,wt){var mt=0,ur=H[wt].id;we[ur]={},pt.forEach(function(Ir,Nr){if(Ir){mt+=Ir;var Hr=H[Nr].id;we[ur][Hr]=Ir,Te+=Ir}}),Se.push(mt)}),Te/=2;for(var ke=1/0,Ge=1/0,tt=0,He=[],ft={};;){P&&H.every(function(pt){return pt.hasOwnProperty("properties")})?ke=x(H,Ae,Se,Te)+p(H,K)*G:ke=x(H,Ae,Se,Te),tt===0&&(Ge=ke,He=H,ft=Ie);var Lt=ke>0&&ke>Ge&&ke-Ge<M;if(ke>Ge&&(He=H.map(function(pt){return{node:pt,clusterId:pt.clusterId}}),ft=(0,k.clone)(Ie),Ge=ke),Lt||tt>100)break;tt++,Object.keys(Ie).forEach(function(pt){var wt=0;J.forEach(function(mt){var ur=mt.source,Ir=mt.target,Nr=ye[ur].node.clusterId,Hr=ye[Ir].node.clusterId;(Nr===pt&&Hr!==pt||Hr===pt&&Nr!==pt)&&(wt=wt+(mt[m]||1))}),Ie[pt].sumTot=wt}),H.forEach(function(pt,wt){var mt=Ie[pt.clusterId],ur=0,Ir,Nr=Se[wt]/(2*Te),Hr=0,It=mt.nodes;It.forEach(function(qr){var Rn=ye[qr.id].idx;Hr+=Ae[wt][Rn]||0});var qt=Hr-mt.sumTot*Nr,ar=It.filter(function(qr){return qr.id!==pt.id}),Oe=[];ar.forEach(function(qr,Rn){Oe[Rn]=K[qr.originIndex]});var Pr=p(ar,K)*G,Cr=we[pt.id];if(Object.keys(Cr).forEach(function(qr){var Rn=ye[qr].node,yn=Rn.clusterId;if(yn!==pt.clusterId){var zr=Ie[yn],Rt=zr.nodes;if(!(!Rt||!Rt.length)){var zt=0;Rt.forEach(function(Cn){var Sn=ye[Cn.id].idx;zt+=Ae[wt][Sn]||0});var Vt=zt-zr.sumTot*Nr,hr=Rt.concat([pt]),Ar=[];hr.forEach(function(Cn,Sn){Ar[Sn]=K[Cn.originIndex]});var en=p(hr,K)*G,Fr=Vt-qt;P&&(Fr=Vt+en-(qt+Pr)),Fr>ur&&(ur=Fr,Ir=zr)}}}),ur>0){Ir.nodes.push(pt);var Gr=pt.clusterId;pt.clusterId=Ir.id;var mr=mt.nodes.indexOf(pt);mt.nodes.splice(mr,1);var rn=0,Sr=0;J.forEach(function(qr){var Rn=qr.source,yn=qr.target,zr=ye[Rn].node.clusterId,Rt=ye[yn].node.clusterId;(zr===Ir.id&&Rt!==Ir.id||Rt===Ir.id&&zr!==Ir.id)&&(rn=rn+(qr[m]||1)),(zr===Gr&&Rt!==Gr||Rt===Gr&&zr!==Gr)&&(Sr=Sr+(qr[m]||1))}),Ir.sumTot=rn,mt.sumTot=Sr}})}var Jt={},Qe=0;Object.keys(ft).forEach(function(pt){var wt=ft[pt];if(!wt.nodes||!wt.nodes.length){delete ft[pt];return}var mt=String(Qe+1);mt!==pt&&(wt.id=mt,wt.nodes=wt.nodes.map(function(ur){return{id:ur.id,clusterId:mt}}),ft[mt]=wt,Jt[pt]=mt,delete ft[pt],Qe++)}),He.forEach(function(pt){var wt=pt.node,mt=pt.clusterId;wt&&(wt.clusterId=mt,wt.clusterId&&Jt[wt.clusterId]&&(wt.clusterId=Jt[wt.clusterId]))});var ut=[],xt={};J.forEach(function(pt){var wt=pt.source,mt=pt.target,ur=pt[m]||1,Ir=ye[wt].node.clusterId,Nr=ye[mt].node.clusterId;if(!(!Ir||!Nr)){var Hr="".concat(Ir,"---").concat(Nr);if(xt[Hr])xt[Hr].weight+=ur,xt[Hr].count++;else{var It={source:Ir,target:Nr,weight:ur,count:1};xt[Hr]=It,ut.push(It)}}});var dt=[];return Object.keys(ft).forEach(function(pt){dt.push(ft[pt])}),{clusters:dt,clusterEdges:ut}},g=v;N.default=g},62663:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=_(F(92392)),U=_(F(6331)),L=F(82890);function _(v){return v&&v.__esModule?v:{default:v}}var I=function(g,d){var c=[],s=g.nodes,m=s===void 0?[]:s,M=g.edges,P=M===void 0?[]:M;if(m.length===0)return c;var R=m[0],j=new Set;j.add(R);var Q=function(K,ne){return d?K.weight-ne.weight:0},G=new U.default(Q);for((0,L.getEdgesByNodeId)(R.id,P).forEach(function(J){G.insert(J)});!G.isEmpty();){var W=G.delMin(),H=W.source,Z=W.target;j.has(H)&&j.has(Z)||(c.push(W),j.has(H)||(j.add(H),(0,L.getEdgesByNodeId)(H,P).forEach(function(J){G.insert(J)})),j.has(Z)||(j.add(Z),(0,L.getEdgesByNodeId)(Z,P).forEach(function(J){G.insert(J)})))}return c},T=function(g,d){var c=[],s=g.nodes,m=s===void 0?[]:s,M=g.edges,P=M===void 0?[]:M;if(m.length===0)return c;var R=P.map(function(H){return H});d&&R.sort(function(H,Z){return H.weight-Z.weight});for(var j=new k.default(m.map(function(H){return H.id}));R.length>0;){var Q=R.shift(),G=Q.source,W=Q.target;j.connected(G,W)||(c.push(Q),j.union(G,W))}return c},x=function(g,d,c){var s={prim:I,kruskal:T};return c?s[c](g,d):T(g,d)},p=x;N.default=p},90300:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=L(F(53838)),U=F(82890);function L(T){return T&&T.__esModule?T:{default:T}}var _=function(x,p,v){typeof p!="number"&&(p=1e-6),typeof v!="number"&&(v=.85);for(var g=1,d=0,c=1e3,s=x.nodes,m=s===void 0?[]:s,M=x.edges,P=M===void 0?[]:M,R=m.length,j,Q={},G={},W=0;W<R;++W){var H=m[W],Z=H.id;Q[Z]=1/R,G[Z]=1/R}for(var J=(0,k.default)(x);c>0&&g>p;){d=0;for(var W=0;W<R;++W){var H=m[W],Z=H.id;if(j=0,J[H.id].inDegree===0)Q[Z]=0;else{for(var K=(0,U.getNeighbors)(Z,P,"source"),ne=0;ne<K.length;++ne){var se=K[ne],fe=J[se].outDegree;fe>0&&(j+=G[se]/fe)}Q[Z]=v*j,d+=Q[Z]}}d=(1-d)/R,g=0;for(var W=0;W<R;++W){var H=m[W],Z=H.id;j=Q[Z]+d,g+=Math.abs(j-G[Z]),G[Z]=j}c-=1}return G},I=_;N.default=I},6331:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var F=function(_,I){return _-I},k=function(){function L(_){_===void 0&&(_=F),this.compareFn=_,this.list=[]}return L.prototype.getLeft=function(_){return 2*_+1},L.prototype.getRight=function(_){return 2*_+2},L.prototype.getParent=function(_){return _===0?null:Math.floor((_-1)/2)},L.prototype.isEmpty=function(){return this.list.length<=0},L.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},L.prototype.delMin=function(){var _=this.top(),I=this.list.pop();return this.list.length>0&&(this.list[0]=I,this.moveDown(0)),_},L.prototype.insert=function(_){if(_!==null){this.list.push(_);var I=this.list.length-1;return this.moveUp(I),!0}return!1},L.prototype.moveUp=function(_){for(var I=this.getParent(_);_&&_>0&&this.compareFn(this.list[I],this.list[_])>0;){var T=this.list[I];this.list[I]=this.list[_],this.list[_]=T,_=I,I=this.getParent(_)}},L.prototype.moveDown=function(_){var I,T=_,x=this.getLeft(_),p=this.getRight(_),v=this.list.length;x!==null&&x<v&&this.compareFn(this.list[T],this.list[x])>0?T=x:p!==null&&p<v&&this.compareFn(this.list[T],this.list[p])>0&&(T=p),_!==T&&(I=[this.list[T],this.list[_]],this.list[_]=I[0],this.list[T]=I[1],this.moveDown(T))},L}(),U=k;N.default=U},69304:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=N.LinkedListNode=void 0;var F=function(I,T){return I===T},k=function(){function _(I,T){T===void 0&&(T=null),this.value=I,this.next=T}return _.prototype.toString=function(I){return I?I(this.value):"".concat(this.value)},_}();N.LinkedListNode=k;var U=function(){function _(I){I===void 0&&(I=F),this.head=null,this.tail=null,this.compare=I}return _.prototype.prepend=function(I){var T=new k(I,this.head);return this.head=T,this.tail||(this.tail=T),this},_.prototype.append=function(I){var T=new k(I);return this.head?(this.tail.next=T,this.tail=T,this):(this.head=T,this.tail=T,this)},_.prototype.delete=function(I){if(!this.head)return null;for(var T=null;this.head&&this.compare(this.head.value,I);)T=this.head,this.head=this.head.next;var x=this.head;if(x!==null)for(;x.next;)this.compare(x.next.value,I)?(T=x.next,x.next=x.next.next):x=x.next;return this.compare(this.tail.value,I)&&(this.tail=x),T},_.prototype.find=function(I){var T=I.value,x=T===void 0?void 0:T,p=I.callback,v=p===void 0?void 0:p;if(!this.head)return null;for(var g=this.head;g;){if(v&&v(g.value)||x!==void 0&&this.compare(g.value,x))return g;g=g.next}return null},_.prototype.deleteTail=function(){var I=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,I;for(var T=this.head;T.next;)T.next.next?T=T.next:T.next=null;return this.tail=T,I},_.prototype.deleteHead=function(){if(!this.head)return null;var I=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),I},_.prototype.fromArray=function(I){var T=this;return I.forEach(function(x){return T.append(x)}),this},_.prototype.toArray=function(){for(var I=[],T=this.head;T;)I.push(T),T=T.next;return I},_.prototype.reverse=function(){for(var I=this.head,T=null,x=null;I;)x=I.next,I.next=T,T=I,I=x;this.tail=this.head,this.head=T},_.prototype.toString=function(I){return I===void 0&&(I=void 0),this.toArray().map(function(T){return T.toString(I)}).toString()},_}(),L=U;N.default=L},10780:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=U(F(69304));function U(I){return I&&I.__esModule?I:{default:I}}var L=function(){function I(){this.linkedList=new k.default}return I.prototype.isEmpty=function(){return!this.linkedList.head},I.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},I.prototype.enqueue=function(T){this.linkedList.append(T)},I.prototype.dequeue=function(){var T=this.linkedList.deleteHead();return T?T.value:null},I.prototype.toString=function(T){return this.linkedList.toString(T)},I}(),_=L;N.default=_},92392:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var F=function(){function U(L){this.count=L.length,this.parent={};for(var _=0,I=L;_<I.length;_++){var T=I[_];this.parent[T]=T}}return U.prototype.find=function(L){for(;this.parent[L]!==L;)L=this.parent[L];return L},U.prototype.union=function(L,_){var I=this.find(L),T=this.find(_);I!==T&&(I<T?(this.parent[_]!==_&&this.union(this.parent[_],L),this.parent[_]=this.parent[L]):(this.parent[L]!==L&&this.union(this.parent[L],_),this.parent[L]=this.parent[_]))},U.prototype.connected=function(L,_){return this.find(L)===this.find(_)},U}(),k=F;N.default=k},86272:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.DistanceType=void 0;var F;N.DistanceType=F,function(k){k.EuclideanDistance="euclideanDistance"}(F||(N.DistanceType=F={}))},82890:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.uniqueId=N.getOutEdgesNodeId=N.getNeighbors=N.getEdgesByNodeId=void 0;var F=function(I,T,x){T===void 0&&(T=[]);var p=T.filter(function(c){return c.source===I||c.target===I});if(x==="target"){var v=function(s){return s.source===I};return p.filter(v).map(function(c){return c.target})}if(x==="source"){var g=function(s){return s.target===I};return p.filter(g).map(function(c){return c.source})}var d=function(s){return s.source===I?s.target:s.source};return p.map(d)};N.getNeighbors=F;var k=function(I,T){return T.filter(function(x){return x.source===I})};N.getOutEdgesNodeId=k;var U=function(I,T){return T.filter(function(x){return x.source===I||x.target===I})};N.getEdgesByNodeId=U;var L=function(I){I===void 0&&(I=0);var T="".concat(Math.random()).split(".")[1].substr(0,5),x="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(I,"-").concat(T).concat(x)};N.uniqueId=L},99505:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.oneHot=N.getDistance=N.getAllKeyValueMap=N.default=void 0;var k=F(13526),U=F(86272),L=_(F(48083));function _(v){return v&&v.__esModule?v:{default:v}}var I=function(g,d,c){var s=[];d!=null&&d.length?s=d:(g.forEach(function(M){s=s.concat(Object.keys(M))}),s=(0,k.uniq)(s));var m={};return s.forEach(function(M){var P=[];g.forEach(function(R){R[M]!==void 0&&R[M]!==""&&P.push(R[M])}),P.length&&!(c!=null&&c.includes(M))&&(m[M]=(0,k.uniq)(P))}),m};N.getAllKeyValueMap=I;var T=function(g,d,c){var s=I(g,d,c),m=[];if(!Object.keys(s).length)return m;var M=Object.values(s),P=M.every(function(R){return R.every(function(j){return typeof j=="number"})});return g.forEach(function(R,j){var Q=[];Object.keys(s).forEach(function(G){var W=R[G],H=s[G],Z=H.findIndex(function(ne){return W===ne}),J=[];if(P)J.push(W);else for(var K=0;K<H.length;K++)K===Z?J.push(1):J.push(0);Q=Q.concat(J)}),m[j]=Q}),m};N.oneHot=T;var x=function(g,d,c,s){c===void 0&&(c=U.DistanceType.EuclideanDistance);var m=0;switch(c){case U.DistanceType.EuclideanDistance:m=new L.default(g).euclideanDistance(new L.default(d));break;default:break}return m};N.getDistance=x;var p={getAllKeyValueMap:I,oneHot:T,getDistance:x};N.default=p},24246:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.getPropertyWeight=N.getAllSortProperties=N.getAllProperties=N.default=void 0;var k=F(53279),U=function(p,v){p===void 0&&(p=[]),v===void 0&&(v=100);var g={};p.forEach(function(c){c.properties&&Object.keys(c.properties).forEach(function(s){if(s==="id"||!"".concat(c.properties[s]).match(k.secondReg)&&!"".concat(c.properties[s]).match(k.dateReg)&&isNaN(Number(c.properties[s]))){g.hasOwnProperty(s)&&delete g[s];return}g.hasOwnProperty(s)?g[s]+=1:g[s]=1})});var d=Object.keys(g).sort(function(c,s){return g[s]-g[c]});return d.length<v?d:d.slice(0,v)};N.getAllSortProperties=U;var L=function(p,v){return v.map(function(g){return p.hasOwnProperty(g)?p[g]:0})},_=function(p){for(var v=U(p),g=[],d=0;d<p.length;d++)g[d]=L(p[d].properties,v);return g};N.getPropertyWeight=_;var I=function(p,v){v===void 0&&(v=void 0);var g=[];return p.forEach(function(d){v===void 0&&g.push(d),d[v]!==void 0&&g.push(d[v])}),g};N.getAllProperties=I;var T={getAllSortProperties:U,getPropertyWeight:_,getAllProperties:I};N.default=T},48083:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=F(13526),U=function(){function _(I){this.arr=I}return _.prototype.getArr=function(){return this.arr||[]},_.prototype.add=function(I){var T,x=I.arr;if(!(!((T=this.arr)===null||T===void 0)&&T.length))return new _(x);if(!(x!=null&&x.length))return new _(this.arr);if(this.arr.length===x.length){var p=[];for(var v in this.arr)p[v]=this.arr[v]+x[v];return new _(p)}},_.prototype.subtract=function(I){var T,x=I.arr;if(!(!((T=this.arr)===null||T===void 0)&&T.length))return new _(x);if(!(x!=null&&x.length))return new _(this.arr);if(this.arr.length===x.length){var p=[];for(var v in this.arr)p[v]=this.arr[v]-x[v];return new _(p)}},_.prototype.avg=function(I){var T=[];if(I!==0)for(var x in this.arr)T[x]=this.arr[x]/I;return new _(T)},_.prototype.negate=function(){var I=[];for(var T in this.arr)I[T]=-this.arr[T];return new _(I)},_.prototype.squareEuclideanDistance=function(I){var T,x=I.arr;if(!(!((T=this.arr)===null||T===void 0)&&T.length)||!(x!=null&&x.length))return 0;if(this.arr.length===x.length){var p=0;for(var v in this.arr)p+=Math.pow(this.arr[v]-I.arr[v],2);return p}},_.prototype.euclideanDistance=function(I){var T,x=I.arr;if(!(!((T=this.arr)===null||T===void 0)&&T.length)||!(x!=null&&x.length))return 0;if(this.arr.length===x.length){var p=0;for(var v in this.arr)p+=Math.pow(this.arr[v]-I.arr[v],2);return Math.sqrt(p)}else console.error("The two vectors are unequal in length.")},_.prototype.normalize=function(){var I=[],T=(0,k.clone)(this.arr);T.sort(function(g,d){return g-d});var x=T[T.length-1],p=T[0];for(var v in this.arr)I[v]=(this.arr[v]-p)/(x-p);return new _(I)},_.prototype.norm2=function(){var I;if(!(!((I=this.arr)===null||I===void 0)&&I.length))return 0;var T=0;for(var x in this.arr)T+=Math.pow(this.arr[x],2);return Math.sqrt(T)},_.prototype.dot=function(I){var T,x=I.arr;if(!(!((T=this.arr)===null||T===void 0)&&T.length)||!(x!=null&&x.length))return 0;if(this.arr.length===x.length){var p=0;for(var v in this.arr)p+=this.arr[v]*I.arr[v];return p}else console.error("The two vectors are unequal in length.")},_.prototype.equal=function(I){var T,x=I.arr;if(((T=this.arr)===null||T===void 0?void 0:T.length)!==(x==null?void 0:x.length))return!1;for(var p in this.arr)if(this.arr[p]!==x[p])return!1;return!0},_}(),L=U;N.default=L},16342:function(Mt,N,F){"use strict";function k(G){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},k(G)}Object.defineProperty(N,"__esModule",{value:!0}),Object.defineProperty(N,"GADDI",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(N,"breadthFirstSearch",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(N,"connectedComponent",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(N,"depthFirstSearch",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(N,"detectCycle",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(N,"dijkstra",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(N,"findAllPath",{enumerable:!0,get:function(){return v.findAllPath}}),Object.defineProperty(N,"findShortestPath",{enumerable:!0,get:function(){return v.findShortestPath}}),Object.defineProperty(N,"floydWarshall",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(N,"getAdjMatrix",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(N,"getDegree",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(N,"getInDegree",{enumerable:!0,get:function(){return I.getInDegree}}),Object.defineProperty(N,"getNeighbors",{enumerable:!0,get:function(){return P.getNeighbors}}),Object.defineProperty(N,"getOutDegree",{enumerable:!0,get:function(){return I.getOutDegree}}),Object.defineProperty(N,"labelPropagation",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(N,"louvain",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(N,"minimumSpanningTree",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(N,"pageRank",{enumerable:!0,get:function(){return m.default}});var U=Q(F(3982)),L=Q(F(39834)),_=Q(F(95482)),I=j(F(53838)),T=Q(F(94878)),x=Q(F(98773)),p=Q(F(115)),v=F(27538),g=Q(F(26696)),d=Q(F(35470)),c=Q(F(12575)),s=Q(F(62663)),m=Q(F(90300)),M=Q(F(28961)),P=F(82890);function R(G){if(typeof WeakMap!="function")return null;var W=new WeakMap,H=new WeakMap;return(R=function(J){return J?H:W})(G)}function j(G,W){if(!W&&G&&G.__esModule)return G;if(G===null||k(G)!=="object"&&typeof G!="function")return{default:G};var H=R(W);if(H&&H.has(G))return H.get(G);var Z={},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in G)if(K!=="default"&&Object.prototype.hasOwnProperty.call(G,K)){var ne=J?Object.getOwnPropertyDescriptor(G,K):null;ne&&(ne.get||ne.set)?Object.defineProperty(Z,K,ne):Z[K]=G[K]}return Z.default=G,H&&H.set(G,Z),Z}function Q(G){return G&&G.__esModule?G:{default:G}}},53410:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.MESSAGE=N.ALGORITHM=void 0;var F={pageRank:"pageRank",breadthFirstSearch:"breadthFirstSearch",connectedComponent:"connectedComponent",depthFirstSearch:"depthFirstSearch",detectCycle:"detectCycle",detectDirectedCycle:"detectDirectedCycle",detectAllCycles:"detectAllCycles",detectAllDirectedCycle:"detectAllDirectedCycle",detectAllUndirectedCycle:"detectAllUndirectedCycle",dijkstra:"dijkstra",findAllPath:"findAllPath",findShortestPath:"findShortestPath",floydWarshall:"floydWarshall",getAdjMatrix:"getAdjMatrix",getDegree:"getDegree",getInDegree:"getInDegree",getNeighbors:"getNeighbors",getOutDegree:"getOutDegree",labelPropagation:"labelPropagation",louvain:"louvain",GADDI:"GADDI",minimumSpanningTree:"minimumSpanningTree",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};N.ALGORITHM=F;var k={SUCCESS:"SUCCESS",FAILURE:"FAILURE"};N.MESSAGE=k},3693:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var k=F(53410),U=L(F(1652));function L(T){return T&&T.__esModule?T:{default:T}}var _=function(x){return function(){for(var p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];return new Promise(function(g,d){var c=new U.default;c.postMessage({_algorithmType:x,data:p}),c.onmessage=function(s){var m=s.data,M=m.data,P=m._algorithmType;k.MESSAGE.SUCCESS===P?g(M):d(),c.terminate()}})}},I=_;N.default=I},19690:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.pageRankAsync=N.minimumSpanningTreeAsync=N.louvainAsync=N.labelPropagationAsync=N.getOutDegreeAsync=N.getNeighborsAsync=N.getInDegreeAsync=N.getDegreeAsync=N.getAdjMatrixAsync=N.floydWarshallAsync=N.findShortestPathAsync=N.findAllPathAsync=N.dijkstraAsync=N.detectCycleAsync=N.detectAllUndirectedCycleAsync=N.detectAllDirectedCycleAsync=N.detectAllCyclesAsync=N.connectedComponentAsync=N.GADDIAsync=void 0;var k=L(F(3693)),U=F(53410);function L(Z){return Z&&Z.__esModule?Z:{default:Z}}var _=function(J,K){return(0,k.default)(U.ALGORITHM.getAdjMatrix).apply(void 0,[J,K])};N.getAdjMatrixAsync=_;var I=function(J,K){return(0,k.default)(U.ALGORITHM.connectedComponent).apply(void 0,[J,K])};N.connectedComponentAsync=I;var T=function(J){return(0,k.default)(U.ALGORITHM.getDegree)(J)};N.getDegreeAsync=T;var x=function(J,K){return(0,k.default)(U.ALGORITHM.getInDegree)(J,K)};N.getInDegreeAsync=x;var p=function(J,K){return(0,k.default)(U.ALGORITHM.getOutDegree)(J,K)};N.getOutDegreeAsync=p;var v=function(J){return(0,k.default)(U.ALGORITHM.detectCycle)(J)};N.detectCycleAsync=v;var g=function(J){return(0,k.default)(U.ALGORITHM.detectAllCycles)(J)};N.detectAllCyclesAsync=g;var d=function(J){return(0,k.default)(U.ALGORITHM.detectAllDirectedCycle)(J)};N.detectAllDirectedCycleAsync=d;var c=function(J){return(0,k.default)(U.ALGORITHM.detectAllUndirectedCycle)(J)};N.detectAllUndirectedCycleAsync=c;var s=function(J,K,ne,se){return(0,k.default)(U.ALGORITHM.dijkstra).apply(void 0,[J,K,ne,se])};N.dijkstraAsync=s;var m=function(J,K,ne,se){return(0,k.default)(U.ALGORITHM.findAllPath).apply(void 0,[J,K,ne,se])};N.findAllPathAsync=m;var M=function(J,K,ne,se,fe){return(0,k.default)(U.ALGORITHM.findShortestPath).apply(void 0,[J,K,ne,se,fe])};N.findShortestPathAsync=M;var P=function(J,K){return(0,k.default)(U.ALGORITHM.floydWarshall).apply(void 0,[J,K])};N.floydWarshallAsync=P;var R=function(J,K,ne,se){return se===void 0&&(se=1e3),(0,k.default)(U.ALGORITHM.labelPropagation)(J,K,ne,se)};N.labelPropagationAsync=R;var j=function(J,K,ne,se){return(0,k.default)(U.ALGORITHM.louvain)(J,K,ne,se)};N.louvainAsync=j;var Q=function(J,K,ne){return(0,k.default)(U.ALGORITHM.minimumSpanningTree).apply(void 0,[J,K,ne])};N.minimumSpanningTreeAsync=Q;var G=function(J,K,ne){return(0,k.default)(U.ALGORITHM.pageRank).apply(void 0,[J,K,ne])};N.pageRankAsync=G;var W=function(J,K,ne){return(0,k.default)(U.ALGORITHM.getNeighbors).apply(void 0,[J,K,ne])};N.getNeighborsAsync=W;var H=function(J,K,ne,se,fe,Ie,ye){return ne===void 0&&(ne=!1),Ie===void 0&&(Ie="cluster"),ye===void 0&&(ye="cluster"),(0,k.default)(U.ALGORITHM.GADDI).apply(void 0,[J,K,ne,se,fe,Ie,ye])};N.GADDIAsync=H},1652:function(Mt,N,F){"use strict";function k(p){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},k(p)}Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var U=I(F(16342)),L=F(53410);function _(p){if(typeof WeakMap!="function")return null;var v=new WeakMap,g=new WeakMap;return(_=function(c){return c?g:v})(p)}function I(p,v){if(!v&&p&&p.__esModule)return p;if(p===null||k(p)!=="object"&&typeof p!="function")return{default:p};var g=_(v);if(g&&g.has(p))return g.get(p);var d={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in p)if(s!=="default"&&Object.prototype.hasOwnProperty.call(p,s)){var m=c?Object.getOwnPropertyDescriptor(p,s):null;m&&(m.get||m.set)?Object.defineProperty(d,s,m):d[s]=p[s]}return d.default=p,g&&g.set(p,d),d}var T=typeof self!="undefined"?self:{};T.onmessage=function(p){var v=p.data,g=v._algorithmType,d=v.data;if(g){if(typeof U[g]=="function"){var c=U[g].apply(U,d);T.postMessage({_algorithmType:L.MESSAGE.SUCCESS,data:c});return}T.postMessage({_algorithmType:L.MESSAGE.FAILURE})}};var x=null;N.default=x},20199:function(Mt,N,F){"use strict";F.r(N),F.d(N,{Kernel:function(){return Ie},World:function(){return Wn}});var k=F(42700),U=F(40749),L=F(92711),_=F(37678),I=F(73806),T=F.n(I),x=F(59933),p=F.n(x),v=F(24669),g=F.n(v),d=F(15612),c=F.n(d),s=null,m=1;function M(){return m++}var P=null,R=null,j;(function(Y){Y[Y.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",Y[Y.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",Y[Y.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",Y[Y.POINTS=0]="POINTS",Y[Y.LINES=1]="LINES",Y[Y.LINE_LOOP=2]="LINE_LOOP",Y[Y.LINE_STRIP=3]="LINE_STRIP",Y[Y.TRIANGLES=4]="TRIANGLES",Y[Y.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Y[Y.TRIANGLE_FAN=6]="TRIANGLE_FAN",Y[Y.ZERO=0]="ZERO",Y[Y.ONE=1]="ONE",Y[Y.SRC_COLOR=768]="SRC_COLOR",Y[Y.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",Y[Y.SRC_ALPHA=770]="SRC_ALPHA",Y[Y.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",Y[Y.DST_ALPHA=772]="DST_ALPHA",Y[Y.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",Y[Y.DST_COLOR=774]="DST_COLOR",Y[Y.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",Y[Y.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",Y[Y.FUNC_ADD=32774]="FUNC_ADD",Y[Y.BLEND_EQUATION=32777]="BLEND_EQUATION",Y[Y.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",Y[Y.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",Y[Y.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",Y[Y.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",Y[Y.MAX_EXT=32776]="MAX_EXT",Y[Y.MIN_EXT=32775]="MIN_EXT",Y[Y.BLEND_DST_RGB=32968]="BLEND_DST_RGB",Y[Y.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",Y[Y.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",Y[Y.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",Y[Y.CONSTANT_COLOR=32769]="CONSTANT_COLOR",Y[Y.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",Y[Y.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",Y[Y.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",Y[Y.BLEND_COLOR=32773]="BLEND_COLOR",Y[Y.ARRAY_BUFFER=34962]="ARRAY_BUFFER",Y[Y.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",Y[Y.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",Y[Y.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",Y[Y.STREAM_DRAW=35040]="STREAM_DRAW",Y[Y.STATIC_DRAW=35044]="STATIC_DRAW",Y[Y.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",Y[Y.BUFFER_SIZE=34660]="BUFFER_SIZE",Y[Y.BUFFER_USAGE=34661]="BUFFER_USAGE",Y[Y.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",Y[Y.FRONT=1028]="FRONT",Y[Y.BACK=1029]="BACK",Y[Y.FRONT_AND_BACK=1032]="FRONT_AND_BACK",Y[Y.CULL_FACE=2884]="CULL_FACE",Y[Y.BLEND=3042]="BLEND",Y[Y.DITHER=3024]="DITHER",Y[Y.STENCIL_TEST=2960]="STENCIL_TEST",Y[Y.DEPTH_TEST=2929]="DEPTH_TEST",Y[Y.SCISSOR_TEST=3089]="SCISSOR_TEST",Y[Y.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",Y[Y.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",Y[Y.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",Y[Y.NO_ERROR=0]="NO_ERROR",Y[Y.INVALID_ENUM=1280]="INVALID_ENUM",Y[Y.INVALID_VALUE=1281]="INVALID_VALUE",Y[Y.INVALID_OPERATION=1282]="INVALID_OPERATION",Y[Y.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",Y[Y.CW=2304]="CW",Y[Y.CCW=2305]="CCW",Y[Y.LINE_WIDTH=2849]="LINE_WIDTH",Y[Y.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",Y[Y.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",Y[Y.CULL_FACE_MODE=2885]="CULL_FACE_MODE",Y[Y.FRONT_FACE=2886]="FRONT_FACE",Y[Y.DEPTH_RANGE=2928]="DEPTH_RANGE",Y[Y.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",Y[Y.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",Y[Y.DEPTH_FUNC=2932]="DEPTH_FUNC",Y[Y.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",Y[Y.STENCIL_FUNC=2962]="STENCIL_FUNC",Y[Y.STENCIL_FAIL=2964]="STENCIL_FAIL",Y[Y.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",Y[Y.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",Y[Y.STENCIL_REF=2967]="STENCIL_REF",Y[Y.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",Y[Y.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",Y[Y.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",Y[Y.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",Y[Y.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",Y[Y.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",Y[Y.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",Y[Y.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",Y[Y.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",Y[Y.VIEWPORT=2978]="VIEWPORT",Y[Y.SCISSOR_BOX=3088]="SCISSOR_BOX",Y[Y.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",Y[Y.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",Y[Y.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",Y[Y.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",Y[Y.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",Y[Y.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",Y[Y.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",Y[Y.RED_BITS=3410]="RED_BITS",Y[Y.GREEN_BITS=3411]="GREEN_BITS",Y[Y.BLUE_BITS=3412]="BLUE_BITS",Y[Y.ALPHA_BITS=3413]="ALPHA_BITS",Y[Y.DEPTH_BITS=3414]="DEPTH_BITS",Y[Y.STENCIL_BITS=3415]="STENCIL_BITS",Y[Y.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",Y[Y.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",Y[Y.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",Y[Y.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",Y[Y.SAMPLES=32937]="SAMPLES",Y[Y.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",Y[Y.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",Y[Y.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",Y[Y.DONT_CARE=4352]="DONT_CARE",Y[Y.FASTEST=4353]="FASTEST",Y[Y.NICEST=4354]="NICEST",Y[Y.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",Y[Y.BYTE=5120]="BYTE",Y[Y.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",Y[Y.SHORT=5122]="SHORT",Y[Y.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",Y[Y.INT=5124]="INT",Y[Y.UNSIGNED_INT=5125]="UNSIGNED_INT",Y[Y.FLOAT=5126]="FLOAT",Y[Y.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",Y[Y.ALPHA=6406]="ALPHA",Y[Y.RGB=6407]="RGB",Y[Y.RGBA=6408]="RGBA",Y[Y.LUMINANCE=6409]="LUMINANCE",Y[Y.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",Y[Y.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",Y[Y.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",Y[Y.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",Y[Y.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",Y[Y.VERTEX_SHADER=35633]="VERTEX_SHADER",Y[Y.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",Y[Y.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",Y[Y.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",Y[Y.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",Y[Y.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",Y[Y.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",Y[Y.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",Y[Y.SHADER_TYPE=35663]="SHADER_TYPE",Y[Y.DELETE_STATUS=35712]="DELETE_STATUS",Y[Y.LINK_STATUS=35714]="LINK_STATUS",Y[Y.VALIDATE_STATUS=35715]="VALIDATE_STATUS",Y[Y.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",Y[Y.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",Y[Y.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",Y[Y.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",Y[Y.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",Y[Y.NEVER=512]="NEVER",Y[Y.LESS=513]="LESS",Y[Y.EQUAL=514]="EQUAL",Y[Y.LEQUAL=515]="LEQUAL",Y[Y.GREATER=516]="GREATER",Y[Y.NOTEQUAL=517]="NOTEQUAL",Y[Y.GEQUAL=518]="GEQUAL",Y[Y.ALWAYS=519]="ALWAYS",Y[Y.KEEP=7680]="KEEP",Y[Y.REPLACE=7681]="REPLACE",Y[Y.INCR=7682]="INCR",Y[Y.DECR=7683]="DECR",Y[Y.INVERT=5386]="INVERT",Y[Y.INCR_WRAP=34055]="INCR_WRAP",Y[Y.DECR_WRAP=34056]="DECR_WRAP",Y[Y.VENDOR=7936]="VENDOR",Y[Y.RENDERER=7937]="RENDERER",Y[Y.VERSION=7938]="VERSION",Y[Y.NEAREST=9728]="NEAREST",Y[Y.LINEAR=9729]="LINEAR",Y[Y.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",Y[Y.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",Y[Y.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",Y[Y.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",Y[Y.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",Y[Y.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",Y[Y.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",Y[Y.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",Y[Y.TEXTURE_2D=3553]="TEXTURE_2D",Y[Y.TEXTURE=5890]="TEXTURE",Y[Y.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",Y[Y.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",Y[Y.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",Y[Y.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",Y[Y.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",Y[Y.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",Y[Y.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",Y[Y.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",Y[Y.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",Y[Y.TEXTURE0=33984]="TEXTURE0",Y[Y.TEXTURE1=33985]="TEXTURE1",Y[Y.TEXTURE2=33986]="TEXTURE2",Y[Y.TEXTURE3=33987]="TEXTURE3",Y[Y.TEXTURE4=33988]="TEXTURE4",Y[Y.TEXTURE5=33989]="TEXTURE5",Y[Y.TEXTURE6=33990]="TEXTURE6",Y[Y.TEXTURE7=33991]="TEXTURE7",Y[Y.TEXTURE8=33992]="TEXTURE8",Y[Y.TEXTURE9=33993]="TEXTURE9",Y[Y.TEXTURE10=33994]="TEXTURE10",Y[Y.TEXTURE11=33995]="TEXTURE11",Y[Y.TEXTURE12=33996]="TEXTURE12",Y[Y.TEXTURE13=33997]="TEXTURE13",Y[Y.TEXTURE14=33998]="TEXTURE14",Y[Y.TEXTURE15=33999]="TEXTURE15",Y[Y.TEXTURE16=34e3]="TEXTURE16",Y[Y.TEXTURE17=34001]="TEXTURE17",Y[Y.TEXTURE18=34002]="TEXTURE18",Y[Y.TEXTURE19=34003]="TEXTURE19",Y[Y.TEXTURE20=34004]="TEXTURE20",Y[Y.TEXTURE21=34005]="TEXTURE21",Y[Y.TEXTURE22=34006]="TEXTURE22",Y[Y.TEXTURE23=34007]="TEXTURE23",Y[Y.TEXTURE24=34008]="TEXTURE24",Y[Y.TEXTURE25=34009]="TEXTURE25",Y[Y.TEXTURE26=34010]="TEXTURE26",Y[Y.TEXTURE27=34011]="TEXTURE27",Y[Y.TEXTURE28=34012]="TEXTURE28",Y[Y.TEXTURE29=34013]="TEXTURE29",Y[Y.TEXTURE30=34014]="TEXTURE30",Y[Y.TEXTURE31=34015]="TEXTURE31",Y[Y.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",Y[Y.REPEAT=10497]="REPEAT",Y[Y.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",Y[Y.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",Y[Y.FLOAT_VEC2=35664]="FLOAT_VEC2",Y[Y.FLOAT_VEC3=35665]="FLOAT_VEC3",Y[Y.FLOAT_VEC4=35666]="FLOAT_VEC4",Y[Y.INT_VEC2=35667]="INT_VEC2",Y[Y.INT_VEC3=35668]="INT_VEC3",Y[Y.INT_VEC4=35669]="INT_VEC4",Y[Y.BOOL=35670]="BOOL",Y[Y.BOOL_VEC2=35671]="BOOL_VEC2",Y[Y.BOOL_VEC3=35672]="BOOL_VEC3",Y[Y.BOOL_VEC4=35673]="BOOL_VEC4",Y[Y.FLOAT_MAT2=35674]="FLOAT_MAT2",Y[Y.FLOAT_MAT3=35675]="FLOAT_MAT3",Y[Y.FLOAT_MAT4=35676]="FLOAT_MAT4",Y[Y.SAMPLER_2D=35678]="SAMPLER_2D",Y[Y.SAMPLER_CUBE=35680]="SAMPLER_CUBE",Y[Y.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",Y[Y.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",Y[Y.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",Y[Y.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",Y[Y.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",Y[Y.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",Y[Y.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",Y[Y.COMPILE_STATUS=35713]="COMPILE_STATUS",Y[Y.LOW_FLOAT=36336]="LOW_FLOAT",Y[Y.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",Y[Y.HIGH_FLOAT=36338]="HIGH_FLOAT",Y[Y.LOW_INT=36339]="LOW_INT",Y[Y.MEDIUM_INT=36340]="MEDIUM_INT",Y[Y.HIGH_INT=36341]="HIGH_INT",Y[Y.FRAMEBUFFER=36160]="FRAMEBUFFER",Y[Y.RENDERBUFFER=36161]="RENDERBUFFER",Y[Y.RGBA4=32854]="RGBA4",Y[Y.RGB5_A1=32855]="RGB5_A1",Y[Y.RGB565=36194]="RGB565",Y[Y.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",Y[Y.STENCIL_INDEX=6401]="STENCIL_INDEX",Y[Y.STENCIL_INDEX8=36168]="STENCIL_INDEX8",Y[Y.DEPTH_STENCIL=34041]="DEPTH_STENCIL",Y[Y.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",Y[Y.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",Y[Y.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",Y[Y.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",Y[Y.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",Y[Y.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",Y[Y.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",Y[Y.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",Y[Y.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",Y[Y.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",Y[Y.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",Y[Y.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",Y[Y.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",Y[Y.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",Y[Y.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",Y[Y.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",Y[Y.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",Y[Y.NONE=0]="NONE",Y[Y.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",Y[Y.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",Y[Y.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",Y[Y.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",Y[Y.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",Y[Y.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",Y[Y.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",Y[Y.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",Y[Y.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",Y[Y.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",Y[Y.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",Y[Y.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",Y[Y.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",Y[Y.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",Y[Y.COPY_SRC=1]="COPY_SRC",Y[Y.COPY_DST=2]="COPY_DST",Y[Y.SAMPLED=4]="SAMPLED",Y[Y.STORAGE=8]="STORAGE",Y[Y.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(j||(j={}));var Q=function(){function Y(){(0,L.Z)(this,Y),this.config=void 0}return(0,_.Z)(Y,[{key:"get",value:function(){return this.config}},{key:"set",value:function(ee){this.config=ee}}]),Y}(),G=typeof navigator!="undefined"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),W;(function(Y){Y.Void="Void",Y.Boolean="Boolean",Y.Float="Float",Y.Uint32="Uint32",Y.Int32="Int32",Y.Vector="Vector",Y.Vector2Float="vec2<f32>",Y.Vector3Float="vec3<f32>",Y.Vector4Float="vec4<f32>",Y.Vector2Boolean="vec2<bool>",Y.Vector3Boolean="vec3<bool>",Y.Vector4Boolean="vec4<bool>",Y.Vector2Uint="vec2<u32>",Y.Vector3Uint="vec3<u32>",Y.Vector4Uint="vec4<u32>",Y.Vector2Int="vec2<i32>",Y.Vector3Int="vec3<i32>",Y.Vector4Int="vec4<i32>",Y.Matrix="Matrix",Y.Matrix3x3Float="mat3x3<f32>",Y.Matrix4x4Float="mat4x4<i32>",Y.Struct="Struct",Y.FloatArray="Float[]",Y.Vector4FloatArray="vec4<f32>[]"})(W||(W={}));var H;(function(Y){Y.Program="Program",Y.Identifier="Identifier",Y.VariableDeclaration="VariableDeclaration",Y.BlockStatement="BlockStatement",Y.ReturnStatement="ReturnStatement",Y.FunctionDeclaration="FunctionDeclaration",Y.VariableDeclarator="VariableDeclarator",Y.AssignmentExpression="AssignmentExpression",Y.LogicalExpression="LogicalExpression",Y.BinaryExpression="BinaryExpression",Y.ArrayExpression="ArrayExpression",Y.UnaryExpression="UnaryExpression",Y.UpdateExpression="UpdateExpression",Y.FunctionExpression="FunctionExpression",Y.MemberExpression="MemberExpression",Y.ConditionalExpression="ConditionalExpression",Y.ExpressionStatement="ExpressionStatement",Y.CallExpression="CallExpression",Y.NumThreadStatement="NumThreadStatement",Y.StorageStatement="StorageStatement",Y.DoWhileStatement="DoWhileStatement",Y.WhileStatement="WhileStatement",Y.ForStatement="ForStatement",Y.BreakStatement="BreakStatement",Y.ContinueStatement="ContinueStatement",Y.IfStatement="IfStatement",Y.ImportedFunctionStatement="ImportedFunctionStatement"})(H||(H={}));var Z;(function(Y){Y.Input="Input",Y.Output="Output",Y.Uniform="Uniform",Y.Workgroup="Workgroup",Y.UniformConstant="UniformConstant",Y.Image="Image",Y.StorageBuffer="StorageBuffer",Y.Private="Private",Y.Function="Function"})(Z||(Z={}));var J;(function(Y){Y.GLSL100="GLSL100",Y.GLSL450="GLSL450",Y.WGSL="WGSL"})(J||(J={}));var K="__DefineValuePlaceholder__";function ne(){if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function se(Y,ie){var ee=Object.keys(Y);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(Y);ie&&(C=C.filter(function(b){return Object.getOwnPropertyDescriptor(Y,b).enumerable})),ee.push.apply(ee,C)}return ee}function fe(Y){for(var ie=1;ie<arguments.length;ie++){var ee=arguments[ie]!=null?arguments[ie]:{};ie%2?se(Object(ee),!0).forEach(function(C){(0,U.Z)(Y,C,ee[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Y,Object.getOwnPropertyDescriptors(ee)):se(Object(ee)).forEach(function(C){Object.defineProperty(Y,C,Object.getOwnPropertyDescriptor(ee,C))})}return Y}var Ie=function(){function Y(ie,ee){(0,L.Z)(this,Y),this.engine=ie,this.configService=ee,this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}return(0,_.Z)(Y,[{key:"init",value:function(){var ee=this.configService.get(),C=ee.canvas,b=ee.engineOptions;this.initPromise=this.engine.init(fe({canvas:C||ne(),antialiasing:!1},b))}},{key:"setBundle",value:function(ee){this.compiledBundle=JSON.parse(JSON.stringify(ee))}},{key:"setDispatch",value:function(ee){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=ee),this}},{key:"setMaxIteration",value:function(ee){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=ee),this}},{key:"setBinding",value:function(ee,C){var b=this;if(typeof ee=="string"){var S=p()(C)||T()(C)||g()(C);if(this.compiledBundle&&this.compiledBundle.context){var X=this.compiledBundle.context.defines.find(function(Me){return Me.name===ee});if(X)return X.value=C,this;var pe=this.compiledBundle.context.uniforms.find(function(Me){return Me.name===ee});pe&&(S?(pe.data=C,pe.isReferer=!1,pe.storageClass===Z.Uniform?this.model&&this.model.updateUniform(ee,C):this.model&&this.model.updateBuffer(ee,C)):(pe.isReferer=!0,pe.data=C))}}else Object.keys(ee).forEach(function(Me){b.setBinding(Me,ee[Me])});return this}},{key:"execute",value:function(){var ie=(0,k.Z)(c().mark(function C(){var b=this,S,X,pe=arguments;return c().wrap(function(me){for(;;)switch(me.prev=me.next){case 0:if(S=pe.length>0&&pe[0]!==void 0?pe[0]:1,!this.dirty){me.next=6;break}return this.compiledBundle.context&&(S>1?this.compiledBundle.context.maxIteration=S:this.compiledBundle.context.maxIteration++),me.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(Le){var st=Le.isReferer;return st}).forEach(function(Le){var st=Le.data,qe=Le.name;b.model.confirmInput(st.model,qe)}),X=0;X<S;X++)this.model.run();return this.engine.endFrame(),me.abrupt("return",this);case 12:case"end":return me.stop()}},C,this)}));function ee(){return ie.apply(this,arguments)}return ee}()},{key:"getOutput",value:function(){var ie=(0,k.Z)(c().mark(function C(){return c().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.abrupt("return",this.model.readData());case 1:case"end":return S.stop()}},C,this)}));function ee(){return ie.apply(this,arguments)}return ee}()},{key:"compile",value:function(){var ie=(0,k.Z)(c().mark(function C(){var b,S,X;return c().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,this.initPromise;case 2:return b=fe({},this.compiledBundle.context),S=this.engine.supportWebGPU?this.engine.useWGSL?J.WGSL:J.GLSL450:J.GLSL100,X=this.compiledBundle.shaders[S],b.defines.filter(function(me){return me.runtime}).forEach(function(me){var Le="".concat(K).concat(me.name);X=X.replace(Le,"".concat(me.value))}),b.shader=X,b.uniforms.forEach(function(me){if(!me.data&&me.storageClass===Z.StorageBuffer){var Le=1;me.type===W.FloatArray?Le=1:me.type===W.Vector4FloatArray&&(Le=4),me.data=new Float32Array(b.output.length*Le).fill(0)}}),this.compiledBundle.context=b,Me.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=Me.sent;case 12:case"end":return Me.stop()}},C,this)}));function ee(){return ie.apply(this,arguments)}return ee}()}]),Y}(),ye=F(40224),Ae=F.n(ye),Se=function(){function Y(ie,ee){(0,L.Z)(this,Y),this.attribute=void 0,this.buffer=void 0;var C=ee.buffer,b=ee.offset,S=ee.stride,X=ee.normalized,pe=ee.size,Me=ee.divisor;this.buffer=C,this.attribute={buffer:C.get(),offset:b||0,stride:S||0,normalized:X||!1,divisor:Me||0},pe&&(this.attribute.size=pe)}return(0,_.Z)(Y,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(ee){this.buffer.subData(ee)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),Y}(),we,Te,ke,Ge,tt,He,ft,Lt,Jt,Qe,ut,xt,dt,pt,wt=(we={},(0,U.Z)(we,j.POINTS,"points"),(0,U.Z)(we,j.LINES,"lines"),(0,U.Z)(we,j.LINE_LOOP,"line loop"),(0,U.Z)(we,j.LINE_STRIP,"line strip"),(0,U.Z)(we,j.TRIANGLES,"triangles"),(0,U.Z)(we,j.TRIANGLE_FAN,"triangle fan"),(0,U.Z)(we,j.TRIANGLE_STRIP,"triangle strip"),we),mt=(Te={},(0,U.Z)(Te,j.STATIC_DRAW,"static"),(0,U.Z)(Te,j.DYNAMIC_DRAW,"dynamic"),(0,U.Z)(Te,j.STREAM_DRAW,"stream"),Te),ur=(ke={},(0,U.Z)(ke,j.BYTE,"int8"),(0,U.Z)(ke,j.UNSIGNED_INT,"int16"),(0,U.Z)(ke,j.INT,"int32"),(0,U.Z)(ke,j.UNSIGNED_BYTE,"uint8"),(0,U.Z)(ke,j.UNSIGNED_SHORT,"uint16"),(0,U.Z)(ke,j.UNSIGNED_INT,"uint32"),(0,U.Z)(ke,j.FLOAT,"float"),ke),Ir=(Ge={},(0,U.Z)(Ge,j.ALPHA,"alpha"),(0,U.Z)(Ge,j.LUMINANCE,"luminance"),(0,U.Z)(Ge,j.LUMINANCE_ALPHA,"luminance alpha"),(0,U.Z)(Ge,j.RGB,"rgb"),(0,U.Z)(Ge,j.RGBA,"rgba"),(0,U.Z)(Ge,j.RGBA4,"rgba4"),(0,U.Z)(Ge,j.RGB5_A1,"rgb5 a1"),(0,U.Z)(Ge,j.RGB565,"rgb565"),(0,U.Z)(Ge,j.DEPTH_COMPONENT,"depth"),(0,U.Z)(Ge,j.DEPTH_STENCIL,"depth stencil"),Ge),Nr=(tt={},(0,U.Z)(tt,j.DONT_CARE,"dont care"),(0,U.Z)(tt,j.NICEST,"nice"),(0,U.Z)(tt,j.FASTEST,"fast"),tt),Hr=(He={},(0,U.Z)(He,j.NEAREST,"nearest"),(0,U.Z)(He,j.LINEAR,"linear"),(0,U.Z)(He,j.LINEAR_MIPMAP_LINEAR,"mipmap"),(0,U.Z)(He,j.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),(0,U.Z)(He,j.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),(0,U.Z)(He,j.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),He),It=(ft={},(0,U.Z)(ft,j.REPEAT,"repeat"),(0,U.Z)(ft,j.CLAMP_TO_EDGE,"clamp"),(0,U.Z)(ft,j.MIRRORED_REPEAT,"mirror"),ft),qt=(Lt={},(0,U.Z)(Lt,j.NONE,"none"),(0,U.Z)(Lt,j.BROWSER_DEFAULT_WEBGL,"browser"),Lt),ar=(Jt={},(0,U.Z)(Jt,j.NEVER,"never"),(0,U.Z)(Jt,j.ALWAYS,"always"),(0,U.Z)(Jt,j.LESS,"less"),(0,U.Z)(Jt,j.LEQUAL,"lequal"),(0,U.Z)(Jt,j.GREATER,"greater"),(0,U.Z)(Jt,j.GEQUAL,"gequal"),(0,U.Z)(Jt,j.EQUAL,"equal"),(0,U.Z)(Jt,j.NOTEQUAL,"notequal"),Jt),Oe=(Qe={},(0,U.Z)(Qe,j.FUNC_ADD,"add"),(0,U.Z)(Qe,j.MIN_EXT,"min"),(0,U.Z)(Qe,j.MAX_EXT,"max"),(0,U.Z)(Qe,j.FUNC_SUBTRACT,"subtract"),(0,U.Z)(Qe,j.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Qe),Pr=(ut={},(0,U.Z)(ut,j.ZERO,"zero"),(0,U.Z)(ut,j.ONE,"one"),(0,U.Z)(ut,j.SRC_COLOR,"src color"),(0,U.Z)(ut,j.ONE_MINUS_SRC_COLOR,"one minus src color"),(0,U.Z)(ut,j.SRC_ALPHA,"src alpha"),(0,U.Z)(ut,j.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),(0,U.Z)(ut,j.DST_COLOR,"dst color"),(0,U.Z)(ut,j.ONE_MINUS_DST_COLOR,"one minus dst color"),(0,U.Z)(ut,j.DST_ALPHA,"dst alpha"),(0,U.Z)(ut,j.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),(0,U.Z)(ut,j.CONSTANT_COLOR,"constant color"),(0,U.Z)(ut,j.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),(0,U.Z)(ut,j.CONSTANT_ALPHA,"constant alpha"),(0,U.Z)(ut,j.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),(0,U.Z)(ut,j.SRC_ALPHA_SATURATE,"src alpha saturate"),ut),Cr=(xt={},(0,U.Z)(xt,j.NEVER,"never"),(0,U.Z)(xt,j.ALWAYS,"always"),(0,U.Z)(xt,j.LESS,"less"),(0,U.Z)(xt,j.LEQUAL,"lequal"),(0,U.Z)(xt,j.GREATER,"greater"),(0,U.Z)(xt,j.GEQUAL,"gequal"),(0,U.Z)(xt,j.EQUAL,"equal"),(0,U.Z)(xt,j.NOTEQUAL,"notequal"),xt),Gr=(dt={},(0,U.Z)(dt,j.ZERO,"zero"),(0,U.Z)(dt,j.KEEP,"keep"),(0,U.Z)(dt,j.REPLACE,"replace"),(0,U.Z)(dt,j.INVERT,"invert"),(0,U.Z)(dt,j.INCR,"increment"),(0,U.Z)(dt,j.DECR,"decrement"),(0,U.Z)(dt,j.INCR_WRAP,"increment wrap"),(0,U.Z)(dt,j.DECR_WRAP,"decrement wrap"),dt),mr=(pt={},(0,U.Z)(pt,j.FRONT,"front"),(0,U.Z)(pt,j.BACK,"back"),pt),rn=function(){function Y(ie,ee){(0,L.Z)(this,Y),this.buffer=void 0;var C=ee.data,b=ee.usage,S=ee.type;this.buffer=ie.buffer({data:C,usage:mt[b||j.STATIC_DRAW],type:ur[S||j.UNSIGNED_BYTE]})}return(0,_.Z)(Y,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(ee){var C=ee.data,b=ee.offset;this.buffer.subdata(C,b)}}]),Y}(),Sr=F(96835);function qr(Y,ie){var ee=Object.keys(Y);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(Y);ie&&(C=C.filter(function(b){return Object.getOwnPropertyDescriptor(Y,b).enumerable})),ee.push.apply(ee,C)}return ee}function Rn(Y){for(var ie=1;ie<arguments.length;ie++){var ee=arguments[ie]!=null?arguments[ie]:{};ie%2?qr(Object(ee),!0).forEach(function(C){(0,U.Z)(Y,C,ee[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Y,Object.getOwnPropertyDescriptors(ee)):qr(Object(ee)).forEach(function(C){Object.defineProperty(Y,C,Object.getOwnPropertyDescriptor(ee,C))})}return Y}var yn=`attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
void main() {
gl_Position = vec4(a_Position, 1.0);
v_TexCoord = a_TexCoord;
}`,zr=0,Rt=!1,zt=function(){function Y(ie,ee){var C=this;(0,L.Z)(this,Y),this.reGl=ie,this.context=ee,this.entity=M(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var b={};this.context.uniforms.forEach(function(me){var Le=me.name,st=me.type,qe=me.data,Nt=me.isReferer,nr=me.storageClass;if(nr===Z.StorageBuffer){if(Nt)C.textureCache[Le]={data:void 0},b["".concat(Le,"Size")]=function(){return qe.compiledBundle.context.output.textureSize};else{C.textureCache[Le]=C.calcDataTexture(Le,st,qe);var Ft=C.textureCache[Le],er=Ft.textureWidth,Ur=Ft.isOutput;b["".concat(Le,"Size")]=[er,er],Ur&&(C.outputTextureName=Le,C.context.needPingpong&&(C.outputTextureName="".concat(Le,"Output"),C.textureCache[C.outputTextureName]=C.calcDataTexture(Le,st,qe)))}b[Le]=function(){return Rt&&console.log("[".concat(C.entity,"]: ").concat(Le," ").concat(C.textureCache[Le].id)),C.textureCache[Le].texture}}else if(nr===Z.Uniform){if(qe&&(Array.isArray(qe)||T()(qe))&&qe.length>16)throw new Error("invalid data type ".concat(st));b[Le]=function(){return me.data}}});var S=this.getOuputDataTexture(),X=S.textureWidth,pe=S.texelCount;b.u_OutputTextureSize=[X,X],b.u_OutputTexelCount=pe,this.context.output.textureSize=[X,X];var Me={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`.concat(this.context.shader),uniforms:b,vert:yn,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(Me)}return(0,_.Z)(Y,[{key:"run",value:function(){var ee=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){ee.computeCommand()}),Rt&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var ie=(0,k.Z)(c().mark(function C(){var b=this,S,X,pe,Me,me,Le,st,qe;return c().wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){S=b.reGl.read()}),!S){nr.next=6;break}if(X=this.getOuputDataTexture(),pe=X.originalDataLength,Me=X.elementsPerTexel,me=X.typedArrayConstructor,Le=me===void 0?Float32Array:me,st=[],Me!==4)for(qe=0;qe<S.length;qe+=4)Me===1?st.push(S[qe]):Me===2?st.push(S[qe],S[qe+1]):st.push(S[qe],S[qe+1],S[qe+2]);else st=S;return nr.abrupt("return",new Le(st.slice(0,pe)));case 6:return nr.abrupt("return",new Float32Array);case 7:case"end":return nr.stop()}},C,this)}));function ee(){return ie.apply(this,arguments)}return ee}()},{key:"confirmInput",value:function(ee,C){var b;this.entity===ee.entity?(this.dynamicPingpong=!0,b=this):b=ee,this.textureCache[C].id=b.getOuputDataTexture().id,this.textureCache[C].texture=b.getOuputDataTexture().texture,Rt&&console.log("[".concat(this.entity,"]: confirm input ").concat(C," from model ").concat(b.entity,", ").concat(b.getOuputDataTexture().id))}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(ee,C){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,S=this.context.uniforms.find(function(me){var Le=me.name;return Le===ee});if(S){var X=this.calcDataTexture(ee,S.type,C),pe=X.texture,Me=X.data;this.textureCache[ee].data=Me,this.textureCache[ee].texture=pe}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var ee=this.context.output.name;this.textureCache[ee].id=this.getOuputDataTexture().id,this.textureCache[ee].texture=this.getOuputDataTexture().texture}var C=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=C,Rt&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var ee=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=ee}},{key:"cloneDataTexture",value:function(ee){var C=ee.data,b=ee.textureWidth;return Rn(Rn({},ee),{},{id:zr++,texture:this.reGl.texture({width:b,height:b,data:C,type:"float"})})}},{key:"calcDataTexture",value:function(ee,C,b){var S=1;C===W.Vector4FloatArray&&(S=4);for(var X=[],pe=0;pe<b.length;pe+=S)S===1?X.push(b[pe],0,0,0):S===2?X.push(b[pe],b[pe+1],0,0):S===3?X.push(b[pe],b[pe+1],b[pe+2],0):S===4&&X.push(b[pe],b[pe+1],b[pe+2],b[pe+3]);var Me=b.length,me=Math.ceil(Me/S),Le=Math.ceil(Math.sqrt(me)),st=Le*Le;me<st&&X.push.apply(X,(0,Sr.Z)(new Array((st-me)*4).fill(0)));var qe=this.reGl.texture({width:Le,height:Le,data:X,type:"float"});return{id:zr++,data:X,originalDataLength:Me,typedArrayConstructor:T()(b)?b.constructor:void 0,textureWidth:Le,texture:qe,texelCount:me,elementsPerTexel:S,isOutput:ee===this.context.output.name}}}]),Y}(),Vt=function(){function Y(ie,ee){(0,L.Z)(this,Y),this.elements=void 0;var C=ee.data,b=ee.usage,S=ee.type,X=ee.count;this.elements=ie.elements({data:C,usage:mt[b||j.STATIC_DRAW],type:ur[S||j.UNSIGNED_BYTE],count:X})}return(0,_.Z)(Y,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(ee){var C=ee.data;this.elements.subdata(C)}},{key:"destroy",value:function(){this.elements.destroy()}}]),Y}(),hr=function(){function Y(ie,ee){(0,L.Z)(this,Y),this.framebuffer=void 0;var C=ee.width,b=ee.height,S=ee.color,X=ee.colors,pe=ee.depth,Me=ee.stencil,me={width:C,height:b};Array.isArray(X)&&(me.colors=X.map(function(Le){return Le.get()})),S&&typeof S!="boolean"&&(me.color=S.get()),this.framebuffer=ie.framebuffer(me)}return(0,_.Z)(Y,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(ee){var C=ee.width,b=ee.height;this.framebuffer.resize(C,b)}}]),Y}(),Ar=F(11371),en=F(69143),Fr=F.n(en);function Cn(Y){var ie={};return Object.keys(Y).forEach(function(ee){Sn(ee,Y[ee],ie,"")}),ie}function Sn(Y,ie,ee,C){if(ie===null||typeof ie=="number"||typeof ie=="boolean"||Array.isArray(ie)&&typeof ie[0]=="number"||T()(ie)||ie===""||ie.resize!==void 0){ee["".concat(C&&C+".").concat(Y)]=ie;return}Fr()(ie)&&Object.keys(ie).forEach(function(b){Sn(b,ie[b],ee,"".concat(C&&C+".").concat(Y))}),Array.isArray(ie)&&ie.forEach(function(b,S){Object.keys(b).forEach(function(X){Sn(X,b[X],ee,"".concat(C&&C+".").concat(Y,"[").concat(S,"]"))})})}function oa(Y,ie){var ee=Object.keys(Y);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(Y);ie&&(C=C.filter(function(b){return Object.getOwnPropertyDescriptor(Y,b).enumerable})),ee.push.apply(ee,C)}return ee}function jr(Y){for(var ie=1;ie<arguments.length;ie++){var ee=arguments[ie]!=null?arguments[ie]:{};ie%2?oa(Object(ee),!0).forEach(function(C){(0,U.Z)(Y,C,ee[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Y,Object.getOwnPropertyDescriptors(ee)):oa(Object(ee)).forEach(function(C){Object.defineProperty(Y,C,Object.getOwnPropertyDescriptor(ee,C))})}return Y}var xn=function(){function Y(ie,ee){(0,L.Z)(this,Y),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=ie;var C=ee.vs,b=ee.fs,S=ee.defines,X=ee.attributes,pe=ee.uniforms,Me=ee.primitive,me=ee.count,Le=ee.elements,st=ee.depth,qe=ee.blend,Nt=ee.stencil,nr=ee.cull,Ft=ee.instances,er=ee.scissor,Ur=ee.viewport,Ct={};pe&&(this.uniforms=Cn(pe),Object.keys(pe).forEach(function(br){Ct[br]=ie.prop(br)}));var Kt={};Object.keys(X).forEach(function(br){Kt[br]=X[br].get()});var lr=S&&this.generateDefines(S)||"",Dr={attributes:Kt,frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`.concat(lr,`
`).concat(b),uniforms:Ct,vert:`
`.concat(lr,`
`).concat(C),primitive:wt[Me===void 0?j.TRIANGLES:Me]};Ft&&(Dr.instances=Ft),me&&(Dr.count=me),Le&&(Dr.elements=Le.get()),er&&(Dr.scissor=er),Ur&&(Dr.viewport=Ur),this.initDepthDrawParams({depth:st},Dr),this.initBlendDrawParams({blend:qe},Dr),this.initStencilDrawParams({stencil:Nt},Dr),this.initCullDrawParams({cull:nr},Dr),this.drawCommand=ie(Dr)}return(0,_.Z)(Y,[{key:"addUniforms",value:function(ee){this.uniforms=jr(jr({},this.uniforms),Cn(ee))}},{key:"draw",value:function(ee){var C=jr(jr({},this.uniforms),Cn(ee.uniforms||{})),b={};Object.keys(C).forEach(function(S){var X=(0,Ar.Z)(C[S]);X==="boolean"||X==="number"||Array.isArray(C[S])||C[S].BYTES_PER_ELEMENT?b[S]=C[S]:X==="string"||(b[S]=C[S].get())}),this.drawCommand(b)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(ee,C){var b=ee.depth;b&&(C.depth={enable:b.enable===void 0?!0:!!b.enable,mask:b.mask===void 0?!0:!!b.mask,func:ar[b.func||j.LESS],range:b.range||[0,1]})}},{key:"initBlendDrawParams",value:function(ee,C){var b=ee.blend;if(b){var S=b.enable,X=b.func,pe=b.equation,Me=b.color,me=Me===void 0?[0,0,0,0]:Me;C.blend={enable:!!S,func:{srcRGB:Pr[X&&X.srcRGB||j.SRC_ALPHA],srcAlpha:Pr[X&&X.srcAlpha||j.SRC_ALPHA],dstRGB:Pr[X&&X.dstRGB||j.ONE_MINUS_SRC_ALPHA],dstAlpha:Pr[X&&X.dstAlpha||j.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Oe[pe&&pe.rgb||j.FUNC_ADD],alpha:Oe[pe&&pe.alpha||j.FUNC_ADD]},color:me}}}},{key:"initStencilDrawParams",value:function(ee,C){var b=ee.stencil;if(b){var S=b.enable,X=b.mask,pe=X===void 0?-1:X,Me=b.func,me=Me===void 0?{cmp:j.ALWAYS,ref:0,mask:-1}:Me,Le=b.opFront,st=Le===void 0?{fail:j.KEEP,zfail:j.KEEP,zpass:j.KEEP}:Le,qe=b.opBack,Nt=qe===void 0?{fail:j.KEEP,zfail:j.KEEP,zpass:j.KEEP}:qe;C.stencil={enable:!!S,mask:pe,func:jr(jr({},me),{},{cmp:Cr[me.cmp]}),opFront:{fail:Gr[st.fail],zfail:Gr[st.zfail],zpass:Gr[st.zpass]},opBack:{fail:Gr[Nt.fail],zfail:Gr[Nt.zfail],zpass:Gr[Nt.zpass]}}}}},{key:"initCullDrawParams",value:function(ee,C){var b=ee.cull;if(b){var S=b.enable,X=b.face,pe=X===void 0?j.BACK:X;C.cull={enable:!!S,face:mr[pe]}}}},{key:"generateDefines",value:function(ee){return Object.keys(ee).map(function(C){return"#define ".concat(C," ").concat(Number(ee[C]))}).join(`
`)}}]),Y}(),vn=function(){function Y(ie,ee){(0,L.Z)(this,Y),this.texture=void 0,this.width=void 0,this.height=void 0;var C=ee.data,b=ee.type,S=b===void 0?j.UNSIGNED_BYTE:b,X=ee.width,pe=ee.height,Me=ee.flipY,me=Me===void 0?!1:Me,Le=ee.format,st=Le===void 0?j.RGBA:Le,qe=ee.mipmap,Nt=qe===void 0?!1:qe,nr=ee.wrapS,Ft=nr===void 0?j.CLAMP_TO_EDGE:nr,er=ee.wrapT,Ur=er===void 0?j.CLAMP_TO_EDGE:er,Ct=ee.aniso,Kt=Ct===void 0?0:Ct,lr=ee.alignment,Dr=lr===void 0?1:lr,br=ee.premultiplyAlpha,sa=br===void 0?!1:br,ea=ee.mag,gn=ea===void 0?j.NEAREST:ea,Tn=ee.min,ra=Tn===void 0?j.NEAREST:Tn,Zn=ee.colorSpace,Vr=Zn===void 0?j.BROWSER_DEFAULT_WEBGL:Zn;this.width=X,this.height=pe;var In={width:X,height:pe,type:ur[S],format:Ir[st],wrapS:It[Ft],wrapT:It[Ur],mag:Hr[gn],min:Hr[ra],alignment:Dr,flipY:me,colorSpace:qt[Vr],premultiplyAlpha:sa,aniso:Kt};C&&(In.data=C),typeof Nt=="number"?In.mipmap=Nr[Nt]:typeof Nt=="boolean"&&(In.mipmap=Nt),this.texture=ie.texture(In)}return(0,_.Z)(Y,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(ee){var C=ee.width,b=ee.height;this.texture.resize(C,b),this.width=C,this.height=b}},{key:"destroy",value:function(){this.texture.destroy()}}]),Y}(),un=function(){function Y(){var ie=this;(0,L.Z)(this,Y),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var ee=(0,k.Z)(c().mark(function C(b){return c().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(!b.uniforms){X.next=3;break}return X.next=3,Promise.all(Object.keys(b.uniforms).map(function(){var pe=(0,k.Z)(c().mark(function Me(me){var Le;return c().wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(!(b.uniforms[me]&&b.uniforms[me].load!==void 0)){qe.next=5;break}return qe.next=3,b.uniforms[me].load();case 3:Le=qe.sent,b.uniforms[me]=Le;case 5:case"end":return qe.stop()}},Me)}));return function(Me){return pe.apply(this,arguments)}}()));case 3:return X.abrupt("return",new xn(ie.gl,b));case 4:case"end":return X.stop()}},C)}));return function(C){return ee.apply(this,arguments)}}(),this.createAttribute=function(ee){return new Se(ie.gl,ee)},this.createBuffer=function(ee){return new rn(ie.gl,ee)},this.createElements=function(ee){return new Vt(ie.gl,ee)},this.createTexture2D=function(ee){return new vn(ie.gl,ee)},this.createFramebuffer=function(ee){return new hr(ie.gl,ee)},this.useFramebuffer=function(ee,C){ie.gl({framebuffer:ee?ee.get():null})(C)},this.createComputeModel=function(){var ee=(0,k.Z)(c().mark(function C(b){return c().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.abrupt("return",new zt(ie.gl,b));case 1:case"end":return X.stop()}},C)}));return function(C){return ee.apply(this,arguments)}}(),this.clear=function(ee){var C=ee.color,b=ee.depth,S=ee.stencil,X=ee.framebuffer,pe=X===void 0?null:X,Me={color:C,depth:b,stencil:S};Me.framebuffer=pe===null?pe:pe.get(),ie.gl.clear(Me)},this.setScissor=function(ee){ie.gl&&ie.gl._gl&&(ee.enable&&ee.box?(ie.gl._gl.enable(j.SCISSOR_TEST),ie.gl._gl.scissor(ee.box.x,ee.box.y,ee.box.width,ee.box.height)):ie.gl._gl.disable(j.SCISSOR_TEST),ie.gl._refresh())},this.viewport=function(ee){var C=ee.x,b=ee.y,S=ee.width,X=ee.height;ie.gl&&ie.gl._gl&&(ie.gl._gl.viewport(C,b,S,X),ie.gl._refresh())},this.readPixels=function(ee){var C=ee.framebuffer,b=ee.x,S=ee.y,X=ee.width,pe=ee.height,Me={x:b,y:S,width:X,height:pe};return C&&(Me.framebuffer=C.get()),ie.gl.read(Me)},this.getCanvas=function(){return ie.$canvas},this.getGLContext=function(){return ie.gl._gl},this.destroy=function(){ie.gl&&(ie.gl.destroy(),ie.inited=!1)}}return(0,_.Z)(Y,[{key:"init",value:function(){var ie=(0,k.Z)(c().mark(function C(b){return c().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(!this.inited){X.next=2;break}return X.abrupt("return");case 2:return this.$canvas=b.canvas,X.next=5,new Promise(function(pe,Me){Ae()({canvas:b.canvas,attributes:{alpha:!0,antialias:b.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(Le,st){(Le||!st)&&Me(Le),pe(st)}})});case 5:this.gl=X.sent,this.inited=!0;case 7:case"end":return X.stop()}},C,this)}));function ee(C){return ie.apply(this,arguments)}return ee}()},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),Y}(),Wn=function(){function Y(){(0,L.Z)(this,Y),this.engine=void 0,this.configService=new Q}return(0,_.Z)(Y,[{key:"setConfig",value:function(ee){this.configService.set(ee)}},{key:"setEngine",value:function(ee){this.engine=ee}},{key:"createEntity",value:function(){return M()}},{key:"createKernel",value:function(ee){var C=new Ie(this.engine,this.configService);return typeof ee=="string"?C.setBundle(JSON.parse(ee)):C.setBundle(ee),C.init(),C}},{key:"destroy",value:function(){this.engine.destroy()}}],[{key:"create",value:function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},C=new Y;return C.setConfig(ee),C.setEngine(new un),C}}]),Y}()},19711:function(Mt,N,F){"use strict";F.d(N,{ZP:function(){return Zh}});var k={};F.r(k),F.d(k,{GADDI:function(){return _a},Stack:function(){return ya},breadthFirstSearch:function(){return Te},connectedComponent:function(){return tt},cosineSimilarity:function(){return b},default:function(){return bo},depthFirstSearch:function(){return xt},detectAllCycles:function(){return mt},detectAllDirectedCycle:function(){return wt},detectAllUndirectedCycle:function(){return pt},detectCycle:function(){return ur},detectDirectedCycle:function(){return Ai},dijkstra:function(){return Hr},findAllPath:function(){return ar},findShortestPath:function(){return qt},floydWarshall:function(){return Pr},getAdjMatrix:function(){return W},getDegree:function(){return ft},getInDegree:function(){return Lt},getNeighbors:function(){return fe},getOutDegree:function(){return Jt},iLouvain:function(){return vn},kCore:function(){return Wn},kMeans:function(){return ee},labelPropagation:function(){return Gr},louvain:function(){return jr},minimumSpanningTree:function(){return Ft},nodesCosineSimilarity:function(){return X},pageRank:function(){return Ur}});var U={};F.r(U),F.d(U,{Line:function(){return Ui},applyMatrix:function(){return Si},compare:function(){return Ei},distance:function(){return Gi},floydWarshall:function(){return _i},fractionToLine:function(){return hs},getAdjMatrix:function(){return Ru},getBBoxBoundLine:function(){return Wi},getCircleCenterByPoints:function(){return On},getCircleIntersectByPoint:function(){return Po},getDegree:function(){return Ho},getEllipseIntersectByPoint:function(){return Ki},getLineIntersect:function(){return Eo},getPointsCenter:function(){return Ca},getRectIntersectByPoint:function(){return Yo},intersectBBox:function(){return Va},invertMatrix:function(){return Ns},isPointInPolygon:function(){return $i},isPointsOverlap:function(){return di},isPolygonsIntersect:function(){return Zo},itemIntersectByLine:function(){return vo},lerp:function(){return hi},lerpArray:function(){return xi},move:function(){return ri},pointLineDistance:function(){return _o},pointLineSquareDist:function(){return ou},pointRectSquareDist:function(){return mi},rotate:function(){return ds},scale:function(){return wo},scaleMatrix:function(){return to},squareDist:function(){return So},translate:function(){return xo}});var L={};F.r(L),F.d(L,{cloneBesidesImg:function(){return Oi},getAnimateCfgWithCallback:function(){return ko},getBBox:function(){return Qo},getComboBBox:function(){return ys},getLabelPosition:function(){return vs},getLetterWidth:function(){return gs},getLoopCfgs:function(){return Jo},getTextSize:function(){return fu},plainCombosToTrees:function(){return ks},reconstructTree:function(){return ps},shouldRefreshEdge:function(){return Gu},traverseTree:function(){return Fa},traverseTreeUp:function(){return yo},truncateLabelByLength:function(){return cu}});var _={};F.r(_),F.d(_,{calculationItemsBBox:function(){return Ro},cloneEvent:function(){return Uu},formatPadding:function(){return hu},isNaN:function(){return ao},isViewportChanged:function(){return Wu},processParallelEdges:function(){return Xu},uniqueId:function(){return du}});var I={};F.r(I),F.d(I,{getClosedSpline:function(){return Qr},getControlPoint:function(){return bu},getSpline:function(){return $u},getStarPath:function(){return Tf},paddedHull:function(){return Go},pathToPoints:function(){return Eu},pointsToPolygon:function(){return as},roundedHull:function(){return Ks}});var T={};F.r(T),F.d(T,{defaultSubjectColors:function(){return Io}});var x={};F.r(x),F.d(x,{isForce:function(){return wu}});var p={};F.r(p),F.d(p,{getColorSetsBySubjectColors:function(){return mc},getColorsWithSubjectColor:function(){return Ms},mixColor:function(){return oi}});var v={};F.r(v),F.d(v,{arrayToTextureData:function(){return Gc},attributesToTextureData:function(){return wc},buildTextureData:function(){return Fc},buildTextureDataWithOneEdgeAttr:function(){return Ff},buildTextureDataWithTwoEdgeAttr:function(){return xc},proccessToFunc:function(){return Ec},radialLayout:function(){return tu}});var g={};F.r(g),F.d(g,{gpuDetector:function(){return Sc}});var d={};F.r(d),F.d(d,{getBrowserName:function(){return _c}});var c=F(99938),s=F(13526),m={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,r=this.events;this.graph=t,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!0),(0,s.each)(r,function(n,a){t.on(a,n)}),document.addEventListener("visibilitychange",function(){e.keydown=!1})},unbind:function(t){var e=this.events,r=t.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!1),(0,s.each)(e,function(n,a){t.off(a,n)}),t.get("canvas").set("draggable",r)},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}},M=function(){function E(){}return E.registerBehavior=function(t,e){if(!e)throw new Error("please specify handler for this behavior: ".concat(t));var r=(0,s.clone)(m);Object.assign(r,e);var n=function(i){var o=this;Object.assign(this,this.getDefaultCfg(),i);var u=this.getEvents();this.events=null;var l={};u&&((0,s.each)(u,function(h,y){l[y]=(0,s.wrapBehavior)(o,h)}),this.events=l)};n.prototype=r,E.types[t]=n},E.hasBehavior=function(t){return!!E.types[t]},E.getBehavior=function(t){return E.types[t]},E.types={},E}(),P=M,R=P,j=F(80216),Q=F(67516),G=function(t,e){var r=t.nodes,n=t.edges,a=[],i={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(o,u){i[o.id]=u;var l=[];a.push(l)}),n&&n.forEach(function(o){var u=o.source,l=o.target,h=i[u],y=i[l];!h&&h!==0||!y&&y!==0||(a[h][y]=1,e||(a[y][h]=1))}),a},W=G,H=function(t,e){return t===e},Z=function(){function E(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return E.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},E}(),J=function(){function E(t){t===void 0&&(t=H),this.head=null,this.tail=null,this.compare=t}return E.prototype.prepend=function(t){var e=new Z(t,this.head);return this.head=e,this.tail||(this.tail=e),this},E.prototype.append=function(t){var e=new Z(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},E.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 r=this.head;if(r!==null)for(;r.next;)this.compare(r.next.value,t)?(e=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,t)&&(this.tail=r),e},E.prototype.find=function(t){var e=t.value,r=e===void 0?void 0:e,n=t.callback,a=n===void 0?void 0:n;if(!this.head)return null;for(var i=this.head;i;){if(a&&a(i.value)||r!==void 0&&this.compare(i.value,r))return i;i=i.next}return null},E.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},E.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},E.prototype.fromArray=function(t){var e=this;return t.forEach(function(r){return e.append(r)}),this},E.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},E.prototype.reverse=function(){for(var t=this.head,e=null,r=null;t;)r=t.next,t.next=e,e=t,t=r;this.tail=this.head,this.head=e},E.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},E}(),K=J,ne=function(){function E(){this.linkedList=new K}return E.prototype.isEmpty=function(){return!this.linkedList.head},E.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},E.prototype.enqueue=function(t){this.linkedList.append(t)},E.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},E.prototype.toString=function(t){return this.linkedList.toString(t)},E}(),se=ne,fe=function(t,e,r){e===void 0&&(e=[]);var n=e.filter(function(u){return u.source===t||u.target===t});if(r==="target"){var a=function(l){return l.source===t};return n.filter(a).map(function(u){return u.target})}if(r==="source"){var i=function(l){return l.target===t};return n.filter(i).map(function(u){return u.source})}var o=function(l){return l.source===t?l.target:l.source};return n.map(o)},Ie=function(t,e){return e.filter(function(r){return r.source===t})},ye=function(t,e){return e.filter(function(r){return r.source===t||r.target===t})},Ae=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),r="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(r)};function Se(E){E===void 0&&(E={});var t=E,e=function(){},r=function(){var n={};return function(a){var i=a.next,o=i;return n[o]?!1:(n[o]=!0,!0)}}();return t.allowTraversal=E.allowTraversal||r,t.enter=E.enter||e,t.leave=E.leave||e,t}var we=function(t,e,r,n){n===void 0&&(n=!0);var a=Se(r),i=new se,o=t.edges,u=o===void 0?[]:o;i.enqueue(e);for(var l="",h=function(){var O=i.dequeue();a.enter({current:O,previous:l}),fe(O,u,n?"target":void 0).forEach(function(A){a.allowTraversal({previous:l,current:O,next:A})&&i.enqueue(A)}),a.leave({current:O,previous:l}),l=O};!i.isEmpty();)h()},Te=we,ke=function(t){for(var e=t.nodes,r=e===void 0?[]:e,n=t.edges,a=n===void 0?[]:n,i=[],o={},u=[],l=function A(z){u.push(z),o[z.id]=!0;for(var $=fe(z.id,a),ae=function(ve){var Ce=$[ve];if(!o[Ce]){var Re=r.filter(function(Ve){return Ve.id===Ce});Re.length>0&&A(Re[0])}},ce=0;ce<$.length;++ce)ae(ce)},h=0;h<r.length;h++){var y=r[h];if(!o[y.id]){l(y);for(var O=[];u.length>0;)O.push(u.pop());i.push(O)}}return i},Ge=function(t){for(var e=t.nodes,r=e===void 0?[]:e,n=t.edges,a=n===void 0?[]:n,i=[],o={},u={},l={},h=[],y=0,O=function ae(ce){u[ce.id]=y,l[ce.id]=y,y+=1,i.push(ce),o[ce.id]=!0;for(var ue=fe(ce.id,a,"target").filter(function(Ue){return r.map(function($e){return $e.id}).indexOf(Ue)>-1}),ve=function($e){var ot=ue[$e];if(!u[ot]&&u[ot]!==0){var et=r.filter(function(yt){return yt.id===ot});et.length>0&&ae(et[0]),l[ce.id]=Math.min(l[ce.id],l[ot])}else o[ot]&&(l[ce.id]=Math.min(l[ce.id],u[ot]))},Ce=0;Ce<ue.length;Ce++)ve(Ce);if(l[ce.id]===u[ce.id]){for(var Re=[];i.length>0;){var Ve=i.pop();if(o[Ve.id]=!1,Re.push(Ve),Ve===ce)break}Re.length>0&&h.push(Re)}},A=0,z=r;A<z.length;A++){var $=z[A];!u[$.id]&&u[$.id]!==0&&O($)}return h};function tt(E,t){return t?Ge(E):ke(E)}var He=function(t){var e={},r=t.nodes,n=r===void 0?[]:r,a=t.edges,i=a===void 0?[]:a;return n.forEach(function(o){e[o.id]={degree:0,inDegree:0,outDegree:0}}),i.forEach(function(o){e[o.source].degree++,e[o.source].outDegree++,e[o.target].degree++,e[o.target].inDegree++}),e},ft=He,Lt=function(t,e){var r=He(t);return r[e]?He(t)[e].inDegree:0},Jt=function(t,e){var r=He(t);return r[e]?He(t)[e].outDegree:0};function Qe(E){E===void 0&&(E={});var t=E,e=function(){},r=function(){var n={};return function(a){var i=a.next;return n[i]?!1:(n[i]=!0,!0)}}();return t.allowTraversal=E.allowTraversal||r,t.enter=E.enter||e,t.leave=E.leave||e,t}function ut(E,t,e,r,n){n===void 0&&(n=!0),r.enter({current:t,previous:e});var a=E.edges,i=a===void 0?[]:a;fe(t,i,n?"target":void 0).forEach(function(o){r.allowTraversal({previous:e,current:t,next:o})&&ut(E,o,t,r,n)}),r.leave({current:t,previous:e})}function xt(E,t,e,r){r===void 0&&(r=!0),ut(E,t,"",Qe(e),r)}var dt=function(t){var e=null,r=t.nodes,n=r===void 0?[]:r,a={},i={},o={},u={};n.forEach(function(y){i[y.id]=y});for(var l={enter:function(O){var A=O.current,z=O.previous;if(o[A]){e={};for(var $=A,ae=z;ae!==A;)e[$]=ae,$=ae,ae=a[ae];e[$]=ae}else o[A]=A,delete i[A],a[A]=z},leave:function(O){var A=O.current;u[A]=A,delete o[A]},allowTraversal:function(O){var A=O.next;return e?!1:!u[A]}};Object.keys(i).length;){var h=Object.keys(i)[0];xt(t,h,l)}return e},pt=function(t,e,r){var n,a;r===void 0&&(r=!0);for(var i=[],o=tt(t,!1),u=0,l=o;u<l.length;u++){var h=l[u];if(h.length)for(var y=h[0],O=y.id,A=[y],z=(n={},n[O]=y,n),$=(a={},a[O]=new Set,a);A.length>0;)for(var ae=A.pop(),ce=ae.id,ue=fe(ce,t.edges),ve=function(Ve){var Ue,$e=ue[Ve],ot=t.nodes.find(function(Mr){return Mr.id===$e});if($e===ce)i.push((Ue={},Ue[$e]=ae,Ue));else if(!($e in $))z[$e]=ae,A.push(ot),$[$e]=new Set([ae]);else if(!$[ce].has(ot)){for(var et=!0,yt=[ot,ae],Gt=z[ce];$[$e].size&&!$[$e].has(Gt)&&(yt.push(Gt),Gt!==z[Gt.id]);)Gt=z[Gt.id];if(yt.push(Gt),e&&r?(et=!1,yt.findIndex(function(Mr){return e.indexOf(Mr.id)>-1})>-1&&(et=!0)):e&&!r&&yt.findIndex(function(Mr){return e.indexOf(Mr.id)>-1})>-1&&(et=!1),et){for(var yr={},kr=1;kr<yt.length;kr+=1)yr[yt[kr-1].id]=yt[kr];yt.length&&(yr[yt[yt.length-1].id]=yt[0]),i.push(yr)}$[$e].add(ae)}},Ce=0;Ce<ue.length;Ce+=1)ve(Ce)}return i},wt=function(t,e,r){r===void 0&&(r=!0);for(var n=[],a=new Set,i=[],o=[],u={},l={},h=function(Gt){for(var yr=[Gt];yr.length>0;){var kr=yr.pop();a.has(kr)&&(a.delete(kr),i[kr.id].forEach(function(Mr){yr.push(Mr)}),i[kr.id].clear())}},y=function yt(Gt,yr,kr){var Mr=!1;if(e&&r===!1&&e.indexOf(Gt.id)>-1)return Mr;n.push(Gt),a.add(Gt);for(var dr=kr[Gt.id],hn=0;hn<dr.length;hn+=1){var on=u[dr[hn]];if(on===yr){for(var cr={},Rr=1;Rr<n.length;Rr+=1)cr[n[Rr-1].id]=n[Rr];n.length&&(cr[n[n.length-1].id]=n[0]),o.push(cr),Mr=!0}else a.has(on)||yt(on,yr,kr)&&(Mr=!0)}if(Mr)h(Gt);else for(var hn=0;hn<dr.length;hn+=1){var on=u[dr[hn]];i[on.id].has(Gt)||i[on.id].add(Gt)}return n.pop(),Mr},O=t.nodes,A=O===void 0?[]:O,z=0;z<A.length;z+=1){var $=A[z],ae=$.id;l[ae]=z,u[z]=$}if(e&&r)for(var ce=function(Gt){var yr=e[Gt];l[A[Gt].id]=l[yr],l[yr]=0,u[0]=A.find(function(kr){return kr.id===yr}),u[l[A[Gt].id]]=A[Gt]},z=0;z<e.length;z++)ce(z);for(var ue=function(Gt){for(var yr,kr,Mr=1/0,dr=0;dr<Gt.length;dr+=1)for(var hn=Gt[dr],on=0;on<hn.length;on++){var cr=l[hn[on].id];cr<Mr&&(Mr=cr,kr=dr)}for(var Rr=Gt[kr],Yr=[],dr=0;dr<Rr.length;dr+=1){var Wr=Rr[dr];Yr[Wr.id]=[];for(var sn=0,wn=fe(Wr.id,t.edges,"target").filter(function(Ra){return Rr.map(function(Ia){return Ia.id}).indexOf(Ra)>-1});sn<wn.length;sn++){var la=wn[sn];la===Wr.id&&!(r===!1&&e.indexOf(Wr.id)>-1)?o.push((yr={},yr[Wr.id]=Wr,yr)):Yr[Wr.id].push(l[la])}}return{component:Rr,adjList:Yr,minIdx:Mr}},ve=0;ve<A.length;){var Ce=A.filter(function(yt){return l[yt.id]>=ve}),Re=Ge({nodes:Ce,edges:t.edges}).filter(function(yt){return yt.length>1});if(Re.length===0)break;var Ve=ue(Re),Ue=Ve.minIdx,$e=Ve.adjList,ot=Ve.component;if(ot.length>1){ot.forEach(function(yt){i[yt.id]=new Set});var et=u[Ue];if(e&&r&&e.indexOf(et.id)===-1)return o;y(et,et,$e),ve=Ue+1}else break}return o},mt=function(t,e,r,n){return n===void 0&&(n=!0),e?wt(t,r,n):pt(t,r,n)},ur=dt,Ir=function(t,e,r){for(var n=1/0,a,i=0;i<e.length;i++){var o=e[i].id;!r[o]&&t[o]<=n&&(n=t[o],a=e[i])}return a},Nr=function(t,e,r,n){var a=t.nodes,i=a===void 0?[]:a,o=t.edges,u=o===void 0?[]:o,l=[],h={},y={},O={};i.forEach(function(ve,Ce){var Re=ve.id;l.push(Re),y[Re]=1/0,Re===e&&(y[Re]=0)});for(var A=i.length,z=function(Ce){var Re=Ir(y,i,h),Ve=Re.id;if(h[Ve]=!0,y[Ve]===1/0)return"continue";var Ue=[];r?Ue=Ie(Ve,u):Ue=ye(Ve,u),Ue.forEach(function($e){var ot=$e.target,et=$e.source,yt=ot===Ve?et:ot,Gt=n&&$e[n]?$e[n]:1;y[yt]>y[Re.id]+Gt?(y[yt]=y[Re.id]+Gt,O[yt]=[Re.id]):y[yt]===y[Re.id]+Gt&&O[yt].push(Re.id)})},$=0;$<A;$++)z($);O[e]=[e];var ae={};for(var ce in y)y[ce]!==1/0&&It(e,ce,O,ae);var ue={};for(var ce in ae)ue[ce]=ae[ce][0];return{length:y,path:ue,allPath:ae}},Hr=Nr;function It(E,t,e,r){if(E===t)return[E];if(r[t])return r[t];for(var n=[],a=0,i=e[t];a<i.length;a++){var o=i[a],u=It(E,o,e,r);if(!u)return;for(var l=0,h=u;l<h.length;l++){var y=h[l];(0,s.isArray)(y)?n.push((0,c.__spreadArray)((0,c.__spreadArray)([],y,!0),[t],!1)):n.push([y,t])}}return r[t]=n,r[t]}var qt=function(t,e,r,n,a){var i=Hr(t,e,n,a),o=i.length,u=i.path,l=i.allPath;return{length:o[r],path:u[r],allPath:l[r]}},ar=function(t,e,r,n){var a;if(e===r)return[[e]];var i=t.edges,o=i===void 0?[]:i,u=[e],l=(a={},a[e]=!0,a),h=[],y=[],O=n?fe(e,o,"target"):fe(e,o);for(h.push(O);u.length>0&&h.length>0;){var A=h[h.length-1];if(A.length){var z=A.shift();z&&(u.push(z),l[z]=!0,O=n?fe(z,o,"target"):fe(z,o),h.push(O.filter(function(ce){return!l[ce]})))}else{var $=u.pop();l[$]=!1,h.pop();continue}if(u[u.length-1]===r){var ae=u.map(function(ue){return ue});y.push(ae);var $=u.pop();l[$]=!1,h.pop()}}return y},Oe=function(t,e){for(var r=W(t,e),n=[],a=r.length,i=0;i<a;i+=1){n[i]=[];for(var o=0;o<a;o+=1)i===o?n[i][o]=0:r[i][o]===0||!r[i][o]?n[i][o]=1/0:n[i][o]=r[i][o]}for(var u=0;u<a;u+=1)for(var i=0;i<a;i+=1)for(var o=0;o<a;o+=1)n[i][o]>n[i][u]+n[u][o]&&(n[i][o]=n[i][u]+n[u][o]);return n},Pr=Oe,Cr=function(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e3);var a=t.nodes,i=a===void 0?[]:a,o=t.edges,u=o===void 0?[]:o,l={},h={};i.forEach(function(Ce,Re){var Ve=Ae();Ce.clusterId=Ve,l[Ve]={id:Ve,nodes:[Ce]},h[Ce.id]={node:Ce,idx:Re}});var y=W(t,e),O=[],A={};y.forEach(function(Ce,Re){var Ve=0,Ue=i[Re].id;A[Ue]={},Ce.forEach(function($e,ot){if($e){Ve+=$e;var et=i[ot].id;A[Ue][et]=$e}}),O.push(Ve)});for(var z=0,$=function(){var Re=!1;if(i.forEach(function(Ve){var Ue={};Object.keys(A[Ve.id]).forEach(function(Mr){var dr=A[Ve.id][Mr],hn=h[Mr].node,on=hn.clusterId;Ue[on]||(Ue[on]=0),Ue[on]+=dr});var $e=-1/0,ot=[];if(Object.keys(Ue).forEach(function(Mr){$e<Ue[Mr]?($e=Ue[Mr],ot=[Mr]):$e===Ue[Mr]&&ot.push(Mr)}),!(ot.length===1&&ot[0]===Ve.clusterId)){var et=ot.indexOf(Ve.clusterId);if(et>=0&&ot.splice(et,1),ot&&ot.length){Re=!0;var yt=l[Ve.clusterId],Gt=yt.nodes.indexOf(Ve);yt.nodes.splice(Gt,1);var yr=Math.floor(Math.random()*ot.length),kr=l[ot[yr]];kr.nodes.push(Ve),Ve.clusterId=kr.id}}}),!Re)return"break";z++};z<n;){var ae=$();if(ae==="break")break}Object.keys(l).forEach(function(Ce){var Re=l[Ce];(!Re.nodes||!Re.nodes.length)&&delete l[Ce]});var ce=[],ue={};u.forEach(function(Ce){var Re=Ce.source,Ve=Ce.target,Ue=Ce[r]||1,$e=h[Re].node.clusterId,ot=h[Ve].node.clusterId,et="".concat($e,"---").concat(ot);if(ue[et])ue[et].weight+=Ue,ue[et].count++;else{var yt={source:$e,target:ot,weight:Ue,count:1};ue[et]=yt,ce.push(yt)}});var ve=[];return Object.keys(l).forEach(function(Ce){ve.push(l[Ce])}),{clusters:ve,clusterEdges:ce}},Gr=Cr,mr=function(){function E(t){this.arr=t}return E.prototype.getArr=function(){return this.arr||[]},E.prototype.add=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new E(r);if(!(r!=null&&r.length))return new E(this.arr);if(this.arr.length===r.length){var n=[];for(var a in this.arr)n[a]=this.arr[a]+r[a];return new E(n)}},E.prototype.subtract=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new E(r);if(!(r!=null&&r.length))return new E(this.arr);if(this.arr.length===r.length){var n=[];for(var a in this.arr)n[a]=this.arr[a]-r[a];return new E(n)}},E.prototype.avg=function(t){var e=[];if(t!==0)for(var r in this.arr)e[r]=this.arr[r]/t;return new E(e)},E.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new E(t)},E.prototype.squareEuclideanDistance=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var n=0;for(var a in this.arr)n+=Math.pow(this.arr[a]-t.arr[a],2);return n}},E.prototype.euclideanDistance=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var n=0;for(var a in this.arr)n+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(n)}else console.error("The two vectors are unequal in length.")},E.prototype.normalize=function(){var t=[],e=(0,s.clone)(this.arr);e.sort(function(i,o){return i-o});var r=e[e.length-1],n=e[0];for(var a in this.arr)t[a]=(this.arr[a]-n)/(r-n);return new E(t)},E.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return 0;var e=0;for(var r in this.arr)e+=Math.pow(this.arr[r],2);return Math.sqrt(e)},E.prototype.dot=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var n=0;for(var a in this.arr)n+=this.arr[a]*t.arr[a];return n}else console.error("The two vectors are unequal in length.")},E.prototype.equal=function(t){var e,r=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(r==null?void 0:r.length))return!1;for(var n in this.arr)if(this.arr[n]!==r[n])return!1;return!0},E}(),rn=mr,Sr=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,qr=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,Rn=function(t,e){t===void 0&&(t=[]),e===void 0&&(e=100);var r={};t.forEach(function(a){a.properties&&Object.keys(a.properties).forEach(function(i){if(i==="id"||!"".concat(a.properties[i]).match(Sr)&&!"".concat(a.properties[i]).match(qr)&&isNaN(Number(a.properties[i]))){r.hasOwnProperty(i)&&delete r[i];return}r.hasOwnProperty(i)?r[i]+=1:r[i]=1})});var n=Object.keys(r).sort(function(a,i){return r[i]-r[a]});return n.length<e?n:n.slice(0,e)},yn=function(t,e){return e.map(function(r){return t.hasOwnProperty(r)?t[r]:0})},zr=function(t){for(var e=Rn(t),r=[],n=0;n<t.length;n++)r[n]=yn(t[n].properties,e);return r},Rt=function(t,e){e===void 0&&(e=void 0);var r=[];return t.forEach(function(n){e===void 0&&r.push(n),n[e]!==void 0&&r.push(n[e])}),r},zt={getAllSortProperties:Rn,getPropertyWeight:zr,getAllProperties:Rt},Vt;(function(E){E.EuclideanDistance="euclideanDistance"})(Vt||(Vt={}));var hr=function(t,e,r){var n=[];e!=null&&e.length?n=e:(t.forEach(function(i){n=n.concat(Object.keys(i))}),n=(0,s.uniq)(n));var a={};return n.forEach(function(i){var o=[];t.forEach(function(u){u[i]!==void 0&&u[i]!==""&&o.push(u[i])}),o.length&&!(r!=null&&r.includes(i))&&(a[i]=(0,s.uniq)(o))}),a},Ar=function(t,e,r){var n=hr(t,e,r),a=[];if(!Object.keys(n).length)return a;var i=Object.values(n),o=i.every(function(u){return u.every(function(l){return typeof l=="number"})});return t.forEach(function(u,l){var h=[];Object.keys(n).forEach(function(y){var O=u[y],A=n[y],z=A.findIndex(function(ce){return O===ce}),$=[];if(o)$.push(O);else for(var ae=0;ae<A.length;ae++)ae===z?$.push(1):$.push(0);h=h.concat($)}),a[l]=h}),a},en=function(t,e,r,n){r===void 0&&(r=Vt.EuclideanDistance);var a=0;switch(r){case Vt.EuclideanDistance:a=new rn(t).euclideanDistance(new rn(e));break;default:break}return a},Fr={getAllKeyValueMap:hr,oneHot:Ar,getDistance:en},Cn=function(t,e,r,n){for(var a=e.length,i=2*n,o=0,u=0;u<a;u++)for(var l=t[u].clusterId,h=0;h<a;h++){var y=t[h].clusterId;if(l===y){var O=e[u][h]||0,A=r[u]||0,z=r[h]||0;o+=O-A*z/i}}return o*=1/i,o},Sn=function(t,e){t===void 0&&(t=[]);for(var r=t.length,n=new rn([]),a=0;a<r;a++)n=n.add(new rn(e[a]));var i=n.avg(r);i.normalize();for(var o=0,a=0;a<r;a++){var u=new rn(e[a]),l=u.squareEuclideanDistance(i);o+=l}var h=[];t.forEach(function(){h.push([])});for(var a=0;a<r;a++){var u=new rn(e[a]);t[a].clusterInertial=0;for(var y=0;y<r;y++){if(a===y){h[a][y]=0;continue}var O=new rn(e[y]);h[a][y]=u.squareEuclideanDistance(O),t[a].clusterInertial+=h[a][y]}}for(var A=0,z=2*r*o,a=0;a<r;a++)for(var $=t[a].clusterId,y=0;y<r;y++){var ae=t[y].clusterId;if(!(a===y||$!==ae)){var ce=t[a].clusterInertial*t[y].clusterInertial/Math.pow(z,2)-h[a][y]/z;A+=ce}}return Number(A.toFixed(4))},oa=function(t,e,r,n,a,i,o,u,l){e===void 0&&(e=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e-4),a===void 0&&(a=!1),i===void 0&&(i=void 0),o===void 0&&(o=[]),u===void 0&&(u=["id"]),l===void 0&&(l=1);var h=t.nodes,y=h===void 0?[]:h,O=t.edges,A=O===void 0?[]:O,z=[];if(a){y.forEach(function(cr,Rr){cr.properties=cr.properties||{},cr.originIndex=Rr});var $=[];y.every(function(cr){return cr.hasOwnProperty("nodeType")})&&($=Array.from(new Set(y.map(function(cr){return cr.nodeType}))),y.forEach(function(cr){cr.properties.nodeType=$.findIndex(function(Rr){return Rr===cr.nodeType})}));var ae=Rt(y,i);z=Ar(ae,o,u)}var ce=1,ue={},ve={};y.forEach(function(cr,Rr){var Yr=String(ce++);cr.clusterId=Yr,ue[Yr]={id:Yr,nodes:[cr]},ve[cr.id]={node:cr,idx:Rr}});var Ce=W(t,e),Re=[],Ve={},Ue=0;Ce.forEach(function(cr,Rr){var Yr=0,Wr=y[Rr].id;Ve[Wr]={},cr.forEach(function(sn,wn){if(sn){Yr+=sn;var la=y[wn].id;Ve[Wr][la]=sn,Ue+=sn}}),Re.push(Yr)}),Ue/=2;for(var $e=1/0,ot=1/0,et=0,yt=[],Gt={};;){a&&y.every(function(cr){return cr.hasOwnProperty("properties")})?$e=Cn(y,Ce,Re,Ue)+Sn(y,z)*l:$e=Cn(y,Ce,Re,Ue),et===0&&(ot=$e,yt=y,Gt=ue);var yr=$e>0&&$e>ot&&$e-ot<n;if($e>ot&&(yt=y.map(function(cr){return{node:cr,clusterId:cr.clusterId}}),Gt=(0,s.clone)(ue),ot=$e),yr||et>100)break;et++,Object.keys(ue).forEach(function(cr){var Rr=0;A.forEach(function(Yr){var Wr=Yr.source,sn=Yr.target,wn=ve[Wr].node.clusterId,la=ve[sn].node.clusterId;(wn===cr&&la!==cr||la===cr&&wn!==cr)&&(Rr=Rr+(Yr[r]||1))}),ue[cr].sumTot=Rr}),y.forEach(function(cr,Rr){var Yr=ue[cr.clusterId],Wr=0,sn,wn=Re[Rr]/(2*Ue),la=0,da=Yr.nodes;da.forEach(function(Ri){var Bi=ve[Ri.id].idx;la+=Ce[Rr][Bi]||0});var Ra=la-Yr.sumTot*wn,Ia=da.filter(function(Ri){return Ri.id!==cr.id}),Xa=[];Ia.forEach(function(Ri,Bi){Xa[Bi]=z[Ri.originIndex]});var Ga=Sn(Ia,z)*l,ci=Ve[cr.id];if(Object.keys(ci).forEach(function(Ri){var Bi=ve[Ri].node,fs=Bi.clusterId;if(fs!==cr.clusterId){var lo=ue[fs],Lo=lo.nodes;if(!(!Lo||!Lo.length)){var pa=0;Lo.forEach(function(Ea){var xa=ve[Ea.id].idx;pa+=Ce[Rr][xa]||0});var Oa=pa-lo.sumTot*wn,va=Lo.concat([cr]),La=[];va.forEach(function(Ea,xa){La[xa]=z[Ea.originIndex]});var za=Sn(va,z)*l,Pn=Oa-Ra;a&&(Pn=Oa+za-(Ra+Ga)),Pn>Wr&&(Wr=Pn,sn=lo)}}}),Wr>0){sn.nodes.push(cr);var ja=cr.clusterId;cr.clusterId=sn.id;var Os=Yr.nodes.indexOf(cr);Yr.nodes.splice(Os,1);var ki=0,Ls=0;A.forEach(function(Ri){var Bi=Ri.source,fs=Ri.target,lo=ve[Bi].node.clusterId,Lo=ve[fs].node.clusterId;(lo===sn.id&&Lo!==sn.id||Lo===sn.id&&lo!==sn.id)&&(ki=ki+(Ri[r]||1)),(lo===ja&&Lo!==ja||Lo===ja&&lo!==ja)&&(Ls=Ls+(Ri[r]||1))}),sn.sumTot=ki,Yr.sumTot=Ls}})}var kr={},Mr=0;Object.keys(Gt).forEach(function(cr){var Rr=Gt[cr];if(!Rr.nodes||!Rr.nodes.length){delete Gt[cr];return}var Yr=String(Mr+1);Yr!==cr&&(Rr.id=Yr,Rr.nodes=Rr.nodes.map(function(Wr){return{id:Wr.id,clusterId:Yr}}),Gt[Yr]=Rr,kr[cr]=Yr,delete Gt[cr],Mr++)}),yt.forEach(function(cr){var Rr=cr.node,Yr=cr.clusterId;Rr&&(Rr.clusterId=Yr,Rr.clusterId&&kr[Rr.clusterId]&&(Rr.clusterId=kr[Rr.clusterId]))});var dr=[],hn={};A.forEach(function(cr){var Rr=cr.source,Yr=cr.target,Wr=cr[r]||1,sn=ve[Rr].node.clusterId,wn=ve[Yr].node.clusterId;if(!(!sn||!wn)){var la="".concat(sn,"---").concat(wn);if(hn[la])hn[la].weight+=Wr,hn[la].count++;else{var da={source:sn,target:wn,weight:Wr,count:1};hn[la]=da,dr.push(da)}}});var on=[];return Object.keys(Gt).forEach(function(cr){on.push(Gt[cr])}),{clusters:on,clusterEdges:dr}},jr=oa,xn=function(t,e,r,n,a,i,o,u){return e===void 0&&(e=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e-4),a===void 0&&(a=void 0),i===void 0&&(i=[]),o===void 0&&(o=["id"]),u===void 0&&(u=1),jr(t,e,r,n,!0,a,i,o,u)},vn=xn,un=function(t,e){var r;e===void 0&&(e=1);for(var n=(0,s.clone)(t),a=n.nodes,i=a===void 0?[]:a,o=n.edges,u=o===void 0?[]:o,l=function(){var O=ft({nodes:i,edges:u}),A=Object.keys(O);A.sort(function(ae,ce){var ue,ve;return((ue=O[ae])===null||ue===void 0?void 0:ue.degree)-((ve=O[ce])===null||ve===void 0?void 0:ve.degree)});var z=A[0];if(!i.length||((r=O[z])===null||r===void 0?void 0:r.degree)>=e)return"break";var $=i.findIndex(function(ae){return ae.id===z});i.splice($,1),u=u.filter(function(ae){return!(ae.source===z||ae.target===z)})};;){var h=l();if(h==="break")break}return{nodes:i,edges:u}},Wn=un,Y=function(t,e,r){var n=[];switch(t){case Vt.EuclideanDistance:n=e[r];break;default:n=[];break}return n},ie=function(t,e,r,n,a,i){e===void 0&&(e=3),r===void 0&&(r=void 0),n===void 0&&(n=[]),a===void 0&&(a=["id"]),i===void 0&&(i=Vt.EuclideanDistance);var o=t.nodes,u=o===void 0?[]:o,l=t.edges,h=l===void 0?[]:l,y={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(i===Vt.EuclideanDistance&&!u.every(function(Yr){return Yr.hasOwnProperty(r)}))return y;var O=[],A=[];if(i===Vt.EuclideanDistance&&(O=Rt(u,r),A=Ar(O,n,a)),!A.length)return y;for(var z=(0,s.uniq)(A.map(function(Yr){return Yr.join("")})),$=Math.min(e,u.length,z.length),ae=0;ae<u.length;ae++)u[ae].originIndex=ae;for(var ce=[],ue=[],ve=[],ae=0;ae<$;ae++)if(ae===0){var Ce=Math.floor(Math.random()*u.length);switch(i){case Vt.EuclideanDistance:ce[ae]=A[Ce];break;default:ce[ae]=[];break}ue.push(Ce),ve[ae]=[u[Ce]],u[Ce].clusterId=String(ae)}else{for(var Re=-1/0,Ve=0,Ue=function(sn){if(!ue.includes(sn)){for(var wn=0,la=0;la<ce.length;la++){var da=0;switch(i){case Vt.EuclideanDistance:da=en(A[u[sn].originIndex],ce[la],i);break;default:break}wn+=da}var Ra=wn/ce.length;Ra>Re&&!ce.find(function(Ia){return(0,s.isEqual)(Ia,Y(i,A,u[sn].originIndex))})&&(Re=Ra,Ve=sn)}},$e=0;$e<u.length;$e++)Ue($e);ce[ae]=Y(i,A,Ve),ue.push(Ve),ve[ae]=[u[Ve]],u[Ve].clusterId=String(ae)}for(var ot=0;;){for(var ae=0;ae<u.length;ae++){var et=0,yt=1/0;if(!(ot===0&&ue.includes(ae))){for(var Gt=0;Gt<ce.length;Gt++){var yr=0;switch(i){case Vt.EuclideanDistance:yr=en(A[ae],ce[Gt],i);break;default:break}yr<yt&&(yt=yr,et=Gt)}if(u[ae].clusterId!==void 0)for(var kr=ve[Number(u[ae].clusterId)].length-1;kr>=0;kr--)ve[Number(u[ae].clusterId)][kr].id===u[ae].id&&ve[Number(u[ae].clusterId)].splice(kr,1);u[ae].clusterId=String(et),ve[et].push(u[ae])}}for(var Mr=!1,ae=0;ae<ve.length;ae++){for(var dr=ve[ae],hn=new rn([]),Gt=0;Gt<dr.length;Gt++)hn=hn.add(new rn(A[dr[Gt].originIndex]));var on=hn.avg(dr.length);on.equal(new rn(ce[ae]))||(Mr=!0,ce[ae]=on.getArr())}if(ot++,u.every(function(Yr){return Yr.clusterId!==void 0})&&Mr||ot>=1e3)break}var cr=[],Rr={};return h.forEach(function(Yr){var Wr,sn,wn=Yr.source,la=Yr.target,da=(Wr=u.find(function(Ga){return Ga.id===wn}))===null||Wr===void 0?void 0:Wr.clusterId,Ra=(sn=u.find(function(Ga){return Ga.id===la}))===null||sn===void 0?void 0:sn.clusterId,Ia="".concat(da,"---").concat(Ra);if(Rr[Ia])Rr[Ia].count++;else{var Xa={source:da,target:Ra,count:1};Rr[Ia]=Xa,cr.push(Xa)}}),{clusters:ve,clusterEdges:cr}},ee=ie,C=function(t,e){var r=new rn(e),n=r.norm2(),a=new rn(t),i=a.norm2(),o=r.dot(a),u=n*i,l=u?o/u:0;return l},b=C,S=function(t,e,r,n,a){t===void 0&&(t=[]),r===void 0&&(r=void 0),n===void 0&&(n=[]),a===void 0&&(a=[]);var i=(0,s.clone)(t.filter(function(O){return O.id!==e.id})),o=t.findIndex(function(O){return O.id===e.id}),u=Rt(t,r),l=Ar(u,n,a),h=l[o],y=[];return i.forEach(function(O,A){if(O.id!==e.id){var z=l[A],$=b(z,h);y.push($),O.cosineSimilarity=$}}),i.sort(function(O,A){return A.cosineSimilarity-O.cosineSimilarity}),{allCosineSimilarity:y,similarNodes:i}},X=S,pe=function(){function E(t){this.count=t.length,this.parent={};for(var e=0,r=t;e<r.length;e++){var n=r[e];this.parent[n]=n}}return E.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},E.prototype.union=function(t,e){var r=this.find(t),n=this.find(e);r!==n&&(r<n?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},E.prototype.connected=function(t,e){return this.find(t)===this.find(e)},E}(),Me=pe,me=function(t,e){return t-e},Le=function(){function E(t){t===void 0&&(t=me),this.compareFn=t,this.list=[]}return E.prototype.getLeft=function(t){return 2*t+1},E.prototype.getRight=function(t){return 2*t+2},E.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},E.prototype.isEmpty=function(){return this.list.length<=0},E.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},E.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},E.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},E.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},E.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),a=this.getRight(t),i=this.list.length;n!==null&&n<i&&this.compareFn(this.list[r],this.list[n])>0?r=n:a!==null&&a<i&&this.compareFn(this.list[r],this.list[a])>0&&(r=a),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},E}(),st=Le,qe=function(t,e){var r=[],n=t.nodes,a=n===void 0?[]:n,i=t.edges,o=i===void 0?[]:i;if(a.length===0)return r;var u=a[0],l=new Set;l.add(u);var h=function(ae,ce){return e?ae.weight-ce.weight:0},y=new st(h);for(ye(u.id,o).forEach(function($){y.insert($)});!y.isEmpty();){var O=y.delMin(),A=O.source,z=O.target;l.has(A)&&l.has(z)||(r.push(O),l.has(A)||(l.add(A),ye(A,o).forEach(function($){y.insert($)})),l.has(z)||(l.add(z),ye(z,o).forEach(function($){y.insert($)})))}return r},Nt=function(t,e){var r=[],n=t.nodes,a=n===void 0?[]:n,i=t.edges,o=i===void 0?[]:i;if(a.length===0)return r;var u=o.map(function(A){return A});e&&u.sort(function(A,z){return A.weight-z.weight});for(var l=new Me(a.map(function(A){return A.id}));u.length>0;){var h=u.shift(),y=h.source,O=h.target;l.connected(y,O)||(r.push(h),l.union(y,O))}return r},nr=function(t,e,r){var n={prim:qe,kruskal:Nt};return r?n[r](t,e):Nt(t,e)},Ft=nr,er=function(t,e,r){typeof e!="number"&&(e=1e-6),typeof r!="number"&&(r=.85);for(var n=1,a=0,i=1e3,o=t.nodes,u=o===void 0?[]:o,l=t.edges,h=l===void 0?[]:l,y=u.length,O,A={},z={},$=0;$<y;++$){var ae=u[$],ce=ae.id;A[ce]=1/y,z[ce]=1/y}for(var ue=ft(t);i>0&&n>e;){a=0;for(var $=0;$<y;++$){var ae=u[$],ce=ae.id;if(O=0,ue[ae.id].inDegree===0)A[ce]=0;else{for(var ve=fe(ce,h,"source"),Ce=0;Ce<ve.length;++Ce){var Re=ve[Ce],Ve=ue[Re].outDegree;Ve>0&&(O+=z[Re]/Ve)}A[ce]=r*O,a+=A[ce]}}a=(1-a)/y,n=0;for(var $=0;$<y;++$){var ae=u[$],ce=ae.id;O=A[ce]+a,n+=Math.abs(O-z[ce]),z[ce]=O}i-=1}return z},Ur=er,Ct=-1,Kt=-1,lr="-1",Dr="-1",br=-1,sa="-1",ea=function(){function E(t,e,r,n){t===void 0&&(t=Ct),e===void 0&&(e=Kt),r===void 0&&(r=Kt),n===void 0&&(n=lr),this.id=t,this.from=e,this.to=r,this.label=n}return E}(),gn=function(){function E(t,e){t===void 0&&(t=Kt),e===void 0&&(e=Dr),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return E.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},E}(),Tn=function(){function E(t,e,r){t===void 0&&(t=Kt),e===void 0&&(e=!0),r===void 0&&(r=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=r}return E.prototype.getNodeNum=function(){return this.nodes.length},E.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var r=new gn(t,e);this.nodes.push(r),this.nodeMap[t]=r,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},E.prototype.addEdge=function(t,e,r,n){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[r]&&this.nodeMap[r].edgeMap[t])){var a=new ea(t,e,r,n);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[n]||(this.edgeLabelMap[n]=[]),this.edgeLabelMap[n].push(a),!this.directed){var i=new ea(t,r,e,n);this.nodeMap[r].addEdge(i),this.edgeLabelMap[n].push(i)}}},E}(),ra=function(){function E(t,e,r,n,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:r||Dr,edgeLabel:n||lr,nodeLabel2:a||Dr}}return E.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},E.prototype.notEqualTo=function(t){return!this.equalTo(t)},E}(),Zn=function(){function E(){this.rmpath=[],this.dfsEdgeList=[]}return E.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,r=t.length;if(e!==r)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==t[n])return!1;return!0},E.prototype.notEqualTo=function(t){return!this.equalTo(t)},E.prototype.pushBack=function(t,e,r,n,a){return this.dfsEdgeList.push(new ra(t,e,r,n,a)),this.dfsEdgeList},E.prototype.toGraph=function(t,e){t===void 0&&(t=br),e===void 0&&(e=!1);var r=new Tn(t,!0,e);return this.dfsEdgeList.forEach(function(n){var a=n.fromNode,i=n.toNode,o=n.nodeEdgeNodeLabel,u=o.nodeLabel1,l=o.edgeLabel,h=o.nodeLabel2;u!==Dr&&r.addNode(a,u),h!==Dr&&r.addNode(i,h),u!==Dr&&h!==u&&r.addEdge(void 0,a,i,l)}),r},E.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,r=e-1;r>=0;r--){var n=this.dfsEdgeList[r],a=n.fromNode,i=n.toNode;a<i&&(t===void 0||i===t)&&(this.rmpath.push(r),t=a)}return this.rmpath},E.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach(function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)}),Object.keys(t).length},E}(),Vr=function(){function E(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return E.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},E.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},E}(),In=function(){function E(t){var e=t.graphs,r=t.minSupport,n=r===void 0?2:r,a=t.minNodeNum,i=a===void 0?1:a,o=t.maxNodeNum,u=o===void 0?4:o,l=t.top,h=l===void 0?10:l,y=t.directed,O=y===void 0?!1:y,A=t.verbose,z=A===void 0?!1:A;this.graphs=e,this.dfsCode=new Zn,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=n,this.top=h,this.directed=O,this.counter=0,this.maxNodeNum=u,this.minNodeNum=i,this.verbose=z,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return E.prototype.findForwardRootEdges=function(t,e){var r=this,n=[],a=t.nodeMap;return e.edges.forEach(function(i){(r.directed||e.label<=a[i.to].label)&&n.push(i)}),n},E.prototype.findBackwardEdge=function(t,e,r,n){if(!this.directed&&e===r)return null;for(var a=t.nodeMap,i=a[r.to],o=i.edges,u=o.length,l=0;l<u;l++){var h=o[l];if(!(n.hasEdge(h)||h.to!==e.from)){if(this.directed){if(a[e.from].label<a[r.to].label||a[e.from].label===a[r.to].label&&e.label<=h.label)return h}else if(e.label<h.label||e.label===h.label&&a[e.to].label<=a[r.to].label)return h}}return null},E.prototype.findForwardPureEdges=function(t,e,r,n){for(var a=[],i=e.to,o=t.nodeMap[i].edges,u=o.length,l=0;l<u;l++){var h=o[l],y=t.nodeMap[h.to];r<=y.label&&!n.hasNode(y)&&a.push(h)}return a},E.prototype.findForwardRmpathEdges=function(t,e,r,n){for(var a=[],i=t.nodeMap,o=i[e.to].label,u=i[e.from],l=u.edges,h=l.length,y=0;y<h;y++){var O=l[y],A=i[O.to].label;e.to===O.to||r>A||n.hasNode(i[O.to])||(e.label<O.label||e.label===O.label&&o<=A)&&a.push(O)}return a},E.prototype.getSupport=function(t){var e={};return t.forEach(function(r){e[r.graphId]||(e[r.graphId]=!0)}),Object.keys(e).length},E.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(r){var n=t[r],a=n.nodeLabel1,i=n.edgeLabel,o=n.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:i,nodeLabel2:o};return}(a<e.nodeLabel1||a===e.nodeLabel1&&i<e.edgeLabel||a===e.nodeLabel1&&i===e.edgeLabel&&o<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:i,nodeLabel2:o})}),e},E.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var r=this.directed,n=e.toGraph(br,r),a=n.nodeMap,i=new Zn,o={};n.nodes.forEach(function(y){var O=t.findForwardRootEdges(n,y);O.forEach(function(A){var z=a[A.to],$="".concat(y.label,"-").concat(A.label,"-").concat(z.label);o[$]||(o[$]={projected:[],nodeLabel1:y.label,edgeLabel:A.label,nodeLabel2:z.label});var ae={graphId:n.id,edge:A,preNode:null};o[$].projected.push(ae)})});var u=this.findMinLabel(o);if(u){i.dfsEdgeList.push(new ra(0,1,u.nodeLabel1,u.edgeLabel,u.nodeLabel2));var l=function y(O){for(var A=i.buildRmpath(),z=i.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,$=i.dfsEdgeList[A[0]].toNode,ae={},ce=!1,ue=0,ve=r?-1:0,Ce=function(hn){if(ce)return"break";O.forEach(function(on){var cr=new Vr(on),Rr=t.findBackwardEdge(n,cr.edges[A[hn]],cr.edges[A[0]],cr);Rr&&(ae[Rr.label]||(ae[Rr.label]={projected:[],edgeLabel:Rr.label}),ae[Rr.label].projected.push({graphId:n.id,edge:ae,preNode:on}),ue=i.dfsEdgeList[A[hn]].fromNode,ce=!0)})},Re=A.length-1;Re>ve;Re--){var Ve=Ce(Re);if(Ve==="break")break}if(ce){var Ue=t.findMinLabel(ae);i.dfsEdgeList.push(new ra($,ue,Dr,Ue.edgeLabel,Dr));var $e=i.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[$e]!==i.dfsEdgeList[$e]?!1:y(ae[Ue.edgeLabel].projected)}var ot={};ce=!1;var et=0;O.forEach(function(dr){var hn=new Vr(dr),on=t.findForwardPureEdges(n,hn.edges[A[0]],z,hn);on.length>0&&(ce=!0,et=$,on.forEach(function(cr){var Rr="".concat(cr.label,"-").concat(a[cr.to].label);ot[Rr]||(ot[Rr]={projected:[],edgeLabel:cr.label,nodeLabel2:a[cr.to].label}),ot[Rr].projected.push({graphId:n.id,edge:cr,preNode:dr})}))});for(var yt=A.length,Gt=function(hn){if(ce)return"break";var on=A[hn];O.forEach(function(cr){var Rr=new Vr(cr),Yr=t.findForwardRmpathEdges(n,Rr.edges[on],z,Rr);Yr.length>0&&(ce=!0,et=i.dfsEdgeList[on].fromNode,Yr.forEach(function(Wr){var sn="".concat(Wr.label,"-").concat(a[Wr.to].label);ot[sn]||(ot[sn]={projected:[],edgeLabel:Wr.label,nodeLabel2:a[Wr.to].label}),ot[sn].projected.push({graphId:n.id,edge:Wr,preNode:cr})}))})},Re=0;Re<yt;Re++){var yr=Gt(Re);if(yr==="break")break}if(!ce)return!0;var kr=t.findMinLabel(ot);i.dfsEdgeList.push(new ra(et,$+1,Dr,kr.edgeLabel,kr.nodeLabel2));var Mr=i.dfsEdgeList.length-1;return e.dfsEdgeList[Mr]!==i.dfsEdgeList[Mr]?!1:y(ot["".concat(kr.edgeLabel,"-").concat(kr.nodeLabel2)].projected)},h="".concat(u.nodeLabel1,"-").concat(u.edgeLabel,"-").concat(u.nodeLabel2);return l(o[h].projected)}},E.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,s.clone)(t))}},E.prototype.subGraphMining=function(t){var e=this,r=this.getSupport(t);if(!(r<this.minSupport)&&this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),i=this.dfsCode.dfsEdgeList[a[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u={},l={};t.forEach(function(h){for(var y=e.graphs[h.graphId],O=y.nodeMap,A=new Vr(h),z=a.length-1;z>=0;z--){var $=e.findBackwardEdge(y,A.edges[a[z]],A.edges[a[0]],A);if($){var ae="".concat(e.dfsCode.dfsEdgeList[a[z]].fromNode,"-").concat($.label);l[ae]||(l[ae]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[z]].fromNode,edgeLabel:$.label}),l[ae].projected.push({graphId:h.graphId,edge:$,preNode:h})}}if(!(n>=e.maxNodeNum)){var ce=e.findForwardPureEdges(y,A.edges[a[0]],o,A);ce.forEach(function(ve){var Ce="".concat(i,"-").concat(ve.label,"-").concat(O[ve.to].label);u[Ce]||(u[Ce]={projected:[],fromNodeId:i,edgeLabel:ve.label,nodeLabel2:O[ve.to].label}),u[Ce].projected.push({graphId:h.graphId,edge:ve,preNode:h})});for(var ue=function(Ce){var Re=e.findForwardRmpathEdges(y,A.edges[a[Ce]],o,A);Re.forEach(function(Ve){var Ue="".concat(e.dfsCode.dfsEdgeList[a[Ce]].fromNode,"-").concat(Ve.label,"-").concat(O[Ve.to].label);u[Ue]||(u[Ue]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[Ce]].fromNode,edgeLabel:Ve.label,nodeLabel2:O[Ve.to].label}),u[Ue].projected.push({graphId:h.graphId,edge:Ve,preNode:h})})},z=0;z<a.length;z++)ue(z)}}),Object.keys(l).forEach(function(h){var y=l[h],O=y.toNodeId,A=y.edgeLabel;e.dfsCode.dfsEdgeList.push(new ra(i,O,"-1",A,"-1")),e.subGraphMining(l[h].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(u).forEach(function(h){var y=u[h],O=y.fromNodeId,A=y.edgeLabel,z=y.nodeLabel2;e.dfsCode.dfsEdgeList.push(new ra(O,i+1,Dr,A,z)),e.subGraphMining(u[h].projected),e.dfsCode.dfsEdgeList.pop()})}},E.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,r=this.minSupport,n=this.frequentSize1Subgraphs,a={},i={},o={},u={};return Object.keys(t).forEach(function(l){var h=t[l],y=h.nodeMap;h.nodes.forEach(function(O,A){var z=O.label,$="".concat(l,"-").concat(z);if(!o[$]){var ae=a[z]||0;ae++,a[z]=ae}o[$]={graphKey:l,label:z},O.edges.forEach(function(ce){var ue=z,ve=y[ce.to].label;if(!e&&ue>ve){var Ce=ve;ve=ue,ue=Ce}var Re=ce.label,Ve="".concat(l,"-").concat(ue,"-").concat(Re,"-").concat(ve),Ue="".concat(ue,"-").concat(Re,"-").concat(ve);if(!i[Ue]){var $e=i[Ue]||0;$e++,i[Ue]=$e}u[Ve]={graphId:l,nodeLabel1:ue,edgeLabel:Re,nodeLabel2:ve}})})}),Object.keys(a).forEach(function(l){var h=a[l];if(!(h<r)){var y={nodes:[],edges:[]};y.nodes.push({id:"0",label:l}),n.push(y)}}),n},E.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,r=this.directed,n={};Object.keys(e).forEach(function(a){var i=e[a],o=i.nodeMap;i.nodes.forEach(function(u){var l=t.findForwardRootEdges(i,u);l.forEach(function(h){var y=o[h.to],O="".concat(u.label,"-").concat(h.label,"-").concat(y.label);n[O]||(n[O]={projected:[],nodeLabel1:u.label,edgeLabel:h.label,nodeLabel2:y.label});var A={graphId:a,edge:h,preNode:null};n[O].projected.push(A)})})}),Object.keys(n).forEach(function(a){var i=n[a],o=i.projected,u=i.nodeLabel1,l=i.edgeLabel,h=i.nodeLabel2;t.dfsCode.dfsEdgeList.push(new ra(0,1,u,l,h)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},E}(),at=function(t,e,r,n){var a={};return Object.keys(t).forEach(function(i,o){var u=t[i],l=new Tn(o,!0,e),h={};u.nodes.forEach(function(y,O){l.addNode(O,y[r]),h[y.id]=O}),u.edges.forEach(function(y,O){var A=h[y.source],z=h[y.target];l.addEdge(-1,A,z,y[n])}),l&&l.getNodeNum()&&(a[l.id]=l)}),a},D=function(t,e,r){var n=[];return t.forEach(function(a){var i={nodes:[],edges:[]};a.nodes.forEach(function(o){var u;i.nodes.push((u={id:"".concat(o.id)},u[e]=o.label,u))}),a.edges.forEach(function(o){var u;i.edges.push((u={source:"".concat(o.from),target:"".concat(o.to)},u[r]=o.label,u))}),n.push(i)}),n},te="cluster",xe=function(t){var e=t.graphs,r=t.directed,n=r===void 0?!1:r,a=t.nodeLabelProp,i=a===void 0?te:a,o=t.edgeLabelProp,u=o===void 0?te:o,l=at(e,n,i,u),h=t.minSupport,y=t.maxNodeNum,O=t.minNodeNum,A=t.verbose,z=t.top,$={graphs:l,minSupport:h,maxNodeNum:y,minNodeNum:O,top:z,verbose:A,directed:n},ae=new In($);ae.run();var ce=D(ae.frequentSubgraphs,i,u);return ce},be=xe,De=function(t,e,r,n){r===void 0&&(r="cluster"),n===void 0&&(n=2);var a=[],i=t.nodes;return e.forEach(function(o,u){a.push(Xe(i,o,u,r,n))}),a},Xe=function(t,e,r,n,a){var i=[r],o=[],u={};return e.forEach(function(l,h){if(l<=a&&r!==h){i.push(h),o.push(t[h]);var y=t[h][n];u[y]?(u[y].count++,u[y].dists.push(l)):u[y]={count:1,dists:[l]}}}),Object.keys(u).forEach(function(l){u[l].dists=u[l].dists.sort(function(h,y){return h-y})}),{nodeIdx:r,nodeId:t[r].id,nodeIdxs:i,neighbors:o,neighborNum:i.length-1,nodeLabelCountMap:u}},Je=function(t,e,r,n,a){var i=Math.ceil(r/e),o={},u=0;return n.forEach(function(l,h){for(var y=0,O=0,A=l.nodeIdxs,z=l.neighborNum-1;y<i;){for(var $=A[1+Math.floor(Math.random()*z)],ae=0;(o["".concat(h,"-").concat($)]||o["".concat($,"-").concat(h)])&&($=Math.floor(Math.random()*e),ae++,!(ae>2*e)););if(ae<2*e&&(o["".concat(h,"-").concat($)]={start:h,end:$,distance:a[h][$]},y++,u++,u>=r))return o;if(O++,O>2*e)break}if(y<i){var ce=i-y;i=(i+ce)/(e-h-1)}}),o},lt=function(t,e,r,n){var a=r.nodes;return n||(n={}),Object.keys(t).forEach(function(i){var o,u;if(!(n&&n[i])){n[i]={nodes:[],edges:[]};var l=t[i],h=(o=e[l.start])===null||o===void 0?void 0:o.nodeIdxs,y=(u=e[l.end])===null||u===void 0?void 0:u.nodeIdxs;if(!(!h||!y)){var O=new Set(y),A=h.filter(function(ue){return O.has(ue)});if(!(!A||!A.length)){for(var z={},$=A.length,ae=0;ae<$;ae++){var ce=a[A[ae]];n[i].nodes.push(ce),z[ce.id]=!0}r.edges.forEach(function(ue){z[ue.source]&&z[ue.target]&&n[i].edges.push(ue)})}}}}),n},Tt=function(t,e,r,n){var a,i,o={};t.nodes.forEach(function(l){o[l.id]=l});var u=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((i=e==null?void 0:e.nodes)===null||i===void 0?void 0:i.length)<2?0:(t.edges.forEach(function(l){var h=o[l.source][r],y=o[l.target][r],O=e==null?void 0:e.nodes[0][r],A=e==null?void 0:e.nodes[1][r],z=e==null?void 0:e.edges[0][n];l[n]===z&&(h===O&&y===A||h===A&&y===O)&&u++}),u)},Ht=function(t,e,r){for(var n=1/0,a=0,i=function(l){var h=t[l],y=Object.keys(h).sort(function(ue,ve){return h[ue]-h[ve]}),O=10,A=[];y.forEach(function(ue,ve){A[ve%O]||(A[ve%O]={graphs:[],totalCount:0,aveCount:0}),A[ve%O].graphs.push(ue),A[ve%O].totalCount+=h[ue]});var z=0,$=[];A.forEach(function(ue){var ve=ue.totalCount/ue.graphs.length;ue.aveCount=ve,$.push(ve);var Ce=0,Re=ue.length;ue.graphs.forEach(function(Ve,Ue){var $e=h[Ve];ue.graphs.forEach(function(ot,et){Ue!==et&&(Ce+=Math.abs($e-h[ot]))})}),Ce/=Re*(Re-1)/2,z+=Ce}),z/=A.length;var ae=0;$.forEach(function(ue,ve){$.forEach(function(Ce,Re){ve!==Re&&(ae+=Math.abs(ue-Ce))}),ae/=$.length*($.length-1)/2});var ce=ae-z;n<ce&&(n=ce,a=l)},o=0;o<e;o++)i(o);return{structure:r[a],structureCountMap:t[a]}},ir=function(t,e){var r={},n={};return t.forEach(function(a,i){r[a.id]={idx:i,node:a,degree:0,inDegree:0,outDegree:0};var o=a[e];n[o]||(n[o]=[]),n[o].push(a)}),{nodeMap:r,nodeLabelMap:n}},Kr=function(t,e,r){var n={},a={};return t.forEach(function(i,o){n["".concat(Ae)]={idx:o,edge:i};var u=i[e];a[u]||(a[u]=[]),a[u].push(i);var l=r[i.source];l&&(l.degree++,l.outDegree++);var h=r[i.target];h&&(h.degree++,h.inDegree++)}),{edgeMap:n,edgeLabelMap:a}},nn=function(t,e,r){var n=e.length,a={};return e.forEach(function(i,o){for(var u=r?0:o+1,l=t[o].id,h=u;h<n;h++)if(o!==h){var y=t[h].id,O=i[h];a["".concat(l,"-").concat(y)]=O,r||(a["".concat(y,"-").concat(l)]=O)}}),a},mn=function(t,e,r,n,a,i,o,u,l,h,y){var O,A="".concat(e.id,"-").concat(r.id);if(h&&h[A])return h[A];var z=y?y[A]:void 0;if(!z){var $=(O={},O[A]={start:n[e.id].idx,end:n[r.id].idx,distance:a},O);y=lt($,i,t,y),z=y[A]}return Tt(z,o,u,l)},Jr=function(t,e,r,n){var a,i,o,u=(a=t[e])===null||a===void 0?void 0:a.degree,l=(i=t[e])===null||i===void 0?void 0:i.inDegree,h=(o=t[e])===null||o===void 0?void 0:o.outDegree;return t[e]===void 0&&(u=1/0,l=1/0,h=1/0,n[e].forEach(function(y){var O=r[y.id].degree;u>O&&(u=O);var A=r[y.id].inDegree;l>A&&(l=A);var z=r[y.id].outDegree;h>z&&(h=z)}),t[e]={degree:u,inDegree:l,outDegree:h}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:l,minPatternNodeLabelOutDegree:h}},jn=function(t,e,r,n,a,i,o){var u;if(r===void 0&&(r=!1),i===void 0&&(i="cluster"),o===void 0&&(o="cluster"),!(!t||!t.nodes)){var l=t.nodes.length;if(l){var h=Pr(t,r),y=Pr(e,r),O=nn(t.nodes,h,r),A=nn(e.nodes,y,r),z=ir(t.nodes,i),$=z.nodeMap,ae=z.nodeLabelMap,ce=ir(e.nodes,i),ue=ce.nodeMap,ve=ce.nodeLabelMap;Kr(t.edges,o,$);var Ce=Kr(e.edges,o,ue).edgeLabelMap,Re=[];y==null||y.forEach(function(pa){Re=Re.concat(pa)}),a||(a=Math.max.apply(Math,(0,c.__spreadArray)((0,c.__spreadArray)([],Re,!1),[2],!1))),n||(n=a);var Ve=De(t,h,i,n),Ue=De(e,y,i,n),$e=Math.min(100,l*(l-1)/2),ot=Je(n,l,$e,Ve,h),et=lt(ot,Ve,t),yt=10,Gt=1,yr=1,kr=4,Mr={graphs:et,nodeLabelProp:i,edgeLabelProp:o,minSupport:Gt,minNodeNum:yr,maxNodeNum:kr,directed:r},dr=be(Mr).slice(0,yt),hn=dr.length,on=[];dr.forEach(function(pa,Oa){on[Oa]={},Object.keys(et).forEach(function(va){var La=et[va],za=Tt(La,pa,i,o);on[Oa][va]=za})});var cr=Ht(on,hn,dr),Rr=cr.structure,Yr=cr.structureCountMap,Wr=e.nodes[0],sn=[],wn=(u=e.nodes[0])===null||u===void 0?void 0:u[i],la=-1/0;e.nodes.forEach(function(pa){var Oa=pa[i],va=ae[Oa];(va==null?void 0:va.length)>la&&(la=va.length,sn=va,wn=Oa,Wr=pa)});var da={},Ra={},Ia={},Xa={},Ga={},ci={};Object.keys(ve).forEach(function(pa,Oa){Ga[pa]=[],r&&(ci[pa]=[]);var va=-1/0,La=ve[pa],za={};La.forEach(function(Sa){var Ta=A["".concat(Wr.id,"-").concat(Sa.id)];if(Ta&&Ga[pa].push(Ta),va<Ta&&(va=Ta),za["".concat(Wr.id,"-").concat(Sa.id)]={start:0,end:ue[Sa.id].idx,distance:Ta},r){var li=A["".concat(Sa.id,"-").concat(Wr.id)];li&&ci[pa].push(li)}}),Ga[pa]=Ga[pa].sort(function(Sa,Ta){return Sa-Ta}),r&&(ci[pa]=ci[pa].sort(function(Sa,Ta){return Sa-Ta})),Ra=lt(za,Ue,e,Ra);var Pn=[];if(Object.keys(za).forEach(function(Sa){if(Ia[Sa]){Pn.push(Ia[Sa]);return}var Ta=Ra[Sa];Ia[Sa]=Tt(Ta,Rr,i,o),Pn.push(Ia[Sa])}),Pn=Pn.sort(function(Sa,Ta){return Ta-Sa}),Xa["".concat(Wr.id,"-").concat(pa)]=Pn,pa!==wn)for(var Ea=(sn==null?void 0:sn.length)||0,xa=function(Ta){var li=sn[Ta],cs=Ve[$[li.id].idx],Ii=cs.nodeLabelCountMap[pa],Nc=ve[pa].length;if(!Ii||Ii.count<Nc)return sn.splice(Ta,1),"continue";for(var nl=!1,Do=0;Do<Nc;Do++)if(Ii.dists[Do]>Ga[pa][Do]){nl=!0;break}if(nl)return sn.splice(Ta,1),"continue";var Ds={};cs.neighbors.forEach(function(No){var iu=O["".concat(li.id,"-").concat(No.id)];Ds["".concat(li.id,"-").concat(No.id)]={start:$[li.id].idx,end:$[No.id].idx,distance:iu}}),et=lt(Ds,Ve,t,et);var Pu=[];Object.keys(Ds).forEach(function(No){if(Yr[No]){Pu.push(Yr[No]);return}var iu=et[No];Yr[No]=Tt(iu,Rr,i,o),Pu.push(Yr[No])}),Pu=Pu.sort(function(No,iu){return iu-No});for(var tc=!1,Do=0;Do<Nc;Do++)if(Pu[Do]<Pn[Do]){tc=!0;break}if(tc)return sn.splice(Ta,1),"continue"},Ua=Ea-1;Ua>=0;Ua--)xa(Ua)});var ja=[];sn==null||sn.forEach(function(pa){for(var Oa=$[pa.id].idx,va=Xe(t.nodes,h[Oa],Oa,i,a),La=va.neighbors,za=La.length,Pn=!1,Ea=za-1;Ea>=0;Ea--){if(La.length+1<e.nodes.length){Pn=!0;return}var xa=La[Ea],Ua=xa[i];if(!ve[Ua]||!ve[Ua].length){La.splice(Ea,1);continue}if(!Ga[Ua]||!Ga[Ua].length){La.splice(Ea,1);continue}var Sa="".concat(pa.id,"-").concat(xa.id),Ta=O[Sa],li=Ga[Ua].length-1,cs=Ga[Ua][li];if(Ta>cs){La.splice(Ea,1);continue}if(r){var Ii="".concat(xa.id,"-").concat(pa.id),Nc=O[Ii];li=ci[Ua].length-1;var nl=ci[Ua][li];if(Nc>nl){La.splice(Ea,1);continue}}var Do=Yr[Sa]?Yr[Sa]:mn(t,pa,xa,$,Ta,Ve,Rr,i,o,Yr,et),Ds="".concat(Wr.id,"-").concat(Ua),Pu=Xa[Ds][Xa[Ds].length-1];if(Do<Pu){La.splice(Ea,1);continue}var tc=Jr(da,Ua,ue,ve),No=tc.minPatternNodeLabelDegree,iu=tc.minPatternNodeLabelInDegree,hf=tc.minPatternNodeLabelOutDegree;if($[xa.id].degree<No){La.splice(Ea,1);continue}}Pn||ja.push({nodes:[pa].concat(La)})});var Os=Hr(e,Wr.id,!1).length,ki={};r?(Object.keys(Os).forEach(function(pa){var Oa=ue[pa].node[i];ki[Oa]?ki[Oa].push(Os[pa]):ki[Oa]=[Os[pa]]}),Object.keys(ki).forEach(function(pa){ki[pa].sort(function(Oa,va){return Oa-va})})):ki=Ga;for(var Ls=ja.length,Ri=function(Oa){var va=ja[Oa],La=va.nodes[0],za={},Pn={};va.nodes.forEach(function(ti,ls){Pn[ti.id]={idx:ls,node:ti,degree:0,inDegree:0,outDegree:0};var Hi=ti[i];za[Hi]?za[Hi]++:za[Hi]=1});var Ea=[],xa={};t.edges.forEach(function(ti){Pn[ti.source]&&Pn[ti.target]&&(Ea.push(ti),xa[ti[o]]?xa[ti[o]]++:xa[ti[o]]=1,Pn[ti.source].degree++,Pn[ti.target].degree++,Pn[ti.source].outDegree++,Pn[ti.target].inDegree++)});for(var Ua=Object.keys(Ce).length,Sa=!1,Ta=0;Ta<Ua;Ta++){var li=Object.keys(Ce)[Ta];if(!xa[li]||xa[li]<Ce[li].length){Sa=!0;break}}if(Sa)return ja.splice(Oa,1),"continue";var cs=Ea.length;if(cs<e.edges.length)return ja.splice(Oa,1),"break";for(var Ii=!1,Nc=function(ls){var Hi=Ea[ls],ku=Hi[o],Pc=Ce[ku];if(!Pc||!Pc.length)return xa[ku]--,Pc&&xa[ku]<Pc.length?(Ii=!0,"break"):(Ea.splice(ls,1),Pn[Hi.source].degree--,Pn[Hi.target].degree--,Pn[Hi.source].outDegree--,Pn[Hi.target].inDegree--,"continue");var Ed=Pn[Hi.source].node[i],xd=Pn[Hi.target].node[i],Wl=!1;if(Pc.forEach(function(wd){var Sd=ue[wd.source].node,_d=ue[wd.target].node;Sd[i]===Ed&&_d[i]===xd&&(Wl=!0),!r&&Sd[i]===xd&&_d[i]===Ed&&(Wl=!0)}),!Wl)return xa[ku]--,Pc&&xa[ku]<Pc.length?(Ii=!0,"break"):(Ea.splice(ls,1),Pn[Hi.source].degree--,Pn[Hi.target].degree--,Pn[Hi.source].outDegree--,Pn[Hi.target].inDegree--,"continue")},Ta=cs-1;Ta>=0;Ta--){var nl=Nc(Ta);if(nl==="break")break}if(Ii)return ja.splice(Oa,1),"continue";va.edges=Ea;var Do=Hr(va,va.nodes[0].id,!1).length;if(Object.keys(Do).reverse().forEach(function(ti){if(!(ti===va.nodes[0].id||Ii)){if(Do[ti]===1/0){var ls=Pn[ti].node[i];if(za[ls]--,za[ls]<ve[ls].length){Ii=!0;return}var Hi=va.nodes.indexOf(Pn[ti].node);va.nodes.splice(Hi,1),Pn[ti]=void 0;return}var ku=$[ti].node[i];if(!ki[ku]||!ki[ku].length||Do[ti]>ki[ku][ki[ku].length-1]){var ls=Pn[ti].node[i];if(za[ls]--,za[ls]<ve[ls].length){Ii=!0;return}var Hi=va.nodes.indexOf(Pn[ti].node);va.nodes.splice(Hi,1),Pn[ti]=void 0}}}),Ii)return ja.splice(Oa,1),"continue";for(var Ds=!0,Pu=0;Ds&&!Ii;){Ds=!1;var tc=r?Pn[La.id].degree<ue[Wr.id].degree||Pn[La.id].inDegree<ue[Wr.id].inDegree||Pn[La.id].outDegree<ue[Wr.id].outDegree:Pn[La.id].degree<ue[Wr.id].degree;if(tc){Ii=!0;break}if(za[La[i]]<ve[La[i]].length){Ii=!0;break}for(var No=va.nodes.length,iu=No-1;iu>=0;iu--){var hf=va.nodes[iu],md=Pn[hf.id].degree,Kh=Pn[hf.id].inDegree,$h=Pn[hf.id].outDegree,Qh=hf[i],Ul=Jr(da,Qh,ue,ve),bd=Ul.minPatternNodeLabelDegree,Jh=Ul.minPatternNodeLabelInDegree,qh=Ul.minPatternNodeLabelOutDegree,ev=r?md<bd||Kh<Jh||$h<qh:md<bd;if(ev){if(za[hf[i]]--,za[hf[i]]<ve[hf[i]].length){Ii=!0;break}va.nodes.splice(iu,1),Pn[hf.id]=void 0,Ds=!0}}if(Ii||!Ds&&Pu!==0)break;cs=Ea.length;for(var Ll=cs-1;Ll>=0;Ll--){var vf=Ea[Ll];if(!Pn[vf.source]||!Pn[vf.target]){Ea.splice(Ll,1);var Dl=vf[o];if(xa[Dl]--,Pn[vf.source]&&(Pn[vf.source].degree--,Pn[vf.source].outDegree--),Pn[vf.target]&&(Pn[vf.target].degree--,Pn[vf.target].inDegree--),Ce[Dl]&&xa[Dl]<Ce[Dl].length){Ii=!0;break}Ds=!0}}Pu++}if(Ii||Ii||va.nodes.length<e.nodes.length||Ea.length<e.edges.length)return ja.splice(Oa,1),"continue"},Bi=Ls-1;Bi>=0;Bi--){var fs=Ri(Bi);if(fs==="break")break}for(var lo=ja.length,Lo=function(Oa){var va=ja[Oa],La={};va.edges.forEach(function(Ea){var xa="".concat(Ea.source,"-").concat(Ea.target,"-").concat(Ea.label);La[xa]?La[xa]++:La[xa]=1});for(var za=function(xa){var Ua=ja[xa],Sa={};Ua.edges.forEach(function(li){var cs="".concat(li.source,"-").concat(li.target,"-").concat(li.label);Sa[cs]?Sa[cs]++:Sa[cs]=1});var Ta=!0;Object.keys(Sa).length!==Object.keys(La).length?Ta=!1:Object.keys(La).forEach(function(li){Sa[li]!==La[li]&&(Ta=!1)}),Ta&&ja.splice(xa,1)},Pn=lo-1;Pn>Oa;Pn--)za(Pn);lo=ja.length},Bi=0;Bi<=lo-1;Bi++)Lo(Bi);return ja}}},_a=jn,Fn=function(){function E(t){t===void 0&&(t=10),this.linkedList=new K,this.maxStep=t}return Object.defineProperty(E.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),E.prototype.isEmpty=function(){return!this.linkedList.head},E.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},E.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},E.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},E.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},E.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},E.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},E}(),ya=Fn,Ai=ur,bo={getAdjMatrix:W,breadthFirstSearch:Te,connectedComponent:tt,getDegree:ft,getInDegree:Lt,getOutDegree:Jt,detectCycle:ur,detectDirectedCycle:Ai,detectAllCycles:mt,detectAllDirectedCycle:wt,detectAllUndirectedCycle:pt,depthFirstSearch:xt,dijkstra:Hr,findAllPath:ar,findShortestPath:qt,floydWarshall:Pr,labelPropagation:Gr,louvain:jr,iLouvain:vn,kCore:Wn,kMeans:ee,cosineSimilarity:b,nodesCosineSimilarity:X,minimumSpanningTree:Ft,pageRank:Ur,getNeighbors:fe,Stack:ya,GADDI:_a},Zi=F(54442),Fi=F(73485),Kn=F(38015),ho=Q.vs,Ei=function(t){return function(e,r){return e[t]-r[t]}},eo=function(t,e,r){return t>=e&&t<=r},Eo=function(t,e,r,n){var a=1e-4,i={x:r.x-t.x,y:r.y-t.y},o={x:e.x-t.x,y:e.y-t.y},u={x:n.x-r.x,y:n.y-r.y},l=o.x*u.y-o.y*u.x,h=l*l,y=1/l,O=o.x*o.x+o.y*o.y,A=u.x*u.x+u.y*u.y;if(h>a*O*A){var z=(i.x*u.y-i.y*u.x)*y,$=(i.x*o.y-i.y*o.x)*y;return!eo(z,0,1)||!eo($,0,1)?null:{x:t.x+z*o.x,y:t.y+z*o.y}}return null},Yo=function(t,e){var r=t.x,n=t.y,a=t.width,i=t.height,o=r+a/2,u=n+i/2,l=[],h={x:o,y:u};l.push({x:r,y:n}),l.push({x:r+a,y:n}),l.push({x:r+a,y:n+i}),l.push({x:r,y:n+i}),l.push({x:r,y:n});for(var y=null,O=1;O<l.length&&(y=Eo(l[O-1],l[O],h,e),!y);O++);return y},Po=function(t,e){var r=t.x,n=t.y,a=t.r,i=e.x,o=e.y,u=i-r,l=o-n;if(u*u+l*l<a*a)return null;var h=Math.atan(l/u);return{x:r+Math.abs(a*Math.cos(h))*Math.sign(u),y:n+Math.abs(a*Math.sin(h))*Math.sign(l)}},Ki=function(t,e){var r=t.rx,n=t.ry,a=t.x,i=t.y,o=e.x-a,u=e.y-i,l=Math.atan2(u/n,o/r);return l<0&&(l+=2*Math.PI),{x:a+r*Math.cos(l),y:i+n*Math.sin(l)}},Si=function(t,e,r){r===void 0&&(r=1);var n=[t.x,t.y,r];return(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]),Zi.transformMat3(n,n,e),{x:n[0],y:n[1]}},Ns=function(t,e,r){r===void 0&&(r=1),(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]);var n=Fi.invert([1,0,0,0,1,0,0,0,1],e);n||(n=[1,0,0,0,1,0,0,0,1]);var a=[t.x,t.y,r];return Zi.transformMat3(a,a,n),{x:a[0],y:a[1]}},On=function(t,e,r){var n=t.x-e.x,a=t.y-e.y,i=t.x-r.x,o=t.y-r.y,u=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,l=(t.x*t.x-r.x*r.x-r.y*r.y+t.y*t.y)/2,h=a*i-n*o;return{x:-(o*u-a*l)/h,y:-(n*l-i*u)/h}},Gi=function(t,e){var r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)},to=function(t,e){var r=[];return t.forEach(function(n){var a=[];n.forEach(function(i){a.push(i*e)}),r.push(a)}),r},_i=function(t){for(var e=[],r=t.length,n=0;n<r;n+=1){e[n]=[];for(var a=0;a<r;a+=1)n===a?e[n][a]=0:t[n][a]===0||!t[n][a]?e[n][a]=1/0:e[n][a]=t[n][a]}for(var i=0;i<r;i+=1)for(var n=0;n<r;n+=1)for(var a=0;a<r;a+=1)e[n][a]>e[n][i]+e[i][a]&&(e[n][a]=e[n][i]+e[i][a]);return e},Ru=function(t,e){var r=t.nodes,n=t.edges,a=[],i={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(o,u){i[o.id]=u;var l=[];a.push(l)}),n&&n.forEach(function(o){var u=o.source,l=o.target,h=i[u],y=i[l];a[h][y]=1,e||(a[y][h]=1)}),a},xo=function(t,e){t.translate(e.x,e.y)},ri=function(t,e,r,n){n===void 0&&(n={duration:500});var a=t.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var i=t.getCanvasBBox(),o=e.x-i.minX,u=e.y-i.minY;if(r){var l=o*a[0],h=u*a[4],y=0,O=0,A=0,z=0;t.animate(function(ae){return A=l*ae,z=h*ae,a=ho(a,[["t",A-y,z-O]]),y=A,O=z,{matrix:a}},n)}else{var $=ho(a,[["t",o,u]]);t.setMatrix($)}},wo=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e;(0,s.isArray)(e)||(n=[e,e]),(0,s.isArray)(e)&&e.length===1&&(n=[e[0],e[0]]),r=ho(r,[["s",n[0],n[1]]]),t.setMatrix(r)},ds=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=ho(r,[["r",e]]),t.setMatrix(r)},Ho=function(t,e,r){for(var n=[],a=0;a<t;a++)n[a]=0;return r.forEach(function(i){i.source&&(n[e[i.source]]+=1),i.target&&(n[e[i.target]]+=1)}),n};function zi(E,t,e){return(e[0]-E[0])*(t[1]-E[1])===(t[0]-E[0])*(e[1]-E[1])&&Math.min(E[0],t[0])<=e[0]&&e[0]<=Math.max(E[0],t[0])&&Math.min(E[1],t[1])<=e[1]&&e[1]<=Math.max(E[1],t[1])}var $i=function(t,e,r){var n=!1,a=t.length,i=1e-6;function o(y){return Math.abs(y)<i?0:y<0?-1:1}if(a<=2)return!1;for(var u=0;u<a;u++){var l=t[u],h=t[(u+1)%a];if(zi(l,h,[e,r]))return!0;o(l[1]-r)>0!=o(h[1]-r)>0&&o(e-(r-l[1])*(l[0]-h[0])/(l[1]-h[1])-l[0])<0&&(n=!n)}return n},Va=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},ro=function(t,e){var r=!1;return(0,s.each)(t,function(n){if(Eo(n.from,n.to,e.from,e.to))return r=!0,!1}),r},Zo=function(t,e){var r=function(O){var A=O.map(function($){return $[0]}),z=O.map(function($){return $[1]});return{minX:Math.min.apply(null,A),maxX:Math.max.apply(null,A),minY:Math.min.apply(null,z),maxY:Math.max.apply(null,z)}},n=function(O){for(var A=[],z=O.length,$=0;$<z-1;$++){var ae=O[$],ce=O[$+1];A.push({from:{x:ae[0],y:ae[1]},to:{x:ce[0],y:ce[1]}})}if(A.length>1){var ue=O[0],ve=O[z-1];A.push({from:{x:ve[0],y:ve[1]},to:{x:ue[0],y:ue[1]}})}return A};if(t.length<2||e.length<2)return!1;var a=r(t),i=r(e);if(!Va(a,i))return!1;var o=!1;if((0,s.each)(e,function(y){if($i(t,y[0],y[1]))return o=!0,!1}),o||((0,s.each)(t,function(y){if($i(e,y[0],y[1]))return o=!0,!1}),o))return!0;var u=n(t),l=n(e),h=!1;return(0,s.each)(l,function(y){if(ro(u,y))return h=!0,!1}),h},Ui=function(){function E(t,e,r,n){this.x1=t,this.y1=e,this.x2=r,this.y2=n}return E.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),n=Math.max(this.y1,this.y2),a={x:t,y:e,minX:t,minY:e,maxX:r,maxY:n,width:r-t,height:n-e};return a},E}(),Wi=function(t,e){var r={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]};return r[e]},Ko=function(t,e){var r=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),n=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),a=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(a){var i=r/a,o=n/a;if(i>=0&&i<=1&&o>=0&&o<=1)return i}return Number.POSITIVE_INFINITY},vo=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),a=0,i=[],o=0;o<4;o++){var u=Wi(n,r[o]),l=u[0],h=u[1],y=u[2],O=u[3];i[o]=Eo({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:l,y:h},{x:y,y:O}),i[o]&&(a+=1)}return[i,a]},hs=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),a=Number.POSITIVE_INFINITY,i=0,o=0;o<4;o++){var u=Wi(n,r[o]),l=u[0],h=u[1],y=u[2],O=u[3],A=Ko(e,new Ui(l,h,y,O));A=Math.abs(A-.5),A>=0&&A<=1&&(i+=1,a=A<a?A:a)}return i===0?-1:a},Ca=function(t){var e=0,r=0;if(t.length>0){for(var n=0,a=t;n<a.length;n++){var i=a[n];e+=i.x,r+=i.y}e/=t.length,r/=t.length}return{x:e,y:r}},So=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},ou=function(t,e){var r=e.x1,n=e.y1,a=e.x2-r,i=e.y2-n,o=t.x-r,u=t.y-n,l=o*a+u*i,h;l<=0?h=0:(o=a-o,u=i-u,l=o*a+u*i,l<=0?h=0:h=l*l/(a*a+i*i));var y=o*o+u*u-h;return y<0&&(y=0),y},di=function(t,e,r){return r===void 0&&(r=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(r,2)},mi=function(t,e){var r=t.x<e.x,n=t.x>e.x+e.width,a=t.y>e.y+e.height,i=t.y<e.y,o=r||n||a||i;if(!o)return 0;if(a&&!r&&!n)return Math.pow(e.y+e.height-t.y,2);if(i&&!r&&!n)return Math.pow(t.y-e.y,2);if(r&&!a&&!i)return Math.pow(e.x-t.x,2);if(n&&!a&&!i)return Math.pow(e.x+e.width-t.x,2);var u=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),l=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return u*u+l*l},_o=function(t,e){var r=t[0],n=t[1],a=t[2],i=t[3],o=e.x,u=e.y,l=[a-r,i-n];if(Kn.exactEquals(l,[0,0]))return NaN;var h=[-l[1],l[0]];Kn.normalize(h,h);var y=[o-r,u-n];return Math.abs(Kn.dot(y,h))},hi=function(t,e,r){return t+(e-t)*r},xi=function(t,e,r){for(var n=Math.min(t.length,e.length),a=new Array(n),i=0;i<n;i++)a[i]=hi(t[i],e[i],r);return a},Vn="rgb(95, 149, 255)",ni="rgb(255, 255, 255)",qa="rgb(0, 0, 0)",wi="rgb(247, 250, 255)",bi="rgb(239, 244, 255)",Mi="rgb(253, 253, 253)",go="rgb(250, 250, 250)",no="rgb(224, 224, 224)",Mo="rgb(234, 234, 234)",po="rgb(245, 245, 245)",su="rgb(191, 213, 255)",gf="#4572d9",uu="rgb(223, 234, 255)",_n={mainStroke:Vn,mainFill:bi,activeStroke:Vn,activeFill:wi,inactiveStroke:su,inactiveFill:wi,selectedStroke:Vn,selectedFill:ni,highlightStroke:gf,highlightFill:uu,disableStroke:no,disableFill:go,edgeMainStroke:no,edgeActiveStroke:Vn,edgeInactiveStroke:Mo,edgeSelectedStroke:Vn,edgeHighlightStroke:Vn,edgeDisableStroke:po,comboMainStroke:no,comboMainFill:Mi,comboActiveStroke:Vn,comboActiveFill:wi,comboInactiveStroke:no,comboInactiveFill:Mi,comboSelectedStroke:Vn,comboSelectedFill:Mi,comboHighlightStroke:gf,comboHighlightFill:Mi,comboDisableStroke:Mo,comboDisableFill:go},dn={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:_n.mainStroke,fill:bi},size:20,color:_n.mainStroke,linkPoints:{size:8,lineWidth:1,fill:_n.activeFill,stroke:_n.activeStroke}},nodeStateStyles:{active:{fill:_n.activeFill,stroke:_n.activeStroke,lineWidth:2,shadowColor:_n.mainStroke,shadowBlur:10},selected:{fill:_n.selectedFill,stroke:_n.selectedStroke,lineWidth:4,shadowColor:_n.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:_n.highlightFill,stroke:_n.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:_n.inactiveFill,stroke:_n.inactiveStroke,lineWidth:1},disable:{fill:_n.disableFill,stroke:_n.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:qa,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:_n.edgeMainStroke,lineAppendWidth:2},color:_n.edgeMainStroke},edgeStateStyles:{active:{stroke:_n.edgeActiveStroke,lineWidth:1},selected:{stroke:_n.edgeSelectedStroke,lineWidth:2,shadowColor:_n.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:_n.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:_n.edgeInactiveStroke,lineWidth:1},disable:{stroke:_n.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:qa,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:_n.comboMainFill,lineWidth:1,stroke:_n.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:_n.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:_n.comboActiveStroke,lineWidth:1,fill:_n.comboActiveFill},selected:{stroke:_n.comboSelectedStroke,lineWidth:2,fill:_n.comboSelectedFill,shadowColor:_n.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:_n.comboHighlightStroke,lineWidth:2,fill:_n.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:_n.comboInactiveStroke,fill:_n.comboInactiveFill,lineWidth:1},disable:{stroke:_n.comboDisableStroke,fill:_n.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window!="undefined"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},rc={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875},ai=Math.PI,Ps=Math.sin,$o=Math.cos,Ba=Ps(ai/8),$a=$o(ai/8),Qo=function(t,e){var r=t.getBBox(),n={x:r.minX,y:r.minY},a={x:r.maxX,y:r.maxY};if(e){var i=e.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]),n=Si(n,i),a=Si(a,i)}var o=n.x,u=n.y,l=a.x,h=a.y;return{x:o,y:u,minX:o,minY:u,maxX:l,maxY:h,width:l-o,height:h-u}},Jo=function(t){var e=t.sourceNode||t.targetNode,r=e.get("group"),n=r.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var a=e.getKeyShape(),i=a.getBBox(),o=t.loopCfg||{},u=o.dist||Math.max(i.width,i.height)*2,l=o.position||dn.defaultLoopPosition,h=[(i.minX+i.maxX)/2+n[6],(i.minY+i.maxY)/2+n[7]],y=[t.startPoint.x,t.startPoint.y],O=[t.endPoint.x,t.endPoint.y],A=i.height/2,z=i.width/2,$=A,ae=A,ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,Re=a.get("type"),Ve=Math.min(A/2,z/2),Ue=Math.min(A,z),$e=o!=null&&o.pointPadding?Math.min(Ue,o==null?void 0:o.pointPadding):Ve;if(y[0]===O[0]&&y[1]===O[1]){switch(l){case"top":Re==="circle"?(y=[h[0]-ce,h[1]-ue],O=[h[0]+ve,h[1]-Ce]):(y=[h[0]-$e,h[1]-A],O=[h[0]+$e,h[1]-A]);break;case"top-right":$=A,ae=z,Re==="circle"?(ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]+ce,h[1]-ue],O=[h[0]+Ce,h[1]-ve]):(y=[h[0]+z-$e,h[1]-A],O=[h[0]+z,h[1]-A+$e]);break;case"right":$=z,ae=z,Re==="circle"?(ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]+ue,h[1]-ce],O=[h[0]+Ce,h[1]+ve]):(y=[h[0]+z,h[1]-$e],O=[h[0]+z,h[1]+$e]);break;case"bottom-right":$=z,ae=A,Re==="circle"?(ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]+ue,h[1]+ce],O=[h[0]+ve,h[1]+Ce]):(y=[h[0]+z,h[1]+A-$e],O=[h[0]+z-$e,h[1]+A]);break;case"bottom":$=A,ae=A,Re==="circle"?(ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]+ce,h[1]+ue],O=[h[0]-ve,h[1]+Ce]):(y=[h[0]-$e,h[1]+A],O=[h[0]+$e,h[1]+A]);break;case"bottom-left":$=A,ae=z,Re==="circle"?(ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]-ce,h[1]+ue],O=[h[0]-Ce,h[1]+ve]):(y=[h[0]-z,h[1]+A-$e],O=[h[0]-z+$e,h[1]+A]);break;case"left":$=z,ae=z,Re==="circle"?(ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]-ue,h[1]+ce],O=[h[0]-Ce,h[1]-ve]):(y=[h[0]-z,h[1]-$e],O=[h[0]-z,h[1]+$e]);break;case"top-left":$=z,ae=A,Re==="circle"?(ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]-ue,h[1]-ce],O=[h[0]-ve,h[1]-Ce]):(y=[h[0]-z+$e,h[1]-A],O=[h[0]-z,h[1]-A+$e]);break;default:$=z,ae=z,ce=$*Ba,ue=$*$a,ve=ae*Ba,Ce=ae*$a,y=[h[0]-ce,h[1]-ue],O=[h[0]+ve,h[1]-Ce]}if(o.clockwise===!1){var ot=[y[0],y[1]];y=[O[0],O[1]],O=[ot[0],ot[1]]}}var et=[y[0]-h[0],y[1]-h[1]],yt=($+u)/$,Gt=(ae+u)/ae;o.clockwise===!1&&(yt=(ae+u)/ae,Gt=($+u)/$);var yr=Kn.scale([0,0],et,yt),kr=[h[0]+yr[0],h[1]+yr[1]],Mr=[O[0]-h[0],O[1]-h[1]],dr=Kn.scale([0,0],Mr,Gt),hn=[h[0]+dr[0],h[1]+dr[1]];return t.startPoint={x:y[0],y:y[1]},t.endPoint={x:O[0],y:O[1]},t.controlPoints=[{x:kr[0],y:kr[1]},{x:hn[0],y:hn[1]}],t},vs=function(t,e,r,n,a){var i=1e-4,o=[],u=t==null?void 0:t.getPoint(e);if(!u)return{x:0,y:0,angle:0};if(e<i)o=t.getStartTangent().reverse();else if(e>1-i)o=t.getEndTangent();else{var l=t==null?void 0:t.getPoint(e+i);o.push([u.x,u.y]),o.push([l.x,l.y])}var h=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(h<0&&(h+=ai*2),r&&(u.x+=$o(h)*r,u.y+=Ps(h)*r),n){var y=h-ai/2;h>1/2*ai&&h<3*1/2*ai&&(y-=ai),u.x+=$o(y)*n,u.y+=Ps(y)*n}var O={x:u.x,y:u.y,angle:h};return a?(h>.5*ai&&h<1.5*ai&&(h-=ai),(0,c.__assign)({rotate:h},O)):O},Bu=function E(t,e,r,n){if(n(t,e,r)===!1)return!1;if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!E(t.children[a],t,a,n))return!1}return!0},Fu=function E(t,e,r,n){if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!E(t.children[a],t,a,n))return}return n(t,e,r)!==!1},Fa=function(t,e){typeof e=="function"&&Bu(t,null,-1,e)},yo=function(t,e){typeof e=="function"&&Fu(t,null,-1,e)},gs=function(t,e){return e*(rc[t]||1)},fu=function(t,e){var r=0,n=new RegExp("[\u4E00-\u9FA5]+");return t.split("").forEach(function(a){n.test(a)?r+=e:r+=gs(a,e)}),[r,e]},cu=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},ks=function(t,e){var r=[],n={},a={};t.forEach(function(u){a[u.id]=u}),t.forEach(function(u,l){var h=(0,s.clone)(u);h.itemType="combo",h.children=void 0,h.parentId===h.id?(console.warn("The parentId for combo ".concat(h.id," can not be the same as the combo's id")),delete h.parentId):h.parentId&&!a[h.parentId]&&(console.warn("The parent combo for combo ".concat(h.id," does not exist!")),delete h.parentId);var y=n[h.id];if(y){if(h.children=y.children,n[h.id]=h,y=h,!y.parentId){r.push(y);return}var O=n[y.parentId];if(O)O.children?O.children.push(h):O.children=[h];else{var A={id:y.parentId,children:[y]};n[y.parentId]=A,n[h.id]=h}return}if((0,s.isString)(u.parentId)){var z=n[u.parentId];if(z)z.children?z.children.push(h):z.children=[h],n[h.id]=h;else{var $={id:u.parentId,children:[h]};n[$.id]=$,n[h.id]=h}}else r.push(h),n[h.id]=h});var i={};(e||[]).forEach(function(u){i[u.id]=u;var l=n[u.comboId];if(l){var h={id:u.id,comboId:u.comboId};l.children?l.children.push(h):l.children=[h],h.itemType="node",n[u.id]=h}});var o=0;return r.forEach(function(u){u.depth=o+10,Fa(u,function(l){var h,y=n[l.id].itemType;y==="node"?h=n[l.comboId]:h=n[l.parentId],h&&y==="node"?l.depth=o+1:l.depth=o+10,o<l.depth&&(o=l.depth);var O=i[l.id];return O&&(O.depth=l.depth),!0})}),r},ps=function(t,e,r){var n,a=t,i,o={root:{children:t}},u=!1,l="root";(t||[]).forEach(function(z){if(!u){if(z.id===e){i=z,z.itemType==="combo"?i.parentId=r:i.comboId=r,u=!0;return}Fa(z,function($){var ae;return o[$.id]={children:($==null?void 0:$.children)||[]},a=(ae=o[$.parentId||$.comboId||"root"])===null||ae===void 0?void 0:ae.children,$&&($.removed||e===$.id)&&a?(l=$.parentId||$.comboId||"root",i=$,$.itemType==="combo"?i.parentId=r:i.comboId=r,u=!0,!1):!0})}}),a=(n=o[l])===null||n===void 0?void 0:n.children;var h=a?a.indexOf(i):-1;if(h>-1&&a.splice(h,1),u||(i={id:e,itemType:"node",comboId:r},o[e]={children:void 0}),e){var y=!1;if(r){var O=0;(t||[]).forEach(function(z){y||Fa(z,function($){return r===$.id?(y=!0,$.children?$.children.push(i):$.children=[i],O=$.depth,i.itemType==="node"?i.depth=O+2:i.depth=O+1,!1):!0})})}else(!r||!y)&&i.itemType!=="node"&&t.push(i);var A=i.depth;Fa(i,function(z){return z.itemType==="node"?A+=2:A+=1,z.depth=A,!0})}return t},ys=function(t,e,r){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};if(!t||t.length===0){var a=r==null?void 0:r.getModel(),i=a||{},o=i.x,u=i.y,l=i.fixSize,h=i.collapsed,y=i.fixCollapseSize,O=h?y:l,A=(0,s.isArray)(O)?O:[O,O],z=A[0],$=A[1],ae=[z/2,$/2];return{minX:o-ae[0],minY:u-ae[1],maxX:o+ae[0],maxY:u+ae[1],x:o,y:u,width:z,height:$}}return t.forEach(function(ce){var ue=e.findById(ce.id);if(!(!ue||!ue.isVisible())){ue.set("bboxCanvasCache",void 0);var ve=ue.getCanvasBBox();ve.x&&n.minX>ve.minX&&(n.minX=ve.minX),ve.y&&n.minY>ve.minY&&(n.minY=ve.minY),ve.x&&n.maxX<ve.maxX&&(n.maxX=ve.maxX),ve.y&&n.maxY<ve.maxY&&(n.maxY=ve.maxY)}}),n.x=(n.minX+n.maxX)/2,n.y=(n.minY+n.maxY)/2,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,(r==null?void 0:r.getKeyShape().get("type"))==="circle"&&(n.width=Math.hypot(n.height,n.width),n.height=n.width),Object.keys(n).forEach(function(ce){(n[ce]===1/0||n[ce]===-1/0)&&(n[ce]=void 0)}),n},Gu=function(t){var e=(0,s.isNumber)(t.x)||(0,s.isNumber)(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||(0,s.isNumber)(t.style.r)||(0,s.isNumber)(t.style.width)||(0,s.isNumber)(t.style.height)||(0,s.isNumber)(t.style.rx)||(0,s.isNumber)(t.style.ry)),e},Oi=function(t){var e={};return Object.keys(t).forEach(function(r){var n=t[r];if(!(r==="img"&&!(0,s.isString)(n)))if((0,s.isObject)(n)&&!(0,s.isArray)(n)){var a={};Object.keys(n).forEach(function(i){var o=n[i];i==="img"&&!(0,s.isString)(o)||(a[i]=(0,s.clone)(o))}),e[r]=a}else e[r]=(0,s.clone)(n)}),e},ko=function(t){var e=t.animateCfg,r=t.callback,n;if(!e)n={duration:500,callback:r};else if(n=(0,s.clone)(e),e.callback){var a=e.callback;n.callback=function(){r(),a()}}else n.callback=r;return n},Rs=function(t){if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var e=t.nodes,r=t.edges,n=t.combos,a=n===void 0?[]:n;if(!e&&!r){var i=!0;return Fa(t,function(O){return(0,s.isString)(O.id)?!0:(i=!1,!1)}),i}var o=(e||[]).find(function(O){return!(0,s.isString)(O.id)});if(o)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(o.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(e||[]).map(function(O){return O.id}),l=a==null?void 0:a.map(function(O){return O.id}),h=(0,c.__spreadArray)((0,c.__spreadArray)([],u,!0),l,!0),y=(r||[]).find(function(O){return!h.includes(O.source)||!h.includes(O.target)});return y?(console.warn("G6 Warning Tips: The source %c".concat(y.source,"%c or the target %c").concat(y.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},zu=function(t,e){if(t==="node"||t==="combo"){if(e.id&&!(0,s.isString)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(t==="edge"&&(!e.source||!e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},lu=function(){function E(t){this.graph=t,this.destroyed=!1,this.modes=t.get("modes")||{default:[]},this.formatModes(),this.mode=t.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return E.prototype.formatModes=function(){var t=this.modes;(0,s.each)(t,function(e){(0,s.each)(e,function(r,n){(0,s.isString)(r)&&(e[n]={type:r})})})},E.prototype.setBehaviors=function(t){var e=this.graph,r=this.modes[t],n=[],a;(0,s.each)(r||[],function(i){var o=P.getBehavior(i.type||i);o&&(a=new o(i),a&&(a.bind(e),n.push(a)))}),this.currentBehaves=n},E.mergeBehaviors=function(t,e){return(0,s.each)(e,function(r){t.indexOf(r)<0&&((0,s.isString)(r)&&(r={type:r}),t.push(r))}),t},E.filterBehaviors=function(t,e){var r=[];return t.forEach(function(n){var a="";(0,s.isString)(n)?a=n:a=n.type,e.indexOf(a)<0&&r.push(n)}),r},E.prototype.setMode=function(t){var e=this,r=e.modes,n=e.graph,a=t,i=r[a];i&&(n.emit("beforemodechange",{mode:t}),(0,s.each)(this.currentBehaves,function(o){o.delegate&&o.delegate.remove(),o.unbind(n)}),this.setBehaviors(a),n.emit("aftermodechange",{mode:t}),this.mode=t)},E.prototype.getMode=function(){return this.mode},E.prototype.manipulateBehaviors=function(t,e,r){var n=this,a;if((0,s.isArray)(t)?a=t:a=[t],(0,s.isArray)(e))return(0,s.each)(e,function(o){n.modes[o]?r?n.modes[o]=E.mergeBehaviors(n.modes[o]||[],a):n.modes[o]=E.filterBehaviors(n.modes[o]||[],a):r&&(n.modes[o]=a)}),this;var i=e;return e||(i=this.mode),this.modes[i]||r&&(this.modes[i]=a),r?this.modes[i]=E.mergeBehaviors(this.modes[i]||[],a):this.modes[i]=E.filterBehaviors(this.modes[i]||[],a),this.formatModes(),this.setMode(this.mode),this},E.prototype.updateBehavior=function(t,e,r){(0,s.isString)(t)&&(t={type:t});var n=[];if(!r||r===this.mode||r==="default"){if(n=this.currentBehaves,!n||!n.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=n.length,i=0;i<a;i++){var o=n[i];if(o.type===t.type)return o.updateCfg(e),this;i===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(n=this.modes[r],!n||!n.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var u=n.length,i=0;i<u;i++){var o=n[i];if(o.type===t.type||o===t.type)return o===t.type&&(o={type:o}),Object.assign(o,e),n[i]=o,this;i===u-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},E.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},E}(),Bs=lu,qo=F(25099),Fs=function(E){(0,c.__extends)(t,E);function t(e,r){var n=E.call(this,e,r)||this;return n.item=r.item,n.canvasX=r.canvasX,n.canvasY=r.canvasY,n.wheelDelta=r.wheelDelta,n.detail=r.detail,n}return t}(qo.Event),du=function(t){return"".concat(t,"-").concat(Math.random()).concat(Date.now())},hu=function(t){if((0,s.isArray)(t))switch(t.length){case 4:return t;case 3:return t.push(t[1]),t;case 2:return t.concat(t);case 1:return[t[0],t[0],t[0],t[0]];default:return[0,0,0,0]}if((0,s.isNumber)(t))return[t,t,t,t];if((0,s.isString)(t)){var e=parseInt(t,10);return[e,e,e,e]}return[0,0,0,0]},Uu=function(t){var e=new Fs(t.type,t);return e.clientX=t.clientX,e.clientY=t.clientY,e.x=t.x,e.y=t.y,e.target=t.target,e.currentTarget=t.currentTarget,e.bubbles=!0,e.item=t.item,e},Wu=function(t){if(!t)return!1;for(var e=9,r=[1,0,0,0,1,0,0,0,1],n=0;n<e;n++)if(t[n]!==r[n])return!0;return!1},ao=function(t){return Number.isNaN(Number(t))},Ro=function(t){for(var e=1/0,r=-1/0,n=1/0,a=-1/0,i=0;i<t.length;i++){var o=t[i],u=o.getBBox(),l=u.minX,h=u.minY,y=u.maxX,O=u.maxY;l<e&&(e=l),h<n&&(n=h),y>r&&(r=y),O>a&&(a=O)}var A=Math.floor(e),z=Math.floor(n),$=Math.ceil(r)-Math.floor(e),ae=Math.ceil(a)-Math.floor(n);return{x:A,y:z,width:$,height:ae,minX:e,minY:n,maxX:r,maxY:a}},Xu=function(t,e,r,n,a){e===void 0&&(e=15),r===void 0&&(r="quadratic"),n===void 0&&(n=void 0),a===void 0&&(a=void 0);for(var i=t.length,o=e*2,u=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],l={},h=[],y={},O=0;O<i;O++){var A=t[O],z=A.source,$=A.target,ae="".concat(z,"-").concat($);if(!h[O]){l[ae]||(l[ae]=[]),h[O]=!0,l[ae].push(A);for(var ce=0;ce<i;ce++)if(O!==ce){var ue=t[ce],ve=ue.source,Ce=ue.target;h[ce]||(z===Ce&&$===ve?(l[ae].push(ue),h[ce]=!0,y["".concat(ve,"|").concat(Ce,"|").concat(l[ae].length-1)]=!0):z===ve&&$===Ce&&(l[ae].push(ue),h[ce]=!0))}}}for(var Re in l)for(var Ve=l[Re],Ue=Ve.length,$e=0;$e<Ue;$e++){var ot=Ve[$e];if(ot.source===ot.target){a&&(ot.type=a),ot.loopCfg={position:u[$e%8],dist:Math.floor($e/8)*20+50};continue}if(Ue===1&&n&&ot.source!==ot.target){ot.type=n;continue}ot.type=r;var et=($e%2===0?1:-1)*(y["".concat(ot.source,"|").concat(ot.target,"|").concat($e)]?-1:1);Ue%2===1?ot.curveOffset=et*Math.ceil($e/2)*o:ot.curveOffset=et*(Math.floor($e/2)*o+e)}return t},vu=F(60728),Xi=function(){function E(t){this.destroyed=!1,this.graph=t,this.destroyed=!1}return E.prototype.getViewCenter=function(){var t=this.getFormatPadding(),e=this.graph,r=this.graph.get("width"),n=e.get("height");return{x:(r-t[1]-t[3])/2+t[3],y:(n-t[0]-t[2])/2+t[0]}},E.prototype.fitCenter=function(t,e){var r=this.graph,n=r.get("group"),a,i=r.getNodes();if(i.length>r.get("optimizeThreshold")){var o=1/0,u=1/0,l=-1/0,h=-1/0;i.forEach(function(Ce){var Re=Ce.getModel(),Ve=Re.x,Ue=Re.y;o>Ve&&(o=Ve),u>Ue&&(u=Ue),l<Ve&&(l=Ve),h<Ue&&(h=Ue)});var y=n.getMatrix()||[1,0,0,0,1,0,0,0,1],O=Si({x:o,y:u},y),A=O.x,z=O.y,$=Si({x:l,y:h},y),ae=$.x,ce=$.y;a={minX:A,maxX:ae,minY:z,maxY:ce,width:ae-A,height:ce-z,x:A,y:z}}else a=n.getCanvasBBox();if(!(a.width===0||a.height===0)){var ue=this.getViewCenter(),ve={x:a.x+a.width/2,y:a.y+a.height/2};r.translate(ue.x-ve.x,ue.y-ve.y,t,e)}},E.prototype.animatedFitView=function(t,e,r,n,a,i,o,u){var l=this.graph;r=r||{duration:500,easing:"easeCubic"};var h=[1,0,0,0,1,0,0,0,1],y=n.x+a.x-i.x-n.minX,O=n.y+a.y-i.y-n.minY;if(!(ao(y)||ao(O))){var A=(0,vu.vs)(h,[["t",y,O]]);if(!u){var z=ko({animateCfg:r,callback:function(){l.emit("viewportchange",{action:"translate",matrix:A})}});t.animate(function(Ce){return{matrix:xi(e,A,Ce)}},z);return}var $=l.get("minZoom"),ae=l.get("maxZoom"),ce=o;$&&o<$?(ce=$,console.warn("fitview failed, ratio out of range, ratio: %f",o,"graph minzoom has been used instead")):ae&&o>ae&&(ce=ae,console.warn("fitview failed, ratio out of range, ratio: %f",o,"graph maxzoom has been used instead"));var ue=(0,vu.vs)(A,[["t",-a.x,-a.y],["s",ce,ce],["t",a.x,a.y]]),ve=ko({animateCfg:r,callback:function(){t.setMatrix(ue),l.emit("viewportchange",{action:"translate",matrix:A}),l.emit("viewportchange",{action:"zoom",matrix:ue})}});t.stopAnimate(),t.setMatrix(e),t.animate(function(Ce){return{matrix:xi(e,ue,Ce)}},ve)}},E.prototype.fitView=function(t,e){var r=this.graph,n=this.getFormatPadding(),a=r.get("width"),i=r.get("height"),o=r.get("group"),u=o.getMatrix()||[1,0,0,0,1,0,0,0,1];o.resetMatrix();var l,h=r.getNodes();if(h.length>r.get("optimizeThreshold")){var y=1/0,O=1/0,A=-1/0,z=-1/0;h.forEach(function(Ve){var Ue=Ve.getModel(),$e=Ue.x,ot=Ue.y;y>$e&&(y=$e),O>ot&&(O=ot),A<$e&&(A=$e),z<ot&&(z=ot)}),l={minX:y,maxX:A,minY:O,maxY:z,width:A-y,height:z-O,x:y,y:O}}else l=o.getCanvasBBox();if(!(l.width===0||l.height===0)){var $=this.getViewCenter(),ae={x:l.x+l.width/2,y:l.y+l.height/2},ce=(a-n[1]-n[3])/l.width,ue=(i-n[0]-n[2])/l.height,ve=ce;if(ce>ue&&(ve=ue),t)this.animatedFitView(o,u,e,l,$,ae,ve,!0);else{var Ce=$.x-ae.x,Re=$.y-ae.y;if(ao(Ce)||ao(Re))return;r.translate(Ce,Re),r.zoom(ve,$)||console.warn("zoom failed, ratio out of range, ratio: %f",ve)}}},E.prototype.fitViewByRules=function(t,e,r){var n=t.onlyOutOfViewPort,a=n===void 0?!1:n,i=t.direction,o=i===void 0?"both":i,u=t.ratioRule,l=u===void 0?"min":u,h=this.graph,y=this.getFormatPadding(),O=h.get("width"),A=h.get("height"),z=h.get("group"),$=z.getMatrix()||[1,0,0,0,1,0,0,0,1];z.resetMatrix();var ae,ce=h.getNodes();if(ce.length>h.get("optimizeThreshold")){var ue=1/0,ve=1/0,Ce=-1/0,Re=-1/0;ce.forEach(function(kr){var Mr=kr.getModel(),dr=Mr.x,hn=Mr.y;ue>dr&&(ue=dr),ve>hn&&(ve=hn),Ce<dr&&(Ce=dr),Re<hn&&(Re=hn)}),ae={minX:ue,maxX:Ce,minY:ve,maxY:Re,width:Ce-ue,height:Re-ve,x:ue,y:ve}}else ae=z.getCanvasBBox();if(!(ae.width===0||ae.height===0)){var Ve=this.getViewCenter(),Ue={x:ae.x+ae.width/2,y:ae.y+ae.height/2},$e=(O-y[1]-y[3])/ae.width,ot=(A-y[0]-y[2])/ae.height,et;if(o==="x"?et=$e:o==="y"?et=ot:et=l==="max"?Math.max($e,ot):Math.min($e,ot),a&&(et=et<1?et:1),e)this.animatedFitView(z,$,r,ae,Ve,Ue,et,!0);else{var yt=h.getZoom(),Gt=yt*et,yr=h.get("minZoom");Gt<yr&&(Gt=yr,console.warn("fitview failed, ratio out of range, ratio: %f",et,"graph minzoom has been used instead")),h.translate(Ve.x-Ue.x,Ve.y-Ue.y),h.zoomTo(Gt,Ve)}}},E.prototype.getFormatPadding=function(){var t=this.graph.get("fitViewPadding");return hu(t)},E.prototype.focusPoint=function(t,e,r){var n=this,a=this.getViewCenter(),i=this.getPointByCanvas(a.x,a.y),o=this.graph.get("group").getMatrix();if(o||(o=[1,0,0,0,1,0,0,0,1]),e){var u=(i.x-t.x)*o[0],l=(i.y-t.y)*o[4],h=0,y=0,O=0,A=0;this.graph.get("canvas").animate(function(z){O=u*z,A=l*z,n.graph.translate(O-h,A-y),h=O,y=A},(0,c.__assign)({},r))}else this.graph.translate((i.x-t.x)*o[0],(i.y-t.y)*o[4])},E.prototype.getPointByCanvas=function(t,e){var r=this.graph.get("group").getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=Ns({x:t,y:e},r);return n},E.prototype.getPointByClient=function(t,e){var r=this.graph.get("canvas"),n=r.getPointByClient(t,e);return this.getPointByCanvas(n.x,n.y)},E.prototype.getClientByPoint=function(t,e){var r=this.graph.get("canvas"),n=this.getCanvasByPoint(t,e),a=r.getClientByPoint(n.x,n.y);return{x:a.x,y:a.y}},E.prototype.getCanvasByPoint=function(t,e){var r=this.graph.get("group").getMatrix();return r||(r=[1,0,0,0,1,0,0,0,1]),Si({x:t,y:e},r)},E.prototype.focus=function(t,e,r){if((0,s.isString)(t)&&(t=this.graph.findById(t)),t){var n=0,a=0;if(t.getType&&t.getType()==="edge"){var i=t.getSource().get("group").getMatrix(),o=t.getTarget().get("group").getMatrix();i&&o?(n=(i[6]+o[6])/2,a=(i[7]+o[7])/2):(i||o)&&(n=i?i[6]:o[6],a=i?i[7]:o[7])}else{var u=t.get("group"),l=u.getMatrix();l||(l=[1,0,0,0,1,0,0,0,1]),n=l[6],a=l[7]}this.focusPoint({x:n,y:a},e,r)}},E.prototype.focusItems=function(t,e,r,n){if(t.length){var a=this.graph,i=this.getFormatPadding(),o=a.get("width"),u=a.get("height"),l=a.get("group"),h=l.getMatrix()||[1,0,0,0,1,0,0,0,1];l.resetMatrix();for(var y={x:0,y:0,minX:Number.MAX_SAFE_INTEGER,minY:Number.MAX_SAFE_INTEGER,maxX:Number.MIN_SAFE_INTEGER,maxY:Number.MIN_SAFE_INTEGER,width:0,height:0},O=0,A=t;O<A.length;O++){var z=A[O],$=z.getBBox();$.minX<y.minX&&(y.minX=$.minX),$.minY<y.minY&&(y.minY=$.minY),$.maxX>y.maxX&&(y.maxX=$.maxX),$.maxY>y.maxY&&(y.maxY=$.maxY)}if(y.x=y.minX,y.y=y.minY,y.width=y.maxX-y.minX,y.height=y.maxY-y.minY,!(y.width===0||y.height===0)){var ae=this.getViewCenter(),ce={x:y.x+y.width/2,y:y.y+y.height/2},ue=(o-i[1]-i[3])/y.width,ve=(u-i[0]-i[2])/y.height,Ce=ue;ue>ve&&(Ce=ve),r?this.animatedFitView(l,h,n,y,ae,ce,Ce,e):(a.translate(ae.x-ce.x,ae.y-ce.y),e&&!a.zoom(Ce,ae)&&console.warn("zoom failed, ratio out of range, ratio: %f",Ce))}}},E.prototype.changeSize=function(t,e){var r=this.graph;if(!(0,s.isNumber)(t)||!(0,s.isNumber)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:t,height:e});var n=r.get("canvas");n.changeSize(t,e);var a=r.get("plugins");a.forEach(function(i){i.get("gridContainer")&&i.positionInit()})},E.prototype.destroy=function(){this.graph=null,this.destroyed=!1},E}(),pf=Xi;function ju(E){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(E)}function yf(E){if(typeof E!="string")return E;var t=function(Ue){if(typeof Ue!="string")return Ue;try{return JSON.parse(Ue.trim())}catch($e){return Ue.trim()}},e=t(E);if(typeof e!="string")return e;for(var r=function(Ue){return Ue[Ue.length-1]},n=E.trim(),a=[],i=[],o=function(){for(var Ue=[],$e=0;$e<arguments.length;$e++)Ue[$e]=arguments[$e];return Ue.some(function(ot){return r(i)===ot})},u=function(){return r(a)},l=null,h=0,y="";h<n.length;){var O=n[h],A=o('"',"'");if(!A&&!O.trim()){h+=1;continue}var z=n[h-1]==="\\",$=o("}"),ae=o("]"),ce=o(","),ue=u();if(A)if(r(i)===O&&!z){i.pop();var ve=t(y);ue.push(ve),l=ve,y=""}else y+=O;else if(ae&&O===",")y&&(ue.push(t(y)),y="");else if($&&O===":")i.push(","),y&&(ue.push(y),y="");else if(ce&&O===",")y&&(ue.push(t(y)),y=""),i.pop();else if(O==="}"&&($||ce)){y&&(ue.push(t(y)),y=""),ce&&i.pop();for(var Ce={},Re=1;Re<ue.length;Re+=2)Ce[ue[Re-1]]=ue[Re];a.pop(),a.length&&r(a).push(Ce),i.pop(),l=Ce}else O==="]"&&ae?(y&&(ue.push(t(y)),y=""),a.pop(),a.length&&r(a).push(ue),i.pop(),l=ue):O==="{"?(a.push([]),i.push("}")):O==="["?(a.push([]),i.push("]")):O==='"'?i.push('"'):O==="'"?i.push("'"):y+=O;h+=1}return l||y}var Gs=function(t){return t.split("-").reduce(function(e,r){return e+r.charAt(0).toUpperCase()+r.slice(1)})},nc=function(t){return function(e){for(var r=t.length,n=[],a=0,i="";a<r;)if(t[a]==="{"&&t[a+1]==="{")n.push(i),i="",a+=2;else if(t[a]==="}"&&t[a+1]==="}"){if(n.length){var o=n.pop();i=(0,s.get)(e,i,o.endsWith("=")?'"{'.concat(i,'}"'):i),n.push(o+i)}a+=2,i=""}else i+=t[a],a+=1;return n.push(i),n.map(function(u,l){return n[l-1]&&n[l-1].endsWith("=")?'"{'.concat(u,'}"'):u}).join("")}};function mf(E,t){var e={},r=E.getAttributeNames&&E.getAttributeNames()||[],n=E.children&&Array.from(E.children).map(function(o){return mf(o,t)}),a={},i=E.tagName?E.tagName.toLowerCase():"group";return i==="text"&&(e.text=E.innerText),a.type=i,i==="img"&&(a.type="image"),Array.from(r).forEach(function(o){var u=Gs(o),l=E.getAttribute(o);try{if(u==="style"||u==="attrs"){var h=yf(l);e=(0,c.__assign)((0,c.__assign)({},e),h)}else a[u]=yf(l)}catch(y){if(u==="style")throw y;a[u]=l}}),a.attrs=e,t&&t.style&&a.name&&ju(t.style[a.name])==="object"&&(a.attrs=(0,c.__assign)((0,c.__assign)({},a.attrs),t.style[a.name])),t&&t.style&&a.keyshape&&(a.attrs=(0,c.__assign)((0,c.__assign)({},a.attrs),t.style)),n.length&&(a.children=n),a}function bf(E,t,e){var r=E.attrs,n=r===void 0?{}:r,a={x:t.x||0,y:t.y||0,width:e.width||0,height:e.height||0},i,o;switch(E.type){case"maker":case"circle":n.r&&(o=2*n.r,i=2*n.r);break;case"text":n.text&&(o=fu(n.text,n.fontSize||12)[0],i=16,a.y+=i,a.height=i,a.width=o,E.attrs=(0,c.__assign)({fontSize:12,fill:"#000"},n));break;default:n.width&&(o=n.width),n.height&&(i=n.height)}return i>=0&&(a.height=i),o>=0&&(a.width=o),n.marginTop&&(a.y+=n.marginTop),n.marginLeft&&(a.x+=n.marginLeft),a}function zs(E,t){var e;t===void 0&&(t={x:0,y:0});var r=(0,c.__assign)({x:0,y:0,width:0,height:0},t);if(!((e=E.children)===null||e===void 0)&&e.length){var n=E.attrs,a=n===void 0?{}:n,i=a.marginTop,o=(0,c.__assign)({},t);i&&(o.y+=i);for(var u=0;u<E.children.length;u++){E.children[u].attrs.key="".concat(a.key||"root"," -").concat(u," ");var l=zs(E.children[u],o);if(l.bbox){var h=l.bbox;l.attrs.next==="inline"?o.x+=l.bbox.width:o.y+=l.bbox.height,h.width+h.x>r.width&&(r.width=h.width+h.x),h.height+h.y>r.height&&(r.height=h.height+h.y)}}}return E.bbox=bf(E,t,r),E.attrs=(0,c.__assign)((0,c.__assign)({},E.attrs),E.bbox),E}function Vu(E,t){var e,r,n,a,i=(E||{}).type,o=((t==null?void 0:t.attrs)||{}).key;if(o&&E&&(E.attrs.key=o),!E&&t)return{action:"delete",val:t,type:i,key:o};if(E&&!t)return{action:"add",val:E,type:i};if(!E&&!t)return{action:"same",type:i};var u=[];if(((e=E.children)===null||e===void 0?void 0:e.length)>0||((r=t.children)===null||r===void 0?void 0:r.length)>0)for(var l=Math.max((n=E.children)===null||n===void 0?void 0:n.length,(a=t.children)===null||a===void 0?void 0:a.length),h=t.children||[],y=E.children||[],O=0;O<l;O+=1)u.push(Vu(y[O],h[O]));var A=Object.keys(t.attrs),z=Object.keys(E.attrs);return t.type!==E.type?{action:"restructure",nowTarget:E,formerTarget:t,key:o,children:u}:A.filter(function($){return $!=="children"}).some(function($){return E.attrs[$]!==t.attrs[$]||!z.includes($)})?{action:"change",val:E,children:u,type:i,key:o}:{action:"same",children:u,type:i,key:o}}function gu(E){var t={},e=function(n){var a=typeof E=="function"?E(n):E,i=nc(a)(n),o=document.createElement("div");o.innerHTML=i;var u=o.children[0],l=zs(mf(u,n));return o.remove(),l};return{draw:function(n,a){var i=e(n),o=a,u=function l(h){var y=h.attrs,O=y===void 0?{}:y,A=h.bbox,z=h.type,$=h.children,ae=(0,c.__rest)(h,["attrs","bbox","type","children"]);if(h.type!=="group"){var ce=a.addShape(h.type,(0,c.__assign)({attrs:O,origin:{bbox:A,type:z,children:$}},ae));h.keyshape&&(o=ce)}h.children&&h.children.forEach(function(ue){return l(ue)})};return u(i),t[n.id]=[i],o},update:function(n,a){t[n.id]||(t[n.id]=[]);var i=a.getContainer(),o=i.get("children"),u=e(n),l=t[n.id].pop(),h=Vu(u,l),y=function z($){var ae;$.type!=="group"&&i.addShape($.type,{attrs:$.attrs}),!((ae=$.children)===null||ae===void 0)&&ae.length&&$.children.map(function(ce){return z(ce)})},O=function z($){var ae,ce=o.find(function(ue){return ue.attrs.key===$.attrs.key});ce&&i.removeChild(ce),!((ae=$.children)===null||ae===void 0)&&ae.length&&$.children.map(function(ue){return z(ue)})},A=function z($){var ae=$.key;if($.type!=="group"){var ce=o.find(function(ve){return ve.attrs.key===ae});switch($.action){case"change":if(ce){var ue=$.val.keyshape?a.getOriginStyle():{};ce.attr((0,c.__assign)((0,c.__assign)({},ue),$.val.attrs))}break;case"add":y($.val);break;case"delete":O($.val);break;case"restructure":O($.formerTarget),y($.nowTarget);break;default:break}}$.children&&$.children.forEach(function(ve){return z(ve)})};A(h),t[n.id].push(u)},getAnchorPoints:function(){return[[0,.5],[1,.5],[.5,1],[.5,0]]}}}var pu={};function yu(E){return pu[E]||(pu[E]=(0,s.upperFirst)(E)),pu[E]}var Us={defaultShapeType:"defaultType",className:null,getShape:function(t){var e=this,r=e[t]||e[e.defaultShapeType]||e["simple-circle"];return r},draw:function(t,e,r){var n=this.getShape(t);r.shapeMap={};var a=n.draw(e,r);return n.afterDraw&&n.afterDraw(e,r,a),a},baseUpdate:function(t,e,r,n){var a,i,o=this.getShape(t);o.update&&(o.mergeStyle=(a=o.getOptions)===null||a===void 0?void 0:a.call(o,e,n),(i=o.update)===null||i===void 0||i.call(o,e,r,n)),o.afterUpdate&&o.afterUpdate(e,r)},setState:function(t,e,r,n){var a=this.getShape(t);a.setState(e,r,n)},shouldUpdate:function(t){var e=this.getShape(t);return!!e.update},getControlPoints:function(t,e){var r=this.getShape(t);return r.getControlPoints(e)},getAnchorPoints:function(t,e){var r=this.getShape(t);return r.getAnchorPoints(e)}},Bo={options:{},draw:function(t,e){return this.drawShape(t,e)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e=this.options.anchorPoints,r=t.anchorPoints||e;return r}},es=function(){function E(){}return E.registerFactory=function(t,e){var r=yu(t),n=Us,a=(0,c.__assign)((0,c.__assign)({},n),e);return E[r]=a,a.className=r,a},E.getFactory=function(t){var e=yu(t);return E[e]},E.registerNode=function(t,e,r){var n=E.Node,a;if(typeof e=="string"||typeof e=="function"){var i=gu(e);a=(0,c.__assign)((0,c.__assign)({},n.getShape("single-node")),i)}else if(e.jsx){var o=e.jsx,i=gu(o);a=(0,c.__assign)((0,c.__assign)((0,c.__assign)({},n.getShape("single-node")),i),e)}else{n.getShape(r);var u=r?n.getShape(r):Bo;a=(0,c.__assign)((0,c.__assign)({},u),e)}return a.type=t,a.itemType="node",n[t]=a,a},E.registerEdge=function(t,e,r){var n=E.Edge,a=r?n.getShape(r):Bo,i=(0,c.__assign)((0,c.__assign)({},a),e);return i.type=t,i.itemType="edge",n[t]=i,i},E.registerCombo=function(t,e,r){var n=E.Combo,a=r?n.getShape(r):Bo,i=(0,c.__assign)((0,c.__assign)({},a),e);return i.type=t,i.itemType="combo",n[t]=i,i},E}(),vi=es;es.registerFactory("node",{defaultShapeType:"circle"}),es.registerFactory("edge",{defaultShapeType:"line"}),es.registerFactory("combo",{defaultShapeType:"circle"});var Ws="bboxCache",Xs="bboxCanvasCache",Ef=null,xf=function(){function E(t){this._cfg={},this.destroyed=!1,this.optimize=!1;var e={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(e,this.getDefaultCfg(),t);var r=this.get("model"),n=r.id,a=this.get("type");typeof n=="undefined"?n=du(a):typeof n!="string"&&(n=String(n)),this.get("model").id=n,this.set("id",n);var i=t.group;i&&(i.set("item",this),i.set("id",n)),this.init(),this.draw();var o=r.shape||r.type||(a==="edge"?"line":"circle"),u=this.get("shapeFactory");if(u&&u[o]){var l=u[o].options;if(l&&l.stateStyles){var h=this.get("styles")||r.stateStyles;h=(0,s.deepMix)({},l.stateStyles,h),this.set("styles",h)}}}return E.prototype.calculateBBox=function(){var t=this.get("keyShape"),e=this.get("group"),r=Qo(t,e);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},E.prototype.calculateCanvasBBox=function(){var t=this.get("keyShape"),e=this.get("group"),r=Qo(t,e);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},E.prototype.drawInner=function(){var t=this,e=t.get("shapeFactory"),r=t.get("group"),n=t.get("model");r.clear();var a=n.visible;if(a!==void 0&&!a&&t.changeVisibility(a),!!e){t.updatePosition(n);var i=t.getShapeCfg(n),o=i.type,u=e.draw(o,i,r);u&&(t.set("keyShape",u),u.set("isKeyShape",!0),u.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",o),this.restoreStates(e,o)}},E.prototype.setOriginStyle=function(){var t=this.get("group"),e=t.get("children"),r=this.getKeyShape(),n=this,a=r.get("name");if(this.get("originStyle")){var A=this.get("originStyle");a&&!A[a]&&(A[a]={});for(var z=this.getCurrentStatesStyle(),$=function(ce){var ue=e[ce],ve=ue.get("name"),Ce=ue.attr();if(ve&&ve!==a){var Re=z[ve];A[ve]||(A[ve]={}),Re?Object.keys(Ce).forEach(function($e){var ot=Ce[$e];ot!==Re[$e]&&(A[ve][$e]=ot)}):A[ve]=ue.get("type")!=="image"?(0,s.clone)(Ce):n.getShapeStyleByName(ve)}else{var Ve=ue.attr(),Ue={};Object.keys(z).forEach(function($e){var ot=z[$e];($e===a||!(0,s.isPlainObject)(ot))&&(Ue[$e]=ot)}),Object.keys(Ve).forEach(function($e){var ot=Ve[$e];Ue[$e]!==ot&&(a?A[a][$e]=ot:A[$e]=ot)})}},o=0;o<e.length;o++)$(o);delete A.path,delete A.matrix,delete A.x,delete A.y,A[a]&&(delete A[a].x,delete A[a].y,delete A[a].matrix,delete A[a].path),n.set("originStyle",A)}else{for(var i={},o=0;o<e.length;o++){var u=e[o],l=u.get("type"),h=u.get("name");if(h&&h!==a)i[h]=l!=="image"?(0,s.clone)(u.attr()):n.getShapeStyleByName(h),l==="text"&&i[h]&&(delete i[h].x,delete i[h].y,delete i[h].matrix);else{var y=n.getShapeStyleByName();if(delete y.path,delete y.matrix,!a)Object.assign(i,y);else if(h)i[a]=y;else{var O=du("shape");u.set("name",O),t.shapeMap[O]=u,i[O]=l!=="image"?(0,s.clone)(u.attr()):n.getShapeStyleByName(h)}}}n.set("originStyle",i)}},E.prototype.restoreStates=function(t,e){var r=this,n=r.get("states");(0,s.each)(n,function(a){t.setState(e,a,!0,r)})},E.prototype.init=function(){var t=vi.getFactory(this.get("type"));this.set("shapeFactory",t)},E.prototype.get=function(t){return this._cfg[t]},E.prototype.set=function(t,e){(0,s.isPlainObject)(t)?this._cfg=(0,c.__assign)((0,c.__assign)({},this._cfg),t):this._cfg[t]=e},E.prototype.getDefaultCfg=function(){return{}},E.prototype.clearCache=function(){this.set(Ws,null),this.set(Xs,null)},E.prototype.beforeDraw=function(){},E.prototype.afterDraw=function(){},E.prototype.afterUpdate=function(){},E.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},E.prototype.getShapeStyleByName=function(t){var e=this.get("group"),r;if(t?r=e.shapeMap[t]||e.find(function(a){return a.get("name")===t}):r=this.getKeyShape(),r){var n={};return(0,s.each)(r.attr(),function(a,i){(i!=="img"||(0,s.isString)(a))&&(n[i]=a)}),n}return{}},E.prototype.getShapeCfg=function(t,e){var r=this.get("styles");if(r){var n=t;return n.style=(0,c.__assign)((0,c.__assign)({},r),t.style),n}return t},E.prototype.getStateStyle=function(t){var e=this.get("styles"),r=e&&e[t];return r},E.prototype.getOriginStyle=function(){return this.get("originStyle")},E.prototype.getCurrentStatesStyle=function(){var t=this,e={},r=t.getStates();return!r||!r.length?this.get("originStyle"):((0,s.each)(t.getStates(),function(n){e=Object.assign(e,t.getStateStyle(n))}),e)},E.prototype.setState=function(t,e){var r=this.get("states"),n=this.get("shapeFactory"),a=t,i=t;(0,s.isString)(e)&&(a="".concat(t,":").concat(e),i="".concat(t,":"));var o=r;if((0,s.isBoolean)(e)){var u=r.indexOf(i);if(e){if(u>-1)return;r.push(a)}else u>-1&&r.splice(u,1)}else if((0,s.isString)(e)){var l=r.filter(function(O){return O.includes(i)});l.length>0&&this.clearStates(l),o=o.filter(function(O){return!O.includes(i)}),o.push(a),this.set("states",o)}if(n){var h=this.get("model"),y=h.type;n.setState(y,t,e,this)}},E.prototype.clearStates=function(t){var e=this,r=e.getStates(),n=e.get("shapeFactory"),a=e.get("model"),i=a.type;t||(t=r),(0,s.isString)(t)&&(t=[t]);var o=r.filter(function(u){return t.indexOf(u)===-1});e.set("states",o),t.forEach(function(u){n.setState(i,u,!1,e)})},E.prototype.setOptimize=function(t){this.optimize=t},E.prototype.getContainer=function(){return this.get("group")},E.prototype.getKeyShape=function(){return this.get("keyShape")},E.prototype.getModel=function(){return this.get("model")},E.prototype.getType=function(){return this.get("type")},E.prototype.getID=function(){return this.get("id")},E.prototype.isItem=function(){return!0},E.prototype.getStates=function(){return this.get("states")},E.prototype.hasState=function(t){var e=this.getStates();return e.indexOf(t)>=0},E.prototype.refresh=function(t){var e=this.get("model");this.updatePosition(e),this.updateShape(t),this.afterUpdate(),this.clearCache()},E.prototype.getUpdateType=function(t){},E.prototype.update=function(t,e){e===void 0&&(e=void 0);var r=this.get("model");if(e==="move")this.updatePosition(t);else{var n=r.visible,a=t.visible;n!==a&&a!==void 0&&this.changeVisibility(a);var i={x:r.x,y:r.y};t.x=isNaN(+t.x)?r.x:+t.x,t.y=isNaN(+t.y)?r.y:+t.y;var o=this.get("styles");if(t.stateStyles){var u=t.stateStyles;(0,s.mix)(o,u),delete t.stateStyles}Object.assign(r,t),(i.x!==t.x||i.y!==t.y)&&this.updatePosition(t),this.updateShape(e)}this.afterUpdate(),this.clearCache()},E.prototype.updateShape=function(t){var e=this.get("shapeFactory"),r=this.get("model"),n=r.type;if(e.shouldUpdate(n)&&n===this.get("currentShape")){var a=this.getShapeCfg(r,t);e.baseUpdate(n,a,this,t),t!=="move"&&this.setOriginStyle()}else this.draw();this.restoreStates(e,n)},E.prototype.updatePosition=function(t){var e=this.get("model"),r=isNaN(+t.x)?+e.x:+t.x,n=isNaN(+t.y)?+e.y:+t.y,a=this.get("group");if(isNaN(r)||isNaN(n))return!1;e.x=r,e.y=n;var i=a.getMatrix();return i&&i[6]===r&&i[7]===n?!1:(a.resetMatrix(),xo(a,{x:r,y:n}),this.clearCache(),!0)},E.prototype.getBBox=function(){var t=this.get(Ws);return t||(t=this.calculateBBox(),this.set(Ws,t)),t},E.prototype.getCanvasBBox=function(){var t=this.get(Xs);return t||(t=this.calculateCanvasBBox(),this.set(Xs,t)),t},E.prototype.toFront=function(){var t=this.get("group");t.toFront()},E.prototype.toBack=function(){var t=this.get("group");t.toBack()},E.prototype.show=function(){this.changeVisibility(!0)},E.prototype.hide=function(){this.changeVisibility(!1)},E.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},E.prototype.isVisible=function(){return this.get("visible")},E.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},E.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},E}(),Yu=xf,js={source:"start",target:"end"},ji="Node",mo="Point",ac="Anchor",Vs=function(E){(0,c.__extends)(t,E);function t(){return E!==null&&E.apply(this,arguments)||this}return t.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},t.prototype.setEnd=function(e,r){var n=js[e]+mo,a=e+ji,i=this.get(a);i&&!i.destroyed&&i.removeEdge(this),(0,s.isPlainObject)(r)?(this.set(n,r),this.set(a,null)):r&&(r.addEdge(this),this.set(a,r),this.set(n,null))},t.prototype.getLinkPoint=function(e,r,n){var a=js[e]+mo,i=e+ji,o=this.get(a);if(!o){var u=this.get(i),l=e+ac,h=this.getPrePoint(e,n),y=r[l];(0,s.isNil)(y)||(o=u.getLinkPointByAnchor(y)),o=o||u.getLinkPoint(h),(0,s.isNil)(o.index)||this.set("".concat(e,"AnchorIndex"),o.index)}return o},t.prototype.getPrePoint=function(e,r){if(r&&r.length){var n=e==="source"?0:r.length-1;return r[n]}var a=e==="source"?"target":"source";return this.getEndPoint(a)},t.prototype.getEndPoint=function(e){var r=e+ji,n=js[e]+mo,a=this.get(r);return a&&!a.destroyed?a.get("model"):this.get(n)},t.prototype.getControlPointsByCenter=function(e){var r=this.getEndPoint("source"),n=this.getEndPoint("target"),a=this.get("shapeFactory"),i=e.type;return a.getControlPoints(i,{startPoint:r,endPoint:n})},t.prototype.getEndCenter=function(e){var r=e+ji,n=js[e]+mo,a=this.get(r);if(a){var i=a.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(n)},t.prototype.init=function(){E.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},t.prototype.getShapeCfg=function(e,r){var n=this,a=n.get("linkCenter"),i=r!=null&&r.includes("move")?e:E.prototype.getShapeCfg.call(this,e);if(a)i.startPoint=n.getEndCenter("source"),i.endPoint=n.getEndCenter("target");else{var o=i.controlPoints||n.getControlPointsByCenter(i);i.startPoint=n.getLinkPoint("source",e,o),i.endPoint=n.getLinkPoint("target",e,o)}return i.sourceNode=n.get("sourceNode"),i.targetNode=n.get("targetNode"),i},t.prototype.getModel=function(){var e=this.get("model"),r=this.get("source".concat(ji)),n=this.get("target".concat(ji));return r?delete e["source".concat(ji)]:e.source=this.get("start".concat(mo)),n?delete e["target".concat(ji)]:e.target=this.get("end".concat(mo)),!(0,s.isString)(e.source)&&!(0,s.isPlainObject)(e.source)&&(e.source=e.source.getID()),!(0,s.isString)(e.target)&&!(0,s.isPlainObject)(e.target)&&(e.target=e.target.getID()),e},t.prototype.setSource=function(e){this.setEnd("source",e),this.set("source",e)},t.prototype.setTarget=function(e){this.setEnd("target",e),this.set("target",e)},t.prototype.getSource=function(){return this.get("source")},t.prototype.getTarget=function(){return this.get("target")},t.prototype.updatePosition=function(){return!1},t.prototype.update=function(e,r){r===void 0&&(r=void 0);var n=this.get("model"),a=n.visible,i=e.visible;a!==i&&i!==void 0&&this.changeVisibility(i);var o=this.get("source"),u=this.get("target");if(!(!o||o.destroyed||!u||u.destroyed)){var l=this.get("styles");if(e.stateStyles){var h=e.stateStyles;(0,s.mix)(l,h),delete e.stateStyles}Object.assign(n,e),this.updateShape(r),this.afterUpdate(),this.clearCache()}},t.prototype.destroy=function(){var e=this.get("source".concat(ji)),r=this.get("target".concat(ji));e&&!e.destroyed&&e.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),E.prototype.destroy.call(this)},t}(Yu),Vi=Vs,Fo="anchorPointsCache",wf="bboxCache",Sf=function(E){(0,c.__extends)(t,E);function t(){return E!==null&&E.apply(this,arguments)||this}return t.prototype.getNearestPoint=function(e,r){for(var n=0,a=e[0],i=Gi(e[0],r),o=0;o<e.length;o++){var u=e[o],l=Gi(u,r);l<i&&(a=u,i=l,n=o)}return a.anchorIndex=n,a},t.prototype.getDefaultCfg=function(){return{type:"node",edges:[]}},t.prototype.getEdges=function(){return this.get("edges")},t.prototype.getInEdges=function(){var e=this;return this.get("edges").filter(function(r){return r.get("target")===e})},t.prototype.getOutEdges=function(){var e=this;return this.get("edges").filter(function(r){return r.get("source")===e})},t.prototype.getNeighbors=function(e){var r=this,n=this.get("edges");if(e==="target"){var a=function(l){return l.getSource()===r};return n.filter(a).map(function(u){return u.getTarget()})}if(e==="source"){var i=function(l){return l.getTarget()===r};return n.filter(i).map(function(u){return u.getSource()})}var o=function(l){return l.getSource()===r?l.getTarget():l.getSource()};return n.map(o)},t.prototype.getLinkPointByAnchor=function(e){var r=this.getAnchorPoints();return r[e]},t.prototype.getLinkPoint=function(e){var r=this.get("keyShape"),n=r.get("type"),a=this.get("type"),i,o,u=this.getBBox();a==="combo"?(i=u.centerX||(u.maxX+u.minX)/2,o=u.centerY||(u.maxY+u.minY)/2):(i=u.centerX,o=u.centerY);var l=this.getAnchorPoints(),h;switch(n){case"circle":h=Po({x:i,y:o,r:u.width/2},e);break;case"ellipse":h=Ki({x:i,y:o,rx:u.width/2,ry:u.height/2},e);break;default:h=Yo(u,e)}var y=h;return l.length&&(y||(y=e),y=this.getNearestPoint(l,y)),y||(y={x:i,y:o}),y},t.prototype.getAnchorPoints=function(){var e=this.get(Fo);if(!e){e=[];var r=this.get("shapeFactory"),n=this.getBBox(),a=this.get("model"),i=this.getShapeCfg(a),o=a.type,u=r.getAnchorPoints(o,i)||[];(0,s.each)(u,function(l,h){var y={x:n.minX+l[0]*n.width,y:n.minY+l[1]*n.height,anchorIndex:h};e.push(y)}),this.set(Fo,e)}return e},t.prototype.addEdge=function(e){this.get("edges").push(e)},t.prototype.lock=function(){this.set("locked",!0)},t.prototype.unlock=function(){this.set("locked",!1)},t.prototype.hasLocked=function(){return this.get("locked")},t.prototype.removeEdge=function(e){var r=this.getEdges(),n=r.indexOf(e);n>-1&&r.splice(n,1)},t.prototype.clearCache=function(){this.set(wf,null),this.set(Fo,null)},t.prototype.getUpdateType=function(e){var r,n,a,i,o;if(e){var u=!(0,s.isNil)(e.x),l=!(0,s.isNil)(e.y),h=Object.keys(e);if(h.length===1&&(u||l)||h.length===2&&u&&l)return"move";if((0,s.isNumber)(e.x)||(0,s.isNumber)(e.y)||e.type||e.anchorPoints||e.size||e!=null&&e.style&&(!((r=e==null?void 0:e.style)===null||r===void 0)&&r.r||!((n=e==null?void 0:e.style)===null||n===void 0)&&n.width||!((a=e==null?void 0:e.style)===null||a===void 0)&&a.height||!((i=e==null?void 0:e.style)===null||i===void 0)&&i.rx||!((o=e==null?void 0:e.style)===null||o===void 0)&&o.ry))return"bbox|label";var y=h.includes("label")||h.includes("labelCfg");return y?"style|label":"style"}},t.prototype.setState=function(e,r){var n=this;if(this.optimize){E.prototype.setState.call(this,e,r);return}this.runWithBBoxAffected(function(){return E.prototype.setState.call(n,e,r)})},t.prototype.clearStates=function(e){var r=this;if(this.optimize){E.prototype.clearStates.call(this,e);return}this.runWithBBoxAffected(function(){return E.prototype.clearStates.call(r,e)})},t.prototype.runWithBBoxAffected=function(e){var r=["r","width","height","rx","ry","lineWidth"],n=this.getKeyShape().attr(),a={};Object.keys(this.getKeyShape().attr()).forEach(function(l){r.includes(l)&&(a[l]=n[l])}),e();for(var i=this.getKeyShape().attr(),o=0;o<r.length;o++){var u=r[o];if(i[u]!==a[u]){this.clearCache(),this.getEdges().forEach(function(l){return l.refresh()});break}}},t}(Yu),Ys=Sf,Hu="bboxCache",ts="bboxCanvasCache",ms="sizeCache",Zu="anchorPointsCache",rs=function(E){(0,c.__extends)(t,E);function t(){return E!==null&&E.apply(this,arguments)||this}return t.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},t.prototype.getShapeCfg=function(e){var r=this.get("styles"),n=this.get("bbox");if(r&&n){var a=e,i=(0,s.isNumber)(e.size)?[e.size,e.size]:e.size,o=(0,s.isNumber)(e.fixSize)?[e.fixSize,e.fixSize]:e.fixSize,u=i||o||dn.defaultCombo.size,l={r:(Math.max(n.width,n.height)||Math.max(u[0],u[1]))/2,width:n.width||u[0],height:n.height||u[1]};a.style=(0,c.__assign)((0,c.__assign)((0,c.__assign)({},r),e.style),l);var h=e.padding||dn.defaultCombo.padding;return(0,s.isNumber)(h)?(l.r+=h,l.width+=h*2,l.height+=h*2):(l.r=l.r+Math.max.apply(Math,h),l.width+=h[1]+h[3]||h[1]*2,l.height+=h[0]+h[2]||h[0]*2),this.set(ms,l),a}return e},t.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var e=this.get("keyShape"),r=this.get("group"),n=this.get(Hu)||{},a=n.x,i=n.x,o=this.get(ms),u=Qo(e,r);if(u.centerX=(u.minX+u.maxX)/2,u.centerY=(u.minY+u.maxY)/2,o){o.width=Math.max(o.width,u.width),o.height=Math.max(o.height,u.height),this.set(ms,o);var l=e.get("type");l==="circle"?(u.width=o.r*2,u.height=o.r*2):(u.width=o.width,u.height=o.height),u.minX=u.centerX-u.width/2,u.minY=u.centerY-u.height/2,u.maxX=u.centerX+u.width/2,u.maxY=u.centerY+u.height/2}else u.width=u.maxX-u.minX,u.height=u.maxY-u.minY,u.centerX=(u.minX+u.maxX)/2,u.centerY=(u.minY+u.maxY)/2;return u.x=u.minX,u.y=u.minY,(u.x!==a||u.y!==i)&&this.set(Zu,null),u}},t.prototype.getChildren=function(){var e=this;return{nodes:e.getNodes(),combos:e.getCombos()}},t.prototype.getNodes=function(){var e=this;return e.get("nodes")},t.prototype.getCombos=function(){var e=this;return e.get("combos")},t.prototype.addChild=function(e){var r=this,n=e.getType();switch(n){case"node":r.addNode(e);break;case"combo":r.addCombo(e);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},t.prototype.addCombo=function(e){var r=this;return r.get("combos").push(e),!0},t.prototype.addNode=function(e){var r=this;return r.get("nodes").push(e),!0},t.prototype.removeChild=function(e){var r=this,n=e.getType();switch(n){case"node":r.removeNode(e);break;case"combo":r.removeCombo(e);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},t.prototype.removeCombo=function(e){if(e){var r=this.getCombos(),n=r.indexOf(e);return n>-1?(r.splice(n,1),!0):!1}},t.prototype.removeNode=function(e){if(e){var r=this.getNodes(),n=r.indexOf(e);return n>-1?(r.splice(n,1),!0):!1}},t.prototype.getUpdateType=function(e){},t.prototype.getBBox=function(){this.set(ts,null);var e=this.calculateCanvasBBox();return e},t.prototype.clearCache=function(){this.set(Hu,null),this.set(ts,null),this.set(Zu,null)},t.prototype.destroy=function(){if(!this.destroyed){var e=this.get("animate"),r=this.get("group");e&&r.stopAnimate(),r.shapeMap={},this.clearCache(),this.set(ms,null),this.set("bbox",null),r.remove(),this._cfg=null,this.destroyed=!0}},t}(Ys),ii=rs,Hs="node",bs="edge",io="vedge",ns="combo",_f="default",Mf="Mapper",Co="stateStyles",ic=function(){function E(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,s.throttle)(function(r){var n=e.graph;if(!(!n||n.get("destroyed"))){var a=e.edgeToBeUpdateMap;if(a){var i=Object.values(a);i.length&&(i.forEach(function(o){var u=o.edge;if(!(!u||u.destroyed)){var l=u.getSource(),h=u.getTarget();!l||l.destroyed||!h||h.destroyed||u.refresh(o.updateType)}}),e.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=t,this.destroyed=!1}return E.prototype.addItem=function(t,e){var r=this.graph,n=t===io?bs:t,a=r.get("".concat(n,"Group"))||r.get("group"),i=(0,s.upperFirst)(n),o=null,u=r.get(n+(0,s.upperFirst)(Co))||{},l=r.get(_f+i);e[Co]&&(u=e[Co]),l&&(0,s.each)(l,function(Ve,Ue){(0,s.isObject)(Ve)&&!(0,s.isArray)(Ve)?e[Ue]=(0,s.deepMix)({},Ve,e[Ue]):(0,s.isArray)(Ve)?e[Ue]=e[Ue]||(0,s.clone)(l[Ue]):e[Ue]=e[Ue]||l[Ue]});var h=r.get(n+Mf);if(h){var y=h(e);y[Co]&&(u=y[Co],delete y[Co]),(0,s.each)(y,function(Ve,Ue){(0,s.isObject)(Ve)&&!(0,s.isArray)(Ve)?e[Ue]=(0,s.deepMix)({},e[Ue],Ve):e[Ue]=y[Ue]||e[Ue]})}if(r.emit("beforeadditem",{type:t,model:e}),t===bs||t===io){var O=void 0,A=void 0;if(O=e.source,A=e.target,O&&(0,s.isString)(O)&&(O=r.findById(O)),A&&(0,s.isString)(A)&&(A=r.findById(A)),!O||!A){console.warn("The source or target node of edge ".concat(e.id," does not exist!"));return}O.getType&&O.getType()==="combo"&&(e.isComboEdge=!0),A.getType&&A.getType()==="combo"&&(e.isComboEdge=!0),o=new Vi({model:e,source:O,target:A,styles:u,linkCenter:r.get("linkCenter"),group:a.addGroup()})}else if(t===Hs)o=new Ys({model:e,styles:u,group:a.addGroup()});else if(t===ns){var z=e.children,$=ys(z,r),ae=void 0,ce=void 0;if(isNaN($.x)?isNaN(e.x)&&(ae=Math.random()*100):ae=$.x,isNaN($.y)?isNaN(e.y)&&(ce=Math.random()*100):ce=$.y,isNaN(e.x)||isNaN(e.y))e.x=ae,e.y=ce;else{var ue=e.x-ae,ve=e.y-ce;this.updateComboSucceeds(e.id,ue,ve,z)}var Ce=a.addGroup();Ce.setZIndex(e.depth),o=new ii({model:e,styles:u,animate:r.get("animate"),bbox:e.collapsed?ys([],r):$,group:Ce}),!e.collapsed&&o.getKeyShape().get("type")==="circle"&&($.width=Math.hypot($.height,$.width),$.height=$.width,o.set("bbox",$),o.refresh());var Re=o.getModel();(z||[]).forEach(function(Ve){var Ue=r.findById(Ve.id);o.addChild(Ue),Ve.depth=Re.depth+2})}if(o)return o.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(t,"s")).push(o),r.get("itemMap")[o.get("id")]=o,r.emit("afteradditem",{item:o,model:e}),o},E.prototype.updateItem=function(t,e){var r=this,n,a,i=this.graph;if((0,s.isString)(t)&&(t=i.findById(t)),!(!t||t.destroyed)){var o="";t.getType&&(o=t.getType());var u=i.get(o+Mf),l=t.getModel(),h=l.x,y=l.y,O=t.getUpdateType(e);if(u){var A=(0,s.deepMix)({},l,e),z=u(A),$=(0,s.deepMix)({},l,z,e);z[Co]&&(t.set("styles",$[Co]),delete $[Co]),(0,s.each)($,function(et,yt){e[yt]=et})}else(0,s.each)(e,function(et,yt){l[yt]&&(0,s.isObject)(et)&&!(0,s.isArray)(et)&&(e[yt]=(0,c.__assign)((0,c.__assign)({},l[yt]),e[yt]))});if(i.emit("beforeupdateitem",{item:t,cfg:e}),o===bs){if(e.source){var ae=e.source;(0,s.isString)(ae)&&(ae=i.findById(ae)),t.setSource(ae)}if(e.target){var ce=e.target;(0,s.isString)(ce)&&(ce=i.findById(ce)),t.setTarget(ce)}t.update(e)}else if(o===Hs){t.update(e,O);var ue=t.getEdges();O==="move"?(0,s.each)(ue,function(et){r.edgeToBeUpdateMap[et.getID()]={edge:et,updateType:O},r.throttleRefresh()}):O!=null&&O.includes("bbox")&&(0,s.each)(ue,function(et){et.refresh(O)})}else if(o===ns){if(t.update(e,O),!isNaN(e.x)||!isNaN(e.y)){var ve=e.x-h||0,Ce=e.y-y||0;this.updateComboSucceeds(l.id,ve,Ce)}var Re=t.getEdges(),Ve=(O==null?void 0:O.includes("bbox"))||O==="move";if(Ve&&o===ns){var Ue=t.get("shapeFactory"),$e=l.type||"circle",ot=l.animate===void 0||e.animate===void 0?(a=(n=Ue[$e])===null||n===void 0?void 0:n.options)===null||a===void 0?void 0:a.animate:l.animate||e.animate;ot?setTimeout(function(){if(!(!t||t.destroyed)){var et=t.getKeyShape();!et||et.destroyed||(0,s.each)(Re,function(yt){yt&&!yt.destroyed&&yt.refresh()})}},201):(0,s.each)(Re,function(et){et.refresh()})}}t.setOptimize(i.getNodes().length>i.get("optimizeThreshold")),i.emit("afterupdateitem",{item:t,cfg:e})}},E.prototype.updateCombo=function(t,e,r){var n=this,a,i,o=this.graph;if((0,s.isString)(t)&&(t=o.findById(t)),!(!t||t.destroyed)){var u=t.getModel(),l=ys(e,o,t),h=l.x,y=l.y;t.set("bbox",l);var O=h,A=y;r?(O=isNaN(u.x)?h:u.x,A=isNaN(u.y)?y:u.y):(O=isNaN(h)?u.x:h,A=isNaN(y)?u.y:y),t.update({x:O,y:A});var z=t.get("shapeFactory"),$=u.type||"circle",ae=u.animate===void 0?(i=(a=z[$])===null||a===void 0?void 0:a.options)===null||i===void 0?void 0:i.animate:u.animate;ae?setTimeout(function(){if(!(!t||t.destroyed)){var ce=t.getKeyShape();!ce||ce.destroyed||(t.getShapeCfg(u),n.updateComboEdges(t))}},201):this.updateComboEdges(t)}},E.prototype.updateComboEdges=function(t){for(var e,r,n=t.getEdges()||[],a=0;a<n.length;a++){var i=n[a];!(i!=null&&i.destroyed)&&!(!((e=i==null?void 0:i.getSource())===null||e===void 0)&&e.destroyed)&&!(!((r=i==null?void 0:i.getTarget())===null||r===void 0)&&r.destroyed)&&i.refresh()}},E.prototype.collapseCombo=function(t,e){e===void 0&&(e=!0);var r=this.graph;(0,s.isString)(t)&&(t=r.findById(t));var n=t.getChildren();n.nodes.forEach(function(a){r.hideItem(a,e)}),n.combos.forEach(function(a){r.hideItem(a,e)})},E.prototype.updateComboSucceeds=function(t,e,r,n){var a=this;n===void 0&&(n=[]);var i=this.graph;if(!(!e&&!r)){var o=n;if(!(o!=null&&o.length)){var u=i.get("comboTrees");u==null||u.forEach(function(l){Fa(l,function(h){return h.id===t?(o=h.children,!1):!0})})}o==null||o.forEach(function(l){var h=i.findById(l.id);if(h){var y=h.getModel();a.updateItem(l.id,{x:(y.x||0)+e,y:(y.y||0)+r})}})}},E.prototype.expandCombo=function(t,e){e===void 0&&(e=!0);var r=this.graph;(0,s.isString)(t)&&(t=r.findById(t));var n=t.getChildren(),a=new Set;n.nodes.forEach(function(i){r.showItem(i,e),i.getEdges().forEach(function(o){return a.add(o)})}),n.combos.forEach(function(i){i.getModel().collapsed?i.show():r.showItem(i,e),i.getEdges().forEach(function(o){return a.add(o)})}),a.forEach(function(i){return i.refresh()})},E.prototype.removeItem=function(t){var e=this,r=this.graph;if((0,s.isString)(t)&&(t=r.findById(t)),!(!t||t.destroyed)){var n=(0,s.clone)(t.getModel()),a="";t.getType&&(a=t.getType()),r.emit("beforeremoveitem",{item:n,type:a});var i=r.get("".concat(a,"s")),o=i.indexOf(t);if(o>-1&&i.splice(o,1),a===bs){var u=r.get("v".concat(a,"s")),l=u.indexOf(t);l>-1&&u.splice(l,1)}var h=t.get("id"),y=r.get("itemMap");delete y[h];var O=r.get("comboTrees"),A=t.get("id");if(a===Hs){var z=t.getModel().comboId;if(O&&z){var $=O,ae=!1;O.forEach(function(Ve){ae||Fa(Ve,function(Ue){if(Ue.id===A&&$){var $e=$.indexOf(Ue);return $.splice($e,1),ae=!0,!1}return $=Ue.children,!0})})}for(var ce=t.getEdges(),ue=ce.length-1;ue>=0;ue--)r.removeItem(ce[ue],!1);z&&r.updateCombo(z)}else if(a===ns){var ve=t.getModel().parentId,Ce,Re=!1;(O||[]).forEach(function(Ue){Re||Fa(Ue,function($e){return $e.id===A?(Ce=$e,Re=!0,!1):!0})}),Ce.removed=!0,Ce&&Ce.children&&Ce.children.forEach(function(Ue){e.removeItem(Ue.id)});for(var ce=t.getEdges(),ue=ce.length;ue>=0;ue--)r.removeItem(ce[ue],!1);ve&&r.updateCombo(ve)}t.destroy(),r.emit("afterremoveitem",{item:n,type:a})}},E.prototype.setItemState=function(t,e,r){var n=this.graph,a=e;(0,s.isString)(r)&&(a="".concat(e,":").concat(r)),!(t.hasState(a)===r&&r||(0,s.isString)(r)&&t.hasState(a))&&(n.emit("beforeitemstatechange",{item:t,state:a,enabled:r}),t.setState(e,r),n.autoPaint(),n.emit("afteritemstatechange",{item:t,state:a,enabled:r}))},E.prototype.priorityState=function(t,e){var r=this.graph,n=t;(0,s.isString)(t)&&(n=r.findById(t)),this.setItemState(n,e,!1),this.setItemState(n,e,!0)},E.prototype.clearItemStates=function(t,e){var r=this.graph;(0,s.isString)(t)&&(t=r.findById(t)),r.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),r.emit("afteritemstatesclear",{item:t,states:e})},E.prototype.refreshItem=function(t){var e=this.graph;(0,s.isString)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},E.prototype.addCombos=function(t,e){var r=this,n=this.graph;(t||[]).forEach(function(i){yo(i,function(o){var u;return e.forEach(function(l){l.id===o.id&&(l.children=o.children,l.depth=o.depth,u=l)}),u&&r.addItem("combo",u),!0})});var a=n.get("comboGroup");a&&a.sort()},E.prototype.changeItemVisibility=function(t,e){var r=this,n=this.graph;if((0,s.isString)(t)&&(t=n.findById(t)),!t){console.warn("The item to be shown or hidden does not exist!");return}if(n.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&t.getType()===Hs){var a=t.getEdges();(0,s.each)(a,function(h){e&&!(h.get("source").isVisible()&&h.get("target").isVisible())||r.changeItemVisibility(h,e)})}else if(t.getType&&t.getType()===ns){var i=n.get("comboTrees"),o=t.get("id"),u=[],l=!1;(i||[]).forEach(function(y){l||!y.children||y.children.length===0||Fa(y,function(O){return O.id===o?(u=O.children,l=!0,!1):!0})}),u&&(!e||e&&!t.getModel().collapsed)&&u.forEach(function(y){var O=n.findById(y.id);r.changeItemVisibility(O,e)});var a=t.getEdges();(0,s.each)(a,function(y){e&&!(y.get("source").isVisible()&&y.get("target").isVisible())||r.changeItemVisibility(y,e)})}return n.emit("afteritemvisibilitychange",{item:t,visible:e}),t},E.prototype.destroy=function(){this.graph=null,this.destroyed=!0},E}(),oc=ic,Es=function(){function E(t){this.graph=t,this.destroyed=!1}return E.prototype.updateState=function(t,e,r){var n=this.graph.get("states"),a=e;(0,s.isString)(r)&&(a="".concat(e,":").concat(r)),n[a]||(n[a]=[]),r?n[a].push(t):n[a]=n[a].filter(function(i){return i!==t}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:n})},E.prototype.updateStates=function(t,e,r){var n=this.graph.get("states"),a=(0,s.isString)(e)?[e]:e;a.forEach(function(i){var o=i;n[o]||(n[o]=[]),(0,s.isString)(r)&&(o="".concat(i,":").concat(r)),r?n[o].push(t):n[o]=n[o].filter(function(u){return u!==t})}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:e})},E.prototype.destroy=function(){this.graph=null,this.destroyed=!0},E}(),Cf=Es,mu=F(81182),Ku=function(t,e){return!t||!e?t:t.replace(/\\?\{([^{}]+)\}/g,function(r,n){if(r.charAt(0)==="\\")return r.slice(1);var a=e[n];return a===0&&(a="0"),a||""})},$u=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's ".concat(t.length));for(var r=0,n=t;r<n.length;r++){var a=n[r],i=a.x,o=a.y;e.push(i),e.push(o)}var u=(0,mu.e9)(e);return u.unshift(["M",t[0].x,t[0].y]),u},bu=function(t,e,r,n){r===void 0&&(r=0),n===void 0&&(n=0);var a={x:(1-r)*t.x+r*e.x,y:(1-r)*t.y+r*e.y},i=[0,0];Kn.normalize(i,[e.x-t.x,e.y-t.y]),(!i||!i[0]&&!i[1])&&(i=[0,0]);var o=[-i[1]*n,i[0]*n];return a.x+=o[0],a.y+=o[1],a},as=function(t,e){var r=t.length;if(!r)return"";for(var n="",a="",i=0;i<r;i++){var o=t[i];i===0?a="M{x} {y}":a="L{x} {y}",n+=Ku(a,o)}return e&&(n+="Z"),n},Eu=function(t){var e=[];return t.forEach(function(r){var n=r[0];if(n!=="A")for(var a=1;a<r.length;a=a+2)e.push([r[a],r[a+1]]);else{var i=r.length;e.push([r[i-2],r[i-1]])}}),e},Qr=function(t){if(t.length<2)throw new Error("point length must larger than 2, now it's ".concat(t.length));var e=t[0],r=t[1],n=t[t.length-1],a=t[t.length-2];t.unshift(n),t.unshift(a),t.push(e),t.push(r);for(var i=[],o=1;o<t.length-2;o+=1){var u=t[o-1].x,l=t[o-1].y,h=t[o].x,y=t[o].y,O=t[o+1].x,A=t[o+1].y,z=o!==t.length-2?t[o+2].x:O,$=o!==t.length-2?t[o+2].y:A,ae=h+(O-u)/6,ce=y+(A-l)/6,ue=O-(z-h)/6,ve=A-($-y)/6;i.push(["C",ae,ce,ue,ve,O,A])}return i.unshift(["M",n.x,n.y]),i},is=function(t,e){return Kn.scale([0,0],Kn.normalize([0,0],t),e)},na=function(t,e){var r=[t[1]-e[1],e[0]-t[0]],n=Math.sqrt(r[0]*r[0]+r[1]*r[1]);if(n===0)throw new Error("p0 should not be equal to p1");return[r[0]/n,r[1]/n]},Zs=function(t,e){return[e[0]-t[0],e[1]-t[1]]};function Ks(E,t){var e=function(y){var O=[y[0][0],y[0][1]-t],A=[y[0][0],y[0][1]+t];return"M ".concat(O," A ").concat(t,",").concat(t,",0,0,0,").concat(A," A ").concat(t,",").concat(t,",0,0,0,").concat(O)},r=function(y){var O=Kn.scale([0,0],na(y[0],y[1]),t),A=Kn.scale([0,0],O,-1),z=Kn.add([0,0],y[0],O),$=Kn.add([0,0],y[1],O),ae=Kn.add([0,0],y[1],A),ce=Kn.add([0,0],y[0],A);return"M ".concat(z," L ").concat($," A ").concat([t,t,"0,0,0",ae].join(",")," L ").concat(ce," A ").concat([t,t,"0,0,0",z].join(","))};if(!E||E.length<1)return"";if(E.length===1)return e(E);if(E.length===2)return r(E);for(var n=new Array(E.length),a=0;a<n.length;++a){var i=a===0?E[E.length-1]:E[a-1],o=E[a],u=Kn.scale([0,0],na(i,o),t);n[a]=[Kn.add([0,0],i,u),Kn.add([0,0],o,u)]}var l="A ".concat([t,t,"0,0,0,"].join(","));return n=n.map(function(h,y){var O="";return y===0&&(O="M ".concat(n[n.length-1][1]," ")),O+="".concat(l+h[0]," L ").concat(h[1]),O}),n.join(" ")}function Go(E,t){var e=E.length,r=function(h){var y=[h[0][0],h[0][1]-t],O=[h[0][0],h[0][1]+t];return"M ".concat(y," A ").concat([t,t,"0,0,0",O].join(",")," A ").concat([t,t,"0,0,0",y].join(","))},n=function(h){var y=Zs(h[0],h[1]),O=is(y,t),A=Kn.add([0,0],h[0],Kn.scale([0,0],O,-1)),z=Kn.add([0,0],h[1],O),$=1.2*t,ae=is(Kn.normalize([0,0],y),$),ce=Kn.scale([0,0],ae,-1),ue=Kn.add([0,0],A,ce),ve=Kn.add([0,0],z,ce),Ce=Kn.add([0,0],A,ae);return"M ".concat(A," C ").concat([ue,ve,z].join(",")," S ").concat([Ce,A].join(",")," Z")};if(!E||e<1)return"";if(e===1)return r(E);if(e===2)return n(E);for(var a=E.map(function(l,h){var y=E[(h+1)%e];return{p:l,v:Kn.normalize([0,0],Zs(l,y))}}),i=0;i<a.length;++i){var o=i>0?i-1:e-1,u=Kn.normalize([0,0],Kn.add([0,0],a[o].v,Kn.scale([0,0],a[i].v,-1)));a[i].p=Kn.add([0,0],a[i].p,Kn.scale([0,0],u,t))}return a.map(function(l){var h=l.p;return{x:h[0],y:h[1]}})}var Tf=function(t,e){for(var r=[],n=0;n<5;n++){var a=Math.cos((18+72*n)/180*Math.PI)*t,i=Math.sin((18+72*n)/180*Math.PI)*t,o=Math.cos((54+72*n)/180*Math.PI)*e,u=Math.sin((54+72*n)/180*Math.PI)*e;n===0?r.push(["M",a,-i]):r.push(["L",a,-i]),r.push(["L",o,-u])}return r.push(["Z"]),r},xs=function(t,e,r){return(t.y-r.y)*(e.x-r.x)-(t.x-r.x)*(e.y-r.y)},xu=function(t){var e=t.map(function(y){return{x:y.getModel().x,y:y.getModel().y}});e.sort(function(y,O){return y.x===O.x?y.y-O.y:y.x-O.x});for(var r={},n=e.length-1;n>=0;n--){var a=e[n],i=a.x,o=a.y;r["".concat(i,"-").concat(o)]&&e.splice(n,1),r["".concat(i,"-").concat(o)]=!0}if(e.length===1)return e;for(var u=[],n=0;n<e.length;n++){for(;u.length>=2&&xs(u[u.length-2],u[u.length-1],e[n])<=0;)u.pop();u.push(e[n])}for(var l=[],n=e.length-1;n>=0;n--){for(;l.length>=2&&xs(l[l.length-2],l[l.length-1],e[n])<=0;)l.pop();l.push(e[n])}l.pop(),u.pop();var h=u.concat(l);return h},If={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 Af(E,t,e){var r=!1,n=function(u,l){return t.cells[u+l*t.width]},a=function(u,l){var h=0;return n(u-1,l-1)>=e&&(h+=1),n(u,l-1)>e&&(h+=2),n(u-1,l)>e&&(h+=4),n(u,l)>e&&(h+=8),h},i=function(u,l){for(var h=u,y=l,O,A,z=0;z<t.width*t.height;z++){if(O=h,A=y,E.findIndex(function(ae){return ae.x===h&&ae.y===y})>-1){if(!(E[0].x!==h||E[0].y!==y))return!0}else E.push({x:h,y});var $=a(h,y);switch($){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:h++;break;case 12:case 14:case 4:h--;break;case 6:O===0&&(A===-1?h-=1:h+=1);break;case 1:case 13:case 5:y--;break;case 9:O===1&&(A===0?y-=1:y+=1);break;case 10:case 8:case 11:y++;break;default:return console.warn("Marching squares invalid state: ".concat($)),!0}}};this.march=function(){for(var o=0;o<t.width&&!r;o+=1)for(var u=0;u<t.height&&!r;u+=1)n(o,u)>e&&a(o,u)!==15&&(r=i(o,u));return r}}var oo=function(t,e,r){var n=Math.ceil(t/r),a=Math.ceil(e/r),i=new Float32Array(Math.max(0,n*a)).fill(0);return{cells:i,width:n,height:a}},q=function(t,e,r){var n=null,a=Number.POSITIVE_INFINITY;return e.forEach(function(i){var o={x:t.getModel().x,y:t.getModel().y},u={x:i.getModel().x,y:i.getModel().y},l=So(o,u),h=new Ui(o.x,o.y,u.x,u.y),y=r.reduce(function(O,A){return hs(A,h)>0?O+1:O},0);l*Math.pow(y+1,2)<a&&(n=i,a=l*Math.pow(y+1,2))}),n},de=function(t,e){var r=Number.POSITIVE_INFINITY,n=null;return t.forEach(function(a){var i=hs(a,e);i>=0&&i<r&&(n=a,r=i)}),n},Ee=function(t,e,r,n){var a=[],i=[];i.push(t);for(var o=!0,u=0,l=function(A,z){var $=!1;return z.forEach(function(ae){$||(di(A,{x:ae.x1,y:ae.y1})||di(A,{x:ae.x2,y:ae.y2}))&&($=!0)}),$},h=function(A,z){for(var $=0,ae=z;$<ae.length;$++){var ce=ae[$],ue=ce.getBBox(),ve=[[ue.x,ue.y],[ue.x+ue.width,ue.y],[ue.x,ue.y+ue.height],[ue.x+ue.width,ue.y+ue.height]];if($i(ve,A.x,A.y))return!0}return!1};o&&u<r;){o=!1;for(var y=function(){var A=i.pop(),z=de(e,A);if(z){var $=vo(z,A),ae=$[0],ce=$[1];if(ce===2){var ue=function(Ce){for(var Re=n,Ve=jt(z,Re,ae,Ce),Ue=l(Ve,i)||l(Ve,a),$e=h(Ve,e);!Ue&&$e&&Re>=1;)Re/=1.5,Ve=jt(z,Re,ae,Ce),Ue=l(Ve,i)||l(Ve,a),$e=h(Ve,e);Ve&&!Ue&&(!Ce||!$e)&&(i.push(new Ui(A.x1,A.y1,Ve.x,Ve.y)),i.push(new Ui(Ve.x,Ve.y,A.x2,A.y2)),o=!0)};ue(!0),o||ue(!1)}}o||a.push(A),u+=1};!o&&i.length;)y()}for(;i.length;)a.push(i.pop());return a};function Pe(E,t,e,r,n){var a=q(E,e,t);if(a===null)return[];var i=function(y){for(var O=[];y.length>0;){var A=y.pop();if(y.length===0){O.push(A);break}var z=y.pop(),$=new Ui(A.x1,A.y1,z.x2,z.y2),ae=de(t,$);ae?(O.push(A),y.push(z)):y.push($)}return O},o=new Ui(E.getModel().x,E.getModel().y,a.getModel().x,a.getModel().y),u=Ee(o,t,r,n),l=i(u);return l}var je=function(t,e,r){var n=Object.assign(If,r),a=Ca(t.map(function(ue){return{x:ue.getModel().x,y:ue.getModel().y}}));t=t.sort(function(ue,ve){return So({x:ue.getModel().x,y:ue.getModel().y},a)-So({x:ve.getModel().x,y:ve.getModel().y},a)});var i=[],o=[];t.forEach(function(ue){var ve=Pe(ue,e,i,n.maxRoutingIterations,n.morphBuffer);ve.forEach(function(Ce){o.push(Ce)}),i.push(ue)});for(var u=bt(t,o,n.nodeR0),l=oo(u.width,u.height,n.pixelGroupSize),h=[],y=[],O=0;O<n.maxMarchingIterations;O++)if(St(t,e,o,u,l,n),h=[],y=[],!!new Af(h,l,n.threshold).march()){var A=h.map(function(ue){return{x:Math.round(ue.x*n.pixelGroupSize+u.minX),y:Math.round(ue.y*n.pixelGroupSize+u.minY)}});if(A){var z=A.length;if(n.skip>1)for(z=Math.floor(A.length/n.skip);z<3&&n.skip>1;)n.skip-=1,z=Math.floor(A.length/n.skip);for(var $=0,ae=0;ae<z;ae+=1,$+=n.skip)y.push({x:A[$].x,y:A[$].y})}var ce=function(){for(var ve=0,Ce=t;ve<Ce.length;ve++){var Re=Ce[ve],Ve=y.map(function(Ue){return[Ue.x,Ue.y]});if(!$i(Ve,Re.getBBox().centerX,Re.getBBox().centerY))return!1}return!0};if(y&&ce())return y;if(n.threshold*=.9,O<=n.maxMarchingIterations*.5)n.memberInfluenceFactor*=1.2,n.edgeInfluenceFactor*=1.2;else if(n.nonMemberInfluenceFactor!==0&&e.length>0)n.nonMemberInfluenceFactor*=.8;else break}return y};function bt(E,t,e){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},n=[];E.forEach(function(u){n.push(u.getBBox())}),t.forEach(function(u){n.push(u.getBBox())});for(var a=0,i=n;a<i.length;a++){var o=i[a];r.minX=(o.minX<r.minX?o.minX:r.minX)-e,r.minY=(o.minY<r.minY?o.minY:r.minY)-e,r.maxX=(o.maxX>r.maxX?o.maxX:r.maxX)+e,r.maxY=(o.maxY>r.maxY?o.maxY:r.maxY)+e}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}function St(E,t,e,r,n,a){function i(A,z){var $=Math.floor((A-z)/a.pixelGroupSize);return $<0?0:$}function o(A,z){return A*a.pixelGroupSize+z}var u=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),l=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1),h=function(z,$){var ae=Math.min(i(z.minX,$+r.minX),n.width),ce=Math.min(i(z.minY,$+r.minY),n.height),ue=Math.min(i(z.maxX,-$+r.minX),n.width),ve=Math.min(i(z.maxY,-$+r.minY),n.height);return[ae,ce,ue,ve]},y=function(z,$){for(var ae=z.getBBox(),ce=h(ae,a.nodeR1),ue=ce[0],ve=ce[1],Ce=ce[2],Re=ce[3],Ve=ve;Ve<Re;Ve+=1)for(var Ue=ue;Ue<Ce;Ue+=1)if(!($<0&&n[Ue+Ve*n.width]<=0)){var $e=o(Ue,r.minX),ot=o(Ve,r.minY),et=mi({x:$e,y:ot},{x:ae.minX,y:ae.minY,width:ae.width,height:ae.height});if(et<Math.pow(a.nodeR1,2)){var yt=Math.sqrt(et)-a.nodeR1;n.cells[Ue+Ve*n.width]+=$*yt*yt}}},O=function(z,$){for(var ae=z.getBBox(),ce=h(ae,a.edgeR1),ue=ce[0],ve=ce[1],Ce=ce[2],Re=ce[3],Ve=ve;Ve<Re;Ve+=1)for(var Ue=ue;Ue<Ce;Ue+=1)if(!($<0&&n.cells[Ue+Ve*n.width]<=0)){var $e=o(Ue,r.minX),ot=o(Ve,r.minY),et=ou({x:$e,y:ot},z);if(et<Math.pow(a.edgeR1,2)){var yt=Math.sqrt(et)-a.edgeR1;n.cells[Ue+Ve*n.width]+=$*yt*yt}}};a.nodeInfluenceFactor&&E.forEach(function(A){y(A,a.nodeInfluenceFactor/u)}),a.edgeInfluenceFactor&&e.forEach(function(A){O(A,a.edgeInfluenceFactor/l)}),a.negativeNodeInfluenceFactor&&t.forEach(function(A){y(A,a.negativeNodeInfluenceFactor/u)})}function jt(E,t,e,r){var n=E.getBBox(),a=e[0],i=e[1],o=e[2],u=e[3],l={topLeft:{x:n.minX-t,y:n.minY-t},topRight:{x:n.maxX+t,y:n.minY-t},bottomLeft:{x:n.minX-t,y:n.maxY+t},bottomRight:{x:n.maxX+t,y:n.maxY+t}},h=n.height*n.width;function y(z,$){return n.width*((z.y-n.minY+($.y-n.minY))*.5)}if(i){if(a)return r?l.topLeft:l.bottomRight;if(o)return r?l.bottomLeft:l.topRight;var O=y(i,u);return O<h*.5?i.y>u.y?r?l.topLeft:l.bottomRight:r?l.topRight:l.bottomLeft:i.y<u.y?r?l.bottomLeft:l.topRight:r?l.bottomRight:l.topLeft}if(u){if(a)return r?l.topRight:l.bottomLeft;if(o)return r?l.bottomRight:l.topLeft}var A=y(a,o);return A<h*.5?a.x>o.x?r?l.topLeft:l.bottomRight:r?l.bottomLeft:l.topRight:a.x<o.x?r?l.topRight:l.bottomLeft:r?l.bottomRight:l.topLeft}var vr=function(){function E(t,e){this.cfg=(0,s.deepMix)(this.getDefaultCfg(),e),this.graph=t,this.id=this.cfg.id,this.group=this.cfg.group,this.members=this.cfg.members.map(function(r){return(0,s.isString)(r)?t.findById(r):r}),this.nonMembers=this.cfg.nonMembers.map(function(r){return(0,s.isString)(r)?t.findById(r):r}),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()}return E.prototype.getDefaultCfg=function(){return{id:"g6-hull",type:"round-convex",members:[],nonMembers:[],style:{fill:"lightblue",stroke:"blue",opacity:.2},padding:10}},E.prototype.setPadding=function(){var t=this.members.length&&this.members[0].getKeyShape().getCanvasBBox().width/2;this.padding=this.cfg.padding>0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},E.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),this.type!=="round-convex"&&this.type!=="smooth-convex"&&this.type!=="bubble"&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},E.prototype.calcPath=function(t,e){var r,n,a;switch(this.type){case"round-convex":r=xu(t),a=Ks(r.map(function(i){return[i.x,i.y]}),this.padding),n=(0,mu.tr)(a);break;case"smooth-convex":r=xu(t),r.length===2?(a=Ks(r.map(function(i){return[i.x,i.y]}),this.padding),n=(0,mu.tr)(a)):r.length>2&&(a=Go(r.map(function(i){return[i.x,i.y]}),this.padding),n=Qr(a));break;case"bubble":r=je(t,e,this.cfg.bubbleCfg),n=r.length>=2&&Qr(r);break;default:}return n},E.prototype.render=function(){this.group.addShape("path",{attrs:(0,c.__assign)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},E.prototype.addMember=function(t){if(t){(0,s.isString)(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}},E.prototype.addNonMember=function(t){if(t){(0,s.isString)(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}},E.prototype.removeMember=function(t){if(t){(0,s.isString)(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):!1}},E.prototype.removeNonMember=function(t){if(t){(0,s.isString)(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):!1}},E.prototype.updateData=function(t,e){var r=this;this.group.findById(this.id).remove(),t&&(this.members=t.map(function(n){return(0,s.isString)(n)?r.graph.findById(n):n})),e&&(this.nonMembers=e.map(function(n){return(0,s.isString)(n)?r.graph.findById(n):n})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},E.prototype.updateStyle=function(t){var e=this.group.findById(this.id);e.attr((0,c.__assign)({},t))},E.prototype.updateCfg=function(t){var e=this;this.cfg=(0,s.deepMix)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map(function(r){return(0,s.isString)(r)?e.graph.findById(r):r})),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(r){return(0,s.isString)(r)?e.graph.findById(r):r})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},E.prototype.contain=function(t){var e=this,r;(0,s.isString)(t)?r=this.graph.findById(t):r=t;var n,a=r.getKeyShape();if(r.get("type")==="path")n=Eu(a.attr("path"));else{var i=a.getCanvasBBox();n=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return n=n.map(function(o){var u=e.graph.getPointByCanvas(o[0],o[1]);return[u.x,u.y]}),Zo(n,Eu(this.path))},E.prototype.destroy=function(){this.group.remove(),this.cfg=null},E}(),xr=vr,$r=Q.vs,an="node",tn=function(E){(0,c.__extends)(t,E);function t(e){var r=E.call(this)||this;return r.sortCombos=(0,s.debounce)(function(){var n=r.get("comboSorted");if(!(!r||r.destroyed||n)){r.set("comboSorted",!0);var a=[],i={},o=r.get("comboTrees");(o||[]).forEach(function(l){Fa(l,function(h){return a[h.depth]?a[h.depth].push(h.id):a[h.depth]=[h.id],i[h.id]=h.depth,!0})});var u=r.getEdges().concat(r.get("vedges"));(u||[]).forEach(function(l){var h=l.getModel(),y=i[h.source]||0,O=i[h.target]||0,A=Math.max(y,O);a[A]?a[A].push(h.id):a[A]=[h.id]}),a.forEach(function(l){if(!(!l||!l.length))for(var h=l.length-1;h>=0;h--){var y=r.findById(l[h]);y&&y.toFront()}})}},500,!1),r.cfg=(0,s.deepMix)(r.getDefaultCfg(),e),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new ya(r.cfg.maxStep),r.redoStack=new ya(r.cfg.maxStep)),r}return t.prototype.init=function(){this.initCanvas();var e=new pf(this),r=new Bs(this),n=new oc(this),a=new Cf(this);this.set({viewController:e,modeController:r,itemController:n,stateController:a}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},t.prototype.initGroups=function(){var e=this.get("canvas");if(e){var r=e.get("el"),n=(r||{}).id,a=n===void 0?"g6":n,i=e.addGroup({id:"".concat(a,"-root"),className:dn.rootContainerClassName});if(this.get("groupByTypes")){var o=i.addGroup({id:"".concat(a,"-edge"),className:dn.edgeContainerClassName}),u=i.addGroup({id:"".concat(a,"-node"),className:dn.nodeContainerClassName}),l=i.addGroup({id:"".concat(a,"-combo"),className:dn.comboContainerClassName});l.toBack(),this.set({nodeGroup:u,edgeGroup:o,comboGroup:l})}var h=i.addGroup({id:"".concat(a,"-delegate"),className:dn.delegateContainerClassName});this.set({delegateGroup:h}),this.set("group",i)}},t.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,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:[],optimizeThreshold:1e3}},t.prototype.set=function(e,r){return(0,s.isPlainObject)(e)?this.cfg=(0,c.__assign)((0,c.__assign)({},this.cfg),e):this.cfg[e]=r,e==="enabledStack"&&r&&!this.undoStack&&!this.redoStack&&(this.undoStack=new ya(this.cfg.maxStep),this.redoStack=new ya(this.cfg.maxStep)),this},t.prototype.get=function(e){var r;return(r=this.cfg)===null||r===void 0?void 0:r[e]},t.prototype.getGroup=function(){return this.get("group")},t.prototype.getContainer=function(){return this.get("container")},t.prototype.getMinZoom=function(){return this.get("minZoom")},t.prototype.setMinZoom=function(e){return this.set("minZoom",e)},t.prototype.getMaxZoom=function(){return this.get("maxZoom")},t.prototype.setMaxZoom=function(e){return this.set("maxZoom",e)},t.prototype.getWidth=function(){return this.get("width")},t.prototype.getHeight=function(){return this.get("height")},t.prototype.clearItemStates=function(e,r){(0,s.isString)(e)&&(e=this.findById(e));var n=this.get("itemController");r||(r=e.get("states")),n.clearItemStates(e,r);var a=this.get("stateController");a.updateStates(e,r,!1)},t.prototype.node=function(e){typeof e=="function"&&this.set("nodeMapper",e)},t.prototype.edge=function(e){typeof e=="function"&&this.set("edgeMapper",e)},t.prototype.combo=function(e){typeof e=="function"&&this.set("comboMapper",e)},t.prototype.findById=function(e){return this.get("itemMap")[e]},t.prototype.find=function(e,r){var n,a=this.get("".concat(e,"s"));return(0,s.each)(a,function(i,o){if(r(i,o))return n=i,n}),n},t.prototype.findAll=function(e,r){var n=[];return(0,s.each)(this.get("".concat(e,"s")),function(a,i){r(a,i)&&n.push(a)}),n},t.prototype.findAllByState=function(e,r,n){return n?this.findAll(e,function(a){return a.hasState(r)&&n(a)}):this.findAll(e,function(a){return a.hasState(r)})},t.prototype.translate=function(e,r,n,a){var i=this,o=this.get("group"),u=(0,s.clone)(o.getMatrix());if(u||(u=[1,0,0,0,1,0,0,0,1]),n){var l=ko({animateCfg:a,callback:function(){return i.emit("viewportchange",{action:"translate",matrix:o.getMatrix()})}});ri(o,{x:o.getCanvasBBox().x+e,y:o.getCanvasBBox().y+r},n,l||{duration:500,easing:"easeCubic"})}else u=$r(u,[["t",e,r]]),o.setMatrix(u),this.emit("viewportchange",{action:"translate",matrix:u}),this.autoPaint()},t.prototype.moveTo=function(e,r,n,a){var i=this.get("group");ri(i,{x:e,y:r},n,a||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},t.prototype.fitView=function(e,r,n,a){e&&this.set("fitViewPadding",e);var i=this.get("viewController");r?i.fitViewByRules(r,n,a):i.fitView(n,a),this.autoPaint()},t.prototype.fitCenter=function(e,r){var n=this.get("viewController");n.fitCenter(e,r),this.autoPaint()},t.prototype.addBehaviors=function(e,r){var n=this.get("modeController");return n.manipulateBehaviors(e,r,!0),this},t.prototype.removeBehaviors=function(e,r){var n=this.get("modeController");return n.manipulateBehaviors(e,r,!1),this},t.prototype.updateBehavior=function(e,r,n){var a=this.get("modeController");return a.updateBehavior(e,r,n),this},t.prototype.zoom=function(e,r,n,a){var i=this,o=this.get("group"),u=(0,s.clone)(o.getMatrix())||[1,0,0,0,1,0,0,0,1],l=this.get("minZoom"),h=this.get("maxZoom"),y=this.getZoom()||1,O=y*e,A=e,z=!1;if(l&&O<l?(A=l/y,z=!0):h&&O>h&&(A=h/y,z=!0),r?u=$r(u,[["t",-r.x,-r.y],["s",A,A],["t",r.x,r.y]]):u=$r(u,[["s",A,A]]),n){var $=(0,s.clone)(o.getMatrix());$||($=[1,0,0,0,1,0,0,0,1]);var ae=$[0],ce=ae*A,ue=ko({animateCfg:a,callback:function(){return i.emit("viewportchange",{action:"zoom",matrix:o.getMatrix()})}});o.animate(function(ve){if(ve===1)$=u;else{var Ce=hi(ae,ce,ve)/$[0];r?$=$r($,[["t",-r.x,-r.y],["s",Ce,Ce],["t",r.x,r.y]]):$=$r($,[["s",Ce,Ce]])}return{matrix:$}},ue)}else o.setMatrix(u),this.emit("viewportchange",{action:"zoom",matrix:u}),this.autoPaint();return!z},t.prototype.zoomTo=function(e,r,n,a){var i=e/this.getZoom();return this.zoom(i,r,n,a)},t.prototype.focusItem=function(e,r,n){var a=this.get("viewController"),i=!1;r?i=!0:r===void 0&&(i=this.get("animate"));var o={};n?o=n:n===void 0&&(o=this.get("animateCfg")),a.focus(e,i,o),this.autoPaint()},t.prototype.focusItems=function(e,r,n,a){var i=this.get("viewController");i.focusItems(e,r,n,a)},t.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},t.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},t.prototype.getPointByClient=function(e,r){var n=this.get("viewController");return n.getPointByClient(e,r)},t.prototype.getClientByPoint=function(e,r){var n=this.get("viewController");return n.getClientByPoint(e,r)},t.prototype.getPointByCanvas=function(e,r){var n=this.get("viewController");return n.getPointByCanvas(e,r)},t.prototype.getCanvasByPoint=function(e,r){var n=this.get("viewController");return n.getCanvasByPoint(e,r)},t.prototype.getGraphCenterPoint=function(){var e=this.get("group").getCanvasBBox();return{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}},t.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},t.prototype.showItem=function(e,r){r===void 0&&(r=!0);var n=this.get("itemController"),a=n.changeItemVisibility(e,!0);if(r&&this.get("enabledStack")){var i=a.getID(),o=a.getType(),u={},l={};switch(o){case"node":u.nodes=[{id:i,visible:!1}],l.nodes=[{id:i,visible:!0}];break;case"edge":u.nodes=[{id:i,visible:!1}],l.edges=[{id:i,visible:!0}];break;case"combo":u.nodes=[{id:i,visible:!1}],l.combos=[{id:i,visible:!0}];break;default:break}this.pushStack("visible",{before:u,after:l})}},t.prototype.hideItem=function(e,r){r===void 0&&(r=!0);var n=this.get("itemController"),a=n.changeItemVisibility(e,!1);if(r&&this.get("enabledStack")){var i=a.getID(),o=a.getType(),u={},l={};switch(o){case"node":u.nodes=[{id:i,visible:!0}],l.nodes=[{id:i,visible:!1}];break;case"edge":u.nodes=[{id:i,visible:!0}],l.edges=[{id:i,visible:!1}];break;case"combo":u.nodes=[{id:i,visible:!0}],l.combos=[{id:i,visible:!1}];break;default:break}this.pushStack("visible",{before:u,after:l})}},t.prototype.refreshItem=function(e){var r=this.get("itemController");r.refreshItem(e)},t.prototype.setAutoPaint=function(e){var r=this;r.set("autoPaint",e);var n=r.get("canvas");n.set("autoDraw",e)},t.prototype.remove=function(e,r){r===void 0&&(r=!0),this.removeItem(e,r)},t.prototype.removeItem=function(e,r){r===void 0&&(r=!0);var n=e;if((0,s.isString)(e)&&(n=this.findById(e)),!n&&(0,s.isString)(e))console.warn("The item ".concat(e," to be removed does not exist!"));else if(n){var a="";if(n.getType&&(a=n.getType()),r&&this.get("enabledStack")){var i=(0,c.__assign)((0,c.__assign)({},n.getModel()),{itemType:a}),o={};switch(a){case"node":{o.nodes=[i],o.edges=[];for(var u=n.getEdges(),l=u.length-1;l>=0;l--)o.edges.push((0,c.__assign)((0,c.__assign)({},u[l].getModel()),{itemType:"edge"}));break}case"edge":o.edges=[i];break;case"combo":o.combos=[i];break;default:break}this.pushStack("delete",{before:o,after:{}})}if(a==="node"){var h=n.getModel();h.comboId&&this.updateComboTree(n,void 0,!1)}var y=this.get("itemController");if(y.removeItem(n),a==="combo"){var O=ps(this.get("comboTrees"));this.set("comboTrees",O)}}},t.prototype.innerAddItem=function(e,r,n){if(!zu(e,r))return!1;if(r.id&&this.findById(r.id)){console.warn("This item exists already. Be sure the id %c".concat(r.id,"%c is unique."),"font-size: 20px; color: red;","");return}var a,i=this.get("comboTrees")||[];if(e==="combo"){var o=this.get("itemMap"),u=!1;if(i.forEach(function(z){u||yo(z,function($){if(r.parentId===$.id){u=!0;var ae=(0,c.__assign)({id:r.id,depth:$.depth+2},r);$.children?$.children.push(ae):$.children=[ae],r.depth=ae.depth,a=n.addItem(e,r)}var ce=o[$.id];return u&&ce&&ce.getType&&ce.getType()==="combo"&&n.updateCombo(ce,$.children),!0})}),!u){var l=(0,c.__assign)({id:r.id,depth:0},r);r.depth=l.depth,i.push(l),a=n.addItem(e,r)}this.set("comboTrees",i),r.collapsed&&(this.collapseCombo(a,!1),this.updateCombo(a))}else if(e==="node"&&(0,s.isString)(r.comboId)&&i){var h=this.findById(r.comboId);h&&h.getType&&h.getType()!=="combo"&&console.warn("'".concat(r.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),a=n.addItem(e,r);var y=this.get("itemMap"),O=!1,A=!1;i.forEach(function(z){A||O||yo(z,function($){if($.id===r.id)return A=!0,!1;if(r.comboId===$.id&&!A){O=!0;var ae=(0,s.clone)(r);ae.itemType="node",$.children?$.children.push(ae):$.children=[ae],ae.depth=$.depth+1}return O&&y[$.id].getType&&y[$.id].getType()==="combo"&&n.updateCombo(y[$.id],$.children),!0})})}else a=n.addItem(e,r);if(e==="node"&&r.comboId||e==="combo"&&r.parentId){var h=this.findById(r.comboId||r.parentId);h&&h.getType&&h.getType()==="combo"&&h.addChild(a)}return a},t.prototype.addItem=function(e,r,n,a){n===void 0&&(n=!0),a===void 0&&(a=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!a);var o=this.get("itemController"),u=this.innerAddItem(e,r,o);if(u===!1||u===!0)return u;var l=this.get("combos");if(l&&l.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var h=(0,c.__assign)((0,c.__assign)({},u.getModel()),{itemType:e}),y={};switch(e){case"node":y.nodes=[h];break;case"edge":y.edges=[h];break;case"combo":y.combos=[h];break;default:break}this.pushStack("add",{before:{},after:y})}return u},t.prototype.addItems=function(e,r,n){e===void 0&&(e=[]),r===void 0&&(r=!0),n===void 0&&(n=!0);var a=this.get("comboSorted");this.set("comboSorted",a&&!n);for(var i=this.get("itemController"),o=[],u=0;u<e.length;u++){var l=e[u];l.type!=="edge"&&l.type!=="vedge"?o.push(this.innerAddItem(l.type,l.model,i)):o.push(void 0)}for(var u=0;u<e.length;u++){var l=e[u];(l.type==="edge"||l.type==="vedge")&&(o[u]=this.innerAddItem(l.type,l.model,i))}if(n){var h=this.get("combos");h&&h.length>0&&this.sortCombos()}if(this.autoPaint(),r&&this.get("enabledStack")){for(var y={nodes:[],edges:[],combos:[]},u=0;u<e.length;u++){var O=e[u].type,A=o[u];if(A&&A!==!0){var z=(0,c.__assign)((0,c.__assign)({},A.getModel()),{itemType:O});switch(O){case"node":y.nodes.push(z);break;case"edge":y.edges.push(z);break;case"combo":y.combos.push(z);break;default:break}}}this.pushStack("addItems",{before:{},after:y})}return o},t.prototype.add=function(e,r,n,a){return n===void 0&&(n=!0),a===void 0&&(a=!0),this.addItem(e,r,n,a)},t.prototype.updateItem=function(e,r,n){var a=this;n===void 0&&(n=!0);var i=this.get("itemController"),o;(0,s.isString)(e)?o=this.findById(e):o=e;var u=n&&this.get("enabledStack"),l;u&&(l=(0,s.clone)(o.getModel()));var h="";o.getType&&(h=o.getType());var y=(0,c.__spreadArray)([],o.getStates(),!0);if(h==="combo"&&(0,s.each)(y,function($){return a.setItemState(o,$,!1)}),i.updateItem(o,r),h==="combo"&&(0,s.each)(y,function($){return a.setItemState(o,$,!0)}),u){var O={nodes:[],edges:[],combos:[]},A={nodes:[],edges:[],combos:[]},z=(0,c.__assign)({id:l.id},r);switch(h){case"node":O.nodes.push(l),A.nodes.push(z);break;case"edge":O.edges.push(l),A.edges.push(z);break;case"combo":O.combos.push(l),A.combos.push(z);break;default:break}this.pushStack("update",{before:O,after:A})}},t.prototype.update=function(e,r,n){n===void 0&&(n=!0),this.updateItem(e,r,n)},t.prototype.setItemState=function(e,r,n){(0,s.isString)(e)&&(e=this.findById(e));var a=this.get("itemController");a.setItemState(e,r,n);var i=this.get("stateController");i.updateState(e,r,n)},t.prototype.priorityState=function(e,r){var n=this.get("itemController");n.priorityState(e,r)},t.prototype.data=function(e){Rs(e),this.set("data",e)},t.prototype.render=function(){var e=this;this.set("comboSorted",!1);var r=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!r)throw new Error("data must be defined first");var n=r.nodes,a=n===void 0?[]:n,i=r.edges,o=i===void 0?[]:i,u=r.combos,l=u===void 0?[]:u;if(this.clear(!0),this.emit("beforerender"),e.addItems(a.map(function(ae){return{type:"node",model:ae}}),!1,!1),(l==null?void 0:l.length)!==0){var h=ks(l,a);this.set("comboTrees",h),e.addCombos(l)}e.addItems(o.map(function(ae){return{type:"edge",model:ae}}),!1,!1);var y=e.get("animate");(e.get("fitView")||e.get("fitCenter"))&&e.set("animate",!1);var O=e.get("layoutController");if(O){if(O.layout(A),this.destroyed)return}else A();function A(){(e.get("comboTrees")||[]).forEach(function(ae){yo(ae,function(ce){var ue=e.findById(ce.id);return ue.getType()==="combo"&&ce.collapsed&&(e.collapseCombo(ce.id,!1),e.updateCombo(ue)),!0})}),e.get("fitView")?e.fitView():e.get("fitCenter")&&e.fitCenter(),e.autoPaint(),e.emit("afterrender"),(e.get("fitView")||e.get("fitCenter"))&&e.set("animate",y),setTimeout(function(){var ae;(ae=e.getCombos())===null||ae===void 0||ae.forEach(function(ce){ce.set("animate",!0)})},0)}if(!this.get("groupByTypes"))if(l&&l.length!==0)this.sortCombos();else if(r.nodes&&r.edges&&r.nodes.length<r.edges.length){var z=this.getNodes();z.forEach(function(ae){ae.toFront()})}else{var $=this.getEdges();$.forEach(function(ae){ae.toBack()})}},t.prototype.read=function(e){this.data(e),this.render()},t.prototype.diffItems=function(e,r,n){var a=this,i,o=this.get("itemMap");(0,s.each)(n,function(u){if(i=o[u.id],i){if(a.get("animate")&&e===an){var l=i.getContainer().getMatrix();l||(l=[1,0,0,0,1,0,0,0,1]),i.set("originAttrs",{x:l[6],y:l[7]})}a.updateItem(i,u,!1)}else i=a.addItem(e,u,!1);i&&r["".concat(e,"s")].push(i)})},t.prototype.changeData=function(e,r){var n=this,a;r===void 0&&(r=!0);var i=this,o=e||i.get("data");if(!Rs(o))return this;this.emit("beforechangedata"),r&&this.get("enabledStack")&&this.pushStack("changedata",{before:i.save(),after:o}),this.set("comboSorted",!1),this.removeHulls(),this.getNodes().map(function(Ce){return i.clearItemStates(Ce)}),this.getEdges().map(function(Ce){return i.clearItemStates(Ce)});var u=this.get("canvas"),l=u.get("localRefresh");u.set("localRefresh",!1),i.get("data")||(i.data(o),i.render());var h=this.get("itemMap"),y={nodes:[],edges:[]},O=o.combos;if(O){var A=ks(O,o.nodes);this.set("comboTrees",A)}else this.set("comboTrees",[]);this.diffItems("node",y,o.nodes),(0,s.each)(h,function(Ce,Re){h[Re].getModel().depth=0,!(Ce.getType&&Ce.getType()==="edge")&&(Ce.getType&&Ce.getType()==="combo"?(delete h[Re],Ce.destroy()):y.nodes.indexOf(Ce)<0&&(delete h[Re],i.remove(Ce,!1)))});for(var z=this.getCombos(),$=z.length,ae=$-1;ae>=0;ae--)z[ae].destroyed&&z.splice(ae,1);O&&(i.addCombos(O),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",y,o.edges),(0,s.each)(h,function(Ce,Re){Ce.getType&&(Ce.getType()==="node"||Ce.getType()==="combo")||y.edges.indexOf(Ce)<0&&(delete h[Re],i.remove(Ce,!1))}),(this.get("comboTrees")||[]).forEach(function(Ce){yo(Ce,function(Re){var Ve=n.findById(Re.id);return Ve.getType()==="combo"&&Re.collapsed&&n.collapseCombo(Re.id,!1),!0})}),this.set({nodes:y.nodes,edges:y.edges});var ce=(this.get("layout")||{}).relayoutAtChangeData,ue=ce===void 0?!0:ce,ve=this.get("layoutController");return ue&&ve&&(ve.changeData(function(){setTimeout(function(){var Ce;(Ce=i.getCombos())===null||Ce===void 0||Ce.forEach(function(Re){Re.set("animate",!0)})},0)}),i.get("animate")&&!ve.getLayoutType()?(i.positionsAnimate(),(a=i.getCombos())===null||a===void 0||a.forEach(function(Ce){return Ce.set("animate",!0)})):i.autoPaint()),setTimeout(function(){u.set("localRefresh",l)},16),this.set("data",o),this.emit("afterchangedata"),this},t.prototype.addCombos=function(e){var r=this,n=r.get("comboTrees"),a=this.get("itemController");a.addCombos(n,e)},t.prototype.createCombo=function(e,r,n){var a=this;n===void 0&&(n=!0);var i=this.get("itemController");this.set("comboSorted",!1);var o="",u;if(e){if((0,s.isString)(e))o=e,u={id:e};else{if(o=e.id,!o){console.warn("Create combo failed. Please assign a unique string id for the adding combo.");return}u=e}var l=n&&this.get("enabledStack"),h={nodes:[],combos:[]};l&&r.forEach(function(ce){var ue=a.findById(ce),ve=ue.getType();if(!(ve!=="node"&&ve!=="combo")){var Ce=ue.getModel();h["".concat(ve,"s")].push({id:ce,parentId:ve==="node"?Ce.comboId:Ce.parentId})}});var y=this.get("comboTrees"),O=new Set(r),A=new Map;y&&(y.forEach(function(ce){yo(ce,function(ue,ve,Ce){if(O.has(ue.id)){if(ve){var Re=a.findById(ve.id),Ve=a.findById(ue.id);ve.children.splice(Ce,1),Re.removeChild(Ve),i.updateCombo(Re,ve.children)}ue.itemType==="combo"&&A.set(ue.id,ue)}return!0})}),y=y.filter(function(ce){return!O.has(ce.id)}),this.set("comboTrees",y));var z={nodes:[],combos:[]},$=r.map(function(ce){var ue=a.findById(ce),ve=ue.getModel(),Ce="";ue.getType&&(Ce=ue.getType());var Re=A.get(ce)||{id:ue.getID(),itemType:Ce};return Ce==="combo"?(Re.parentId=o,ve.parentId=o):Ce==="node"&&(Re.comboId=o,ve.comboId=o),l&&z["".concat(Ce,"s")].push({id:ve.id,parentId:o}),Re});u.children=$,this.addItem("combo",u,!1),this.set("comboSorted",!1),y&&(y.forEach(function(ce){Fa(ce,function(ue){return ue.id===o?(ue.itemType="combo",ue.children=$,!1):!0})}),this.sortCombos()),l&&(z.combos.push(u),this.pushStack("createCombo",{before:h,after:z}));var ae=this.findById(o);!ae.getModel().parentId&&ae.getChildren().combos.length&&this.updateComboTree(ae,void 0,!1),setTimeout(function(){ae.set("animate",!0)},0)}},t.prototype.uncombo=function(e,r){var n=this,a,i;r===void 0&&(r=!0);var o=this,u=e;if((0,s.isString)(e)&&(u=this.findById(e)),!u||u.getType&&u.getType()!=="combo"){console.warn("The item is not a combo!");return}var l=u.getModel(),h=u.getModel().parentId,y=o.get("comboTrees");y||(y=[]);var O=this.get("itemMap"),A=u.get("id"),z,$=[],ae=this.get("combos"),ce=this.findById(h),ue=r&&this.get("enabledStack"),ve={};if(ue&&(ve=(0,s.clone)(l),ve.children=[]),y.forEach(function(Ue){z||yo(Ue,function($e){var ot;if($e.id===A){z=$e;var et=u.getEdges().map(function(yr){return yr.getID()});et.forEach(function(yr){n.removeItem(yr,!1)});var yt=ae.indexOf(u);ae.splice(yt,1),delete O[A];var Gt=(0,s.clone)(u.getModel());u.destroy(),n.emit("afterremoveitem",{item:Gt,type:"combo"})}if(h&&z&&$e.id===h){ce.removeCombo(u),$=$e.children;var yt=$.indexOf(z);return yt!==-1&&$.splice(yt,1),(ot=z.children)===null||ot===void 0||ot.forEach(function(kr){var Mr=n.findById(kr.id),dr=Mr.getModel();Mr.getType&&Mr.getType()==="combo"?(kr.parentId=h,delete kr.comboId,dr.parentId=h,delete dr.comboId):Mr.getType&&Mr.getType()==="node"&&(kr.comboId=h,dr.comboId=h),ce.addChild(Mr),$.push(kr)}),n.updateCombo(ce),!1}return!0})}),!h&&z){var Ce=y.indexOf(z);y.splice(Ce,1),(a=z.children)===null||a===void 0||a.forEach(function(Ue){Ue.parentId=void 0;var $e=n.findById(Ue.id).getModel();delete $e.parentId,delete $e.comboId,Ue.itemType!=="node"&&y.push(Ue)})}if(ue){var Re={nodes:[],combos:[]},Ve={nodes:[],combos:[]};(i=z.children)===null||i===void 0||i.forEach(function(Ue){var $e=n.findById(Ue.id),ot=$e.getType();ot!=="node"&&ot!=="combo"||(Re["".concat(ot,"s")].push({id:Ue.id,parentId:A}),Ve["".concat(ot,"s")].push({id:Ue.id,parentId:h}))}),Re.combos.push(ve),this.pushStack("uncombo",{before:Re,after:Ve})}},t.prototype.updateCombos=function(e){var r=this;e===void 0&&(e=!1);var n=this,a=this.get("comboTrees"),i=n.get("itemController"),o=n.get("itemMap");(a||[]).forEach(function(u){yo(u,function(l){var h;if(!l)return!0;var y=o[l.id];if(((h=y==null?void 0:y.getType)===null||h===void 0?void 0:h.call(y))==="combo"){var O=(0,c.__spreadArray)([],y.getStates(),!0);(0,s.each)(O,function(A){return r.setItemState(y,A,!1)}),i.updateCombo(y,l.children,e),(0,s.each)(O,function(A){return r.setItemState(y,A,!0)})}return!0})}),n.sortCombos()},t.prototype.updateCombo=function(e){var r=this,n=this,a=e,i;if((0,s.isString)(e)&&(a=this.findById(e)),!a||a.getType&&a.getType()!=="combo"){console.warn("The item to be updated is not a combo!");return}i=a.get("id");var o=this.get("comboTrees"),u=n.get("itemController"),l=n.get("itemMap");(o||[]).forEach(function(h){yo(h,function(y){if(!y)return!0;var O=l[y.id];if(i===y.id&&O&&O.getType&&O.getType()==="combo"){var A=(0,c.__spreadArray)([],O.getStates(),!0);(0,s.each)(A,function(z){O.getStateStyle(z)&&r.setItemState(O,z,!1)}),u.updateCombo(O,y.children),(0,s.each)(A,function(z){O.getStateStyle(z)&&r.setItemState(O,z,!0)}),i&&(i=y.parentId)}return!0})})},t.prototype.updateComboTree=function(e,r,n){n===void 0&&(n=!0);var a=this;this.set("comboSorted",!1);var i;(0,s.isString)(e)?i=a.findById(e):i=e;var o=i.getModel(),u=o.comboId||o.parentId,l="";if(i.getType&&(l=i.getType()),r&&l==="combo"){var h=this.get("comboTrees"),y=!0,O;if((h||[]).forEach(function(ue){O||Fa(ue,function(ve){if(!O)return ve.id===i.getID()&&(O=ve),!0})}),Fa(O,function(ue){return ue.id===r?(y=!1,!1):!0}),!y){console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!");return}}if(n&&this.get("enabledStack")){var A={},z={};l==="combo"?(A.combos=[{id:o.id,parentId:o.parentId}],z.combos=[{id:o.id,parentId:r}]):l==="node"&&(A.nodes=[{id:o.id,parentId:o.comboId}],z.nodes=[{id:o.id,parentId:r}]),this.pushStack("updateComboTree",{before:A,after:z})}if(o.parentId||o.comboId){var $=this.findById(o.parentId||o.comboId);$&&$.removeChild(i)}if(l==="combo"?o.parentId=r:l==="node"&&(o.comboId=r),r){var ae=this.findById(r);ae&&ae.addChild(i)}if(u){var ae=this.findById(u);ae&&ae.removeChild(i)}var ce=ps(this.get("comboTrees"),o.id,r);this.set("comboTrees",ce),this.updateCombos()},t.prototype.save=function(){var e=[],r=[],n=[];return(0,s.each)(this.get("nodes"),function(a){e.push(a.getModel())}),(0,s.each)(this.get("edges"),function(a){r.push(a.getModel())}),(0,s.each)(this.get("combos"),function(a){n.push(a.getModel())}),{nodes:e,edges:r,combos:n}},t.prototype.changeSize=function(e,r){var n=this.get("viewController");return n.changeSize(e,r),this},t.prototype.refresh=function(){var e=this;if(e.emit("beforegraphrefresh"),e.get("animate"))e.positionsAnimate();else{var r=e.get("nodes"),n=e.get("edges"),a=e.get("edges");(0,s.each)(r,function(i){i.refresh()}),(0,s.each)(n,function(i){i.refresh()}),(0,s.each)(a,function(i){i.refresh()})}e.emit("aftergraphrefresh"),e.autoPaint()},t.prototype.getNodes=function(){return this.get("nodes")},t.prototype.getEdges=function(){return this.get("edges")},t.prototype.getCombos=function(){return this.get("combos")},t.prototype.getComboChildren=function(e){if((0,s.isString)(e)&&(e=this.findById(e)),!e||e.getType&&e.getType()!=="combo"){console.warn("The combo does not exist!");return}return e.getChildren()},t.prototype.positionsAnimate=function(e){var r=this;r.emit("beforeanimate");var n=r.get("animateCfg"),a=n.onFrame,i=e?r.getNodes().concat(r.getCombos()):r.getNodes(),o=i.map(function(l){var h=l.getModel();return{id:h.id,x:h.x,y:h.y}});r.stopAnimate();var u=r.get("canvas");r.animating=!0,setTimeout(function(){u.animate(function(l){(0,s.each)(o,function(h){var y=r.findById(h.id);if(!(!y||y.destroyed)){var O=y.get("originAttrs"),A=y.get("model"),z=y.getContainer().getMatrix();if(O==null&&(z&&(O={x:z[6],y:z[7]}),y.set("originAttrs",O||0)),a){var $=a(y,l,h,O||{x:0,y:0});y.set("model",Object.assign(A,$))}else O?(A.x=O.x+(h.x-O.x)*l,A.y=O.y+(h.y-O.y)*l):(A.x=h.x,A.y=h.y)}}),r.refreshPositions(e)},{duration:n.duration,easing:n.easing,callback:function(){(0,s.each)(i,function(h){h.set("originAttrs",null)}),n.callback&&n.callback(),r.emit("afteranimate"),r.animating=!1}})},0)},t.prototype.refreshPositions=function(e){var r=this;r.emit("beforegraphrefreshposition");var n=r.get("nodes"),a=r.get("edges"),i=r.get("vedges"),o=r.get("combos"),u,l={},h=function(O){(0,s.each)(O,function(A){u=A.getModel();var z=A.get("originAttrs");if(!(z&&u.x===z.x&&u.y===z.y)){var $=A.updatePosition({x:u.x,y:u.y});l[u.id]=$,u.comboId&&(l[u.comboId]=l[u.comboId]||$),u.parentId&&(l[u.parentId]=l[u.parentId]||$)}})};h(o),h(n),o&&o.length!==0&&(e&&h(o),r.updateCombos()),(0,s.each)(a,function(y){var O=y.getSource().getModel(),A=y.getTarget();if(!(0,s.isPlainObject)(A)){var z=A.getModel();(l[O.id]||l[z.id]||y.getModel().isComboEdge)&&y.refresh()}}),(0,s.each)(i,function(y){y.refresh()}),r.emit("aftergraphrefreshposition"),r.autoPaint()},t.prototype.stopAnimate=function(){var e=this.get("canvas"),r=e.cfg.timeline;r&&r.stopAllAnimations()},t.prototype.isAnimating=function(){return this.animating},t.prototype.getZoom=function(){var e=this.get("group").getMatrix();return e?e[0]:1},t.prototype.getCurrentMode=function(){var e=this.get("modeController");return e.getMode()},t.prototype.setMode=function(e){var r=this.get("modeController");return r.setMode(e),this},t.prototype.clear=function(e){var r;return e===void 0&&(e=!1),(r=this.get("canvas"))===null||r===void 0||r.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),e||this.emit("afterrender"),this},t.prototype.updateLayout=function(e,r,n,a){var i=this;e===void 0&&(e={}),a===void 0&&(a=!0);var o=this.get("layoutController");if((0,s.isString)(e)&&(e={type:e}),r){var u=n;u||(r==="begin"?u={x:0,y:0}:u={x:this.getWidth()/2,y:this.getHeight()/2}),u=this.getPointByCanvas(u.x,u.y);var l=["force","gForce","fruchterman","force2"];l.includes(e.type)||!e.type&&l.includes(o==null?void 0:o.layoutType)?e.center=[u.x,u.y]:this.once("afterlayout",function(O){var A=i.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];u.x=u.x*A[0]+A[6],u.y=u.y*A[0]+A[7];var z=i.getGroup().getCanvasBBox(),$=z.minX,ae=z.maxX,ce=z.minY,ue=z.maxY,ve={x:($+ae)/2,y:(ce+ue)/2};r==="begin"&&(ve.x=$,ve.y=ce),i.translate(u.x-ve.x,u.y-ve.y)})}var h=(0,c.__assign)({},this.get("layout")),y={};Object.assign(y,h,e),e.pipes&&!e.type?delete y.type:!e.pipes&&y.type&&delete y.pipes,this.set("layout",y),o&&(o.isLayoutTypeSame(y)&&y.gpuEnabled===h.gpuEnabled?o.updateLayoutCfg(y):o.changeLayout(y),a&&this.get("enabledStack")&&this.pushStack("layout",{before:h,after:y}))},t.prototype.destroyLayout=function(){var e=this.get("layoutController");e==null||e.destroyLayout()},t.prototype.layout=function(){var e,r=this.get("layoutController"),n=this.get("layout");if(!(!n||!r)){if(n.workerEnabled){r.layout();return}!((e=r.layoutMethods)===null||e===void 0)&&e.length?r.relayout(!0):r.layout()}},t.prototype.collapseCombo=function(e,r){var n=this;if(r===void 0&&(r=!0),!this.destroyed){if((0,s.isString)(e)&&(e=this.findById(e)),!e){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"collapse",item:e});var a=e.getModel(),i=this.get("itemController");i.collapseCombo(e,r),a.collapsed=!0;var o=this.getEdges().concat(this.get("vedges")),u=[],l=this.get("comboTrees"),h=!1;(l||[]).forEach(function(O){h||Fa(O,function(A){if(h&&A.depth<=a.depth)return!1;if(a.id===A.id&&(h=!0),h){var z=n.findById(A.id);z&&z.getType&&z.getType()==="combo"&&(u=u.concat(z.getNodes()),u=u.concat(z.getCombos()))}return!0})});var y={};o.forEach(function(O){var A=O.getModel(),z=A.isVEdge,$=A.size,ae=$===void 0?1:$;if(!(O.isVisible()&&!z)){var ce=O.getSource(),ue=O.getTarget(),ve=null,Ce;if(ce.getModel().id===a.id||u.includes(ce)&&!u.includes(ue)?(ve=ue,Ce=!1):(ue.getModel().id===a.id||!u.includes(ce)&&u.includes(ue))&&(ve=ce,Ce=!0),ve){if(z){n.removeItem(O,!1);return}for(var Re=ve.getModel();!ve.isVisible();){var Ve=Re.parentId,Ue=Re.comboId,$e=Ve||Ue;if(ve=n.findById($e),!ve||!$e)return;Re=ve.getModel()}var ot=Re.id,et=Ce?{source:ot,target:a.id,size:ae,isVEdge:!0}:{source:a.id,target:ot,size:ae,isVEdge:!0},yt="".concat(et.source,"-").concat(et.target);if(y[yt]){y[yt].size+=ae;return}y[yt]=et}}}),this.addItems(Object.values(y).map(function(O){return{type:"vedge",model:O}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:e})}},t.prototype.expandCombo=function(e,r){var n=this;if(r===void 0&&(r=!0),(0,s.isString)(e)&&(e=this.findById(e)),!e||e.getType&&e.getType()!=="combo"){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:e});var a=e.getModel(),i=this.get("itemController");i.expandCombo(e,r),a.collapsed=!1;var o=this.getEdges().concat(this.get("vedges")),u=[],l=this.get("comboTrees"),h=!1;(l||[]).forEach(function(O){h||Fa(O,function(A){if(h&&A.depth<=a.depth)return!1;if(a.id===A.id&&(h=!0),h){var z=n.findById(A.id);z&&z.getType&&z.getType()==="combo"&&(u=u.concat(z.getNodes()),u=u.concat(z.getCombos()))}return!0})});var y={};o.forEach(function(O){if(!(O.isVisible()&&!O.getModel().isVEdge)){var A=O.getSource(),z=O.getTarget(),$=A.get("id"),ae=z.get("id"),ce=null,ue;if($===a.id||u.includes(A)&&!u.includes(z)?(ce=z,ue=!1):ae===a.id||!u.includes(A)&&u.includes(z)?(ce=A,ue=!0):u.includes(A)&&u.includes(z)&&A.isVisible()&&z.isVisible()&&O.show(),ce){var ve=O.getModel(),Ce=ve.isVEdge,Re=ve.size,Ve=Re===void 0?1:Re;if(Ce){n.removeItem(O,!1);return}for(var Ue=ce.getModel();!ce.isVisible();){var $e=Ue.parentId,ot=Ue.comboId,et=$e||ot;if(ce=n.findById(et),!ce||!et)return;Ue=ce.getModel()}for(var yt=Ue.id,Gt=ue?z:A,yr=Gt.getModel();!Gt.isVisible();){var kr=yr.parentId,Mr=yr.comboId,dr=kr||Mr;if(Gt=n.findById(dr),!Gt||!dr)return;if(yr.comboId===a.id||yr.parentId===a.id)break;yr=Gt.getModel()}var hn=yr.id;if(yt){var on=ue?{source:yt,target:hn,isVEdge:!0,size:Ve}:{source:hn,target:yt,isVEdge:!0,size:Ve},cr="".concat(on.source,"-").concat(on.target);if(y[cr]){y[cr].size+=Ve;return}y[cr]=on}}}}),this.addItems(Object.values(y).map(function(O){return{type:"vedge",model:O}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:e})},t.prototype.collapseExpandCombo=function(e,r){if(r===void 0&&(r=!0),(0,s.isString)(e)&&(e=this.findById(e)),!(!e||e.getType&&e.getType()!=="combo")){for(var n=e.getModel(),a=this.findById(n.parentId);a;){var i=a.getModel();if(i.collapsed){console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),a=void 0;return}a=this.findById(i.parentId)}var o=n.collapsed;o?this.expandCombo(e,r):this.collapseCombo(e,r),this.updateCombo(e)}},t.prototype.getNeighbors=function(e,r){var n=e;return(0,s.isString)(e)&&(n=this.findById(e)),n.getNeighbors(r)},t.prototype.getNodeDegree=function(e,r,n){r===void 0&&(r=void 0),n===void 0&&(n=!1);var a=e;(0,s.isString)(e)&&(a=this.findById(e));var i=this.get("degrees");(!i||n)&&(i=ft(this.save()),this.set("degrees",i));var o=i[a.getID()],u=0;if(!o)return 0;switch(r){case"in":u=o.inDegree;break;case"out":u=o.outDegree;break;case"all":u=o;break;default:u=o.degree;break}return u},t.prototype.getUndoStack=function(){return this.undoStack},t.prototype.getRedoStack=function(){return this.redoStack},t.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},t.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},t.prototype.pushStack=function(e,r,n){if(e===void 0&&(e="update"),n===void 0&&(n="undo"),!this.get("enabledStack")){console.warn("\u8BF7\u5148\u542F\u7528 undo & redo \u529F\u80FD\uFF0C\u5728\u5B9E\u4F8B\u5316 Graph \u65F6\u5019\u914D\u7F6E enabledStack: true !");return}var a=r?(0,s.clone)(r):{before:{},after:(0,s.clone)(this.save())};n==="redo"?this.redoStack.push({action:e,data:a}):this.undoStack.push({action:e,data:a}),this.emit("stackchange",{action:e,stackType:n,undoStack:this.undoStack,redoStack:this.redoStack})},t.prototype.getAdjMatrix=function(e,r){e===void 0&&(e=!0),r===void 0&&(r=this.get("directed"));var n=this.get("adjMatrix");return(!n||!e)&&(n=W(this.save(),r),this.set("adjMatrix",n)),n},t.prototype.getShortestPathMatrix=function(e,r){e===void 0&&(e=!0),r===void 0&&(r=this.get("directed"));var n=this.get("adjMatrix"),a=this.get("shortestPathMatrix");return(!n||!e)&&(n=W(this.save(),r),this.set("adjMatrix",n)),(!a||!e)&&(a=Pr(this.save(),r),this.set("shortestPathMatrix",a)),a},t.prototype.on=function(e,r,n){return E.prototype.on.call(this,e,r,n)},t.prototype.destroy=function(){var e,r,n,a,i;this.emit("beforedestroy"),this.clear(),this.clearStack(),(e=this.get("itemController"))===null||e===void 0||e.destroy(),(r=this.get("modeController"))===null||r===void 0||r.destroy(),(n=this.get("viewController"))===null||n===void 0||n.destroy(),(a=this.get("stateController"))===null||a===void 0||a.destroy(),(i=this.get("canvas"))===null||i===void 0||i.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},t.prototype.createHull=function(e){if(!e.members||e.members.length<1){console.warn("Create hull failed! The members is empty.");return}var r=this.get("hullGroup"),n=this.get("hullMap");if(n||(n={},this.set("hullMap",n)),(!r||r.get("destroyed"))&&(r=this.get("group").addGroup({id:"hullGroup"}),r.toBack(),this.set("hullGroup",r)),n[e.id])return console.warn("Existed hull id."),n[e.id];var a=r.addGroup({id:"".concat(e.id,"-container")}),i=new xr(this,(0,c.__assign)((0,c.__assign)({},e),{group:a})),o=i.id;return n[o]=i,i},t.prototype.getHulls=function(){return this.get("hullMap")},t.prototype.getHullById=function(e){return this.get("hullMap")[e]},t.prototype.removeHull=function(e){var r,n;(0,s.isString)(e)?n=this.getHullById(e):n=e,(r=this.get("hullMap"))===null||r===void 0||delete r[n.id],n.destroy()},t.prototype.removeHulls=function(){var e=this.getHulls();!e||!Object.keys(e).length||(Object.keys(e).forEach(function(r){var n=e[r];n.destroy()}),this.set("hullMap",{}))},t}(j.Z),Gn=tn;function $n(E){"@babel/helpers - typeof";return $n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$n(E)}var Dn=Q.vs,Nn="-shape",zn="-label",pn=["startArrow","endArrow"],Yn={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},Xn={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},bn={edge:Xn,node:Yn,combo:Yn},Qn="-label-bg",ga={options:{labelCfg:{style:{fontFamily:dn.windowFontFamily}},descriptionCfg:{style:{fontFamily:dn.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return e==="move"||e!=null&&e.includes("bbox")?t:(0,s.deepMix)({},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){e.shapeMap={},this.mergeStyle=this.getOptions(t);var r=this.drawShape(t,e);if(r.set("className",this.itemType+Nn),e.shapeMap[this.itemType+Nn]=r,t.label){var n=this.drawLabel(t,e);n.set("className",this.itemType+zn),e.shapeMap[this.itemType+zn]=n}return r},afterDraw:function(t,e,r){},drawShape:function(t,e){return null},drawLabel:function(t,e){var r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg,n=r||{},a=this.getLabelStyle(t,n,e),i=a.rotate;delete a.rotate;var o=e.addShape("text",{attrs:a,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&i!==""){var u=o.getBBox(),l=[1,0,0,0,1,0,0,0,1];if(a.rotateCenter)switch(a.rotateCenter){case"center":l=Dn(l,[["t",-u.width/2,-u.height/2],["r",i],["t",u.width/2,u.height/2]]);break;case"lefttop":l=Dn(l,[["t",-a.x,-a.y],["r",i],["t",a.x,a.y]]);break;case"leftcenter":l=Dn(l,[["t",-a.x,-a.y-u.height/2],["r",i],["t",a.x,a.y+u.height/2]]);break;default:l=Dn(l,[["t",-u.width/2,-u.height/2],["r",i],["t",u.width/2,u.height/2]]);break}else l=Dn(l,[["t",-a.x,-a.y-u.height/2],["r",i],["t",a.x,a.y+u.height/2]]);o.setMatrix(l)}if(a.background){var h=this.drawLabelBg(t,e,o),y=this.itemType+Qn;h.set("classname",y),e.shapeMap[y]=h,o.toFront()}return o},drawLabelBg:function(t,e,r){var n=this.options.labelCfg,a=(0,s.mix)({},n,t.labelCfg),i=this.getLabelBgStyleByPosition(r,a),o=e.addShape("rect",{name:"text-bg-shape",attrs:i,labelRelated:!0});return e.shapeMap["text-bg-shape"]=o,o},getLabelStyleByPosition:function(t,e,r){return{text:t.label}},getLabelBgStyleByPosition:function(t,e){return{}},getLabelStyle:function(t,e,r){var n=this.getLabelStyleByPosition(t,e,r),a="".concat(this.itemType,"Label"),i=dn[a]?dn[a].style:null;return(0,c.__assign)((0,c.__assign)((0,c.__assign)({},i),n),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e,r){this.updateShapeStyle(t,e,r),this.updateLabel(t,e,r)},updateShapeStyle:function(t,e,r){var n,a=e.getContainer(),i=e.getKeyShape(),o=(0,s.mix)({},i.attr(),t.style),u=function(y){var O,A=o[y];if((0,s.isPlainObject)(A)){var z=((n=a.shapeMap)===null||n===void 0?void 0:n[y])||a.find(function($){return $.get("name")===y});z==null||z.attr(A)}else i.attr((O={},O[y]=A,O))};for(var l in o)u(l)},updateLabel:function(t,e,r){var n,a,i=e.getContainer(),o=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,u=o===void 0?{}:o,l=this.itemType+zn,h=i.shapeMap[l]||i.find(function(Ce){return Ce.get("className")===l}),y=this.itemType+Qn,O=i.shapeMap[y]||i.find(function(Ce){return Ce.get("className")===y});if(h&&t.label===void 0&&(i.removeChild(h),delete i.shapeMap[l],O&&(i.removeChild(O),delete i.shapeMap[y])),t.label||t.label==="")if(h){(!r||r==="bbox|label"||this.itemType==="edge"&&r!=="style")&&(u=(0,s.deepMix)(u,t.labelCfg));var z=this.getLabelStyleByPosition(t,u,i),$=(n=t.labelCfg)===null||n===void 0?void 0:n.style,ae=(0,c.__assign)((0,c.__assign)({},z),$),ce=ae.rotate;if(delete ae.rotate,!isNaN(ce)&&ce!==""){var ue=[1,0,0,0,1,0,0,0,1];ue=Dn(ue,[["t",-ae.x,-ae.y],["r",ce],["t",ae.x,ae.y]]),ae.matrix=ue,h.attr(ae)}else((a=h.getMatrix())===null||a===void 0?void 0:a[4])!==1&&h.resetMatrix(),h.attr(ae);if(!O)ae.background&&(O=this.drawLabelBg(t,i,h),O.set("classname",y),i.shapeMap[y]=O,h.toFront());else if(ae.background){var ve=this.getLabelBgStyleByPosition(h,u);O.attr(ve)}else i.removeChild(O)}else{var A=this.drawLabel(t,i);A.set("className",l),i.shapeMap[l]=A}},afterUpdate:function(t,e){},setState:function(t,e,r){var n,a,i,o=r.get("keyShape");if(!(!o||o.destroyed)){var u=r.getType(),l=(0,s.isBoolean)(e)?t:"".concat(t,":").concat(e),h=this.getStateStyle(l,r),y=r.getStateStyle(l);if(!(!y&&!h)){var O=(0,s.mix)({},y||h),A=r.getContainer(),z={x:1,y:1,cx:1,cy:1,matrix:1};if(u==="combo"&&(z.r=1,z.width=1,z.height=1),e){var $=function(dr){var hn,on=O[dr];if((0,s.isPlainObject)(on)&&!pn.includes(dr)){var cr=((i=A.shapeMap)===null||i===void 0?void 0:i[dr])||A.find(function(Rr){return Rr.get("name")===dr});cr==null||cr.attr(on)}else o.attr((hn={},hn[dr]=on,hn))};for(var ae in O)$(ae)}else{var ce=Oi(r.getCurrentStatesStyle()),ue=r.getModel(),ve=(0,s.mix)({},ue.style,Oi(r.getOriginStyle())),Ce=o.get("name"),Re=o.attr(),Ve={};Object.keys(Re).forEach(function(Mr){if(Mr!=="img"){var dr=Re[Mr];dr&&$n(dr)==="object"?Ve[Mr]=(0,s.clone)(dr):Ve[Mr]=dr}});var Ue={},$e=function(dr){var hn=O[dr];if((0,s.isPlainObject)(hn)&&!pn.includes(dr)){var on=A.shapeMap[dr]||A.find(function(Yr){return Yr.get("name")===dr});if(on){var cr=Oi(on.attr());(0,s.each)(hn,function(Yr,Wr){if(dr===Ce&&Ve[Wr]&&!z[Wr]){delete Ve[Wr];var sn=ve[dr][Wr]||bn[u][Wr];o.attr(Wr,sn)}else if(cr[Wr]||cr[Wr]===0){delete cr[Wr];var wn=ve[dr][Wr]||bn[u][Wr];on.attr(Wr,wn)}}),Ue[dr]=cr}}else if(Ve[dr]&&!z[dr]){delete Ve[dr];var Rr=ve[dr]||(ve[Ce]?ve[Ce][dr]:void 0)||bn[u][dr];o.attr(dr,Rr)}};for(var ot in O)$e(ot);Ce?Ue[Ce]=Ve:(0,s.mix)(Ue,Ve);for(var ae in ce)if(!z[ae]){var et=ce[ae];(!(0,s.isPlainObject)(et)||pn.includes(ae))&&(Ce?((0,s.mix)(ve[Ce],(a={},a[ae]=et,a)),delete ve[ae]):(0,s.mix)(ve,(n={},n[ae]=et,n)),delete ce[ae])}var yt={};(0,s.deepMix)(yt,ve,Ue,ce);var Gt=!1,yr=function(dr){var hn,on,cr=yt[dr];if((0,s.isPlainObject)(cr)&&!pn.includes(dr)){var Rr=A.shapeMap[dr]||A.find(function(Wr){return Wr.get("name")===dr});Rr&&((Rr.get("type")==="text"||Rr.get("labelRelated"))&&(delete cr.x,delete cr.y,delete cr.matrix),dr===Ce&&(u==="combo"&&(delete cr.r,delete cr.width,delete cr.height),Gt=!0),Rr.attr(cr))}else if(!Gt){var Yr=cr||bn[u][dr];u==="combo"?Ce||o.attr((hn={},hn[dr]=Yr,hn)):o.attr((on={},on[dr]=Yr,on))}};for(var kr in yt)yr(kr)}}}},getStateStyle:function(t,e){var r=e.getModel(),n=e.getType(),a=this.getOptions(r),i=a.stateStyles,o=a.style,u=o===void 0?{}:o,l=r.stateStyles?r.stateStyles[t]:i&&i[t];return n==="combo"?(0,s.clone)(l):(0,s.mix)({},u,l)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e,r,n=(t==null?void 0:t.anchorPoints)||((e=this.getCustomConfig(t))===null||e===void 0?void 0:e.anchorPoints)||((r=this.options)===null||r===void 0?void 0:r.anchorPoints);return n}},Da={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:dn.nodeLabel.offset,getSize:function(t){var e,r=((e=this.mergeStyle)===null||e===void 0?void 0:e.size)||t.size||this.getOptions({}).size||dn.defaultNode.size;return(0,s.isArray)(r)&&r.length===1&&(r=[r[0],r[0]]),(0,s.isArray)(r)||(r=[r,r]),r},getLabelStyleByPosition:function(t,e){var r=e.maxLength,n=t.label;r&&(n=cu(n,r));var a=e.position||this.labelPosition;if(a==="center")return{x:0,y:0,text:n,textBaseline:"middle",textAlign:"center"};var i=e.offset;(0,s.isNil)(i)&&(i=this.offset);var o=this.getSize(t),u;switch(a){case"top":u={x:0,y:-o[1]/2-i,textBaseline:"bottom",textAlign:"center"};break;case"bottom":u={x:0,y:o[1]/2+i,textBaseline:"top",textAlign:"center"};break;case"left":u={x:-o[0]/2-i,y:0,textBaseline:"middle",textAlign:"right"};break;default:u={x:o[0]/2+i,y:0,textBaseline:"middle",textAlign:"left"};break}return u.text=n,u},getLabelBgStyleByPosition:function(t,e){var r;if(!t)return{};var n=(r=e.style)===null||r===void 0?void 0:r.background;if(!n)return{};var a=t.getBBox(),i=hu(n.padding),o=a.width+i[1]+i[3],u=a.height+i[0]+i[2];return(0,c.__assign)((0,c.__assign)({x:a.minX-i[3],y:a.minY-i[0]},n),{width:o,height:u})},drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t),a=e.addShape(r,{attrs:n,draggable:!0,name:"node-shape"});return e.shapeMap["node-shape"]=a,a},updateLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=e.shapeMap["link-point-left"]||e.find(function(yt){return yt.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(yt){return yt.get("className")==="link-point-right"}),i=e.shapeMap["link-point-top"]||e.find(function(yt){return yt.get("className")==="link-point-top"}),o=e.shapeMap["link-point-bottom"]||e.find(function(yt){return yt.get("className")==="link-point-bottom"}),u;n&&(u=n.attr()),a&&!u&&(u=a.attr()),i&&!u&&(u=i.attr()),o&&!u&&(u=o.attr()),u||(u=r);var l=(0,s.mix)({},u,t.linkPoints),h=l.fill,y=l.stroke,O=l.lineWidth,A=l.size/2;A||(A=l.r);var z=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},$=z.left,ae=z.right,ce=z.top,ue=z.bottom,ve=this.getSize(t),Ce=ve[0],Re=ve[1],Ve={r:A,fill:h,stroke:y,lineWidth:O};if(n)!$&&$!==void 0?(n.remove(),delete e.shapeMap["link-point-left"]):n.attr((0,c.__assign)((0,c.__assign)({},Ve),{x:-Ce/2,y:0}));else if($){var Ue="link-point-left";e.shapeMap[Ue]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},Ve),{x:-Ce/2,y:0}),className:Ue,name:Ue,isAnchorPoint:!0})}if(a)!ae&&ae!==void 0&&(a.remove(),delete e.shapeMap["link-point-right"]),a.attr((0,c.__assign)((0,c.__assign)({},Ve),{x:Ce/2,y:0}));else if(ae){var $e="link-point-right";e.shapeMap[$e]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},Ve),{x:Ce/2,y:0}),className:$e,name:$e,isAnchorPoint:!0})}if(i)!ce&&ce!==void 0&&(i.remove(),delete e.shapeMap["link-point-top"]),i.attr((0,c.__assign)((0,c.__assign)({},Ve),{x:0,y:-Re/2}));else if(ce){var ot="link-point-top";e.shapeMap[ot]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},Ve),{x:0,y:-Re/2}),className:ot,name:ot,isAnchorPoint:!0})}if(o)!ue&&ue!==void 0?(o.remove(),delete e.shapeMap["link-point-bottom"]):o.attr((0,c.__assign)((0,c.__assign)({},Ve),{x:0,y:Re/2}));else if(ue){var et="link-point-bottom";e.shapeMap[et]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},Ve),{x:0,y:Re/2}),className:et,name:et,isAnchorPoint:!0})}},updateShape:function(t,e,r,n,a){var i=e.get("keyShape");i.attr((0,c.__assign)({},r)),this.updateLabel(t,e,a),n&&this.updateIcon(t,e)},updateIcon:function(t,e){var r=this,n=e.getContainer(),a=(this.mergeStyle||this.getOptions(t)).icon,i=t.icon?t.icon:{show:void 0,text:void 0},o=i.show,u=i.text,l=n.shapeMap["".concat(this.type,"-icon")]||n.find(function(ce){return ce.get("name")==="".concat(r.type,"-icon")});if(l)if(o||o===void 0){var h=(0,s.mix)({},l.attr(),a),y=h.width,O=y===void 0?20:y,A=h.height,z=A===void 0?20:A;(h.fontFamily==="iconfont"||h.hasOwnProperty("text"))&&(O=0,z=0),l.attr((0,c.__assign)((0,c.__assign)({},h),{x:-O/2,y:-z/2}))}else l.remove(),delete n.shapeMap["".concat(this.type,"-icon")];else if(o){var $="".concat(this.type,"-icon");if(u)n.shapeMap[$]=n.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:$,name:$});else{var O=a.width,z=a.height;n.shapeMap[$]=n.addShape("image",{attrs:(0,c.__assign)((0,c.__assign)({},a),{x:-O/2,y:-z/2}),className:$,name:$})}var ae=n.shapeMap["node-label"]||n.find(function(ce){return ce.get("name")==="node-label"});ae&&ae.toFront()}}},Ma=(0,c.__assign)((0,c.__assign)({},ga),Da);vi.registerNode("single-node",Ma);var ha="edge-shape";function Pa(E){var t=E;return E==="start"?t="end":E==="end"&&(t="start"),t}var Qa={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:dn.defaultEdge.size,style:{x:0,y:0,stroke:dn.defaultEdge.style.stroke,lineAppendWidth:dn.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:dn.edgeLabel.style.fill,fontSize:dn.edgeLabel.style.fontSize,fontFamily:dn.windowFontFamily}},stateStyles:(0,c.__assign)({},dn.edgeStateStyles)},getPath:function(t){var e=[];return(0,s.each)(t,function(r,n){n===0?e.push(["M",r.x,r.y]):e.push(["L",r.x,r.y])}),e},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,s.mix)({},e,r,t.style),a=t.size||dn.defaultEdge.size;t=this.getPathPoints(t);var i=t.startPoint,o=t.endPoint,u=this.getControlPoints(t),l=[i];u&&(l=l.concat(u)),l.push(o);var h=this.getPath(l),y=(0,s.mix)({},dn.defaultEdge.style,{stroke:dn.defaultEdge.color,lineWidth:a,path:h},n);return y},updateShapeStyle:function(t,e,r){var n,a=e.getContainer(),i=((n=e.getKeyShape)===null||n===void 0?void 0:n.call(e))||a.shapeMap["edge-shape"],o=t.size;t=this.getPathPoints(t);var u=t.startPoint,l=t.endPoint,h=this.getControlPoints(t),y=[u];h&&(y=y.concat(h)),y.push(l);var O=i.attr(),A=t.style||{};A.stroke===void 0&&(A.stroke=t.color);var z=t.sourceNode,$=t.targetNode,ae={radius:A.radius};h||(ae={source:z,target:$,offset:A.offset,radius:A.radius});var ce=this.getPath(y,ae),ue={};r==="move"?ue={path:ce}:(O.endArrow&&A.endArrow===!1&&(t.style.endArrow={path:""}),O.startArrow&&A.startArrow===!1&&(t.style.startArrow={path:""}),ue=(0,c.__assign)({},t.style),ue.lineWidth===void 0&&(ue.lineWidth=((0,s.isNumber)(o)?o:o==null?void 0:o[0])||O.lineWidth),ue.path===void 0&&(ue.path=ce),ue.stroke===void 0&&(ue.stroke=O.stroke||t.color)),i&&i.attr(ue)},getLabelStyleByPosition:function(t,e,r){var n=e.position||this.labelPosition,a={},i=r==null?void 0:r.shapeMap[ha],o;n==="start"?o=0:n==="end"?o=1:o=.5;var u=e.refX||this.refX,l=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return a.x=t.startPoint.x+u,a.y=t.startPoint.y+l,a.text=t.label,a;var h;(0,s.isNil)(e.autoRotate)?h=this.labelAutoRotate:h=e.autoRotate;var y=vs(i,o,u,l,h);return a.x=y.x,a.y=y.y,a.rotate=y.rotate,a.textAlign=this._getTextAlign(n,y.angle),a.text=t.label,a},getLabelBgStyleByPosition:function(t,e){if(!t)return{};var r=t.getBBox(),n=e.style&&e.style.background;if(!n)return{};var a=n.padding,i=r.width+a[1]+a[3],o=r.height+a[0]+a[2],u=(0,c.__assign)((0,c.__assign)({},n),{width:i,height:o,x:r.minX-a[3],y:r.minY-a[0],matrix:[1,0,0,0,1,0,0,0,1]}),l;return(0,s.isNil)(e.autoRotate)?l=this.labelAutoRotate:l=e.autoRotate,l&&(u.matrix=t.attr("matrix")||[1,0,0,0,1,0,0,0,1]),u},_getTextAlign:function(t,e){var r="center";return e?(e=e%(Math.PI*2),t!=="center"&&(e>=0&&e<=Math.PI/2||e>=3/2*Math.PI&&e<2*Math.PI?r=t:r=Pa(t)),r):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("path",{className:ha,name:ha,attrs:r});return e.shapeMap[ha]=n,n},drawLabel:function(t,e){var r=this.options.labelCfg,n=(0,s.deepMix)({},r,t.labelCfg),a=this.getLabelStyle(t,n,e),i=a.rotate;delete a.rotate;var o=e.addShape("text",{attrs:a,name:"text-shape",labelRelated:!0,draggable:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&i!==""&&o.rotateAtStart(i),a.background){var u=this.drawLabelBg(t,e,o,a,i),l=this.itemType+Qn;u.set("classname",l),e.shapeMap[l]=u,o.toFront()}return o},drawLabelBg:function(t,e,r,n,a){var i=this.options.labelCfg,o=(0,s.deepMix)({},i,t.labelCfg),u=this.getLabelBgStyleByPosition(r,o),l=e.addShape("rect",{name:"text-bg-shape",attrs:u,labelRelated:!0});return e.shapeMap["text-bg-shape"]=l,l}},Ya=(0,c.__assign)((0,c.__assign)({},ga),Qa);vi.registerEdge("single-edge",Ya),vi.registerEdge("line",{getControlPoints:function(){}},"single-edge"),vi.registerEdge("spline",{getPath:function(t){var e=$u(t);return e}},"single-edge"),vi.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e=t.startPoint,r=t.endPoint,n={x:(e.x+r.x)/2,y:(e.y+r.y)/2},a,i;if(t.controlPoints!==void 0){if(i=t.controlPoints[0],a=On(e,i,r),e.x<=r.x&&e.y>r.y?this.clockwise=a.x>i.x?0:1:e.x<=r.x&&e.y<r.y?this.clockwise=a.x>i.x?1:0:e.x>r.x&&e.y<=r.y?this.clockwise=a.y<i.y?0:1:this.clockwise=a.y<i.y?1:0,(i.x-e.x)/(i.y-e.y)===(r.x-e.x)/(r.y-e.y))return[]}else{t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),(0,s.isArray)(t.curveOffset)&&(t.curveOffset=t.curveOffset[0]),t.curveOffset<0?this.clockwise=0:this.clockwise=1;var o={x:r.x-e.x,y:r.y-e.y},u=Math.atan2(o.y,o.x);i={x:t.curveOffset*Math.cos(-Math.PI/2+u)+n.x,y:t.curveOffset*Math.sin(-Math.PI/2+u)+n.y},a=On(e,i,r)}var l=Gi(e,a),h=[{x:l,y:l}];return h},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),t.length===2?e.push(["L",t[1].x,t[1].y]):e.push(["A",t[1].x,t[1].y,0,0,this.clockwise,t[2].x,t[2].y]),e}},"single-edge"),vi.registerEdge("quadratic",{curvePosition:.5,curveOffset:-20,getControlPoints:function(t){var e=t.controlPoints;if(!e||!e.length){var r=t.startPoint,n=t.endPoint;t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),(0,s.isArray)(t.curveOffset)&&(t.curveOffset=t.curveOffset[0]),(0,s.isArray)(t.curvePosition)&&(t.curvePosition=t.curveOffset[0]);var a=bu(r,n,t.curvePosition,t.curveOffset);e=[a]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["Q",t[1].x,t[1].y,t[2].x,t[2].y]),e}},"single-edge"),vi.registerEdge("cubic",{curvePosition:[1/2,1/2],curveOffset:[-20,20],getControlPoints:function(t){var e=t.controlPoints;if(t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),(0,s.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),(0,s.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]),!e||!e.length||e.length<2){var r=t.startPoint,n=t.endPoint,a=bu(r,n,t.curvePosition[0],t.curveOffset[0]),i=bu(r,n,t.curvePosition[1],t.curveOffset[1]);e=[a,i]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y]),e}},"single-edge"),vi.registerEdge("cubic-vertical",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,r=t.endPoint;t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.minCurveOffset===void 0&&(t.minCurveOffset=this.minCurveOffset),(0,s.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),(0,s.isNumber)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),(0,s.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var n=r.y-e.y,a=[0,0];t.curveOffset?a=t.curveOffset:Math.abs(n)<Math.abs(t.minCurveOffset[0])&&(a=t.minCurveOffset);var i={x:e.x,y:e.y+n*this.curvePosition[0]+a[0]},o={x:r.x,y:r.y-n*this.curvePosition[1]+a[1]};return[i,o]}},"cubic"),vi.registerEdge("cubic-horizontal",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,r=t.endPoint;t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.minCurveOffset===void 0&&(t.minCurveOffset=this.minCurveOffset),(0,s.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),(0,s.isNumber)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),(0,s.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var n=r.x-e.x,a=[0,0];t.curveOffset?a=t.curveOffset:Math.abs(n)<Math.abs(t.minCurveOffset[0])&&(a=t.minCurveOffset);var i={x:e.x+n*this.curvePosition[0]+a[0],y:e.y},o={x:r.x-n*this.curvePosition[1]+a[1],y:r.y},u=[i,o];return u}},"cubic"),vi.registerEdge("loop",{getPathPoints:function(t){return Jo(t)},getControlPoints:function(t){return t.controlPoints},afterDraw:function(t){t.controlPoints=void 0},afterUpdate:function(t){t.controlPoints=void 0}},"cubic");var zo={itemType:"combo",shapeType:"single-combo",labelPosition:"top",refX:dn.comboLabel.refX,refY:dn.comboLabel.refY,options:{style:{stroke:dn.defaultCombo.style.stroke,fill:dn.defaultCombo.style.fill,lineWidth:dn.defaultCombo.style.lineWidth},labelCfg:{style:{fill:dn.comboLabel.style.fill,fontSize:dn.comboLabel.style.fontSize,fontFamily:dn.windowFontFamily}},stateStyles:(0,c.__assign)({},dn.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},getSize:function(t){var e=(0,s.clone)(t.size||this.options.size||dn.defaultCombo.size);return(0,s.isArray)(e)&&e.length===1&&(e=[e[0],e[0]]),(0,s.isArray)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var r=e.position||this.labelPosition,n=t.style,a=t.padding||this.options.padding;(0,s.isArray)(a)&&(a=Math.max.apply(Math,a));var i=e.refX,o=e.refY;(0,s.isNil)(i)&&(i=this.refX),(0,s.isNil)(o)&&(o=this.refY);var u=this.getSize(t),l=Math.max(n.r,u[0]/2)||u[0]/2,h=l+a,y;switch(r){case"top":y={x:0,y:-h-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":y={x:0,y:h+o,textBaseline:"bottom",textAlign:"center"};break;case"left":y={x:-h+i,y:0,textAlign:"left"};break;case"center":y={x:0,y:0,text:t.label,textAlign:"center"};break;default:y={x:h+i,y:0,textAlign:"right"};break}return y.text=t.label,y},drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t),a=e.addShape(r,{attrs:n,draggable:!0,name:"combo-shape"});return a},updateCollapsedIcon:function(t,e,r){var n=t.collapsed,a=t.collapsedSubstituteIcon,i=a===void 0?{}:a,o=Object.assign({},this.options.collapsedSubstituteIcon,i),u=o.show,l=o.img,h=o.width,y=o.height,O=e.getContainer(),A=O.find(function(ce){return ce.get("name")==="combo-collapsed-substitute-icon"}),z=A&&!A.destroyed,$=e.get("keyShape");if(n&&u){if(z)A.show();else{var ae={width:h||r.r*2||r.width,height:y||r.r*2||r.height};A=O.addShape("image",{attrs:(0,c.__assign)({img:l,x:-ae.width/2,y:-ae.height/2},ae),name:"combo-collapsed-substitute-icon",draggable:!0})}$.hide()}else z&&(A.hide(),$.show())},updateShape:function(t,e,r){var n=this,a=e.get("keyShape"),i=e.get("animate"),o=i&&(t.animate===void 0?this.options.animate:t.animate);o&&a.animate?(t.collapsed||this.updateCollapsedIcon(t,e,r),a.animate(r,{duration:200,easing:"easeLinear",callback:function(){t.collapsed&&n.updateCollapsedIcon(t,e,r)}})):(a.attr((0,c.__assign)({},r)),this.updateCollapsedIcon(t,e,r)),this.updateLabel(t,e)}},Qu=(0,c.__assign)((0,c.__assign)({},ga),zo);vi.registerCombo("single-combo",Qu),vi.registerCombo("circle",{options:{size:[dn.defaultCombo.size[0],dn.defaultCombo.size[0]],padding:Math.max.apply(Math,dn.defaultCombo.padding),animate:!0,style:{stroke:dn.defaultCombo.style.stroke,fill:dn.defaultCombo.style.fill,lineWidth:dn.defaultCombo.style.lineWidth},labelCfg:{style:{fill:dn.comboLabel.style.fill,fontSize:dn.comboLabel.style.fontSize},refX:0,refY:0},stateStyles:(0,c.__assign)({},dn.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},shapeType:"circle",labelPosition:"top",drawShape:function(t,e){var r=this.getShapeStyle(t);delete r.height,delete r.width;var n=e.addShape("circle",{attrs:r,className:"circle-combo",name:"circle-combo",draggable:!0});return n},getShapeStyle:function(t){var e=this.options.style,r=t.padding||this.options.padding;(0,s.isArray)(r)&&(r=Math.max.apply(Math,r));var n={stroke:t.color},a=(0,s.mix)({},e,n,t.style),i=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize,o;if(i)o=(0,s.isNumber)(i)?i/2:i[0]/2;else{var u=this.getSize(t);!(0,s.isNumber)(a.r)||isNaN(a.r)?o=u[0]/2||dn.defaultCombo.style.r:o=Math.max(a.r,u[0]/2)||u[0]/2}a.r=o+r;var l=(0,c.__assign)({x:0,y:0},a);return t.style?t.style.r=o:t.style={r:o},l},update:function(t,e){var r=this.getSize(t),n=t.padding||this.options.padding;(0,s.isArray)(n)&&(n=Math.max.apply(Math,n));var a=(0,s.clone)(t.style),i=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize,o;i?o=(0,s.isNumber)(i)?i/2:i[0]/2:o=Math.max(a.r,r[0]/2)||r[0]/2,a.r=o+n;var u=e.get("sizeCache");u&&(u.r=a.r);var l={stroke:t.color},h=e.get("keyShape"),y=(0,s.mix)({},h.attr(),l,a);t.style?t.style.r=o:t.style={r:o},this.updateShape(t,e,y,!0)}},"single-combo"),vi.registerCombo("rect",{options:{size:[40,5],padding:[25,20,15,20],animate:!0,style:{radius:0,stroke:dn.defaultCombo.style.stroke,fill:dn.defaultCombo.style.fill,lineWidth:dn.defaultCombo.style.lineWidth},labelCfg:{style:{fill:dn.comboLabel.style.fill,fontSize:dn.comboLabel.style.fontSize,fontFamily:dn.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,c.__assign)({},dn.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},shapeType:"rect",labelPosition:"top",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"rect-combo",name:"rect-combo",draggable:!0});return n},getLabelStyleByPosition:function(t,e){var r=e.position||this.labelPosition,n=t.style,a=t.padding||this.options.padding;(0,s.isNumber)(a)&&(a=[a,a,a,a]);var i=e.refX,o=e.refY;(0,s.isNil)(i)&&(i=this.refX),(0,s.isNil)(o)&&(o=this.refY);var u=-n.width/2-a[3],l=n.width/2+a[1],h=-n.height/2-a[0],y=n.height/2+a[2],O;switch(r){case"top":O={x:u+i,y:h+o,textBaseline:"top",textAlign:"left"};break;case"bottom":O={x:0,y:y+o,textBaseline:"top",textAlign:"center"};break;case"left":O={x:u+o,y:0,textAlign:"left"};break;case"center":O={x:0,y:0,text:t.label,textAlign:"center"};break;case"top-center":O={x:0,y:h+o,textBaseline:"top",textAlign:"center"};break;default:O={x:l+i,y:0,textAlign:"right"};break}return O.text=t.label,O},getShapeStyle:function(t){var e=this.options.style,r=t.padding||this.options.padding;(0,s.isNumber)(r)&&(r=[r,r,r,r]);var n={stroke:t.color},a=(0,s.mix)({},e,n,t.style),i=this.getSize(t),o,u,l=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;l?(0,s.isNumber)(l)?(o=l,u=l):(o=l[0],u=l[1]):(!(0,s.isNumber)(a.width)||isNaN(a.width)?o=i[0]||dn.defaultCombo.style.width:o=Math.max(a.width,i[0])||i[0],!(0,s.isNumber)(a.height)||isNaN(a.height)?u=i[1]||dn.defaultCombo.style.height:u=Math.max(a.height,i[1])||i[1]);var h=-o/2-r[3],y=-u/2-r[0];a.width=o+r[1]+r[3],a.height=u+r[0]+r[2];var O=(0,c.__assign)({x:h,y},a);return t.style?(t.style.width=o,t.style.height=u):t.style={width:o,height:u},O},update:function(t,e){var r=this.getSize(t),n=t.padding||this.options.padding;(0,s.isNumber)(n)&&(n=[n,n,n,n]);var a=(0,s.clone)(t.style),i,o,u=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;u?(0,s.isNumber)(u)?(i=u,o=u):(i=u[0],o=u[1]):(i=Math.max(a.width,r[0])||r[0],o=Math.max(a.height,r[1])||r[1]),a.width=i+n[1]+n[3],a.height=o+n[0]+n[2];var l=e.get("sizeCache");l&&(l.width=a.width,l.height=a.height),a.x=-i/2-n[3],a.y=-o/2-n[0];var h={stroke:t.color},y=e.get("keyShape"),O=(0,s.mix)({},y.attr(),h,a);t.style?(t.style.width=i,t.style.height=o):t.style={width:i,height:o},this.updateShape(t,e,O,!1)}},"single-combo"),vi.registerNode("simple-circle",{options:{size:dn.defaultNode.size,style:{x:0,y:0,stroke:dn.defaultNode.style.stroke,fill:dn.defaultNode.style.fill,lineWidth:dn.defaultNode.style.lineWidth},labelCfg:{style:{fill:dn.nodeLabel.style.fill,fontSize:dn.nodeLabel.style.fontSize,fontFamily:dn.windowFontFamily}},stateStyles:(0,c.__assign)({},dn.nodeStateStyles)},shapeType:"simple-circle",labelPosition:"center",shapeMap:{},drawShape:function(t,e){var r=this.getShapeStyle(t),n="".concat(this.type,"-keyShape"),a=e.addShape("circle",{attrs:r,className:"".concat(this.type,"-keyShape"),name:n,draggable:!0});return e.shapeMap[n]=a,a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.deepMix)({},e,r),a=this.getSize(t),i=a[0]/2,o=(0,c.__assign)({x:0,y:0,r:i},n);return o},update:function(t,e,r){var n=this.getSize(t),a={stroke:t.color,r:n[0]/2},i=e.get("keyShape"),o=(0,s.deepMix)({},i.attr(),a,t.style);this.updateShape(t,e,o,!0,r)}},"single-node"),vi.registerNode("simple-rect",{options:{size:[100,30],style:{radius:0,stroke:dn.defaultNode.style.stroke,fill:dn.defaultNode.style.fill,lineWidth:dn.defaultNode.style.lineWidth},labelCfg:{style:{fill:dn.nodeLabel.style.fill,fontSize:dn.nodeLabel.style.fontSize,fontFamily:dn.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,c.__assign)({},dn.nodeStateStyles)},shapeType:"simple-rect",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return n},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.mix)({},e,r),a=this.getSize(t),i=n.width||a[0],o=n.height||a[1],u=(0,c.__assign)({x:-i/2,y:-o/2,width:i,height:o},n);return u},update:function(t,e,r){var n=e.getContainer(),a=(this.mergeStyle||this.getOptions(t)).style,i=this.getSize(t),o=e.get("keyShape");t.size||(i[0]=o.attr("width")||a.width,i[1]=o.attr("height")||a.height);var u={stroke:t.color,x:-i[0]/2,y:-i[1]/2,width:i[0],height:i[1]},l=(0,s.mix)({},a,o.attr(),u);l=(0,s.mix)(l,t.style),this.updateShape(t,e,l,!1,r)}},"single-node"),vi.registerNode("image",{options:{img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ",size:200,labelCfg:{style:{fontFamily:dn.windowFontFamily}},clipCfg:{show:!1,type:"circle",r:50,rx:50,ry:35,width:50,height:35,points:[[30,12],[12,30],[30,48],[48,30]],path:[["M",25,25],["L",50,25],["A",12.5,12.5,0,1,1,50,50],["A",12.5,12.5,0,1,0,50,50],["L",25,75],["Z"]],x:0,y:0}},shapeType:"image",labelPosition:"bottom",drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t);delete n.fill;var a=e.addShape(r,{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return this.drawClip(t,a),a},drawClip:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).clipCfg;if(r.show){var n=r.type,a=r.x,i=r.y,o=r.style;if(n==="circle"){var u=r.r;e.setClip({type:"circle",attrs:(0,c.__assign)({r:u,x:a,y:i},o)})}else if(n==="rect"){var l=r.width,h=r.height,y=a-l/2,O=i-h/2;e.setClip({type:"rect",attrs:(0,c.__assign)({x:y,y:O,width:l,height:h},o)})}else if(n==="ellipse"){var A=r.rx,z=r.ry;e.setClip({type:"ellipse",attrs:(0,c.__assign)({x:a,y:i,rx:A,ry:z},o)})}else if(n==="polygon"){var $=r.points;e.setClip({type:"polygon",attrs:(0,c.__assign)({points:$},o)})}else if(n==="path"){var ae=r.path;e.setClip({type:"path",attrs:(0,c.__assign)({path:ae},o)})}}},getShapeStyle:function(t){var e=this.mergeStyle||this.getOptions(t),r=e.style,n=e.img,a=this.getSize(t),i=a[0],o=a[1];r&&(i=r.width||a[0],o=r.height||a[1]);var u=(0,c.__assign)({x:-i/2,y:-o/2,width:i,height:o,img:n},r);return u},updateShapeStyle:function(t,e){var r=e.getContainer(),n="".concat(this.itemType,"-shape"),a=r.shapeMap[n]||r.find(function(o){return o.get("className")===n})||e.getKeyShape(),i=this.getShapeStyle(t);a&&!a.destroyed&&a.attr(i)}},"single-node");var To={triangle:function(t,e,r){t===void 0&&(t=10),e===void 0&&(e=15),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,",0 L ").concat(n+e,",-").concat(t/2," L ").concat(n+e,",").concat(t/2," Z");return a},vee:function(t,e,r){t===void 0&&(t=15),e===void 0&&(e=20),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,",0 L ").concat(n+e,",-").concat(t/2,`
L `).concat(n+2*e/3,",0 L ").concat(n+e,",").concat(t/2," Z");return a},circle:function(t,e){t===void 0&&(t=5),e===void 0&&(e=0);var r=e*2,n="M ".concat(r,`, 0
a `).concat(t,",").concat(t," 0 1,0 ").concat(t*2,`,0
a `).concat(t,",").concat(t," 0 1,0 ").concat(-t*2,",0");return n},rect:function(t,e,r){t===void 0&&(t=10),e===void 0&&(e=10),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,",").concat(-t/2,`
L `).concat(n+e,",").concat(-t/2,`
L `).concat(n+e,",").concat(t/2,`
L `).concat(n,",").concat(t/2," Z");return a},diamond:function(t,e,r){t===void 0&&(t=15),e===void 0&&(e=15),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,`,0
L `).concat(n+e/2,",").concat(-t/2,`
L `).concat(n+e,`,0
L `).concat(n+e/2,",").concat(t/2," Z");return a},triangleRect:function(t,e,r,n,a,i){t===void 0&&(t=15),e===void 0&&(e=15),r===void 0&&(r=15),n===void 0&&(n=3),a===void 0&&(a=5),i===void 0&&(i=0);var o=i*2,u=o+e+a,l="M ".concat(o,",0 L ").concat(o+e,",-").concat(t/2," L ").concat(o+e,",").concat(t/2,` Z
M `).concat(u,", -").concat(r/2,`
L `).concat(u+n," -").concat(r/2,`
L `).concat(u+n," ").concat(r/2,`
L `).concat(u," ").concat(r/2,`
Z`);return l}},$s={collapse:function(t,e,r){return[["M",t-r,e],["a",r,r,0,1,0,r*2,0],["a",r,r,0,1,0,-r*2,0],["M",t-r+4,e],["L",t+r-4,e]]},expand:function(t,e,r){return[["M",t-r,e],["a",r,r,0,1,0,r*2,0],["a",r,r,0,1,0,-r*2,0],["M",t-r+4,e],["L",t-r+2*r-4,e],["M",t-r+r,e-r+4],["L",t,e+r-4]]},upTriangle:function(t,e,r){var n=r*Math.cos(Math.PI/6),a=r*Math.sin(Math.PI/6);return[["M",t-n,e+a],["L",t+n,e+a],["L",t,e-r],["Z"]]},downTriangle:function(t,e,r){var n=r*Math.cos(Math.PI/6),a=r*Math.sin(Math.PI/6);return[["M",t-n,e-a],["L",t+n,e-a],["L",t,e+r],["Z"]]}},Qi=vi,Io=["#5F95FF","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"],wu=function(t){return t==="force"||t==="g6force"||t==="gForce"||t==="force2"},sc=Q.vs,Qs=(0,c.__assign)((0,c.__assign)((0,c.__assign)((0,c.__assign)((0,c.__assign)((0,c.__assign)((0,c.__assign)({},_),L),I),U),T),x),{transform:sc,mat3:Fi}),ei=Qs,Of=function(){function E(t){this.graph=t,this.layoutCfg=t.get("layout")||{},this.layoutType=this.getLayoutType(),this.layoutMethods=[],this.initLayout()}return E.prototype.initLayout=function(){},E.prototype.getLayoutType=function(){return this.getLayoutCfgType(this.layoutCfg)},E.prototype.getLayoutCfgType=function(t){var e=t.type;if(e)return e;var r=t.pipes;return Array.isArray(r)?r.map(function(n){return(n==null?void 0:n.type)||""}):null},E.prototype.isLayoutTypeSame=function(t){var e=this.getLayoutCfgType(t),r=Array.isArray(this.layoutType),n=Array.isArray(e);return r&&n?this.layoutType.every(function(a,i){return a===e[i]}):Array.isArray(e)||Array.isArray(this.layoutType)?!1:(t==null?void 0:t.type)===this.layoutType},E.prototype.refreshLayout=function(){var t=this,e=t.graph,r=t.layoutType,n=t.layoutCfg,a=n===void 0?{}:n;if(e){var i=a.animate,o=i===void 0&&(r==="force"||r==="force2"),u=wu(r)&&(i||o);e.get("animate")&&!u?e.positionsAnimate(r==="comboCombined"):e.refreshPositions(r==="comboCombined")}},E.prototype.changeLayout=function(t){var e=t.disableTriggerLayout,r=(0,c.__rest)(t,["disableTriggerLayout"]);this.layoutCfg=r,this.layoutType=r.type||this.layoutType,!e&&this.layout()},E.prototype.changeData=function(t){this.layout(t)},E.prototype.destoryLayoutMethods=function(){var t=this.layoutMethods,e=[];return t==null||t.forEach(function(r){var n,a=(n=r.getType)===null||n===void 0?void 0:n.call(r);a&&e.push(a),r.destroy()}),this.layoutMethods=[],e},E.prototype.destroyLayout=function(){this.destoryLayoutMethods();var t=this.graph;t&&!t.get("destroyed")&&t.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0},E.prototype.setDataFromGraph=function(){for(var t,e=[],r=[],n=[],a=[],i=[],o=[],u=[],l=this.graph.getNodes(),h=this.graph.getEdges(),y=this.graph.getCombos(),O=l.length,A=0;A<O;A++){var z=l[A];if(!(!z||z.destroyed)){var $=z.getModel();if(!z.isVisible()){r.push($);continue}e.push($)}}for(var ae=h.length,A=0;A<ae;A++){var ce=h[A];if(!(!ce||ce.destroyed)){var $=ce.getModel();if(!ce.isVisible()){a.push($);continue}$.isComboEdge?i.push($):n.push($)}}for(var ue=y.length,A=0;A<ue;A++){var ve=y[A];if(!ve.destroyed){var $=ve.getModel();if(!ve.isVisible()){u.push($);continue}o.push($)}}return{nodes:e,hiddenNodes:r,edges:n,hiddenEdges:a,combos:o,hiddenCombos:u,comboEdges:i,vedges:(t=this.graph.get("vedges"))===null||t===void 0?void 0:t.map(function(Ce){return Ce.getModel()})}},E.prototype.relayout=function(t){var e=this,r=this,n=r.graph,a=r.layoutMethods,i=r.layoutCfg;if(!(!n||n.get("destroyed"))){var o=Promise.resolve();if(t){this.data=this.setDataFromGraph();var u=this.data.nodes;if(!u)return!1;o=this.initPositions(i.center,u)}n.emit("beforelayout"),a==null||a.forEach(function(l,h){var y=i[h]||i;o=o.then(function(){var O,A=e.execLayoutMethod(y,h);return h===a.length-1&&((O=i.onAllLayoutEnd)===null||O===void 0||O.call(i)),A})})}},E.prototype.filterLayoutData=function(t,e){var r=t.nodes,n=t.edges,a=(0,c.__rest)(t,["nodes","edges"]);if(!r)return t;var i,o;(0,s.isFunction)(e==null?void 0:e.nodesFilter)?i=e.nodesFilter:i=function(){return!0};var u=r.filter(i);if((0,s.isFunction)(e==null?void 0:e.edgesFilter))o=e.edgesFilter;else{var l=u.reduce(function(h,y){return h[y.id]=!0,h},{});o=function(y){return l[y.source]&&l[y.target]}}return(0,c.__assign)({nodes:u,edges:n.filter(o)},a)},E.prototype.getLayoutBBox=function(t){var e=this.graph,r=(0,s.groupBy)(e.getNodes(),function(i){return i.getModel().layoutOrder}),n=Object.values(r).map(function(i){var o=Ro(i);return o.size=[o.width,o.height],o}),a=Object.values((0,s.groupBy)(t,"layoutOrder"));return{groupNodes:a,layoutNodes:n}},E.prototype.layoutAnimate=function(){},E.prototype.moveToZero=function(){var t=this.graph,e=t.get("data"),r=e.nodes;if(!(r[0].x===void 0||r[0].x===null||ao(r[0].x))){for(var n=[0,0],a=r.length,i=0;i<a;i++){var o=r[i];n[0]+=o.x,n[1]+=o.y}n[0]/=r.length,n[1]/=r.length;for(var i=0;i<a;i++){var o=r[i];o.x-=n[0],o.y-=n[1]}}},E.prototype.initPositions=function(t,e){var r;return(0,c.__awaiter)(this,void 0,void 0,function(){var n,a,i;return(0,c.__generator)(this,function(o){return n=this.graph,e!=null&&e.length?(a=e.filter(function(u){return ao(u.x)||ao(u.y)}),i=a?a.length:0,i?[2,(r=this.initWithPreset)===null||r===void 0?void 0:r.call(this,function(){},function(){var u=n.get("width")*.85,l=n.get("height")*.85,h=Math.ceil(Math.sqrt(i)*(u/l)),y=Math.ceil(i/h),O=u/(h-1),A=l/(y-1);(!isFinite(O)||!O)&&(O=0),(!isFinite(A)||!O)&&(A=0);for(var z=t[0]-u/2,$=t[1]-l/2,ae=!0,ce=0;ce<i;ce++){var ue=a[ce];ao(+ue.x)&&(ae=!1,ue.x=ce%h*O+z),ao(+ue.y)&&(ae=!1,ue.y=Math.floor(ce/h)*A+$)}})]:[2]):[2,Promise.resolve()]})})},E.prototype.destroy=function(){this.graph=null,this.destoryLayoutMethods(),this.destroyed=!0},E}(),ws=Of,Ss=function(){function E(t){this.graph=t,this.destroyed=!1,this.initEvents()}return E}(),Ju=Ss,so=Qi.registerNode,qu=Qi.registerEdge,Uo=Qi.registerCombo,_s=R.registerBehavior,Zr=dn,uc={version:dn.version,AbstractGraph:Gn,BaseGlobal:Zr,Util:ei,Shape:Qi,Node:Ys,Edge:Vi,Combo:ii,Hull:xr,registerNode:Qi.registerNode,registerEdge:Qi.registerEdge,registerCombo:Qi.registerCombo,registerBehavior:R.registerBehavior,Arrow:To,Marker:$s,AbstractLayout:ws,AbstractEvent:Ju},al=F(71673),Ji=F(67938),Wo=F(42423),ka=F(24714),Su=F(74654),_u=F.n(Su),os=F(20680),Mu=2,Lf=.16,fc=.05,cc=.05,lc=.15,ef=5,dc=4,kc=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function hc(E,t,e){var r;return Math.round(E.h)>=60&&Math.round(E.h)<=240?r=e?Math.round(E.h)-Mu*t:Math.round(E.h)+Mu*t:r=e?Math.round(E.h)+Mu*t:Math.round(E.h)-Mu*t,r<0?r+=360:r>=360&&(r-=360),r}function vc(E,t,e){if(E.h===0&&E.s===0)return E.s;var r;return e?r=E.s-Lf*t:t===dc?r=E.s+Lf:r=E.s+fc*t,r>1&&(r=1),e&&t===ef&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function gc(E,t,e){var r;return e?r=E.v+cc*t:r=E.v-lc*t,r>1&&(r=1),Number(r.toFixed(2))}function Cu(E){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],r=(0,os.Z)(E),n=ef;n>0;n-=1){var a=r.toHsv(),i=(0,os.Z)({h:hc(a,n,!0),s:vc(a,n,!0),v:gc(a,n,!0)}).toHexString();e.push(i)}e.push(r.toHexString());for(var o=1;o<=dc;o+=1){var u=r.toHsv(),l=(0,os.Z)({h:hc(u,o),s:vc(u,o),v:gc(u,o)}).toHexString();e.push(l)}return t.theme==="dark"?kc.map(function(h){var y=h.index,O=h.opacity,A=os.Z.mix(t.backgroundColor||"#141414",e[y],O*100).toHexString();return A}):e}var tf={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"},Ci={},Df={};Object.keys(tf).forEach(function(E){Ci[E]=Cu(tf[E]),Ci[E].primary=Ci[E][5],Df[E]=Cu(tf[E],{theme:"dark",backgroundColor:"#141414"}),Df[E].primary=Df[E][5]});var il=Ci.red,Nf=Ci.volcano,Rc=Ci.gold,ht=Ci.orange,ol=Ci.yellow,rf=Ci.lime,pc=Ci.green,sl=Ci.cyan,Bc=Ci.blue,ul=Ci.geekblue,fl=Ci.purple,Pf=Ci.magenta,yc=Ci.grey,oi=function(t,e,r){var n=_u()(t),a=_u()(e);return _u()([(1-r)*n.red()+r*a.red(),(1-r)*n.green()+r*a.green(),(1-r)*n.blue()+r*a.blue()]).rgb()},kf=function(t,e,r){e===void 0&&(e="#fff"),r===void 0&&(r="rgb(150, 150, 150)");var n=oi(e,t,.05).rgb().toString(),a=oi(e,t,.1).rgb().toString(),i=oi(e,t,.2).rgb().toString(),o=oi(e,t,.4).rgb().toString(),u=oi(e,r,.02).rgb().toString(),l=oi(e,r,.05).rgb().toString(),h=oi(e,r,.1).rgb().toString(),y=oi(e,r,.2).rgb().toString(),O=oi(e,r,.3).rgb().toString(),A=Cu(t,{theme:"default",backgroundColor:e}),z=_u()(t).hex().toLowerCase(),$=A.indexOf(z),ae=t;return $!==-1&&(ae=A[$+1]),{mainStroke:t,mainFill:a,activeStroke:t,activeFill:n,inactiveStroke:o,inactiveFill:n,selectedStroke:t,selectedFill:e,highlightStroke:ae,highlightFill:i,disableStroke:O,disableFill:l,edgeMainStroke:O,edgeActiveStroke:t,edgeInactiveStroke:y,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:O,comboMainFill:u,comboActiveStroke:t,comboActiveFill:n,comboInactiveStroke:O,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:ae,comboHighlightFill:u,comboDisableStroke:y,comboDisableFill:l}},gi=function(t,e,r){e===void 0&&(e="#fff"),r===void 0&&(r="#777");var n=oi(e,t,.2).rgb().toString(),a=oi(e,t,.3).rgb().toString(),i=oi(e,t,.6).rgb().toString(),o=oi(e,t,.8).rgb().toString(),u=oi(e,r,.2).rgb().toString(),l=oi(e,r,.25).rgb().toString(),h=oi(e,r,.3).rgb().toString(),y=oi(e,r,.4).rgb().toString(),O=oi(e,r,.5).rgb().toString(),A=Cu(t,{theme:"dark",backgroundColor:e}),z=_u()(t).hex().toLowerCase(),$=A.indexOf(z),ae=t;return $!==-1&&(ae=A[$+1]),{mainStroke:o,mainFill:n,activeStroke:t,activeFill:a,inactiveStroke:o,inactiveFill:n,selectedStroke:t,selectedFill:n,highlightStroke:t,highlightFill:i,disableStroke:O,disableFill:l,edgeMainStroke:r,edgeActiveStroke:t,edgeInactiveStroke:r,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:y,comboMainFill:l,comboActiveStroke:t,comboActiveFill:u,comboInactiveStroke:y,comboInactiveFill:l,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:ae,comboHighlightFill:l,comboDisableStroke:y,comboDisableFill:u}},Ms=function(t,e,r,n){return e===void 0&&(e="#fff"),r===void 0&&(r="default"),n===void 0&&(n="rgb(150, 150, 150)"),r==="default"?kf(t,e,"rgb(150, 150, 150)"):gi(t,e,"#777")},mc=function(t,e,r,n){e===void 0&&(e="#fff"),r===void 0&&(r="default"),n===void 0&&(n="rgb(150, 150, 150)");var a=[];return t.forEach(function(i){a.push(Ms(i,e,r,n))}),a},nf="rgb(95, 149, 255)",Xo="rgb(255, 255, 255)",Js="rgb(0, 0, 0)",ta=Ms(nf,Xo),qi={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:ta.mainStroke,fill:ta.mainFill},size:20,color:ta.mainStroke,linkPoints:{size:8,lineWidth:1,fill:ta.activeFill,stroke:ta.activeStroke}},nodeStateStyles:{active:{fill:ta.activeFill,stroke:ta.activeStroke,lineWidth:2,shadowColor:ta.mainStroke,shadowBlur:10},selected:{fill:ta.selectedFill,stroke:ta.selectedStroke,lineWidth:4,shadowColor:ta.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:ta.highlightFill,stroke:ta.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:ta.inactiveFill,stroke:ta.inactiveStroke,lineWidth:1},disable:{fill:ta.disableFill,stroke:ta.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Js,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:ta.edgeMainStroke,lineAppendWidth:2},color:ta.edgeMainStroke},edgeStateStyles:{active:{stroke:ta.edgeActiveStroke,lineWidth:1},selected:{stroke:ta.edgeSelectedStroke,lineWidth:2,shadowColor:ta.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ta.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:ta.edgeInactiveStroke,lineWidth:1},disable:{stroke:ta.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Js,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:ta.comboMainFill,lineWidth:1,stroke:ta.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:ta.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:ta.comboActiveStroke,lineWidth:1,fill:ta.comboActiveFill},selected:{stroke:ta.comboSelectedStroke,lineWidth:2,fill:ta.comboSelectedFill,shadowColor:ta.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ta.comboHighlightStroke,lineWidth:2,fill:ta.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:ta.comboInactiveStroke,fill:ta.comboInactiveFill,lineWidth:1},disable:{stroke:ta.comboDisableStroke,fill:ta.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},Tu=function(t){var e=t.clone();return qs(t,e),e},qs=function E(t,e){var r;t.isGroup()&&e.isGroup()&&((r=t.get("children"))===null||r===void 0||r.forEach(function(o,u){var l=e.get("children")[u];E(o,l)}));var n=t.get("type"),a=e.get("type");if(!(n!=="image"||a!=="image")){var i=t.get("clipShape");i&&e.setClip({type:i.get("type"),attrs:i.attr()})}},jo=F(60798),eu=ei.cloneEvent,Rf=ei.isViewportChanged,Bf=function(E){(0,c.__extends)(t,E);function t(e){var r=E.call(this,e)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=e,r.destroyed=!1,r.initEvents(),r}return t.prototype.initEvents=function(){var e=this,r=e.graph,n=e.extendEvents,a=n===void 0?[]:n,i=r.get("canvas"),o=i.get("el"),u=(0,s.wrapBehavior)(this,"onCanvasEvents"),l=(0,s.wrapBehavior)(this,"onExtendEvents"),h=(0,s.wrapBehavior)(this,"onWheelEvent");i.off("*").on("*",u),this.canvasHandler=u,a.push((0,jo.Z)(o,"wheel",h)),typeof window!="undefined"&&(a.push((0,jo.Z)(window,"keydown",l)),a.push((0,jo.Z)(window,"keyup",l)),a.push((0,jo.Z)(window,"focus",l))),this.resetHandler&&r.off("afterchangedata",this.resetHandler),this.resetHandler=(0,s.wrapBehavior)(this,"resetStatus"),r.on("afterchangedata",this.resetHandler)},t.getItemRoot=function(e){for(;e&&!e.get("item");)e=e.get("parent");return e},t.prototype.onCanvasEvents=function(e){var r=this,n=this.graph,a=n.get("canvas"),i=e.target,o=e.type;switch(o){case"drag":this.onCanvasEvents(Object.assign({},e,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},e,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return r.mousedown=!1});break;case"click":if(!this.mousedown)return;break;default:break}e.canvasX=e.x,e.canvasY=e.y;var u={x:e.canvasX,y:e.canvasY},l=n.get("group"),h=l.getMatrix();if(h||(h=[1,0,0,0,1,0,0,0,1]),Rf(h)&&(u=n.getPointByClient(e.clientX,e.clientY)),e.x=u.x,e.y=u.y,e.currentTarget=n,i===a){(o==="mousemove"||o==="mouseleave")&&this.handleMouseMove(e,"canvas"),e.target=a,e.item=null,n.emit(o,e),n.emit("canvas:".concat(o),e);return}var y=t.getItemRoot(i);if(!y){n.emit(o,e);return}var O=y.get("item");if(!O.destroyed){var A=O.getType();if(e.target=i,e.item=O,e.canvasX===e.x&&e.canvasY===e.y){var z=n.getCanvasByPoint(e.x,e.y);e.canvasX=z.x,e.canvasY=z.y}e.name&&!e.name.includes(":")?(n.emit("".concat(A,":").concat(o),e),n.emit(o,e)):e.name&&n.emit(e.name,e),o==="dragstart"&&(this.dragging=!0),o==="dragend"&&(this.dragging=!1),o==="mousemove"&&this.handleMouseMove(e,A)}},t.prototype.onExtendEvents=function(e){this.graph.emit(e.type,e)},t.prototype.onWheelEvent=function(e){(0,s.isNil)(e.wheelDelta)&&(e.wheelDelta=-e.detail),this.graph.emit("wheel",e)},t.prototype.handleMouseMove=function(e,r){var n=this,a=n.graph,i=n.preItem,o=a.get("canvas"),u=e.target===o?null:e.item;e=eu(e),i&&i!==u&&!i.destroyed&&(e.item=i,this.emitCustomEvent(i.getType(),"mouseleave",e),this.dragging&&this.emitCustomEvent(i.getType(),"dragleave",e)),u&&i!==u&&(e.item=u,this.emitCustomEvent(r,"mouseenter",e),this.dragging&&this.emitCustomEvent(r,"dragenter",e)),this.preItem=u},t.prototype.emitCustomEvent=function(e,r,n){n.type=r,this.graph.emit("".concat(e,":").concat(r),n)},t.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},t.prototype.destroy=function(){var e=this,r=e.graph,n=e.canvasHandler,a=e.extendEvents,i=r.get("canvas");i.off("*",n),(0,s.each)(a,function(o){o.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},t}(Ju),af=Bf,ua=F(20378),bc=F(72407),ss=F.n(bc),uo=ei.traverseTree,Ec=function(t,e){var r;return t?(0,s.isNumber)(t)?r=function(a){return t}:r=t:r=function(a){return e||1},r},Fc=function(t,e){var r=[],n=[],a={},i=0;for(i=0;i<t.length;i++){var o=t[i];a[o.id]=i,r.push(o.x),r.push(o.y),r.push(0),r.push(0),n.push([])}for(i=0;i<e.length;i++){var u=e[i];n[a[u.source]].push(a[u.target]),n[a[u.target]].push(a[u.source])}var l=0;for(i=0;i<t.length;i++){var h=r.length,y=n[i],O=y.length;r[i*4+2]=h,r[i*4+3]=y.length,l=Math.max(l,y.length);for(var A=0;A<O;++A){var z=y[A];r.push(+z)}}for(;r.length%4!==0;)r.push(0);return{array:new Float32Array(r),maxEdgePerVetex:l}},Ff=function(t,e,r){var n=[],a=[],i={},o=0;for(o=0;o<t.length;o++){var u=t[o];i[u.id]=o,n.push(u.x),n.push(u.y),n.push(0),n.push(0),a.push([])}for(o=0;o<e.length;o++){var l=e[o];a[i[l.source]].push(i[l.target]),a[i[l.source]].push(r(l)),a[i[l.target]].push(i[l.source]),a[i[l.target]].push(r(l))}var h=0;for(o=0;o<t.length;o++){var y=n.length,O=a[o],A=O.length;n[o*4+2]=y,n[o*4+3]=A/2,h=Math.max(h,A/2);for(var z=0;z<A;++z){var $=O[z];n.push(+$)}}for(;n.length%4!==0;)n.push(0);return{array:new Float32Array(n),maxEdgePerVetex:h}},xc=function(t,e,r,n){var a=[],i=[],o={},u=0;for(u=0;u<t.length;u++){var l=t[u];o[l.id]=u,a.push(l.x),a.push(l.y),a.push(0),a.push(0),i.push([])}for(u=0;u<e.length;u++){var h=e[u];i[o[h.source]].push(o[h.target]),i[o[h.source]].push(r(h)),i[o[h.source]].push(n(h)),i[o[h.source]].push(0),i[o[h.target]].push(o[h.source]),i[o[h.target]].push(r(h)),i[o[h.target]].push(n(h)),i[o[h.target]].push(0)}var y=0;for(u=0;u<t.length;u++){var O=a.length,A=i[u],z=A.length;a[u*4+2]=O+1048576*z/4,a[u*4+3]=0,y=Math.max(y,z/4);for(var $=0;$<z;++$){var ae=A[$];a.push(+ae)}}for(;a.length%4!==0;)a.push(0);return{array:new Float32Array(a),maxEdgePerVetex:y}},wc=function(t,e){var r=[],n=t.length,a={};return e.forEach(function(i){t.forEach(function(o,u){if(a[i[o]]===void 0&&(a[i[o]]=Object.keys(a).length),r.push(a[i[o]]),u===n-1)for(;r.length%4!==0;)r.push(0)})}),{array:new Float32Array(r),count:Object.keys(a).length}},Gc=function(t){for(var e=[],r=t.length,n=t[0].length,a=function(u){t.forEach(function(l,h){if(e.push(l[u]),h===r-1)for(;e.length%4!==0;)e.push(0)})},i=0;i<n;i++)a(i);return new Float32Array(e)},tu=function(t,e){var r=["V","TB","BT"],n={x:1/0,y:1/0},a={x:-1/0,y:-1/0},i="x",o="y";e&&r.indexOf(e)>=0&&(o="x",i="y");var u=0;uo(t,function(y){return u++,y.x>a.x&&(a.x=y.x),y.x<n.x&&(n.x=y.x),y.y>a.y&&(a.y=y.y),y.y<n.y&&(n.y=y.y),!0});var l=Math.PI*2/u,h=a[o]-n[o];return h===0||uo(t,function(y){var O=(y[o]-n[o])/h*(Math.PI*2-l)+l,A=Math.abs(i==="x"?y.x-t.x:y.y-t.y);return y.x=A*Math.cos(O),y.y=A*Math.sin(O),!0}),t},Sc=function E(){return typeof window=="undefined"||typeof document=="undefined"?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var t=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl")))}catch(e){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var e=document.createElement("div");return e.id="webgl-error-message",e.style.fontFamily="monospace",e.style.fontSize="13px",e.style.fontWeight="normal",e.style.textAlign="center",e.style.background="#fff",e.style.color="#000",e.style.padding="1.5em",e.style.width="400px",e.style.margin="5em auto 0",this.webgl||(e.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
`):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
`)),e},addGetWebGLMessage:function(e){e=e||{};var r=e.parent!==void 0?e.parent:document.body,n=e.id!==void 0?e.id:"oldie",a=E().getWebGLErrorMessage();a.id=n,r.appendChild(a)}}},_c=function(){var t=navigator.userAgent.toLowerCase();return t.indexOf("firefox")>-1?"firefox":t.indexOf("safari")>-1?"safari":t.indexOf("opr")>-1?"opera":t.indexOf("chrome")>-1?"chrome":t.indexOf("trident")>-1?"ie 11":t.indexOf("ie")>-1?"ie":"unknown"},cl=(0,c.__assign)((0,c.__assign)((0,c.__assign)((0,c.__assign)((0,c.__assign)({},ei),p),v),g),d),Vo=cl,zc=Vo.radialLayout,ll=function(){function E(t){this.type=t.type,this.radial=t.radial,this.config=t}return E.prototype.init=function(t){var e=this;if(this.data=t,this.radial){this.layoutMethod=function(r){var n=ss()[e.type](r,e.config);return zc(n),n};return}this.layoutMethod=function(r){return ss()[e.type](r,e.config)}},E.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},E.prototype.layout=function(t){return this.init(t),this.execute()},E}(),Uc=ll;(0,ua.registerLayout)("grid",ua.GridLayout),(0,ua.registerLayout)("random",ua.RandomLayout),(0,ua.registerLayout)("force",ua.ForceLayout),(0,ua.registerLayout)("circular",ua.CircularLayout),(0,ua.registerLayout)("dagre",ua.DagreLayout),(0,ua.registerLayout)("dagreCompound",ua.DagreCompoundLayout),(0,ua.registerLayout)("radial",ua.RadialLayout),(0,ua.registerLayout)("concentric",ua.ConcentricLayout),(0,ua.registerLayout)("mds",ua.MDSLayout),(0,ua.registerLayout)("fruchterman",ua.FruchtermanLayout),(0,ua.registerLayout)("fruchterman-gpu",ua.FruchtermanGPULayout),(0,ua.registerLayout)("gForce",ua.GForceLayout),(0,ua.registerLayout)("force2",ua.Force2Layout),(0,ua.registerLayout)("gForce-gpu",ua.GForceGPULayout),(0,ua.registerLayout)("comboForce",ua.ComboForceLayout),(0,ua.registerLayout)("comboCombined",ua.ComboCombinedLayout),(0,ua.registerLayout)("forceAtlas2",ua.ForceAtlas2Layout);var Wc=function(t,e){e.isCustomLayout=!0,ua.Layouts[t]=(0,ua.registerLayout)(t,e)},dl=function(){function E(t,e){var r=t.toString(),n=new Blob(["importScripts('".concat(e,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(n))}return E}(),Xc=dl,jc=function(t){t===void 0&&(t="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js");function e(){var n={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout);function a(o){var u=o.data.type;return u===n.RUN||u===n.GPURUN}function i(o){var u=this,l=o.data.type;switch(l){case n.RUN:{var h=o.data,y=h.nodes,O=h.edges,A=h.layoutCfg,z=A===void 0?{}:A,$=z.type,ae=layout.getLayoutByName($);if(!ae){this.postMessage({type:n.ERROR,message:"layout ".concat($," not found")});break}var ce;z.onLayoutEnd=function(){u.postMessage({type:n.END,nodes:y}),ce==null||ce.destroy()},ce=new ae(z),ce.init({nodes:y,edges:O}),ce.execute();break}case n.GPURUN:{var ue=o.data,ve=ue.nodes,O=ue.edges,Ce=ue.layoutCfg,z=Ce===void 0?{}:Ce,Re=ue.canvas,$=z.type,ae=layout.getLayoutByName($);if(!ae){this.postMessage({type:n.ERROR,message:"layout ".concat($," not found")});break}if($.split("-")[1]!=="gpu"){this.postMessage({type:n.ERROR,message:"layout ".concat($," does not support GPU")});break}var Ve=new ae(z);Ve.init({nodes:ve,edges:O}),Ve.executeWithWorker(Re,this);break}default:break}}onmessage=function(u){a(u)&&i(u)}}var r=new Xc(e,t);return r},ru={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};function Gf(E){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(E)}var zf=function(t){return setTimeout(t,16)},Iu=function(t){return clearTimeout(t)},nu={requestAnimationFrame:function(t){var e=typeof window!="undefined"&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||zf;return e(t)},cancelAnimationFrame:function(t){var e=typeof window!="undefined"&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||Iu;return e(t)}},Uf=["fruchterman","gForce"],Wf=["force","grid","circular"],Mc=function(E){(0,c.__extends)(t,E);function t(e){var r=E.call(this,e)||this;return r.graph=e,r.layoutCfg=e.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return t.prototype.initLayout=function(){},t.prototype.getWorker=function(){return this.worker?this.worker:(typeof Worker=="undefined"?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=jc(this.layoutCfg.workerScriptURL),this.worker)},t.prototype.stopWorker=function(){var e=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,e.requestId&&(nu.cancelAnimationFrame(e.requestId),e.requestId=null),e.requestId2&&(nu.cancelAnimationFrame(e.requestId2),e.requestId2=null))},t.prototype.execLayoutMethod=function(e,r){var n=this;return new Promise(function(a,i){return(0,c.__awaiter)(n,void 0,void 0,function(){var o,u,l,h,y,$,O,A,z,$,ae;return(0,c.__generator)(this,function(ce){switch(ce.label){case 0:if(o=this.graph,!o||o.get("destroyed"))return[2];u=e.type,e.onLayoutEnd=function(){o.emit("aftersublayout",{type:u}),a()},u&&this.isGPU&&(sf(u)?u="".concat(u,"-gpu"):console.warn("The '".concat(u,"' layout does not support GPU calculation for now, it will run in CPU."))),ei.isForce(u)?(l=e.onTick,h=e.animate,y=h===void 0&&(u==="force"||u==="force2"),$=function(){l&&l(),(h||y)&&o.refreshPositions()},e.tick=$):(u==="comboForce"||u==="comboCombined")&&(e.comboTrees=o.get("comboTrees")),O=!1;try{A=new ua.Layouts[u](e),this.layoutMethods[r]&&this.layoutMethods[r].destroy(),this.layoutMethods[r]=A}catch(ue){console.warn("The layout method: '".concat(u,"' does not exist! Please specify it first.")),i()}return O=A.enableTick,O&&(z=e.onTick,$=function(){z&&z(),o.refreshPositions()},A.tick=$),ae=this.filterLayoutData(this.data,e),jf(ae,r),A.init(ae),o.emit("beforesublayout",{type:u}),[4,A.execute()];case 1:return ce.sent(),A.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd(),[2]}})})})},t.prototype.updateLayoutMethod=function(e,r){var n=this;return new Promise(function(a,i){return(0,c.__awaiter)(n,void 0,void 0,function(){var o,u,l,h,y,O,A;return(0,c.__generator)(this,function(z){switch(z.label){case 0:return o=this.graph,u=r==null?void 0:r.type,r.onLayoutEnd=function(){o.emit("aftersublayout",{type:u}),a()},ei.isForce(u)&&(l=r.onTick,h=r.animate,y=h===void 0&&(u==="force"||u==="force2"),O=function(){l==null||l(),(h||y)&&o.refreshPositions()},r.tick=O),A=this.filterLayoutData(this.data,r),e.init(A),e.updateCfg(r),o.emit("beforesublayout",{type:u}),[4,e.execute()];case 1:return z.sent(),e.isCustomLayout&&r.onLayoutEnd&&r.onLayoutEnd(),[2]}})})})},t.prototype.layout=function(e){var r=this,n,a=this.graph;if(!(!a||a.get("destroyed"))){this.data=this.setDataFromGraph();var i=this.data,o=i.nodes,u=i.hiddenNodes;if(!o)return!1;var l=a.get("width"),h=a.get("height"),y={};Object.assign(y,{width:l,height:h,center:[l/2,h/2]},this.layoutCfg),this.layoutCfg=y;var O=y.type,A=!1;(n=this.layoutMethods)===null||n===void 0||n.forEach(function(Re){var Ve;return A=!!(!((Ve=Re.nodes)===null||Ve===void 0)&&Ve.length)||A});var z=this.destoryLayoutMethods();a.emit("beforelayout");var $=Promise.resolve();A&&O&&(z==null?void 0:z.length)===1&&z[0]===O?this.tweakInit():$=this.initPositions(y.center,o);var ae=this.initPositions(y.center,u);ae.then(),this.isGPU=uf(y,O);var ce=y.onLayoutEnd,ue=y.layoutEndFormatted,ve=y.adjust;if(ue||(y.layoutEndFormatted=!0,y.onAllLayoutEnd=function(){return(0,c.__awaiter)(r,void 0,void 0,function(){return(0,c.__generator)(this,function(Re){switch(Re.label){case 0:return ce&&ce(o),this.refreshLayout(),ve&&y.pipes?[4,this.adjustPipesBox(this.data,ve)]:[3,2];case 1:Re.sent(),this.refreshLayout(),Re.label=2;case 2:return a.emit("afterlayout"),[2]}})})}),this.stopWorker(),y.workerEnabled&&this.layoutWithWorker(this.data,e))return!0;var Ce=!1;return y.type?(Ce=!0,$=$.then(function(){return(0,c.__awaiter)(r,void 0,void 0,function(){return(0,c.__generator)(this,function(Re){switch(Re.label){case 0:return[4,this.execLayoutMethod(y,0)];case 1:return[2,Re.sent()]}})})})):y.pipes&&(Ce=!0,y.pipes.forEach(function(Re,Ve){$=$.then(function(){return(0,c.__awaiter)(r,void 0,void 0,function(){return(0,c.__generator)(this,function(Ue){switch(Ue.label){case 0:return[4,this.execLayoutMethod(Re,Ve)];case 1:return[2,Ue.sent()]}})})})})),Ce?$.then(function(){y.onAllLayoutEnd&&y.onAllLayoutEnd(),e&&e()}).catch(function(Re){console.warn("graph layout failed,",Re)}):(a.refreshPositions(),e==null||e()),!1}},t.prototype.tweakInit=function(){var e=this,r=e.data,n=e.graph,a=r.nodes,i=r.edges;if(a!=null&&a.length){var o={};a.forEach(function(h){var y=h.x,O=h.y;!isNaN(y)&&!isNaN(O)&&(o[h.id]={x:y,y:O},h.mass=h.mass||2)}),i.forEach(function(h){var y=h.source,O=h.target,A=o[y],z=o[O];!A&&z?o[y]={x:z.x+(Math.random()-.5)*80,y:z.y+(Math.random()-.5)*80}:!z&&A&&(o[O]={x:A.x+(Math.random()-.5)*80,y:A.y+(Math.random()-.5)*80})});var u=n.get("width"),l=n.get("height");a.forEach(function(h){var y=o[h.id]||{x:u/2+(Math.random()-.5)*20,y:l/2+(Math.random()-.5)*20};h.x=y.x,h.y=y.y})}},t.prototype.initWithPreset=function(e,r){var n=this;return new Promise(function(a,i){return(0,c.__awaiter)(n,void 0,void 0,function(){var o,u,l,h,y,O,A;return(0,c.__generator)(this,function(z){switch(z.label){case 0:return o=this,u=o.layoutCfg,l=o.data,h=u.preset,!(h!=null&&h.type)||!ua.Layouts[h==null?void 0:h.type]?(r==null||r(),a(),[2,!1]):(y=uf(h,h.type),O=y?"".concat(h.type,"-gpu"):h.type,A=new ua.Layouts[O](h),delete u.preset,A.init(l),[4,A.execute()]);case 1:return z.sent(),e==null||e(),a(),[2,!0]}})})})},t.prototype.layoutWithWorker=function(e,r){var n=this,a=this,i=a.layoutCfg,o=a.graph,u=this.getWorker(),l=this.workerData;if(!u)return!1;l.requestId=null,l.requestId2=null,l.currentTick=null,l.currentTickData=null,o.emit("beforelayout");var h=Promise.resolve(),y=!1;if(i.type)y=!0,h=h.then(function(){return n.runWebworker(u,e,i)});else if(i.pipes){y=!0;for(var O=function(ce){h=h.then(function(){return n.runWebworker(u,e,ce)})},A=0,z=i.pipes;A<z.length;A++){var $=z[A];O($)}}return y&&h.then(function(){i.onAllLayoutEnd&&i.onAllLayoutEnd(),r==null||r()}).catch(function(ae){console.error("layout failed",ae)}),!0},t.prototype.runWebworker=function(e,r,n){var a=this,i=this.isGPU,o=this.filterLayoutData(r,n),u=o.nodes,l=o.edges,h=document.createElement("canvas"),y=i&&typeof window!="undefined"&&window.navigator&&!navigator.gpu&&"OffscreenCanvas"in window&&"transferControlToOffscreen"in h,O=of(n,function(z){return typeof z!="function"});if(!y)e.postMessage({type:ru.RUN,nodes:u,edges:l,layoutCfg:O});else{var A=h.transferControlToOffscreen();O.type="".concat(O.type,"-gpu"),e.postMessage({type:ru.GPURUN,nodes:u,edges:l,layoutCfg:O,canvas:A},[A])}return new Promise(function(z,$){e.onmessage=function(ae){a.handleWorkerMessage(z,$,ae,o,n)}})},t.prototype.handleWorkerMessage=function(e,r,n,a,i){var o=this,u=o.graph,l=o.workerData,h=n.data,y=h.type,O=function(){i.onTick&&i.onTick()};switch(y){case ru.TICK:l.currentTick=h.currentTick,l.currentTickData=h,l.requestId||(l.requestId=nu.requestAnimationFrame(function(){Au(a,h),u.refreshPositions(),O(),h.currentTick===h.totalTicks?e():l.currentTick===h.totalTicks&&(l.requestId2=nu.requestAnimationFrame(function(){Au(a,l.currentTickData),u.refreshPositions(),l.requestId2=null,O(),e()})),l.requestId=null}));break;case ru.END:l.currentTick==null&&(Au(a,h),e());break;case ru.GPUEND:l.currentTick==null&&(Cc(a,h),e());break;case ru.ERROR:console.warn("Web-Worker layout error!",h.message),r();break;default:r();break}},t.prototype.updateLayoutCfg=function(e){var r=this,n=this,a=n.graph,i=n.layoutMethods;if(!(!a||a.get("destroyed"))){var o=e.disableTriggerLayout,u=(0,c.__rest)(e,["disableTriggerLayout"]),l=(0,s.mix)({},this.layoutCfg,u);if(this.layoutCfg=l,!o){if(!(i!=null&&i.length)){this.layout();return}if(this.data=this.setDataFromGraph(),this.stopWorker(),!(u.workerEnabled&&this.layoutWithWorker(this.data,null))){a.emit("beforelayout");var h=Promise.resolve(),y=!1;(i==null?void 0:i.length)===1?(y=!0,h=h.then(function(){return(0,c.__awaiter)(r,void 0,void 0,function(){return(0,c.__generator)(this,function(O){switch(O.label){case 0:return[4,this.updateLayoutMethod(i[0],l)];case 1:return[2,O.sent()]}})})})):i!=null&&i.length&&(y=!0,i.forEach(function(O,A){var z=l.pipes[A];h=h.then(function(){return(0,c.__awaiter)(r,void 0,void 0,function(){return(0,c.__generator)(this,function($){switch($.label){case 0:return[4,this.updateLayoutMethod(O,z)];case 1:return[2,$.sent()]}})})})})),y&&h.then(function(){l.onAllLayoutEnd&&l.onAllLayoutEnd()}).catch(function(O){console.warn("layout failed",O)})}}}},t.prototype.adjustPipesBox=function(e,r){var n=this;return new Promise(function(a){var i=e.nodes;i!=null&&i.length||a(),Wf.includes(r)||(console.warn("The adjust type ".concat(r," is not supported yet, please assign it with 'force', 'grid', or 'circular'.")),a());var o={center:n.layoutCfg.center,nodeSize:function(z){return Math.max(z.height,z.width)},preventOverlap:!0,onLayoutEnd:function(){}},u=n.getLayoutBBox(i),l=u.groupNodes,h=u.layoutNodes,y=(0,s.clone)(h);o.onLayoutEnd=function(){h==null||h.forEach(function(A,z){var $,ae,ce,ue=A.x-(($=y[z])===null||$===void 0?void 0:$.x),ve=A.y-((ae=y[z])===null||ae===void 0?void 0:ae.y);(ce=l[z])===null||ce===void 0||ce.forEach(function(Ce){Ce.x+=ue,Ce.y+=ve})}),a()};var O=new ua.Layouts[r](o);O.layout({nodes:h})})},t.prototype.destroy=function(){this.destoryLayoutMethods();var e=this.worker;e&&(e.terminate(),this.worker=null),this.destroyed=!0,this.graph.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0,this.graph=null},t}(ws),Xf=Mc;function Au(E,t){for(var e=E.nodes,r=t.nodes,n=e.length,a=0;a<n;a++){var i=e[a];i.x=r[a].x,i.y=r[a].y}}function of(E,t){var e={};return E&&Gf(E)==="object"?(Object.keys(E).forEach(function(r){E.hasOwnProperty(r)&&t(E[r])&&(e[r]=E[r])}),e):E}function Cc(E,t){for(var e=E.nodes,r=t.vertexEdgeData,n=e.length,a=0;a<n;a++){var i=e[a],o=r[4*a],u=r[4*a+1];i.x=o,i.y=u}}function jf(E,t){var e;if(!((e=E==null?void 0:E.nodes)===null||e===void 0)&&e.length){var r=E.nodes;r.forEach(function(n){n.layoutOrder=t})}}function sf(E){return Uf.includes(E)}function uf(E,t){var e=t;t&&t.split("-")[1]==="gpu"&&(e=t.split("-")[0],E.gpuEnabled=!0);var r=!1;return E.gpuEnabled&&(r=!0,Sc().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),r=!1)),r&&!sf(e)&&(console.warn("The '".concat(e,"' layout does not support GPU calculation for now, it will run in CPU.")),r=!1),r}var Ou=Q.vs,ff="svg",Lu=function(E){(0,c.__extends)(t,E);function t(e){var r=E.call(this,e)||this,n=r.get("defaultNode");return n||r.set("defaultNode",{type:"circle"}),n.type||(n.type="circle",r.set("defaultNode",n)),r.destroyed=!1,r}return t.prototype.initLayoutController=function(){var e=new Xf(this);this.set({layoutController:e})},t.prototype.initEventController=function(){var e=new af(this);this.set({eventController:e})},t.prototype.initCanvas=function(){var e=this.get("container");if(typeof e=="string"&&(e=document.getElementById(e),this.set("container",e)),!e)throw new Error("invalid container");var r=e.clientWidth,n=e.clientHeight,a=this.get("width")||r,i=this.get("height")||n;!this.get("width")&&!this.get("height")&&(this.set("width",r),this.set("height",n));var o=this.get("renderer"),u;if(o===ff)u=new Wo.Canvas({container:e,width:a,height:i});else{var l={container:e,width:a,height:i},h=this.get("pixelRatio");h&&(l.pixelRatio=h,window.devicePixelRatio=h),u=new Ji.Canvas(l)}this.set("canvas",u)},t.prototype.initPlugins=function(){var e=this;(0,s.each)(e.get("plugins"),function(r){!r.destroyed&&r.initPlugin&&r.initPlugin(e)})},t.prototype.downloadImageWatermark=function(e,r,n,a){return(0,c.__awaiter)(this,void 0,void 0,function(){var i,o,u;return(0,c.__generator)(this,function(l){switch(l.label){case 0:return i=e.style.backgroundImage,o=i.slice(5,i.length-2),u=new Image,u.src=o,[4,new Promise(function(h){u.onload=function(){var y=r.createPattern(u,"repeat");r.rect(0,0,n,a),r.fillStyle=y,r.fill(),h("")}})];case 1:return l.sent(),[2]}})})},t.prototype.asyncToDataUrl=function(e,r,n,a,i,o){var u=this,l=document.querySelector(".g6-graph-watermarker"),h=this.get("canvas"),y=h.getRenderer(),O=o||h.get("el"),A="";e||(e="image/png"),setTimeout(function(){return(0,c.__awaiter)(u,void 0,void 0,function(){var z,$,ae,ce,ue,ve,Ce,Re,Ve,Ue;return(0,c.__generator)(this,function($e){switch($e.label){case 0:return y!=="svg"?[3,1]:(z=O.cloneNode(!0),$=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),ae=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",$),ae.replaceChild(z,ae.documentElement),ce=new XMLSerializer().serializeToString(ae),A="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(ce)),[3,4]);case 1:return ue=void 0,ve=O.getContext("2d"),Ce=a||this.get("width"),Re=i||this.get("height"),Ve=void 0,l?[4,this.downloadImageWatermark(l,ve,Ce,Re)]:[3,3];case 2:$e.sent(),$e.label=3;case 3:if(r){Ue=typeof window!="undefined"?window.devicePixelRatio:1;try{ue=ve.getImageData(0,0,Ce*Ue,Re*Ue),Ve=ve.globalCompositeOperation,ve.globalCompositeOperation="destination-over",ve.fillStyle=r,ve.fillRect(0,0,Ce,Re)}catch(ot){console.error("Download image failed. Out of memory at ImageData creation")}}A=O.toDataURL(e),r&&(ve.clearRect(0,0,Ce,Re),ve.putImageData(ue,0,0),ve.globalCompositeOperation=Ve),$e.label=4;case 4:return n&&n(A),[2]}})})},16)},t.prototype.toDataURL=function(e,r){var n=this.get("canvas"),a=n.getRenderer(),i=n.get("el");e||(e="image/png");var o="";if(a==="svg"){var u=i.cloneNode(!0),l=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),h=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",l);h.replaceChild(u,h.documentElement);var y=new XMLSerializer().serializeToString(h);o="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(y))}else{var O=void 0,A=i.getContext("2d"),z=Math.max(this.get("width"),500),$=Math.max(this.get("height"),500),ae=void 0;if(r){var ce=typeof window!="undefined"&&window.devicePixelRatio||1;try{O=A.getImageData(0,0,z*ce,$*ce),ae=A.globalCompositeOperation,A.globalCompositeOperation="destination-over",A.fillStyle=r,A.fillRect(0,0,z,$)}catch(ue){console.error("Download image failed. Out of memory at ImageData creation")}}o=i.toDataURL(e),r&&(A.clearRect(0,0,z,$),A.putImageData(O,0,0),A.globalCompositeOperation=ae)}return o},t.prototype.toFullDataURL=function(e,r,n){var a=this.get("group").getCanvasBBox(),i=a.height,o=a.width,u=this.get("renderer"),l=(0,ka.Z)('<div id="virtual-image"></div>'),h=n?n.backgroundColor:void 0,y=n?n.padding:void 0;y?(0,s.isNumber)(y)&&(y=[y,y,y,y]):y=[0,0,0,0];var O=i+y[0]+y[2],A=o+y[1]+y[3],z={container:l,height:O,width:A,quickHit:!0},$=u==="svg"?new Wo.Canvas(z):new Ji.Canvas(z),ae=this.get("group"),ce=ae.clone(),ue=(0,s.clone)(ce.getMatrix());ue||(ue=[1,0,0,0,1,0,0,0,1]);var ve=(a.maxX+a.minX)/2,Ce=(a.maxY+a.minY)/2;ue=Ou(ue,[["t",-ve,-Ce],["t",o/2+y[3],i/2+y[0]]]),ce.resetMatrix(),ce.setMatrix(ue),$.add(ce);var Re=$.get("el"),Ve="";r||(r="image/png"),setTimeout(function(){if(u==="svg"){var Ue=Re.cloneNode(!0),$e=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),ot=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",$e);ot.replaceChild(Ue,ot.documentElement);var et=new XMLSerializer().serializeToString(ot);Ve="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(et))}else{var yt=void 0,Gt=Re.getContext("2d"),yr=void 0;if(h){var kr=typeof window!="undefined"?window.devicePixelRatio:1;try{yt=Gt.getImageData(0,0,A*kr,O*kr),yr=Gt.globalCompositeOperation,Gt.globalCompositeOperation="destination-over",Gt.fillStyle=h,Gt.fillRect(0,0,A,O)}catch(Mr){console.error("Download image failed. Out of memory at ImageData creation")}}Ve=Re.toDataURL(r),h&&(Gt.clearRect(0,0,A,O),Gt.putImageData(yt,0,0),Gt.globalCompositeOperation=yr)}e&&e(Ve)},16)},t.prototype.downloadFullImage=function(e,r,n){var a=this,i=this.get("group").getCanvasBBox(),o=i.height,u=i.width,l=this.get("renderer"),h=(0,ka.Z)('<div id="virtual-image"></div>'),y=document.querySelector(".g6-graph-watermarker"),O=n?n.backgroundColor:void 0,A=n?n.padding:void 0;A?(0,s.isNumber)(A)&&(A=[A,A,A,A]):A=[0,0,0,0];var z=o+A[0]+A[2],$=u+A[1]+A[3];if(y){var ae=this.get("graphWaterMarker").cfg||{},ce=ae.width,ue=ae.height;z=Math.ceil(z/ue)*ue,$=Math.ceil($/ce)*ce}var ve={container:h,height:z,width:$},Ce=l==="svg"?new Wo.Canvas(ve):new Ji.Canvas(ve),Re=this.get("group"),Ve=Tu(Re),Ue=(0,s.clone)(Ve.getMatrix());Ue||(Ue=[1,0,0,0,1,0,0,0,1]);var $e=(i.maxX+i.minX)/2,ot=(i.maxY+i.minY)/2;Ue=Ou(Ue,[["t",-$e,-ot],["t",u/2+A[3],o/2+A[0]]]),Ve.resetMatrix(),Ve.setMatrix(Ue),Ce.add(Ve);var et=Ce.get("el");r||(r="image/png"),this.asyncToDataUrl(r,O,function(yt){var Gt=document.createElement("a"),yr=(e||"graph")+(l==="svg"?".svg":".".concat(r.split("/")[1]));a.dataURLToImage(yt,l,Gt,yr);var kr=document.createEvent("MouseEvents");kr.initEvent("click",!1,!1),Gt.dispatchEvent(kr)},$,z,et)},t.prototype.downloadImage=function(e,r,n){var a=this,i=this;i.stopAnimate();var o=i.get("canvas"),u=o.getRenderer();r||(r="image/png");var l=(e||"graph")+(u==="svg"?".svg":".".concat(r.split("/")[1])),h=document.createElement("a");i.asyncToDataUrl(r,n,function(y){a.dataURLToImage(y,u,h,l);var O=document.createEvent("MouseEvents");O.initEvent("click",!1,!1),h.dispatchEvent(O)})},t.prototype.dataURLToImage=function(e,r,n,a){if(!e||e==="data:"){console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items");return}if(typeof window!="undefined")if(window.Blob&&window.URL&&r!=="svg"){var i=e.split(","),o="";if(i&&i.length>0){var u=i[0].match(/:(.*?);/);u&&u.length>=2&&(o=u[1])}for(var l=atob(i[1]),h=l.length,y=new Uint8Array(h);h--;)y[h]=l.charCodeAt(h);var O=new Blob([y],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(O,a):n.addEventListener("click",function(){n.download=a,n.href=window.URL.createObjectURL(O)})}else n.addEventListener("click",function(){n.download=a,n.href=e})},t.prototype.addPlugin=function(e){var r=this;e.destroyed||(r.get("plugins").push(e),e.initPlugin(r))},t.prototype.removePlugin=function(e){var r=this.get("plugins"),n=r.indexOf(e);n>=0&&(e.destroyPlugin(),r.splice(n,1))},t.prototype.setImageWaterMarker=function(e,r){e===void 0&&(e=qi.waterMarkerImage);var n=this.get("container");(0,s.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var a=this.get("graphWaterMarker"),i=(0,s.deepMix)({},qi.imageWaterMarkerConfig,r),o=i.width,u=i.height,l=i.compatible,h=i.image;if(!e){var y=l?n:document.querySelector(".g6-graph-watermarker");y&&(y.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var O={container:n,width:o,height:u,capture:!1},A=this.get("pixelRatio");A&&(O.pixelRatio=A,window.devicePixelRatio=A),a=new Ji.Canvas(O),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var z=a.get("context"),$=h.rotate,ae=h.x,ce=h.y;z.rotate(-$*Math.PI/180);var ue=new Image;ue.crossOrigin="anonymous",ue.src=e,ue.onload=function(){if(z.drawImage(ue,ae,ce,h.width,h.height),z.rotate($*Math.PI/180),l)n.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var ve=document.querySelector(".g6-graph-watermarker");ve||(ve=document.createElement("div"),ve.className="g6-graph-watermarker"),ve.className="g6-graph-watermarker",a.destroyed||(ve.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),n.appendChild(ve))}}},t.prototype.setTextWaterMarker=function(e,r){var n=this.get("container");(0,s.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var a=this.get("graphWaterMarker"),i=(0,s.deepMix)({},qi.textWaterMarkerConfig,r),o=i.width,u=i.height,l=i.compatible,h=i.text;if(!(e!=null&&e.length)){var y=l?n:document.querySelector(".g6-graph-watermarker");y&&(y.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var O={container:n,width:o,height:u,capture:!1},A=this.get("pixelRatio");A&&(O.pixelRatio=A,window.devicePixelRatio=A),a=new Ji.Canvas(O),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var z=a.get("context"),$=h.rotate,ae=h.fill,ce=h.fontFamily,ue=h.fontSize,ve=h.baseline,Ce=h.x,Re=h.y,Ve=h.lineHeight;z.rotate(-$*Math.PI/180),z.font="".concat(ue,"px ").concat(ce),z.fillStyle=ae,z.textBaseline=ve;for(var Ue=(0,s.isString)(e)?[e]:e,$e=Ue.length-1;$e>=0;$e--)z.fillText(Ue[$e],Ce,Re+$e*Ve);if(z.rotate($*Math.PI/180),l)n.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var ot=document.querySelector(".g6-graph-watermarker");ot||(ot=document.createElement("div"),ot.className="g6-graph-watermarker"),ot.style.cssText="background-image: url(".concat(a.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(ot)}},t.prototype.destroy=function(){var e,r,n,a;(0,s.each)(this.get("plugins"),function(h){h.destroyPlugin()});var i=this.get("tooltips");if(i)for(var o=0;o<i.length;o++){var u=i[o];if(u){var l=u.parentElement;l&&l.removeChild(u)}}(e=this.get("eventController"))===null||e===void 0||e.destroy(),(r=this.get("layoutController"))===null||r===void 0||r.destroy(),(n=this.get("graphWaterMarker"))===null||n===void 0||n.destroy(),(a=document.querySelector(".g6-graph-watermarker"))===null||a===void 0||a.remove(),E.prototype.destroy.call(this)},t}(Gn),Du=Lu;function Cs(E){"@babel/helpers - typeof";return Cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cs(E)}function Tc(E,t){if(t===void 0&&(t=new WeakMap),E===null)return E;if(E instanceof Date)return new Date(E);if(E instanceof RegExp)return new RegExp(E);if(Cs(E)!=="object")return E;if(t.get(E))return t.get(E);var e=Array.isArray(E)?[]:{};t.set(E,e);for(var r in E)E.hasOwnProperty(r)&&E[r]!==void 0&&(e[r]=Tc(E[r],t));return e}function cf(E){try{return structuredClone(E)}catch(t){return Tc(E)}}var au=Vo.radialLayout,Vf=Vo.traverseTree,Yf=function(E){(0,c.__extends)(t,E);function t(e){var r=E.call(this,e)||this;return r.layoutAnimating=!1,r.set("removeList",[]),r.set("layoutMethod",r.getLayout()),r}return t.prototype.getLayout=function(){var e=this.get("layout");return e?typeof e=="function"?e:(e.type||(e.type="dendrogram"),e.direction||(e.direction=e.type==="indented"?"LR":"TB"),e.radial?function(r){var n=ss()[e.type](r,e);return au(n),n}:function(r){return ss()[e.type](r,e)}):null},t.indexOfChild=function(e,r){var n=-1;return(0,s.each)(e,function(a,i){if(r===a.id)return n=i,!1}),n},t.prototype.getDefaultCfg=function(){var e=E.prototype.getDefaultCfg.call(this);return e.animate=!0,e},t.prototype.innerAddChild=function(e,r,n){var a=this,i=e.data;i&&(i.x=e.x,i.y=e.y,i.depth=e.depth);var o=a.addItem("node",i,!1);if(r){if(o.set("parent",r),n){var u=r.get("originAttrs");if(u)o.set("originAttrs",u);else{var l=r.getModel();o.set("originAttrs",{x:l.x,y:l.y})}}var h=r.get("children");h?h.push(o):r.set("children",[o]),a.addItem("edge",{source:r.get("id"),target:o.get("id"),id:"".concat(r.get("id"),":").concat(o.get("id"))},!1)}return(0,s.each)(e.children||[],function(y){a.innerAddChild(y,o,n)}),a.emit("afteraddchild",{item:o,parent:r}),o},t.prototype.innerUpdateChild=function(e,r,n){var a=this,i=a.findById(e.id);if(!i){a.innerAddChild(e,r,n);return}(0,s.each)(e.children||[],function(z){a.innerUpdateChild(z,i,n)});var o=i.get("children");if(o){var u=o.length;if(u>0)for(var l=o.length-1;l>=0;l--){var h=o[l].getModel();t.indexOfChild(e.children||[],h.id)===-1&&(a.innerRemoveChild(h.id,{x:e.x,y:e.y},n),o.splice(l,1))}}var y,O;i.get("originAttrs")&&(y=i.get("originAttrs").x,O=i.get("originAttrs").y);var A=i.getModel();n&&i.set("originAttrs",{x:A.x,y:A.y}),i.set("model",Object.assign(A,e.data)),(y!==e.x||O!==e.y)&&i.updatePosition({x:e.x,y:e.y})},t.prototype.innerRemoveChild=function(e,r,n){var a=this,i=a.findById(e);if(i)if((0,s.each)(i.get("children"),function(u){a.innerRemoveChild(u.getModel().id,r,n)}),n){var o=i.getModel();i.set("to",r),i.set("originAttrs",{x:o.x,y:o.y}),a.get("removeList").push(i)}else a.removeItem(i,!1)},t.prototype.changeData=function(e,r){r===void 0&&(r=!0);var n=this;this.getNodes().map(function(a){return n.clearItemStates(a)}),this.getEdges().map(function(a){return n.clearItemStates(a)}),r&&this.get("enabledStack")&&this.pushStack("changedata",{before:n.get("originData"),after:e||n.get("data")}),e?(n.data(e),n.render(!1)):n.layout(this.get("fitView"))},t.prototype.changeLayout=function(e){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");var r=this;r.updateLayout(e)},t.prototype.updateLayout=function(e,r,n,a){a===void 0&&(a=!0);var i=this;if(!e){console.warn("layout cannot be null");return}if(a&&this.get("enabledStack")&&this.pushStack("layout",{before:i.get("layout"),after:e}),i.set("layout",e),i.set("layoutMethod",i.getLayout()),i.layout(),r){var o=n;o||(r==="begin"?o={x:0,y:0}:o={x:this.getWidth()/2,y:this.getHeight()/2}),o=this.getPointByCanvas(o.x,o.y);var u=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];o.x=o.x*u[0]+u[6],o.y=o.y*u[0]+u[7];var l=this.getGroup().getCanvasBBox(),h=l.minX,y=l.maxX,O=l.minY,A=l.maxY,z={x:(h+y)/2,y:(O+A)/2};r==="begin"&&(z.x=h,z.y=O),this.translate(o.x-z.x,o.y-z.y)}},t.prototype.refreshLayout=function(e){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");var r=this;r.layout(e)},t.prototype.layout=function(e){var r=this,n=this,a=n.get("data"),i=n.get("layoutMethod"),o=n.get("layout"),u=a;if(o!=null&&o.excludeInvisibles){a=(0,s.clone)(n.get("data"));var l={};Vf(a,function(O){var A=O.children;if(!(A!=null&&A.length))return!0;for(var z=A.length-1;z>=0;z--){var $=r.findById(A[z].id),ae=$?!$.isVisible():A[z].visible===!1;ae&&(l[O.id]=l[O.id]||[],l[O.id].push({idx:z,child:A.splice(z,1)[0]}))}}),u=i?i(a,n.get("layout")):a,Vf(u,function(O){var A=l[O.id];if(A!=null&&A.length)for(var z=A.length-1;z>=0;z--){var $=A[z],ae=$.idx,ce=$.child;O.children.splice(ae,0,ce)}})}else u=i?i(a,n.get("layout")):a;var h=n.get("animate");if(n.emit("beforerefreshlayout",{data:a,layoutData:u}),n.emit("beforelayout"),n.innerUpdateChild(u,void 0,h),e){var y=n.get("viewController");y.fitView()}h?n.layoutAnimate(u):(n.refresh(),n.paint()),n.emit("afterrefreshlayout",{data:a,layoutData:u}),n.emit("afterlayout")},t.prototype.addChild=function(e,r,n){n===void 0&&(n=!0);var a=this;a.emit("beforeaddchild",{model:e,parent:r}),(0,s.isString)(r)||(r=r.get("id"));var i=a.findDataById(r);if(i){i.children||(i.children=[]),i.children.push(e);var o=a.findById(r);o.refresh(),a.changeData(void 0,n)}},t.prototype.updateChildren=function(e,r,n){n===void 0&&(n=!0);var a=this,i=a.findById(r);if(!r||!i){console.warn("Update children failed! There is no node with id '".concat(r,"'"));return}var o=a.findDataById(r);o.children=e,i.refresh(),a.changeData(void 0,n)},t.prototype.updateChild=function(e,r,n){n===void 0&&(n=!0);var a=this;if(!r||!a.findById(r)){a.changeData(e,n);return}var i=a.findDataById(r),o=a.findById(e.id);if(i.children||(i.children=[]),!o)i.children.push(e);else{var u=t.indexOfChild(i.children,e.id);u>-1&&(i.children[u]=e)}var l=a.findById(r);l==null||l.refresh(),a.changeData(void 0,n)},t.prototype.removeChild=function(e,r){r===void 0&&(r=!0);var n=this,a=n.findById(e),i;if(a?i=a==null?void 0:a.get("parent"):i=n.getNodes().find(function(y){var O=y.getModel().children||[];return!!O.find(function(A){return A.id===e})}),i&&!i.destroyed){var o=i.get("id"),u=n.findDataById(o),l=u&&u.children||[],h=t.indexOfChild(l,e);l.splice(h,1),i.refresh()}n.changeData(void 0,r)},t.prototype.findDataById=function(e,r){var n=this;if(r||(r=n.get("data")),e===r.id)return r;var a=null;return(0,s.each)(r.children||[],function(i){if(i.id===e)return a=i,!1;if(a=n.findDataById(e,i),a)return!1}),a},t.prototype.layoutAnimate=function(e,r){var n=this,a=this.get("animateCfg");n.emit("beforeanimate",{data:e}),n.getEdges().forEach(function(i){var o=i.get("model");o.sourceAnchor||(o.sourceAnchor=i.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(i){Vf(e,function(o){var u=n.findById(o.id);if(u){var l=u.get("originAttrs"),h=u.get("model");if(l||(l={x:h.x,y:h.y},u.set("originAttrs",l)),r){var y=r(u,i,l,e);u.set("model",Object.assign(h,y))}else h.x=l.x+(o.x-l.x)*i,h.y=l.y+(o.y-l.y)*i}return!0}),(0,s.each)(n.get("removeList"),function(o){var u=o.getModel(),l=o.get("originAttrs"),h=o.get("to");u.x=l.x+(h.x-l.x)*i,u.y=l.y+(h.y-l.y)*i}),n.refreshPositions()},{duration:a.duration,easing:a.ease,callback:function(){(0,s.each)(n.getNodes(),function(o){o.set("originAttrs",null)}),(0,s.each)(n.get("removeList"),function(o){n.removeItem(o,!1)}),n.set("removeList",[]),a.callback&&a.callback(),n.emit("afteranimate",{data:e})},delay:a.delay})},t.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},t.prototype.isLayoutAnimating=function(){return this.layoutAnimating},t.prototype.render=function(e){e===void 0&&(e=!0);var r=this,n=r.get("data");if(!n||!(0,s.isObject)(n)||!Object.keys(n).length)throw new Error("data must be defined first");r.clear(),e&&this.get("enabledStack")&&this.clearStack(),r.emit("beforerender"),r.layout(this.get("fitView")),r.emit("afterrender")},t.prototype.save=function(){return this.get("data")},t.prototype.data=function(e){E.prototype.data.call(this,e),this.set("originData",cf(e))},t}(Du),hl=Yf,aa=F(10818),vl=function(){function E(t){this._cfgs=(0,s.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return E.prototype.getDefaultCfgs=function(){return{}},E.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var r=e.getEvents(),n={};(0,s.each)(r,function(a,i){var o=(0,s.wrapBehavior)(e,a);n[i]=o,t.on(i,o)}),this._events=n,this.init()},E.prototype.getEvents=function(){return{}},E.prototype.get=function(t){var e;return(e=this._cfgs)===null||e===void 0?void 0:e[t]},E.prototype.set=function(t,e){this._cfgs[t]=e},E.prototype.destroy=function(){},E.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,s.each)(e,function(r,n){t.off(n,r)}),this._events=null,this._cfgs=null,this.destroyed=!0},E}(),si=vl,Vc=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ic="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",Yc=function(E){Vc(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{img:Ic,follow:!0}},t.prototype.init=function(){var e=this.get("graph"),r=e.get("container"),n=e.get("canvas").get("el"),a=this.get("img")||Ic;a.includes("url(")||(a='url("'.concat(a,'")'));var i=(0,ka.Z)(`<div class='g6-grid-container' style="position:absolute;overflow:hidden;z-index: -1;"></div>`),o=(0,ka.Z)(`<div
class='g6-grid'
style='position:absolute;
background-image: `.concat(a,`;
user-select: none
'></div>`));this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),r.insertBefore(i,n)},t.prototype.positionInit=function(){var e=this.get("graph"),r=e.get("minZoom"),n=e.get("width"),a=e.get("height");(0,aa.Z)(this.get("container"),{width:"".concat(n,"px"),height:"".concat(a,"px")});var i=n*80/r,o=a*80/r;(0,aa.Z)(this.get("gridContainer"),{width:"".concat(i,"px"),height:"".concat(o,"px"),left:"-".concat(i/2,"px"),top:"-".concat(o/2,"px")})},t.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},t.prototype.updateGrid=function(e){var r=this.get("gridContainer"),n=e.matrix;n||(n=[1,0,0,0,1,0,0,0,1]);var a=this.get("follow"),i="matrix(".concat(n[0],", ").concat(n[1],", ").concat(n[3],", ").concat(n[4],", ").concat(a?n[6]:"0",", ").concat(a?n[7]:"0",")");(0,aa.Z)(r,{transform:i})},t.prototype.getContainer=function(){return this.get("container")},t.prototype.destroy=function(){var e=this.get("graph"),r=e.get("container"),n=this.get("container");r.removeChild(n)},t}(si),gl=Yc,Hc=F(89486),Hf=F.n(Hc),Ti=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();typeof document!="undefined"&&Hf()(`
.g6-component-contextmenu {
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
background-color: rgba(255, 255, 255, 0.9);
padding: 10px 8px;
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
}
.g6-contextmenu-ul {
padding: 0;
margin: 0;
list-style: none;
}
`);var Zc=function(E){Ti(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(r){return`
<ul class='g6-contextmenu-ul'>
<li>\u83DC\u5355\u98791</li>
<li>\u83DC\u5355\u98792</li>
</ul>
`},shouldBegin:function(r){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},t.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},t.prototype.init=function(){var e=this.get("className"),r=(0,ka.Z)("<div class=".concat(e||"g6-component-contextmenu","></div>"));(0,aa.Z)(r,{top:"0px",position:"absolute",visibility:"hidden"});var n=this.get("container");n||(n=this.get("graph").get("container")),(0,s.isString)(n)&&(n=document.getElementById(n)),n.appendChild(r),this.set("menu",r)},t.prototype.onMenuShow=function(e){var r=this;e.preventDefault();var n=this.get("itemTypes");if(e.item){if(e.item&&e.item.getType&&n.indexOf(e.item.getType())===-1){r.onMenuHide();return}}else if(n.indexOf("canvas")===-1){r.onMenuHide();return}var a=this.get("shouldBegin");if(a(e)){var i=this.get("menu"),o=this.get("getContent"),u=this.get("graph"),l=o(e,u);(0,s.isString)(l)?i.innerHTML=l:i.innerHTML=l.outerHTML,this.removeMenuEventListener();var h=this.get("handleMenuClick");if(h){var y=function($e){h($e.target,e.item,u)};this.set("handleMenuClickWrapper",y),i.addEventListener("click",y)}var O=u.get("width"),A=u.get("height"),z=i.getBoundingClientRect(),$=this.get("offsetX")||0,ae=this.get("offsetY")||0,ce=u.getContainer().offsetTop,ue=u.getContainer().offsetLeft,ve=e.canvasX+ue+$,Ce=e.canvasY+ce+ae;ve+z.width>O&&(ve=e.canvasX-z.width-$+ue),Ce+z.height>A&&(Ce=e.canvasY-z.height-ae+ce),Ce<0&&(Ce=0),(0,aa.Z)(i,{top:"".concat(Ce,"px"),left:"".concat(ve,"px"),visibility:"visible"});var Re=this.get("trigger")==="click",Ve=function($e){if(Re){Re=!1;return}r.onMenuHide()};document.body.addEventListener("click",Ve),this.set("handler",Ve)}},t.prototype.removeMenuEventListener=function(){var e=this.get("handleMenuClickWrapper"),r=this.get("handler");if(e){var n=this.get("menu");n.removeEventListener("click",e),this.set("handleMenuClickWrapper",null)}r&&document.body.removeEventListener("click",r)},t.prototype.onMenuHide=function(){var e=this.get("menu");e&&(0,aa.Z)(e,{visibility:"hidden"}),this.removeMenuEventListener()},t.prototype.destroy=function(){var e=this.get("menu");if(this.removeMenuEventListener(),e){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,s.isString)(r)&&(r=document.getElementById(r)),r.removeChild(e)}},t}(si),Nu=Zc,Ts=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),Zf=function(){return Zf=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},Zf.apply(this,arguments)},Kf=Math.max,$f=Q.vs,Kc="default",Yi="keyShape",Is="delegate",Ja="svg",Li=function(E){Ts(t,E);function t(e){var r=E.call(this,e)||this;return r.handleUpdateCanvas=(0,s.debounce)(function(n){var a=r;a.destroyed||a.updateCanvas()},100,!1),r}return t.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",type:"default",padding:50,size:[200,120],delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0,hideEdge:!1}},t.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},t.prototype.disableRefresh=function(){this.set("refresh",!1)},t.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},t.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},t.prototype.initViewport=function(){var e=this,r=this._cfgs,n=r.size,a=r.graph;if(!this.destroyed){var i=this.get("canvas"),o=i.get("container"),u=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,l=navigator.userAgent.toLowerCase().indexOf("safari")>-1,h=(0,ka.Z)(`
<div
class=`.concat(r.viewportClassName,`
style='position:absolute;
left:0;
top:0;
box-sizing:border-box;
outline: 2px solid #1980ff;
cursor:move'
draggable=`).concat(!(l||u),`
</div>`)),y=0,O=0,A=!1,z=0,$=0,ae=0,ce=0,ue=0,ve=0,Ce=l||u?"mousedown":"dragstart";h.addEventListener(Ce,function($e){var ot,et;if($e.dataTransfer){var yt=new Image;yt.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",(et=(ot=$e.dataTransfer).setDragImage)===null||et===void 0||et.call(ot,yt,0,0);try{$e.dataTransfer.setData("text/html","view-port-minimap")}catch(yr){$e.dataTransfer.setData("text","view-port-minimap")}}if(r.refresh=!1,$e.target===h){var Gt=h.style;z=parseInt(Gt.left,10),$=parseInt(Gt.top,10),ae=parseInt(Gt.width,10),ce=parseInt(Gt.height,10),!(ae>n[0]||ce>n[1])&&(ve=a.getZoom(),ue=e.get("ratio"),A=!0,y=$e.clientX,O=$e.clientY)}},!1);var Re=function(ot){if(!(!A||(0,s.isNil)(ot.clientX)||(0,s.isNil)(ot.clientY))){var et=y-ot.clientX,yt=O-ot.clientY;(z-et<0||z-et+ae>=n[0])&&(et=0),($-yt<0||$-yt+ce>=n[1])&&(yt=0),z-=et,$-=yt,(0,aa.Z)(h,{left:"".concat(z,"px"),top:"".concat($,"px")}),a.translate(et*ve/ue,yt*ve/ue),y=ot.clientX,O=ot.clientY}};!l&&!u&&h.addEventListener("drag",Re,!1);var Ve=function(){A=!1,r.refresh=!0},Ue=l||u?"mouseup":"dragend";h.addEventListener(Ue,Ve,!1),o.addEventListener("mouseleave",Ve),o.addEventListener("mouseup",Ve),(l||u)&&o.addEventListener("mousemove",Re,!1),this.set("viewport",h),o.appendChild(h)}},t.prototype.updateViewport=function(){if(!this.destroyed){var e=this.get("ratio"),r=this.get("totaldx"),n=this.get("totaldy"),a=this.get("graph"),i=this.get("size"),o=a.get("canvas").get("el"),u=a.get("width")||o.scrollWidth||500,l=a.get("height")||o.scrollHeight||500,h=a.getPointByCanvas(0,0),y=a.getPointByCanvas(u,l),O=this.get("viewport");O||this.initViewport();var A=(y.x-h.x)*e,z=(y.y-h.y)*e,$=h.x*e+r,ae=h.y*e+n,ce=$+A,ue=ae+z;$<0&&(A+=$,$=0),ce>i[0]&&(A=A-(ce-i[0])),ae<0&&(z+=ae,ae=0),ue>i[1]&&(z=z-(ue-i[1])),this.set("ratio",e);var ve="".concat($,"px"),Ce="".concat(ae,"px");(0,aa.Z)(O,{left:ve,top:Ce,width:"".concat(A,"px"),height:"".concat(z,"px")})}},t.prototype.updateGraphShapes=function(){var e=this._cfgs.graph,r=this.get("canvas"),n=e.get("group");if(!n.destroyed){r.clear();var a;this.get("hideEdge")?(a=r.addGroup(),n.get("children").forEach(function(o){o.get("id").includes("-edge")||a.add(o.clone())})):(a=n.clone(),a.resetMatrix(),r.add(a));var i=e.get("renderer");i===Ja&&this.updateVisible(a)}},t.prototype.updateVisible=function(e){var r=this;if(!e.isGroup()&&!e.get("visible"))e.hide();else{var n=e.get("children");if(!n||!n.length)return;n.forEach(function(a){a.get("visible")||a.hide(),r.updateVisible(a)})}},t.prototype.updateKeyShapes=function(){var e=this,r=this._cfgs.graph,n=this.get("canvas"),a=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,s.each)(r.getEdges(),function(u){e.updateOneEdgeKeyShape(u,a)}),(0,s.each)(r.getNodes(),function(u){e.updateOneNodeKeyShape(u,a)});var i=r.getCombos();if(i&&i.length){var o=a.find(function(u){return u.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){e.destroyed||((0,s.each)(i,function(u){e.updateOneComboKeyShape(u,o)}),o==null||o.sort(),o==null||o.toBack(),e.updateCanvas())},250)}this.clearDestroyedShapes()},t.prototype.updateOneComboKeyShape=function(e,r){if(!this.destroyed){var n=this.get("itemMap")||{},a=n[e.get("id")],i=e.getBBox(),o=e.get("keyShape").clone(),u=o.attr(),l={x:i.centerX,y:i.centerY};a?l=Object.assign(u,l):(a=o,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(l.x=i.minX,l.y=i.minY),a.attr(l),e.isVisible()?a.show():a.hide(),a.exist=!0;var y=e.getModel().depth;isNaN(y)||a.set("zIndex",y),n[e.get("id")]=a,this.set("itemMap",n)}},t.prototype.updateOneNodeKeyShape=function(e,r){var n=this.get("itemMap")||{},a=n[e.get("id")],i=e.getBBox(),o=e.get("keyShape").clone(),u=o.attr(),l={x:i.centerX,y:i.centerY};a?(l=Object.assign(u,l),a.toFront()):(a=o,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(l.x=i.minX,l.y=i.minY),a.attr(l),e.isVisible()?a.show():a.hide(),a.exist=!0;var y=e.getModel().depth;isNaN(y)||a.set("zIndex",y),n[e.get("id")]=a,this.set("itemMap",n)},t.prototype.updateDelegateShapes=function(){var e=this,r=this._cfgs.graph,n=this.get("canvas"),a=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,s.each)(r.getEdges(),function(u){e.updateOneEdgeKeyShape(u,a)}),(0,s.each)(r.getNodes(),function(u){e.updateOneNodeDelegateShape(u,a)});var i=r.getCombos();if(i&&i.length){var o=a.find(function(u){return u.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){e.destroyed||((0,s.each)(i,function(u){e.updateOneComboKeyShape(u,o)}),o==null||o.sort(),o==null||o.toBack(),e.updateCanvas())},250)}this.clearDestroyedShapes()},t.prototype.clearDestroyedShapes=function(){var e=this.get("itemMap")||{},r=Object.keys(e);if(!(!r||r.length===0))for(var n=r.length-1;n>=0;n--){var a=e[r[n]],i=a.exist;a.exist=!1,i||(a.remove(),delete e[r[n]])}},t.prototype.updateOneEdgeKeyShape=function(e,r){var n=this.get("itemMap")||{},a=n[e.get("id")];if(a){var i=e.get("keyShape").attr("path");a.attr("path",i)}else a=e.get("keyShape").clone(),r.add(a);e.isVisible()?a.show():a.hide(),a.exist=!0,n[e.get("id")]=a,this.set("itemMap",n)},t.prototype.updateOneNodeDelegateShape=function(e,r){var n=this.get("delegateStyle"),a=this.get("itemMap")||{},i=a[e.get("id")],o=e.getBBox();if(i){var u={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(u),i.toFront()}else i=r.addShape("rect",{attrs:Zf({x:o.minX,y:o.minY,width:o.width,height:o.height},n),name:"minimap-node-shape"});e.isVisible()?i.show():i.hide(),i.exist=!0,a[e.get("id")]=i,this.set("itemMap",a)},t.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},t.prototype.initContainer=function(){var e=this,r=e.get("graph"),n=e.get("size"),a=e.get("className"),i=e.get("container"),o=(0,ka.Z)("<div class='".concat(a,"' style='width: ").concat(n[0],"px; height: ").concat(n[1],"px; overflow: hidden'></div>"));(0,s.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(o):r.get("container").appendChild(o),e.set("container",o);var u=(0,ka.Z)('<div class="g6-minimap-container" style="position: relative;"></div>');o.appendChild(u),u.addEventListener("dragenter",function(y){y.preventDefault()}),u.addEventListener("dragover",function(y){y.preventDefault()});var l,h=r.get("renderer");h===Ja?l=new Wo.Canvas({container:u,width:n[0],height:n[1]}):l=new Ji.Canvas({container:u,width:n[0],height:n[1]}),e.set("canvas",l),e.updateCanvas()},t.prototype.updateCanvas=function(){if(!this.destroyed){var e=this.get("refresh");if(e){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var n=this.get("size"),a=this.get("canvas"),i=this.get("type"),o=this.get("padding");if(!a.destroyed){switch(i){case Kc:this.updateGraphShapes();break;case Yi:this.updateKeyShapes();break;case Is:this.updateDelegateShapes();break;default:break}var u=a.get("children")[0];if(u){u.resetMatrix();var l=u.getCanvasBBox(),h=r.get("canvas").getCanvasBBox(),y=r.getZoom()||1,O=h.width/y,A=h.height/y;Number.isFinite(l.width)&&(O=Kf(l.width,O),A=Kf(l.height,A)),O+=2*o,A+=2*o;var z=Math.min(n[0]/O,n[1]/A),$=[1,0,0,0,1,0,0,0,1],ae=0,ce=0;Number.isFinite(l.minX)&&(ae=-l.minX),Number.isFinite(l.minY)&&(ce=-l.minY);var ue=(n[0]-(O-2*o)*z)/2,ve=(n[1]-(A-2*o)*z)/2;$=$f($,[["t",ae,ce],["s",z,z],["t",ue,ve]]),u.setMatrix($),this.set("ratio",z),this.set("totaldx",ue+ae*z),this.set("totaldy",ve+ce*z),this.set("dx",ue),this.set("dy",ve),this.updateViewport()}}}}}},t.prototype.getCanvas=function(){return this.get("canvas")},t.prototype.getViewport=function(){return this.get("viewport")},t.prototype.getContainer=function(){return this.get("container")},t.prototype.destroy=function(){var e;(e=this.get("canvas"))===null||e===void 0||e.destroy();var r=this.get("container");r!=null&&r.parentNode&&r.parentNode.removeChild(r)},t}(si),Qf=Li,pl=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();function Ao(E,t,e){var r=E.x-t.x,n=E.y-t.y;return!e||Math.abs(r)>e||Math.abs(n)>e?Math.sqrt(r*r+n*n):e}function yl(E,t){return E.x*t.x+E.y*t.y}function $c(E,t){var e=(t.source.y-t.target.y)/(t.source.x-t.target.x),r=(e*e*t.source.x+e*(E.y-t.source.y)+E.x)/(e*e+1),n=e*(r-t.source.x)+t.source.y;return{x:r,y:n}}var Qc=function(E){pl(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},t.prototype.init=function(){var e=this.get("graph"),r=this.get("onTick"),n=function(){r&&r(),e.refreshPositions()};this.set("tick",n)},t.prototype.bundling=function(e){var r=this;if(r.set("data",e),!r.isTicking()){var n=e.edges||[],a=e.nodes||[],i={},o=!1;if(a.forEach(function(Ce){(Ce.x===null||!Ce.y===null||Ce.x===void 0||!Ce.y===void 0)&&(o=!0),i[Ce.id]=Ce}),o)throw new Error("please layout the graph or assign x and y for nodes first");r.set("nodeIdMap",i);var u=r.get("divisions"),l=r.get("divRate"),h=r.divideEdges(u);r.set("edgePoints",h);var y=r.getEdgeBundles();r.set("edgeBundles",y);for(var O=r.get("cycles"),A=r.get("iterations"),z=r.get("iterRate"),$=r.get("lambda"),ae=0;ae<O;ae++){for(var ce=function(Re){var Ve=[];n.forEach(function(Ue,$e){if(Ue.source!==Ue.target){var ot=i[Ue.source],et=i[Ue.target];Ve[$e]=r.getEdgeForces({source:ot,target:et},$e,u,$);for(var yt=0;yt<u+1;yt++)h[$e][yt].x+=Ve[$e][yt].x,h[$e][yt].y+=Ve[$e][yt].y}})},ue=0;ue<A;ue++)ce(ue);$=$/2,u*=l,A*=z,h=r.divideEdges(u),r.set("edgePoints",h)}n.forEach(function(Ce,Re){Ce.source!==Ce.target&&(Ce.type="polyline",Ce.controlPoints=h[Re].slice(1,h[Re].length-1))});var ve=r.get("graph");ve.refresh()}},t.prototype.updateBundling=function(e){var r=this,n=e.data;if(n&&r.set("data",n),r.get("ticking")&&r.set("ticking",!1),Object.keys(e).forEach(function(i){r.set(i,e[i])}),e.onTick){var a=this.get("graph");r.set("tick",function(){e.onTick(),a.refresh()})}r.bundling(n)},t.prototype.divideEdges=function(e){var r=this,n=r.get("data").edges,a=r.get("nodeIdMap"),i=r.get("edgePoints");return(!i||i===void 0)&&(i=[]),n.forEach(function(o,u){var l;(!i[u]||i[u]===void 0)&&(i[u]=[]);var h=a[o.source],y=a[o.target];if(e===1)i[u].push({x:h.x,y:h.y}),i[u].push({x:.5*(h.x+y.x),y:.5*(h.y+y.y)}),i[u].push({x:y.x,y:y.y});else{var O=0;!((l=i[u])===null||l===void 0)&&l.length?O=r.getEdgeLength(i[u]):O=Ao({x:h.x,y:h.y},{x:y.x,y:y.y});var A=O/(e+1),z=A,$=[{x:h.x,y:h.y}];i[u].forEach(function(ae,ce){if(ce!==0){for(var ue=Ao(ae,i[u][ce-1]);ue>z;){var ve=z/ue,Ce={x:i[u][ce-1].x,y:i[u][ce-1].y};Ce.x+=ve*(ae.x-i[u][ce-1].x),Ce.y+=ve*(ae.y-i[u][ce-1].y),$.push(Ce),ue-=z,z=A}z-=ue}}),$.push({x:y.x,y:y.y}),i[u]=$}}),i},t.prototype.getEdgeLength=function(e){var r=0;return e.forEach(function(n,a){a!==0&&(r+=Ao(n,e[a-1]))}),r},t.prototype.getEdgeBundles=function(){var e=this,r=e.get("data"),n=r.edges||[],a=e.get("bundleThreshold"),i=e.get("nodeIdMap"),o=e.get("edgeBundles");return o||(o=[]),n.forEach(function(u,l){(!o[l]||o[l]===void 0)&&(o[l]=[])}),n.forEach(function(u,l){var h=i[u.source],y=i[u.target];n.forEach(function(O,A){if(!(A<=l)){var z=i[O.source],$=i[O.target],ae=e.getBundleScore({source:h,target:y},{source:z,target:$});ae>=a&&(o[l].push(A),o[A].push(l))}})}),o},t.prototype.getBundleScore=function(e,r){var n=this;e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,r.vx=r.target.x-r.source.x,r.vy=r.target.y-r.source.y,e.length=Ao({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),r.length=Ao({x:r.source.x,y:r.source.y},{x:r.target.x,y:r.target.y});var a=n.getAngleScore(e,r),i=n.getScaleScore(e,r),o=n.getPositionScore(e,r),u=n.getVisibilityScore(e,r);return a*i*o*u},t.prototype.getAngleScore=function(e,r){var n=yl({x:e.vx,y:e.vy},{x:r.vx,y:r.vy});return n/(e.length*r.length)},t.prototype.getScaleScore=function(e,r){var n=(e.length+r.length)/2,a=2/(n/Math.min(e.length,r.length)+Math.max(e.length,r.length)/n);return a},t.prototype.getPositionScore=function(e,r){var n=(e.length+r.length)/2,a={x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2},i={x:(r.source.x+r.target.x)/2,y:(r.source.y+r.target.y)/2},o=Ao(a,i);return n/(n+o)},t.prototype.getVisibilityScore=function(e,r){var n=this.getEdgeVisibility(e,r),a=this.getEdgeVisibility(r,e);return n<a?n:a},t.prototype.getEdgeVisibility=function(e,r){var n=$c(r.source,e),a=$c(r.target,e),i={x:(n.x+a.x)/2,y:(n.y+a.y)/2},o={x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2};return Math.max(0,1-2*Ao(i,o)/Ao(n,a))},t.prototype.getEdgeForces=function(e,r,n,a){for(var i=this,o=i.get("edgePoints"),u=i.get("K"),l=u/(Ao(e.source,e.target)*(n+1)),h=[{x:0,y:0}],y=1;y<n;y++){var O={x:0,y:0},A=i.getSpringForce({pre:o[r][y-1],cur:o[r][y],next:o[r][y+1]},l),z=i.getElectrostaticForce(y,r);O.x=a*(A.x+z.x),O.y=a*(A.y+z.y),h.push(O)}return h.push({x:0,y:0}),h},t.prototype.getSpringForce=function(e,r){var n=e.pre.x+e.next.x-2*e.cur.x,a=e.pre.y+e.next.y-2*e.cur.y;return n*=r,a*=r,{x:n,y:a}},t.prototype.getElectrostaticForce=function(e,r){var n=this,a=n.get("eps"),i=n.get("edgeBundles"),o=n.get("edgePoints"),u=i[r],l={x:0,y:0};return u.forEach(function(h){var y={x:o[h][e].x-o[r][e].x,y:o[h][e].y-o[r][e].y};if(Math.abs(y.x)>a||Math.abs(y.y)>a){var O=Ao(o[h][e],o[r][e]),A=1/O;l.x+=y.x*A,l.y+=y.y*A}}),l},t.prototype.isTicking=function(){return this.get("ticking")},t.prototype.getSimulation=function(){return this.get("forceSimulation")},t.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),E.prototype.destroy.call(this)},t}(si),ml=Qc,bl=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ac=function(){return Ac=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},Ac.apply(this,arguments)},Jf=.05,Oc={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:.1,fill:"#ccc"},Lc=function(E){bl(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{trigger:"mousemove",d:1.5,r:300,delegateStyle:(0,s.clone)(Oc),showLabel:!1,maxD:5,minD:0,scaleRBy:"unset",scaleDBy:"unset",showDPercent:!0}},t.prototype.getEvents=function(){var e;switch(this.get("trigger")){case"click":e={click:"magnify"};break;case"drag":e={click:"createDelegate"};break;default:e={mousemove:"magnify"};break}return e},t.prototype.init=function(){var e=this,r=e.get("r");e.set("cachedMagnifiedModels",[]),e.set("cachedOriginPositions",{}),e.set("r2",r*r);var n=e.get("d");e.set("molecularParam",(n+1)*r)},t.prototype.createDelegate=function(e){var r=this,n=this,a=n.get("delegate");(!a||a.destroyed)&&(n.magnify(e),a=n.get("delegate"),a.on("dragstart",function(i){n.set("delegateCenterDiff",{x:a.attr("x")-i.x,y:a.attr("y")-i.y})}),a.on("drag",function(i){n.magnify(i)}),this.get("scaleDBy")==="wheel"&&a.on("mousewheel",function(i){r.scaleDByWheel(i)}),this.get("scaleRBy")==="wheel"&&a.on("mousewheel",function(i){n.scaleRByWheel(i)}))},t.prototype.scaleRByWheel=function(e){var r=this;if(!(!e||!e.originalEvent)){e.preventDefault&&e.preventDefault();var n=r.get("graph"),a,i=r.get("delegate"),o=i?{x:i.attr("x"),y:i.attr("y")}:void 0,u=o||n.getPointByClient(e.clientX,e.clientY);e.originalEvent.wheelDelta<0?a=1-Jf:a=1/(1-Jf);var l=r.get("maxR"),h=r.get("minR"),y=r.get("r");(y>(l||n.get("height"))&&a>1||y<(h||n.get("height")*.05)&&a<1)&&(a=1),y*=a,r.set("r",y),r.set("r2",y*y);var O=r.get("d");r.set("molecularParam",(O+1)*y),r.set("delegateCenterDiff",void 0),r.magnify(e,u)}},t.prototype.scaleRByDrag=function(e){var r=this;if(e){var n=r.get("dragPrePos"),a=r.get("graph"),i,o=a.getPointByClient(e.clientX,e.clientY);e.x-n.x<0?i=1-Jf:i=1/(1-Jf);var u=r.get("maxR"),l=r.get("minR"),h=r.get("r");(h>(u||a.get("height"))&&i>1||h<(l||a.get("height")*.05)&&i<1)&&(i=1),h*=i,r.set("r",h),r.set("r2",h*h);var y=r.get("d");r.set("molecularParam",(y+1)*h),r.magnify(e,o),r.set("dragPrePos",{x:e.x,y:e.y})}},t.prototype.scaleDByWheel=function(e){var r=this;if(!(!e&&!e.originalEvent)){e.preventDefault&&e.preventDefault();var n=0;e.originalEvent.wheelDelta<0?n=-.1:n=.1;var a=r.get("d"),i=a+n,o=r.get("maxD"),u=r.get("minD");if(i<o&&i>u){r.set("d",i);var l=r.get("r");r.set("molecularParam",(i+1)*l);var h=r.get("delegate"),y=h?{x:h.attr("x"),y:h.attr("y")}:void 0;r.set("delegateCenterDiff",void 0),r.magnify(e,y)}}},t.prototype.scaleDByDrag=function(e){var r=this,n=r.get("dragPrePos"),a=e.x-n.x>0?.1:-.1,i=r.get("d"),o=i+a,u=r.get("maxD"),l=r.get("minD");if(o<u&&o>l){r.set("d",o);var h=r.get("r");r.set("molecularParam",(o+1)*h),r.magnify(e)}r.set("dragPrePos",{x:e.x,y:e.y})},t.prototype.magnify=function(e,r){var n=this;n.restoreCache();var a=n.get("graph"),i=n.get("cachedMagnifiedModels"),o=n.get("cachedOriginPositions"),u=n.get("showLabel"),l=n.get("r"),h=n.get("r2"),y=n.get("d"),O=n.get("molecularParam"),A=a.getNodes(),z=A.length,$=r?{x:r.x,y:r.y}:{x:e.x,y:e.y};n.get("dragging")&&(n.get("trigger")==="mousemove"||n.get("trigger")==="click")&&($=n.get("cacheCenter"));var ae=n.get("delegateCenterDiff");ae&&($.x+=ae.x,$.y+=ae.y),n.updateDelegate($,l);for(var ce=0;ce<z;ce++){var ue=A[ce].getModel(),ve=ue.x,Ce=ue.y;if(!(isNaN(ve)||isNaN(Ce))){var Re=(ve-$.x)*(ve-$.x)+(Ce-$.y)*(Ce-$.y);if(!isNaN(Re)&&Re<h&&Re!==0){var Ve=Math.sqrt(Re),Ue=O*Ve/(y*Ve+l),$e=(ve-$.x)/Ve,ot=(Ce-$.y)/Ve;if(ue.x=$e*Ue+$.x,ue.y=ot*Ue+$.y,o[ue.id]||(o[ue.id]={x:ve,y:Ce,texts:[]}),i.push(ue),u&&2*Ve<l)for(var et=A[ce],yt=et.getContainer(),Gt=yt.getChildren(),yr=Gt.length,kr=0;kr<yr;kr++){var Mr=Gt[kr];Mr.get("type")==="text"&&(o[ue.id].texts.push({visible:Mr.get("visible"),shape:Mr}),Mr.set("visible",!0))}}}}a.refreshPositions()},t.prototype.restoreCache=function(){for(var e=this,r=e.get("cachedMagnifiedModels"),n=e.get("cachedOriginPositions"),a=r.length,i=0;i<a;i++){var o=r[i],u=o.id,l=n[u];o.x=l.x,o.y=l.y;for(var h=l.texts.length,y=0;y<h;y++){var O=l.texts[y];O.shape.set("visible",O.visible)}}e.set("cachedMagnifiedModels",[]),e.set("cachedOriginPositions",{})},t.prototype.updateParams=function(e){var r=this,n=e.r,a=e.d,i=e.trigger,o=e.minD,u=e.maxD,l=e.minR,h=e.maxR,y=e.scaleDBy,O=e.scaleRBy;isNaN(e.r)||(r.set("r",n),r.set("r2",n*n)),isNaN(a)||r.set("d",a),isNaN(u)||r.set("maxD",u),isNaN(o)||r.set("minD",o),isNaN(h)||r.set("maxR",h),isNaN(l)||r.set("minR",l);var A=r.get("d"),z=r.get("r");if(r.set("molecularParam",(A+1)*z),(i==="mousemove"||i==="click"||i==="drag")&&r.set("trigger",i),y==="drag"||y==="wheel"||y==="unset"){r.set("scaleDBy",y),r.get("delegate").remove(),r.get("delegate").destroy();var $=r.get("dPercentText");$&&($.remove(),$.destroy())}if(O==="drag"||O==="wheel"||O==="unset"){r.set("scaleRBy",O),r.get("delegate").remove(),r.get("delegate").destroy();var $=r.get("dPercentText");$&&($.remove(),$.destroy())}},t.prototype.updateDelegate=function(e,r){var n=this,a=this,i=a.get("graph"),o=a.get("delegate");if(!o||o.destroyed){var u=i.get("group"),l=a.get("delegateStyle")||Oc;o=u.addShape("circle",{attrs:Ac({r:r/1.5,x:e.x,y:e.y},l),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&(this.get("scaleRBy")==="wheel"?o.on("mousewheel",function(z){a.scaleRByWheel(z)}):this.get("scaleRBy")==="drag"&&(o.on("dragstart",function(z){a.set("dragging",!0),a.set("cacheCenter",{x:z.x,y:z.y}),a.set("dragPrePos",{x:z.x,y:z.y})}),o.on("drag",function(z){a.scaleRByDrag(z)}),o.on("dragend",function(z){a.set("dragging",!1)})),this.get("scaleDBy")==="wheel"?o.on("mousewheel",function(z){n.scaleDByWheel(z)}):this.get("scaleDBy")==="drag"&&(o.on("dragstart",function(z){a.set("dragging",!0),a.set("cacheCenter",{x:z.x,y:z.y}),a.set("dragPrePos",{x:z.x,y:z.y})}),o.on("drag",function(z){n.scaleDByDrag(z)}),o.on("dragend",function(z){a.set("dragging",!1)})))}else o.attr({x:e.x,y:e.y,r:r/1.5});if(a.get("showDPercent")){var h=Math.round((a.get("d")-a.get("minD"))/(a.get("maxD")-a.get("minD"))*100),y=a.get("dPercentText"),O=e.y+r/1.5+16;if(!y||y.destroyed){var A=i.get("group");y=A.addShape("text",{attrs:{text:"".concat(h,"%"),x:e.x,y:O,fill:"#aaa",stroke:"#fff",lineWidth:1,fontSize:12}}),a.set("dPercentText",y)}else y.attr({text:"".concat(h,"%"),x:e.x,y:O})}a.set("delegate",o)},t.prototype.clear=function(){var e=this.get("graph");this.restoreCache(),e.refreshPositions();var r=this.get("delegate");r&&!r.destroyed&&(r.remove(),r.destroy());var n=this.get("dPercentText");n&&!n.destroyed&&(n.remove(),n.destroy())},t.prototype.destroy=function(){this.clear()},t}(si),qf=Lc,Jc=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),qc=.05;typeof document!="undefined"&&Hf()(`
.g6-component-toolbar {
position: absolute;
list-style-type: none;
padding: 6px;
left: 0px;
top: 0px;
background-color: rgba(255, 255, 255, 0.9);
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
margin: 0;
}
.g6-component-toolbar li {
float: left;
text-align: center;
width: 35px;
height: 24px;
cursor: pointer;
list-style-type:none;
list-style: none;
margin-left: 0px;
}
.g6-component-toolbar li .icon {
opacity: 0.7;
}
.g6-component-toolbar li .icon:hover {
opacity: 1;
}
`);var el=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],r=t.target;r;){if(e.push(r),r.tagName==="HTML")return e.push(document,window),e;r=r.parentElement}return e},tl=function(E){Jc(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{handleClick:void 0,getContent:function(r){return`
<ul class='g6-component-toolbar'>
<li code='redo'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M256 682.666667c0-102.741333 66.730667-213.333333 213.333333-213.333334 107.008 0 190.762667 56.576 230.570667 125.354667L611.968 682.666667H853.333333v-241.365334l-91.562666 91.562667C704.768 448.469333 601.130667 384 469.333333 384c-196.096 0-298.666667 150.229333-298.666666 298.666667h85.333333z" fill="" p-id="2041"></path>
</svg>
</li>
<li code='undo'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M170.666667 682.666667h241.365333l-87.936-87.978667C363.904 525.909333 447.658667 469.333333 554.666667 469.333333c146.602667 0 213.333333 110.592 213.333333 213.333334h85.333333c0-148.437333-102.570667-298.666667-298.666666-298.666667-131.797333 0-235.392 64.469333-292.48 148.821333L170.666667 441.301333V682.666667z" fill="" p-id="2764"></path>
</svg>
</li>
<li code='zoomOut'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M658.432 428.736a33.216 33.216 0 0 1-33.152 33.152H525.824v99.456a33.216 33.216 0 0 1-66.304 0V461.888H360.064a33.152 33.152 0 0 1 0-66.304H459.52V296.128a33.152 33.152 0 0 1 66.304 0V395.52H625.28c18.24 0 33.152 14.848 33.152 33.152z m299.776 521.792a43.328 43.328 0 0 1-60.864-6.912l-189.248-220.992a362.368 362.368 0 0 1-215.36 70.848 364.8 364.8 0 1 1 364.8-364.736 363.072 363.072 0 0 1-86.912 235.968l192.384 224.64a43.392 43.392 0 0 1-4.8 61.184z m-465.536-223.36a298.816 298.816 0 0 0 298.432-298.432 298.816 298.816 0 0 0-298.432-298.432A298.816 298.816 0 0 0 194.24 428.8a298.816 298.816 0 0 0 298.432 298.432z"></path>
</svg>
</li>
<li code='zoomIn'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M639.936 416a32 32 0 0 1-32 32h-256a32 32 0 0 1 0-64h256a32 32 0 0 1 32 32z m289.28 503.552a41.792 41.792 0 0 1-58.752-6.656l-182.656-213.248A349.76 349.76 0 0 1 480 768 352 352 0 1 1 832 416a350.4 350.4 0 0 1-83.84 227.712l185.664 216.768a41.856 41.856 0 0 1-4.608 59.072zM479.936 704c158.784 0 288-129.216 288-288S638.72 128 479.936 128a288.32 288.32 0 0 0-288 288c0 158.784 129.216 288 288 288z" p-id="3853"></path>
</svg>
</li>
<li code='realZoom'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
<path d="M384 320v384H320V320h64z m256 0v384H576V320h64zM512 576v64H448V576h64z m0-192v64H448V384h64z m355.968 576H92.032A28.16 28.16 0 0 1 64 931.968V28.032C64 12.608 76.608 0 95.168 0h610.368L896 192v739.968a28.16 28.16 0 0 1-28.032 28.032zM704 64v128h128l-128-128z m128 192h-190.464V64H128v832h704V256z"></path>
</svg>
</li>
<li code='autoZoom'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
<path d="M684.288 305.28l0.128-0.64-0.128-0.64V99.712c0-19.84 15.552-35.904 34.496-35.712a35.072 35.072 0 0 1 34.56 35.776v171.008h170.944c19.648 0 35.84 15.488 35.712 34.432a35.072 35.072 0 0 1-35.84 34.496h-204.16l-0.64-0.128a32.768 32.768 0 0 1-20.864-7.552c-1.344-1.024-2.816-1.664-3.968-2.816-0.384-0.32-0.512-0.768-0.832-1.088a33.472 33.472 0 0 1-9.408-22.848zM305.28 64a35.072 35.072 0 0 0-34.56 35.776v171.008H99.776A35.072 35.072 0 0 0 64 305.216c0 18.944 15.872 34.496 35.84 34.496h204.16l0.64-0.128a32.896 32.896 0 0 0 20.864-7.552c1.344-1.024 2.816-1.664 3.904-2.816 0.384-0.32 0.512-0.768 0.768-1.088a33.024 33.024 0 0 0 9.536-22.848l-0.128-0.64 0.128-0.704V99.712A35.008 35.008 0 0 0 305.216 64z m618.944 620.288h-204.16l-0.64 0.128-0.512-0.128c-7.808 0-14.72 3.2-20.48 7.68-1.28 1.024-2.752 1.664-3.84 2.752-0.384 0.32-0.512 0.768-0.832 1.088a33.664 33.664 0 0 0-9.408 22.912l0.128 0.64-0.128 0.704v204.288c0 19.712 15.552 35.904 34.496 35.712a35.072 35.072 0 0 0 34.56-35.776V753.28h170.944c19.648 0 35.84-15.488 35.712-34.432a35.072 35.072 0 0 0-35.84-34.496z m-593.92 11.52c-0.256-0.32-0.384-0.768-0.768-1.088-1.088-1.088-2.56-1.728-3.84-2.688a33.088 33.088 0 0 0-20.48-7.68l-0.512 0.064-0.64-0.128H99.84a35.072 35.072 0 0 0-35.84 34.496 35.072 35.072 0 0 0 35.712 34.432H270.72v171.008c0 19.84 15.552 35.84 34.56 35.776a35.008 35.008 0 0 0 34.432-35.712V720l-0.128-0.64 0.128-0.704a33.344 33.344 0 0 0-9.472-22.848zM512 374.144a137.92 137.92 0 1 0 0.128 275.84A137.92 137.92 0 0 0 512 374.08z"></path>
</svg>
</li>
</ul>
`},zoomSensitivity:2}},t.prototype.init=function(){var e=this,r=this.get("graph"),n=this.get("getContent"),a=n(r),i=a;(0,s.isString)(a)&&(i=(0,ka.Z)(a));var o=this.get("className");i.setAttribute("class",o||"g6-component-toolbar");var u=this.get("container");u||(u=this.get("graph").get("container")),(0,s.isString)(u)&&(u=document.getElementById(u)),u.appendChild(i),this.set("toolBar",i);var l=this.get("handleClick");i.addEventListener("click",function(y){var O=el(y).filter(function(z){return z.nodeName==="LI"});if(O.length!==0){var A=O[0].getAttribute("code");A&&(l?l(A,r):e.handleDefaultOperator(A))}});var h=this.get("position");h&&(0,aa.Z)(i,{top:"".concat(h.y,"px"),left:"".concat(h.x,"px")}),this.bindUndoRedo()},t.prototype.bindUndoRedo=function(){var e=this.get("graph"),r=document.querySelector('.g6-component-toolbar li[code="undo"]'),n=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),a=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');!r||!n||!a||!i||(r.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4"),a.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),e.on("stackchange",function(o){var u=o.undoStack,l=o.redoStack,h=u.length,y=l.length;h===0?(r.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),n.removeAttribute("style")),y===0?(a.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(a.removeAttribute("style"),i.removeAttribute("style"))}))},t.prototype.undo=function(){var e=this.get("graph"),r=e.getUndoStack();if(!(!r||r.length===0)){var n=r.pop();if(n){var a=n.action;e.pushStack(a,(0,s.clone)(n.data),"redo");var i=n.data.before;if(a==="add"&&(i=n.data.after),!i)return;switch(a){case"visible":{Object.keys(i).forEach(function(y){var O=i[y];O&&O.forEach(function(A){var z=e.findById(A.id);A.visible?e.showItem(z,!1):e.hideItem(z,!1)})});break}case"render":case"update":Object.keys(i).forEach(function(y){var O=i[y];O&&O.forEach(function(A){var z=e.findById(A.id);delete A.id,e.updateItem(z,A,!1),z.getType()==="combo"&&e.updateCombo(z)})});break;case"changedata":e.changeData(i,!1);break;case"delete":{Object.keys(i).forEach(function(y){var O=i[y];O&&O.forEach(function(A){var z=A.itemType;delete A.itemType,e.addItem(z,A,!1)})});break}case"add":Object.keys(i).forEach(function(y){var O=i[y];O&&O.forEach(function(A){e.removeItem(A.id,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(y){var O=i[y];O&&O.forEach(function(A){e.updateComboTree(A.id,A.parentId,!1)})});break;case"createCombo":var o=n.data.after.combos,u=o[o.length-1];Object.keys(i).forEach(function(y){var O=i[y];O&&O.forEach(function(A){e.updateComboTree(A.id,A.parentId,!1)})}),e.removeItem(u.id,!1);break;case"uncombo":var l=i.combos[i.combos.length-1],h=i.nodes.concat(i.combos).map(function(y){return y.id}).filter(function(y){return y!==l.id});e.createCombo(l,h,!1);break;case"layout":e.updateLayout(i,void 0,void 0,!1);break;default:}}}},t.prototype.redo=function(){var e=this.get("graph"),r=e.getRedoStack();if(!(!r||r.length===0)){var n=r.pop();if(n){var a=n.action,i=n.data.after;if(e.pushStack(a,(0,s.clone)(n.data)),a==="delete"&&(i=n.data.before),!i)return;switch(a){case"visible":{Object.keys(i).forEach(function(h){var y=i[h];y&&y.forEach(function(O){var A=e.findById(O.id);O.visible?e.showItem(A,!1):e.hideItem(A,!1)})});break}case"render":case"update":Object.keys(i).forEach(function(h){var y=i[h];y&&y.forEach(function(O){var A=e.findById(O.id);delete O.id,e.updateItem(A,O,!1),A.getType()==="combo"&&e.updateCombo(A)})});break;case"changedata":e.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach(function(h){e.removeItem(h.id,!1)}),i.nodes&&i.nodes.forEach(function(h){e.removeItem(h.id,!1)}),i.combos&&i.combos.forEach(function(h){e.removeItem(h.id,!1)});break;case"add":{Object.keys(i).forEach(function(h){var y=i[h];y&&y.forEach(function(O){var A=O.itemType;delete O.itemType,e.addItem(A,O,!1)})});break}case"updateComboTree":Object.keys(i).forEach(function(h){var y=i[h];y&&y.forEach(function(O){e.updateComboTree(O.id,O.parentId,!1)})});break;case"createCombo":var o=i.combos[i.combos.length-1];e.createCombo(o,o.children.map(function(h){return h.id}),!1);break;case"uncombo":var u=n.data.before.combos,l=u[u.length-1];e.uncombo(l.id,!1);break;case"layout":e.updateLayout(i,void 0,void 0,!1);break;default:}}}},t.prototype.zoomOut=function(){var e=this.get("graph"),r=e.getZoom(),n=1/(1-qc*this.get("zoomSensitivity")),a=this.get("maxZoom")||e.get("maxZoom");n*r>a||e.zoomTo(r*n)},t.prototype.zoomIn=function(){var e=this.get("graph"),r=e.getZoom(),n=1-qc*this.get("zoomSensitivity"),a=this.get("minZoom")||e.get("minZoom");n*r<a||e.zoomTo(r*n)},t.prototype.realZoom=function(){var e=this.get("graph");e.zoomTo(1)},t.prototype.autoZoom=function(){var e=this.get("graph");e.fitView([20,20])},t.prototype.handleDefaultOperator=function(e){switch(e){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom();break;default:}},t.prototype.destroy=function(){var e=this.get("toolBar");if(e){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,s.isString)(r)&&(r=document.getElementById(r)),r.removeChild(e)}var n=this.get("handleClick");n&&e.removeEventListener("click",n)},t}(si),ec=tl,he=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();typeof document!="undefined"&&Hf()(`
.g6-component-tooltip {
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
background-color: rgba(255, 255, 255, 0.9);
padding: 10px 8px;
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
}
.tooltip-type {
padding: 0;
margin: 0;
}
.tooltip-id {
color: #531dab;
}
`);var We=function(E){he(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(r){return`
<h4 class='tooltip-type'>\u7C7B\u578B\uFF1A`.concat(r.item.getType(),`</h4>
<span class='tooltip-id'>ID\uFF1A`).concat(r.item.getID(),`</span>
`)},shouldBegin:function(r){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},t.prototype.getEvents=function(){return this.get("trigger")==="click"?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},t.prototype.init=function(){var e=this,r=e.get("className")||"g6-component-tooltip",n=(0,ka.Z)("<div class='".concat(r,"'></div>")),a=e.get("container");a||(a=e.get("graph").get("container")),(0,s.isString)(a)&&(a=document.getElementById(a)),(0,aa.Z)(n,{position:"absolute",visibility:"hidden",display:"none"}),a.appendChild(n),e.get("trigger")!=="click"&&(n.addEventListener("mouseenter",function(i){(0,aa.Z)(n,{visibility:"visible",display:"unset"})}),n.addEventListener("mouseleave",function(i){e.hideTooltip()})),e.set("tooltip",n)},t.prototype.onClick=function(e){var r=this.get("itemTypes");if(!(e.item&&e.item.getType&&r.indexOf(e.item.getType())===-1)){var n=e.item,a=this.get("graph");this.currentTarget===n?(this.currentTarget=null,this.hideTooltip(),a.emit("tooltipchange",{item:e.item,action:"hide"})):(this.currentTarget=n,this.showTooltip(e),a.emit("tooltipchange",{item:e.item,action:"show"}))}},t.prototype.onMouseEnter=function(e){var r=this.get("itemTypes");if(!(e.item&&e.item.getType&&r.indexOf(e.item.getType())===-1)){var n=e.item,a=this.get("graph");this.currentTarget=n,this.showTooltip(e),a.emit("tooltipchange",{item:e.item,action:"show"})}},t.prototype.onMouseMove=function(e){var r=this.get("itemTypes");e.item&&e.item.getType&&r.indexOf(e.item.getType())===-1||!this.currentTarget||e.item!==this.currentTarget||this.showTooltip(e)},t.prototype.onMouseLeave=function(){this.hideTooltip();var e=this.get("graph");e.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},t.prototype.clearContainer=function(){var e=this.get("tooltip");e&&(e.innerHTML="")},t.prototype.showTooltip=function(e){if(e.item){var r=this.get("itemTypes");if(!(e.item.getType&&r.indexOf(e.item.getType())===-1)){var n=this.get("tooltip"),a=this.get("getContent"),i=a(e);(0,s.isString)(i)?n.innerHTML=i:(this.clearContainer(),n.appendChild(i)),this.updatePosition(e)}}},t.prototype.hideTooltip=function(){var e=this.get("tooltip");e&&(0,aa.Z)(e,{visibility:"hidden",display:"none"})},t.prototype.updatePosition=function(e){var r=this.get("shouldBegin"),n=this.get("tooltip");if(!r(e)){(0,aa.Z)(n,{visibility:"hidden",display:"none"});return}var a=this.get("graph"),i=a.get("width"),o=a.get("height"),u=this.get("offsetX")||0,l=this.get("offsetY")||0,h=a.getPointByClient(e.clientX,e.clientY),y=this.get("fixToNode"),O=e.item;if(O.getType&&O.getType()==="node"&&y&&(0,s.isArray)(y)&&y.length>=2){var A=O.getBBox();h={x:A.minX+A.width*y[0],y:A.minY+A.height*y[1]}}var z=a.getCanvasByPoint(h.x,h.y),$=z.x,ae=z.y,ce=a.getContainer(),ue={x:$+ce.offsetLeft+u,y:ae+ce.offsetTop+l};(0,aa.Z)(n,{visibility:"visible",display:"unset"});var ve=n.getBoundingClientRect();$+ve.width+u>i&&(ue.x-=ve.width+u),ae+ve.height+l>o&&(ue.y-=ve.height+l,ue.y<0&&(ue.y=0)),(0,aa.Z)(n,{left:"".concat(ue.x,"px"),top:"".concat(ue.y,"px")})},t.prototype.hide=function(){this.onMouseLeave()},t.prototype.destroy=function(){var e=this.get("tooltip");if(e){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,s.isString)(r)&&(r=document.getElementById(r)),r.removeChild(e)}},t}(si),it=We,Zt="timebarstartplay",or="timebarendplay",Xt="valuechange",Qt="timebarConfigChanged",gr="playPauseBtn",Er="nextStepBtn",wr="preStepBtn",_r={opacity:.5,fill:"#000"},Br={opacity:.5,fill:"#000",r:5},f={fill:"#fff",fontSize:12},w=function(){function E(t){var e=t.x,r=e===void 0?0:e,n=t.y,a=n===void 0?0:n,i=t.container,o=t.text,u=t.padding,l=u===void 0?[4,4,4,4]:u,h=t.className,y=h===void 0?"g6-component-timebar-tooltip":h,O=t.backgroundColor,A=O===void 0?"#000":O,z=t.textColor,$=z===void 0?"#fff":z,ae=t.opacity,ce=ae===void 0?.8:ae,ue=t.fontSize,ve=ue===void 0?12:ue;this.container=i,this.className=y,this.backgroundColor=A,this.textColor=$,this.x=r,this.y=a,this.text=o,this.padding=l,this.opacity=ce,this.fontSize=ve,this.render()}return E.prototype.render=function(){var t=this,e=t.className,r=t.x,n=t.y,a=t.backgroundColor,i=t.textColor,o=t.text,u=t.padding,l=t.opacity,h=t.fontSize,y=t.container,O=(0,ka.Z)("<div class='".concat(e,`' style="position: absolute; width: fit-content; height: fit-content; opacity: `).concat(l,'"></div>'));(0,s.isString)(y)&&(y=document.getElementById(y)),y.appendChild(O),t.parentHeight=y.offsetHeight,t.parentWidth=y.offsetWidth,(0,aa.Z)(O,{visibility:"hidden",top:0,left:0});var A=(0,ka.Z)(`
<div style='position: absolute; white-space:nowrap; background-color: `.concat(a,"; font-size: ").concat(h,"px; border-radius: 4px; width: fit-content; height: fit-content; color: ").concat(i,"; padding: ").concat(u[0],"px ").concat(u[1],"px ").concat(u[2],"px ").concat(u[3],"px'></div>"));A.innerHTML=o,O.appendChild(A),t.backgroundDOM=A;var z=(0,ka.Z)("<div style='position: absolute; width: 0px; height: 0px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 10px solid ".concat(a,"'></div>"));O.appendChild(z),t.arrowDOM=z,t.container=O},E.prototype.show=function(t){var e=this,r=t.text,n=t.x,a=t.y,i=t.clientX,o=t.clientY;e.backgroundDOM.innerHTML=r;var u=e.backgroundDOM.offsetWidth,l=e.backgroundDOM.offsetHeight,h=e.arrowDOM.offsetWidth,y=e.arrowDOM.offsetHeight;(0,aa.Z)(e.container,{top:"".concat(-l-y,"px"),left:"".concat(n,"px"),visibility:"visible"}),(0,aa.Z)(e.backgroundDOM,{marginLeft:"".concat(-u/2,"px")}),(0,aa.Z)(e.arrowDOM,{marginLeft:"".concat(-h/2,"px"),top:"".concat(l,"px")});var O=n-u/2,A=n+u/2;O<0?(0,aa.Z)(e.backgroundDOM,{marginLeft:"".concat(-u/2-O,"px")}):A>e.parentWidth&&(0,aa.Z)(e.backgroundDOM,{marginLeft:"".concat(-u/2-A+e.parentWidth+12,"px")})},E.prototype.hide=function(){(0,aa.Z)(this.container,{top:0,left:0,visibility:"hidden"})},E}(),B=w,V=function(){return V=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},V.apply(this,arguments)},re=function(){function E(t){this.config=(0,s.deepMix)({},t),this.init()}return E.prototype.update=function(t){this.config=(0,s.deepMix)({},this.config,t),this.updateElement(),this.renderMarker()},E.prototype.init=function(){this.initElement(),this.renderMarker()},E.prototype.initElement=function(){var t=this.config,e=t.group,r=t.style,n=r.scale,a=n===void 0?1:n,i=r.offsetX,o=i===void 0?0:i,u=r.offsetY,l=u===void 0?0:u,h=this.config.x+o,y=this.config.y+l,O=e.addGroup({name:gr});this.startMarkerGroup=O.addGroup({name:gr}),this.circle=e.addShape("circle",{attrs:V({x:h,y,r:this.config.r*a},r),name:gr}),this.startMarker=this.startMarkerGroup.addShape("path",{attrs:{path:this.getStartMarkerPath(h,y,a),fill:r.stroke||"#aaa"},name:"start-marker"}),this.pauseMarkerGroup=O.addGroup({name:gr});var A=.25*this.config.r*a,z=.5*this.config.r*Math.sqrt(3)*a;this.pauseLeftMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:h-.375*this.config.r*a,y:y-z/2,width:A,height:z,fill:r.stroke||"#aaa",lineWidth:0}}),this.pauseRightMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:h+1/8*this.config.r*a,y:y-z/2,width:A,height:z,fill:r.stroke||"#aaa",lineWidth:0}})},E.prototype.updateElement=function(){var t=this.config.style,e=t.scale,r=e===void 0?1:e,n=t.offsetX,a=n===void 0?0:n,i=t.offsetY,o=i===void 0?0:i,u=this.config.x+a,l=this.config.y+o;this.circle.attr("x",u),this.circle.attr("y",l),this.circle.attr("r",this.config.r*r),this.startMarker.attr("path",this.getStartMarkerPath(u,l,r));var h=.25*this.config.r*r,y=.5*this.config.r*Math.sqrt(3)*r;this.pauseLeftMarker.attr("x",u-(1/4+1/8)*this.config.r*r),this.pauseLeftMarker.attr("y",l-y/2),this.pauseLeftMarker.attr("width",h),this.pauseLeftMarker.attr("height",y),this.pauseRightMarker.attr("x",u+1/8*this.config.r*r),this.pauseRightMarker.attr("y",l-y/2),this.pauseRightMarker.attr("width",h),this.pauseRightMarker.attr("height",y)},E.prototype.renderMarker=function(){this.config.isPlay?(this.startMarkerGroup.hide(),this.pauseMarkerGroup.show()):(this.startMarkerGroup.show(),this.pauseMarkerGroup.hide())},E.prototype.getStartMarkerPath=function(t,e,r){var n=.5*this.config.r*Math.sqrt(3)*r;return[["M",t-n/Math.sqrt(3)/2,e-n/2],["L",t+n/Math.sqrt(3),e],["L",t-n/Math.sqrt(3)/2,e+n/2]]},E}(),oe=re,le=function(){return le=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},le.apply(this,arguments)},ge=Q.vs,_e="#aaa",Ne="green",ze={fill:"#aaa",fillOpacity:.35,stroke:"#aaa"},Be={fill:"#fff"},nt={fill:"green"},_t={pointer:{fill:"#aaa",lineWidth:0},scroller:{stroke:"#aaa",fill:"#aaa",lineWidth:1,lineAppendWidth:5,cursor:"pointer"},text:{fill:"#aaa",textBaseline:"top"}},tr={check:{stroke:"green",lineWidth:3},box:{fill:"#fff",stroke:"#aaa",lineWidth:2,radius:3,width:12,height:12},text:{fill:"#aaa",fontSize:12,textBaseline:"top"}},Pt={speed:1,loop:!1,fill:"#fff",stroke:"#fff",hideTimeTypeController:!1,preBtnStyle:{fill:"#aaa",stroke:"#aaa"},nextBtnStyle:{fill:"#aaa",stroke:"#aaa"},playBtnStyle:{fill:"#aaa",stroke:"#aaa",fillOpacity:.05},speedControllerStyle:_t,timeTypeControllerStyle:tr},kt=110,Dt=50,pr={SINGLE:"single",RANGE:"range"},Xr=function(){function E(t){this.controllerCfg=(0,s.deepMix)({},Pt,t),this.group=t.group,this.controllerGroup=this.group.addGroup({name:"controller-group"}),this.speedAxisY=[],this.currentSpeed=this.controllerCfg.speed,this.currentType=this.controllerCfg.defaultTimeType||pr.RANGE,this.fontFamily=t.fontFamily||"Arial, sans-serif",this.init()}return E.prototype.init=function(){this.renderPlayButton()},E.prototype.getNextMarkerPath=function(t,e,r){return[["M",t,e-r],["L",t+r,e],["L",t,e+r],["Z",t,e-r],["M",t,e],["L",t-r,e-r],["L",t-r,e+r],["Z"]]},E.prototype.getPreMarkerPath=function(t,e,r){return[["M",t,e-r],["L",t-r,e],["L",t,e+r],["L",t,e-r],["M",t,e],["L",t+r,e-r],["L",t+r,e+r],["Z"]]},E.prototype.renderPlayButton=function(){var t=this.controllerCfg,e=t.width,r=t.height,n=t.x,a=t.y,i=t.hideTimeTypeController,o=t.fill,u=o===void 0?_e:o,l=t.stroke,h=l===void 0?Ne:l,y=t.containerStyle,O=y===void 0?{}:y,A=le(le({},ze),t.playBtnStyle||{}),z=le(le({},Be),t.preBtnStyle||{}),$=le(le({},nt),t.nextBtnStyle||{}),ae=r/2-5,ce=a+10,ue=this.controllerGroup.addShape("rect",{attrs:le({x:n,y:ce,width:e,height:r,stroke:h,fill:u},O),name:"container-rect"});this.playButton?this.playButton.update({x:e/2,y:ce,r:ae}):this.playButton=new oe({group:this.controllerGroup,x:e/2,y:ce+ae+5,r:ae,isPlay:this.isPlay,style:A});var ve=z.offsetX||0,Ce=z.offsetY||0,Re=(z.scale||1)*ae;this.controllerGroup.addShape("path",{attrs:le({path:this.getPreMarkerPath(e/2-5*ae+ve,ce+ae+5+Ce,Re*.5)},z),name:wr});var Ve=$.offsetX||0,Ue=$.offsetY||0,$e=($.scale||1)*ae;this.controllerGroup.addShape("path",{attrs:le({path:this.getNextMarkerPath(e/2+5*ae+Ve,ce+ae+5+Ue,$e*.5)},$),name:Er}),ue.toBack(),this.renderSpeedBtn(),i||this.renderToggleTime(),this.bindEvent();var ot=this.controllerCfg.scale,et=ot===void 0?1:ot,yt=this.controllerGroup.getCanvasBBox(),Gt=(yt.maxX+yt.minX)/2,yr=(yt.maxY+yt.minY)/2,kr=ge([1,0,0,0,1,0,0,0,1],[["t",-Gt,-yr],["s",et,et],["t",Gt,yr]]);this.controllerGroup.setMatrix(kr)},E.prototype.renderSpeedBtn=function(){var t=this.controllerCfg,e=t.y,r=t.width,n=t.hideTimeTypeController,a=le(le({},_t),this.controllerCfg.speedControllerStyle||{}),i=a.scroller,o=i===void 0?{}:i,u=a.text,l=u===void 0?{}:u,h=a.pointer,y=h===void 0?{}:h,O=a.scale,A=O===void 0?1:O,z=a.offsetX,$=z===void 0?0:z,ae=a.offsetY,ce=ae===void 0?0:ae,ue=this.controllerGroup.addGroup({name:"speed-group"});this.speedGroup=ue;var ve=[],Ce=5;this.speedAxisY=[19,22,26,32,39];for(var Re=0;Re<5;Re++){var Ve=e+this.speedAxisY[Re],Ue=r-(n?Dt:kt);ue.addShape("line",{attrs:le({x1:Ue,x2:Ue+15,y1:Ve,y2:Ve},o),speed:Ce,name:"speed-rect"}),this.speedAxisY[Re]=Ve,ve.push(Ce),Ce=Ce-1}this.speedText=ue.addShape("text",{attrs:le({x:r-(n?Dt:kt)+20,y:this.speedAxisY[0]+4,text:"1.0X",fontFamily:this.fontFamily||"Arial, sans-serif"},l),name:"speed-text"}),this.speedPoint=ue.addShape("path",{attrs:le({path:this.getPointerPath(r-(n?Dt:kt),0),matrix:[1,0,0,0,1,0,0,this.speedAxisY[4],1]},y),name:"speed-pointer"});var $e=this.speedGroup.getCanvasBBox(),ot=($e.maxX+$e.minX)/2,et=($e.maxY+$e.minY)/2,yt=this.speedGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];yt=ge(yt,[["t",-ot,-et],["s",A,A],["t",ot+$*A,et+ce*A]]),this.speedGroup.setMatrix(yt)},E.prototype.getPointerPath=function(t,e){return[["M",t,e],["L",t-10,e-4],["L",t-10,e+4],["Z"]]},E.prototype.renderToggleTime=function(){var t,e,r=this.controllerCfg,n=r.width,a=r.defaultTimeType,i=le(le({},tr),this.controllerCfg.timeTypeControllerStyle||{}),o=i.scale,u=o===void 0?1:o,l=i.offsetX,h=l===void 0?0:l,y=i.offsetY,O=y===void 0?0:y,A=i.box,z=A===void 0?{}:A,$=i.check,ae=$===void 0?{}:$,ce=i.text,ue=ce===void 0?{}:ce;this.toggleGroup=this.controllerGroup.addGroup({name:"toggle-group"});var ve=a===pr.SINGLE;this.toggleGroup.addShape("rect",{attrs:le({x:n-Dt,y:this.speedAxisY[0]+3.5},z),isChecked:ve,name:"toggle-model"}),this.checkedIcon=this.toggleGroup.addShape("path",{attrs:le({path:[["M",n-Dt+3,this.speedAxisY[1]+6],["L",n-Dt+7,this.speedAxisY[1]+10],["L",n-Dt+12,this.speedAxisY[1]+4]]},ae),capture:!1,name:"check-icon"}),ve||this.checkedIcon.hide(),this.checkedText=this.toggleGroup.addShape("text",{attrs:le({text:ve?((t=this.controllerCfg)===null||t===void 0?void 0:t.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4":((e=this.controllerCfg)===null||e===void 0?void 0:e.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4",x:n-Dt+15,y:this.speedAxisY[0]+4,fontFamily:typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},ue),name:"checked-text"});var Ce=this.toggleGroup.getCanvasBBox(),Re=(Ce.maxX+Ce.minX)/2,Ve=(Ce.maxY+Ce.minY)/2,Ue=this.toggleGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];Ue=ge(Ue,[["t",-Re,-Ve],["s",u,u],["t",Re+h*u,Ve+O*u]]),this.toggleGroup.setMatrix(Ue)},E.prototype.bindEvent=function(){var t=this;this.speedGroup.on("speed-rect:click",function(e){var r=e.target.attr("y1"),n=t.speedPoint.attr("matrix"),a=t.speedAxisY.indexOf(n[7]||0),i=t.speedAxisY.indexOf(r),o=t.speedAxisY[i]-t.speedAxisY[a];n=ge(n,[["t",0,o]]),t.speedPoint.setMatrix(n),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit(Qt,{speed:t.currentSpeed,type:t.currentType})}),this.speedGroup.on("mousewheel",function(e){e.preventDefault();var r=t.speedPoint.attr("matrix")||[1,0,0,0,1,0,0,0,1],n=r[7],a=t.speedAxisY.indexOf(n);if(a===-1){var i=1/0;t.speedAxisY.forEach(function(u,l){var h=Math.abs(u-n);i>h&&(i=h,a=l)})}e.originalEvent.deltaY>0?a=Math.max(0,a-1):a=Math.min(t.speedAxisY.length-1,a+1);var o=t.speedAxisY[a]-n;r=ge(r,[["t",0,o]]),t.speedPoint.setMatrix(r),t.currentSpeed=t.speedAxisY.length-a,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit(Qt,{speed:t.currentSpeed,type:t.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(e){var r,n,a=e.target.get("isChecked");a?(t.checkedIcon.hide(),t.checkedText.attr("text",((n=t.controllerCfg)===null||n===void 0?void 0:n.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4"),t.currentType=pr.RANGE):(t.checkedIcon.show(),t.checkedText.attr("text",((r=t.controllerCfg)===null||r===void 0?void 0:r.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4"),t.currentType=pr.SINGLE),e.target.set("isChecked",!a),t.group.emit(Qt,{type:t.currentType,speed:t.currentSpeed})})},E.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},E}(),Or=Xr,fn=function(){return fn=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},fn.apply(this,arguments)},cn=Q.vs,Mn={fill:"#5B8FF9"},Un={fill:"#e6e8e9"},kn=function(){function E(t){this.frameCount=0,this.fontFamily="Arial, sans-serif";var e=t.graph,r=t.canvas,n=t.group,a=t.width,i=t.height,o=t.padding,u=t.data,l=t.start,h=t.end,y=t.x,O=y===void 0?0:y,A=t.y,z=A===void 0?0:A,$=t.tickLabelFormatter,ae=t.selectedTickStyle,ce=ae===void 0?Mn:ae,ue=t.unselectedTickStyle,ve=ue===void 0?Un:ue,Ce=t.tooltipBackgroundColor,Re=t.tooltipFomatter,Ve=t.tickLabelStyle,Ue=t.controllerCfg,$e=Ue===void 0?{speed:1}:Ue;this.graph=e,this.group=n,this.sliceGroup=n.addGroup({name:"slice-group"}),this.canvas=r,this.width=a,this.height=i,this.padding=o,this.data=u,this.start=l,this.end=h,this.tickLabelFormatter=$,this.tickLabelStyle=Ve||{},this.selectedTickStyle=ce,this.unselectedTickStyle=ve,this.controllerCfg=$e,this.currentSpeed=$e.speed||1,this.x=O,this.y=z,this.tooltipBackgroundColor=Ce,this.tooltipFomatter=Re,this.fontFamily=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlices(),this.initEvent()}return E.prototype.renderSlices=function(){var t=this,e=this,r=e.width,n=e.height,a=e.padding,i=e.data,o=e.start,u=e.end,l=e.tickLabelFormatter,h=e.selectedTickStyle,y=e.unselectedTickStyle,O=e.tickLabelStyle,A=r-2*a,z=10,$=4,ae=3*a+$+z,ce=n-ae-2*a,ue=2,ve=i.length,Ce=(A-ue*(ve-1))/ve;this.tickWidth=Ce;var Re=this.sliceGroup,Ve=[],Ue=[],$e=Math.round(ve*o),ot=Math.round(ve*u);this.startTickRectId=$e,this.endTickRectId=ot;var et=O.rotate;delete O.rotate,i.forEach(function(Gt,yr){var kr=yr>=$e&&yr<=ot,Mr=kr?h:y,dr=Re.addShape("rect",{attrs:fn({x:a+yr*(Ce+ue),y:a,width:Ce,height:ce},Mr),draggable:!0,name:"tick-rect-".concat(yr)}),hn=Re.addShape("rect",{attrs:{x:a+yr*Ce+ue*(2*yr-1)/2,y:a,width:yr===0||yr===ve-1?Ce+ue/2:Ce+ue,height:ce,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(yr)});hn.toFront();var on=dr.getBBox(),cr=(on.minX+on.maxX)/2;Ve.push({rect:dr,pickRect:hn,value:Gt.date,x:cr,y:on.minY});var Rr;if(l?(Rr=l(Gt),!(0,s.isString)(Rr)&&Rr&&(Rr=Gt.date)):yr%Math.round(ve/10)===0&&(Rr=Gt.date),Rr){Ue.push(Rr);var Yr=on.maxY+a*2;Re.addShape("line",{attrs:{stroke:"#BFBFBF",x1:cr,y1:Yr,x2:cr,y2:Yr+$},name:"tick-line"});var Wr=Yr+$+a,sn=Re.addShape("text",{attrs:fn({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:cr,y:Wr,textAlign:"center",text:Rr,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},O),capture:!1,name:"tick-label"}),wn=sn.getBBox();if(wn.maxX>r?sn.attr("textAlign","right"):wn.minX<0&&sn.attr("textAlign","left"),(0,s.isNumber)(et)&&Ue.length!==10){var la=cn([1,0,0,0,1,0,0,0,1],[["t",-cr,-Wr],["r",et],["t",cr-5,Wr+2]]);sn.attr({textAlign:"left",matrix:la})}Ue.length===1?sn.attr({textAlign:"left"}):Ue.length===10&&sn.attr({textAlign:"right"})}}),this.tickRects=Ve;var yt=this.group;this.currentSpeed=1,this.controllerBtnGroup=new Or(fn({group:yt,x:this.x,y:this.y+n+5,width:r,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},E.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",function(h){var y=h.target;if(!(y.get("type")!=="rect"||!y.get("name"))){var O=parseInt(y.get("name").split("-")[2],10);if(!isNaN(O)){var A=t.tickRects,z=t.unselectedTickStyle;A.forEach(function(ue){ue.rect.attr(z)});var $=t.selectedTickStyle;A[O].rect.attr($),t.startTickRectId=O,t.endTickRectId=O;var ae=A.length,ce=O/ae;t.graph.emit(Xt,{value:[ce,ce]})}}}),e.on("dragstart",function(h){var y=t.tickRects,O=t.unselectedTickStyle;y.forEach(function(ue){ue.rect.attr(O)});var A=h.target,z=parseInt(A.get("name").split("-")[2],10),$=t.selectedTickStyle;y[z].rect.attr($),t.startTickRectId=z;var ae=y.length,ce=z/ae;t.graph.emit(Xt,{value:[ce,ce]}),t.dragging=!0}),e.on("dragover",function(h){if(t.dragging&&h.target.get("type")==="rect"){for(var y=parseInt(h.target.get("name").split("-")[2],10),O=t.startTickRectId,A=t.tickRects,z=t.selectedTickStyle,$=t.unselectedTickStyle,ae=0;ae<A.length;ae++){var ce=ae>=O&&ae<=y?z:$;A[ae].rect.attr(ce)}var ue=A.length;t.endTickRectId=y;var ve=O/ue,Ce=y/ue;t.graph.emit(Xt,{value:[ve,Ce]})}}),e.on("drop",function(h){if(t.dragging&&(t.dragging=!1,h.target.get("type")==="rect")){var y=t.startTickRectId,O=parseInt(h.target.get("name").split("-")[2],10);if(!(O<y)){var A=t.selectedTickStyle,z=t.tickRects;z[O].rect.attr(A),t.endTickRectId=O;var $=z.length,ae=y/$,ce=O/$;t.graph.emit(Xt,{value:[ae,ce]})}}});var r=this,n=r.tooltipBackgroundColor,a=r.tooltipFomatter,i=r.canvas,o=new B({container:i.get("container"),backgroundColor:n}),u=this.tickRects;u.forEach(function(h){var y=h.pickRect;y.on("mouseenter",function(O){var A=O.target;if(A.get("type")==="rect"){var z=parseInt(A.get("name").split("-")[2],10),$=i.getClientByPoint(u[z].x,u[z].y);o.show({x:u[z].x,y:u[z].y,clientX:$.x,clientY:$.y,text:a?a(u[z].value):u[z].value})}}),y.on("mouseleave",function(O){o.hide()})});var l=this.group;l.on("".concat(gr,":click"),function(){t.isPlay=!t.isPlay,t.changePlayStatus()}),l.on("".concat(Er,":click"),function(){t.updateStartEnd(1)}),l.on("".concat(wr,":click"),function(){t.updateStartEnd(-1)}),l.on(Qt,function(h){var y=h.type,O=h.speed;t.currentSpeed=O})},E.prototype.changePlayStatus=function(t){t===void 0&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(Zt,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit(or,null))},E.prototype.startPlay=function(){var t=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var e=t.currentSpeed;t.frameCount%(60/e)===0&&(t.frameCount=0,t.updateStartEnd(1)),t.frameCount++,t.isPlay&&(t.playHandler=t.startPlay())}):void 0},E.prototype.updateStartEnd=function(t){var e=this,r=this.tickRects,n=r.length,a=this.unselectedTickStyle,i=this.selectedTickStyle,o=e.endTickRectId;if(t>0?e.endTickRectId++:(r[e.endTickRectId].rect.attr(a),e.endTickRectId--),o!==e.startTickRectId)e.endTickRectId<e.startTickRectId&&(e.startTickRectId=e.endTickRectId);else{for(var u=e.startTickRectId;u<=e.endTickRectId-1;u++)r[u].rect.attr(a);e.startTickRectId=e.endTickRectId}if(r[e.endTickRectId]){r[e.endTickRectId].rect.attr(i);var l=e.startTickRectId/n,h=e.endTickRectId/n;this.graph.emit(Xt,{value:[l,h]})}},E.prototype.destory=function(){var t=this.sliceGroup;t.off("click"),t.off("dragstart"),t.off("dragover"),t.off("drop"),this.tickRects.forEach(function(e){var r=e.pickRect;r.off("mouseenter"),r.off("mouseleave")}),this.tickRects.length=0,t.off("".concat(gr,":click")),t.off("".concat(Er,":click")),t.off("".concat(wr,":click")),t.off(Qt),this.sliceGroup.destroy()},E}(),Na=kn,Bn=F(21851),Ha=function(E,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,a;r<n;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return E.concat(a||Array.prototype.slice.call(t))};function Aa(E){return(0,s.map)(E,function(t,e){var r=e===0?"M":"L",n=t[0],a=t[1];return[r,n,a]})}function fa(E){return Aa(E)}function Wa(E){if(E.length<=2)return fa(E);var t=[];(0,s.each)(E,function(i){(0,s.isEqual)(i,t.slice(t.length-2))||t.push(i[0],i[1])});var e=mu.e9(t,!1),r=(0,s.head)(E),n=r[0],a=r[1];return e.unshift(["M",n,a]),e}function Za(E,t,e,r){r===void 0&&(r=!0);var n=new Bn.bJ({values:E}),a=new Bn.WD({values:(0,s.map)(E,function(o,u){return u})}),i=(0,s.map)(E,function(o,u){return[a.scale(u)*t,e-n.scale(o)*e]});return r?Wa(i):fa(i)}function pi(E,t,e,r){r===void 0&&(r=5);for(var n=new Bn.bJ({values:E}),a=new Bn.WD({values:(0,s.map)(E,function(O,A){return A})}),i=(0,s.map)(E,function(O,A){return[a.scale(A)*t,e-n.scale(O)*e]}),o=[],u=0;u<i.length;u++){var l=i[u],h={x:l[0],y:l[1],y0:e,size:r},y=Jn(h);o.push.apply(o,y)}return Ni(o)}function Di(E,t){var e=new Bn.bJ({values:E}),r=Math.max(0,e.min);return t-e.scale(r)*t}function ui(E,t,e,r){var n=Ha([],E,!0),a=Di(r,e);return n.push(["L",t,a]),n.push(["L",0,a]),n.push(["Z"]),n}function Jn(E){var t=E.x,e=E.y,r=E.y0,n=E.size,a,i;(0,s.isArray)(e)?(a=e[0],i=e[1]):(a=r,i=e);var o,u;(0,s.isArray)(t)?(o=t[0],u=t[1]):(o=t-n/2,u=t+n/2);var l=[{x:o,y:a},{x:o,y:i}];return l.push({x:u,y:i},{x:u,y:a}),l}function Ni(E,t){t===void 0&&(t=!0);var e=[],r=E[0];e.push(["M",r.x,r.y]);for(var n=1,a=E.length;n<a;n++)e.push(["L",E[n].x,E[n].y]);return t&&(e.push(["L",r.x,r.y]),e.push(["z"])),e}var ma=function(){return ma=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},ma.apply(this,arguments)},An={stroke:"#C5C5C5",strokeOpacity:.85},ca={fill:"#CACED4",opacity:.85},ba=function(){function E(t){var e=t.x,r=e===void 0?0:e,n=t.y,a=n===void 0?0:n,i=t.width,o=i===void 0?200:i,u=t.height,l=u===void 0?26:u,h=t.smooth,y=h===void 0?!0:h,O=t.isArea,A=O===void 0?!1:O,z=t.data,$=z===void 0?[]:z,ae=t.lineStyle,ce=t.areaStyle,ue=t.group,ve=t.interval,Ce=ve===void 0?null:ve;this.group=ue,this.x=r,this.y=a,this.width=o,this.height=l,this.data=$,this.smooth=y,this.isArea=A,this.lineStyle=Object.assign({},An,ae),this.areaStyle=Object.assign({},ca,ce),this.intervalConfig=Ce,this.renderLine()}return E.prototype.renderLine=function(){var t=this,e=t.x,r=t.y,n=t.width,a=t.height,i=t.barWidth,o=t.data,u=t.smooth,l=t.isArea,h=t.lineStyle,y=t.areaStyle,O=this.group.addGroup({name:"trend-group"});if(o){var A=Za(o,n,a,u);if(O.addShape("path",{attrs:ma({path:A},h),name:"trend-line"}),l){var z=ui(A,n,a,o);O.addShape("path",{attrs:ma({path:z},y),name:"trend-area"})}}this.intervalConfig&&O.addShape("path",{attrs:ma({path:pi(this.intervalConfig.data,n,a,this.intervalConfig.style.barWidth)},this.intervalConfig.style),name:"trend-interval"}),O.move(e,r)},E.prototype.destory=function(){this.group.destroy()},E}(),fi=ba,fo=function(){return fo=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},fo.apply(this,arguments)},lf={fill:"#1890ff",stroke:"#1890ff",type:"trend",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},rt={fill:"#fff",stroke:"#1890ff",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},$t=function(){function E(t){var e=t.group,r=t.name,n=t.type,a=t.x,i=a===void 0?0:a,o=t.y,u=o===void 0?0:o,l=t.width,h=l===void 0?2:l,y=t.height,O=y===void 0?24:y,A=t.style,z=A===void 0?{}:A;this.group=e,this.name=r,this.handleType=n,this.x=i,this.y=u,this.width=h,this.height=O,n==="trend"?this.style=fo(fo({},lf),z):n==="simple"&&(this.style=fo(fo({},rt),z)),this.renderHandle()}return E.prototype.setX=function(t){this.setXY(t,void 0)},E.prototype.setY=function(t){this.setXY(void 0,t)},E.prototype.setXY=function(t,e){(0,s.isNumber)(t)&&(this.x=t),(0,s.isNumber)(e)&&(this.y=e),this.updateXY()},E.prototype.renderHandle=function(){var t=this,e=t.width,r=t.height,n=t.style,a=t.name,i=n.fill,o=n.stroke,u=n.radius,l=n.opacity,h=n.cursor;this.handleGroup=this.group.addGroup(),this.handleType==="trend"?(this.verticalLine=this.handleGroup.addShape("rect",{attrs:{x:0,y:0,width:e,height:r,fill:i,stroke:o,radius:u,opacity:l,cursor:h},name:"".concat(a,"-handler")}),this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:e/2,y:0,r:2*e,fill:i,stroke:o,radius:u,opacity:l,cursor:h,lineAppendWidth:12},name:"".concat(a,"-handler")}),this.bottomCircle=this.handleGroup.addShape("circle",{attrs:{x:e/2,y:r,r:2*e,fill:i,stroke:o,radius:u,opacity:l,cursor:h},name:"".concat(a,"-handler")})):this.handleType==="simple"&&(this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:e/2,y:r/2,r:2*e,fill:i,stroke:o,radius:u,opacity:l,cursor:h,lineWidth:2},name:"".concat(a,"-handler")})),this.updateXY(),this.handleType==="trend"?this.bindTrendEvents():this.handleType==="simple"&&this.bindSimpleEvents()},E.prototype.bindSimpleEvents=function(){var t=this,e=this.name;this.handleGroup.on("".concat(e,"-handler:mouseenter"),function(){var r=t.style.highLightFill;t.topCircle.attr("fill",r)}),this.handleGroup.on("".concat(e,"-handler:mouseleave"),function(){var r=t.style.fill;t.topCircle.attr("fill",r)})},E.prototype.bindTrendEvents=function(){var t=this,e=this.name;this.handleGroup.on("".concat(e,"-handler:mouseenter"),function(){var r=t.style.highLightFill;t.verticalLine.attr("fill",r),t.topCircle.attr("fill",r),t.bottomCircle.attr("fill",r)}),this.handleGroup.on("".concat(e,"-handler:mouseleave"),function(){var r=t.style.fill;t.verticalLine.attr("fill",r),t.topCircle.attr("fill",r),t.bottomCircle.attr("fill",r)})},E.prototype.show=function(){this.handleGroup.show()},E.prototype.hide=function(){this.handleGroup.hide()},E.prototype.updateXY=function(){this.handleGroup.setMatrix([1,0,0,0,1,0,this.x,this.y,1])},E}(),Yt=$t,Lr=function(){return Lr=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},Lr.apply(this,arguments)},ia=Q.vs,Ze={fill:"#416180",opacity:.05},Fe={fill:"#416180",opacity:.15,radius:5},vt={fill:"#5B8FF9",opacity:.3,cursor:"grab"},Bt=2,Ut={width:Bt,height:24},Et={textBaseline:"middle",fill:"#000",opacity:.45},gt={textAlign:"center",textBaseline:"top",fill:"#607889",opacity:.35},Ot={lineWidth:1,stroke:"#ccc"},Ke=function(){function E(t){var e=this;this.prevX=0,this.onMouseDown=function(Yr){return function(Wr){e.currentHandler=Yr;var sn=Wr.originalEvent;sn.stopPropagation(),sn.preventDefault(),e.prevX=(0,s.get)(sn,"touches.0.pageX",sn.pageX);var wn=e.canvas.get("container");wn.addEventListener("mousemove",e.onMouseMove),wn.addEventListener("mouseup",e.onMouseUp),wn.addEventListener("mouseleave",e.onMouseUp),wn.addEventListener("touchmove",e.onMouseMove),wn.addEventListener("touchend",e.onMouseUp),wn.addEventListener("touchcancel",e.onMouseUp)}},this.onMouseMove=function(Yr){Yr.stopPropagation(),Yr.preventDefault();var Wr=(0,s.get)(Yr,"touches.0.pageX",Yr.pageX),sn=Wr-e.prevX,wn=e.adjustOffsetRange(sn/e.width);e.updateStartEnd(wn),e.updateUI(),e.prevX=Wr},this.onMouseUp=function(){e.currentHandler&&(e.currentHandler=void 0);var Yr=e.canvas.get("container");Yr&&(Yr.removeEventListener("mousemove",e.onMouseMove),Yr.removeEventListener("mouseup",e.onMouseUp),Yr.removeEventListener("mouseleave",e.onMouseUp),Yr.removeEventListener("touchmove",e.onMouseMove),Yr.removeEventListener("touchend",e.onMouseUp),Yr.removeEventListener("touchcancel",e.onMouseUp))};var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.width,u=o===void 0?100:o,l=t.height,h=t.padding,y=h===void 0?10:h,O=t.trendCfg,A=t.controllerCfg,z=A===void 0?{speed:1}:A,$=t.backgroundStyle,ae=$===void 0?{}:$,ce=t.foregroundStyle,ue=ce===void 0?{}:ce,ve=t.handlerStyle,Ce=ve===void 0?{}:ve,Re=t.textStyle,Ve=Re===void 0?{}:Re,Ue=t.start,$e=Ue===void 0?0:Ue,ot=t.end,et=ot===void 0?1:ot,yt=t.minText,Gt=yt===void 0?"":yt,yr=t.maxText,kr=yr===void 0?"":yr,Mr=t.group,dr=t.graph,hn=t.canvas,on=t.tick,cr=on===void 0?{tickLabelStyle:{},tickLineStyle:{},tickLabelFormatter:function(Wr){return Wr},ticks:[]}:on,Rr=t.type;this.graph=dr,this.canvas=hn,this.group=Mr,this.timeBarType=Rr,this.x=n,this.y=i,this.width=u,this.height=l,this.padding=y,this.ticks=cr.ticks,this.trendCfg=O,this.controllerCfg=z,this.currentSpeed=z.speed||1,this.tickLabelFormatter=cr.tickLabelFormatter,Rr==="trend"?this.backgroundStyle=Lr(Lr({},Ze),ae):Rr==="simple"&&(this.backgroundStyle=Lr(Lr({},Fe),ae)),this.foregroundStyle=Lr(Lr({},vt),ue),this.handlerStyle=Lr(Lr({},Ut),Ce),this.textStyle=Lr(Lr({},Et),Ve),this.tickLabelStyle=Lr(Lr({},gt),cr.tickLabelStyle),this.tickLineStyle=Lr(Lr({},Ot),cr.tickLineStyle),this.currentMode=z.defaultTimeType||pr.RANGE,this.start=$e,this.end=et,this.minText=Gt,this.maxText=kr,this.fontFamily=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlider()}return E.prototype.update=function(t){var e=t.x,r=t.y,n=t.width,a=t.height,i=t.minText,o=t.maxText,u=t.start,l=t.end;this.start=Math.min(1,Math.max(u,0)),this.end=Math.min(1,Math.max(l,0)),(0,s.assign)(this,{x:e,y:r,width:n,height:a,minText:i,maxText:o}),this.updateUI()},E.prototype.setText=function(t,e){this.minTextShape.attr("text",t),this.maxTextShape.attr("text",e)},E.prototype.renderSlider=function(){var t=this,e=this,r=e.width,n=e.height,a=e.timeBarType;if(a==="trend"&&(0,s.size)((0,s.get)(this.trendCfg,"data"))){var i=new fi(Lr(Lr({x:this.x,y:this.y,width:r,height:n},this.trendCfg),{group:this.group}));this.trendComponent=i}var o=this.group.addGroup({name:"slider-group"});o.addShape("rect",{attrs:Lr({x:0,y:0,width:r,height:n},this.backgroundStyle),name:"background"});var u=this.group.addGroup();a==="trend"?(this.minTextShape=u.addShape("text",{attrs:Lr({x:0,y:n/2+this.y,textAlign:"right",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=u.addShape("text",{attrs:Lr({y:n/2+this.y,textAlign:"left",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})):(this.minTextShape=u.addShape("text",{attrs:Lr({x:0,y:this.y-10,textAlign:"center",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=u.addShape("text",{attrs:Lr({y:this.y-10,textAlign:"center",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})),this.foregroundShape=this.group.addGroup().addShape("rect",{attrs:Lr({x:0,y:this.y,height:n},this.foregroundStyle),name:"foreground-shape"}),this.foregroundShape.on("mousedown",function(ce){ce.target.attr("cursor","grabbing")}),this.foregroundShape.on("mouseup",function(ce){ce.target.attr("cursor",t.foregroundStyle.cursor||"grab")});var l=(0,s.get)(this.handlerStyle,"width",2),h=(0,s.get)(this.handlerStyle,"height",24),y=this.group.addGroup({name:"minHandlerShape"});this.minHandlerShape=new Yt({name:"minHandlerShape",group:y,type:a,x:this.x,y:this.y,width:l,height:h,style:this.handlerStyle});var O=this.group.addGroup({name:"maxHandlerShape"});this.maxHandlerShape=new Yt({name:"maxHandlerShape",group:O,type:a,x:this.x,y:this.y,width:l,height:h,style:this.handlerStyle});var A=this.ticks,z=r/(A.length-1);this.tickPosList=[],this.textList&&this.textList.length&&this.textList.forEach(function(ce){ce.destroy()});var $=-1/0,ae=this.tickLabelStyle.rotate;delete this.tickLabelStyle.rotate,this.textList=A.map(function(ce,ue){t.tickPosList.push(t.x+ue*z);var ve;t.tickLabelFormatter?(ve=t.tickLabelFormatter(ce),!(0,s.isString)(ve)&&ve&&(ve=ce.date)):ve=ce.date;var Ce=t.x+ue*z,Re=t.y+n+5,Ve=t.group.addShape("text",{attrs:Lr({x:Ce,y:Re,text:ve,fontFamily:t.fontFamily||"Arial, sans-serif"},t.tickLabelStyle),name:"tick-label"});if((0,s.isNumber)(ae)&&ue!==A.length-1){var Ue=ia([1,0,0,0,1,0,0,0,1],[["t",-Ce,-Re],["r",ae],["t",Ce-5,Re+2]]);Ve.attr({textAlign:"left",matrix:Ue})}ue===0?Ve.attr({textAlign:"left"}):ue!==A.length-1&&Ve.attr({textAlign:"right"});var $e=t.group.addShape("line",{attrs:Lr({x1:t.x+ue*z,y1:t.y+n+2,x2:t.x+ue*z,y2:t.y+n+6},t.tickLineStyle),name:"tick-line"});$e.toBack();var ot=Ve.getBBox();return ot.minX>$?(Ve.show(),$e.show(),$=ot.minX+ot.width+10):(Ve.hide(),$e.hide()),Ve}),this.controllerBtnGroup=new Or(Lr({group:this.group,x:this.x,y:this.y+n+25,width:r,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),o.move(this.x,this.y),this.bindEvents(),this.currentMode===pr.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},E.prototype.bindEvents=function(){var t=this,e=this.group.find(function(n){return n.get("name")==="minHandlerShape"});e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var r=this.group.find(function(n){return n.get("name")==="maxHandlerShape"});r&&(r.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),r.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat(gr,":click"),function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()}),this.group.on("".concat(Er,":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()}),this.group.on("".concat(wr,":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()}),this.group.on(Qt,function(n){var a=n.type,i=n.speed;t.currentSpeed=i,t.currentMode=a,a===pr.SINGLE?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):a===pr.RANGE&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())})},E.prototype.adjustTickIndex=function(t){for(var e=0;e<this.tickPosList.length-1;e++)if(this.tickPosList[e]<=t&&t<=this.tickPosList[e+1])return Math.abs(this.tickPosList[e]-t)<Math.abs(t-this.tickPosList[e+1])?e:e+1;return 0},E.prototype.adjustOffsetRange=function(t){switch(this.currentHandler){case this.minHandlerShape:{var e=0-this.start,r=1-this.start;return Math.min(r,Math.max(e,t))}case this.maxHandlerShape:{var e=0-this.end,r=1-this.end;return Math.min(r,Math.max(e,t))}case this.foregroundShape:{var e=0-this.start,r=1-this.end;return Math.min(r,Math.max(e,t))}default:return 0}},E.prototype.updateStartEnd=function(t){var e=this.ticks[this.adjustTickIndex(this.start*this.width)],r=this.ticks[this.adjustTickIndex(this.end*this.width)];if(!this.currentHandler){this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e==null?void 0:e.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r==null?void 0:r.date;return}switch(this.currentHandler){case this.minHandlerShape:this.maxText=this.maxTextShape.attr("text"),this.start+=t,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e.date;break;case this.maxHandlerShape:this.minText=this.minTextShape.attr("text"),this.end+=t,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r.date;break;case this.foregroundShape:this.start+=t,this.end+=t,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r.date;break;default:break}},E.prototype.updateUI=function(){var t=this;this.start<0&&(this.start=0),this.start>1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var e=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",r-e);var n=(0,s.get)(this.handlerStyle,"width",Bt);this.setText(this.minText,this.maxText);var a=this.dodgeText([e,r]),i=a[0],o=a[1];this.minHandlerShape.setX(e-n/2),(0,s.each)(i,function(u,l){return t.minTextShape.attr(l,u)}),this.maxHandlerShape.setX(r-n/2),(0,s.each)(o,function(u,l){return t.maxTextShape.attr(l,u)}),this.currentMode===pr.RANGE?this.graph.emit(Xt,{value:[this.start,this.end].sort()}):this.currentMode===pr.SINGLE&&this.graph.emit(Xt,{value:[this.end,this.end]})},E.prototype.dodgeText=function(t){var e,r,n=2,a=(0,s.get)(this.handlerStyle,"width",Bt),i=this.minTextShape,o=this.maxTextShape,u=t[0],l=t[1],h=!1;u>l&&(e=[l,u],u=e[0],l=e[1],r=[o,i],i=r[0],o=r[1],h=!0);var y=i.getBBox(),O=o.getBBox(),A=null,z=null;return this.timeBarType==="trend"?(A=u-y.width<this.x+n?{x:u+a/2+n,textAlign:"left"}:{x:u-a/2-n,textAlign:"right"},z=l+O.width>this.x+this.width?{x:l-a/2-n,textAlign:"right"}:{x:l+a/2+n,textAlign:"left"}):this.timeBarType==="simple"&&(A=i.attr("x")>y.width?{x:u,textAlign:"center"}:{x:u,textAlign:"left"},z=o.attr("x")>this.width-O.width?{x:l,textAlign:"right"}:{x:l,textAlign:"center"}),h?[z,A]:[A,z]},E.prototype.startPlay=function(){var t=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var e=t,r=e.ticks,n=e.width,a=t.currentSpeed,i=n/r.length,o=i/((10-a)*1e3/60),u=t.adjustOffsetRange(o/t.width);t.updateStartEnd(u),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())}):void 0},E.prototype.changePlayStatus=function(t){t===void 0&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(Zt,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit(or,null))},E.prototype.destory=function(){this.graph.off(Xt,function(){});var t=this.group,e=t.find(function(n){return n.get("name")==="minHandlerShape"});e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var r=t.find(function(n){return n.get("name")==="maxHandlerShape"});r&&(r.off("maxHandlerShape-handler:mousedown"),r.off("maxHandlerShape-handler:touchstart"),r.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("".concat(gr,":click")),t.off("".concat(Er,":click")),t.off("".concat(wr,":click")),t.off(Qt),t.destroy(),this.trendComponent&&this.trendComponent.destory()},E}(),ct=Ke,Ye=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),At=function(){return At=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},At.apply(this,arguments)},Wt=function(E,t){var e={};for(var r in E)Object.prototype.hasOwnProperty.call(E,r)&&t.indexOf(r)<0&&(e[r]=E[r]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(E);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(E,r[n])&&(e[r[n]]=E[r[n]]);return e},sr=4,fr=26,rr=function(E){Ye(t,E);function t(e){var r=E.call(this,e)||this;return r.afterrenderListener=function(n){return r.filterData({})},r.valueChangeListener=(0,s.throttle)(function(n){return r.filterData(n)},200,{trailing:!0,leading:!0}),r.changeData=function(n){var a=r.get("graph");r.cacheGraphData=a.get("data"),r.filterData({})},r}return t.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-component-timebar",padding:10,type:"trend",trend:{data:[],isArea:!1,smooth:!0},controllerCfg:{speed:1,loop:!1},slider:{start:.1,end:.9,minText:"min",maxText:"max"},tick:{start:.1,end:.9,data:[]},textStyle:{},filterEdge:!1,filterItemTypes:["node"],containerCSS:{},putInGraphContainer:!0}},t.prototype.initContainer=function(){var e=this.get("graph"),r=this._cfgs,n=r.width,a=r.height,i=r.putInGraphContainer,o=this.get("className")||"g6-component-timebar",u=this.get("container"),l;if(u?((0,s.isString)(u)&&(u=document.getElementById(u)),l=u):(l=(0,ka.Z)("<div class='".concat(o,"'></div>")),(0,aa.Z)(l,{position:"relative"})),i){var h=this.get("graph").get("container");h.appendChild(l)}this.set("timeBarContainer",l);var y,O=e.get("renderer");O==="SVG"?y=new Wo.Canvas({container:l,width:n,height:a}):y=new Ji.Canvas({container:l,width:n,height:a}),this.get("containerCSS")&&(0,aa.Z)(l,this.get("containerCSS")),this.set("canvas",y)},t.prototype.init=function(){this.initContainer();var e=this.get("canvas"),r=e.addGroup({name:"timebar-group"});this.set("timeBarGroup",r),this.renderTrend(),this.initEvent();var n=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",n)},t.prototype.play=function(){this.togglePlay(!0)},t.prototype.pause=function(){this.togglePlay(!1)},t.prototype.togglePlay=function(e){var r=this.get("timebar");r&&(r.isPlay=!!e,r.changePlayStatus())},t.prototype.renderTrend=function(){var e=this,r=this._cfgs,n=r.width,a=r.x,i=r.y,o=r.padding,u=r.type,l=r.trend,h=r.slider,y=r.controllerCfg,O=r.textStyle,A=r.tick,z=r.backgroundStyle,$=r.foregroundStyle,ae=l.data,ce=Wt(l,["data"]),ue=n-2*o,ve=u==="trend"?fr:sr,Ce=this.get("graph"),Re=this.get("timeBarGroup"),Ve=this.get("canvas"),Ue=null;if(u==="trend"||u==="simple"){var $e=this.get("getValue");Ue=new ct(At(At({graph:Ce,canvas:Ve,group:Re,type:u,x:a+o,y:u==="trend"?i+o:i+o+15,width:ue,height:ve,padding:o,backgroundStyle:z,foregroundStyle:$,trendCfg:At(At({},ce),{data:ae.map(function(et){return($e==null?void 0:$e(et))||et.value})})},h),{tick:{ticks:ae,tickLabelFormatter:A.tickLabelFormatter,tickLabelStyle:A.tickLabelStyle,tickLineStyle:A.tickLineStyle},handlerStyle:At(At({},h.handlerStyle),{height:h.height||ve}),controllerCfg:y,textStyle:O}))}else u==="tick"&&(Ue=new Na(At({graph:Ce,canvas:Ve,group:Re,x:a+o,y:i+o,width:n,height:42,padding:2,controllerCfg:y},A)));var ot=function et(){var yt=e.get("timebar");yt.draggingHandler=!1,yt.isPlay&&(yt.isPlay=!1,yt.currentHandler=yt.maxHandlerShape,yt.changePlayStatus()),document.removeEventListener("mouseup",et)};Ve.on("mousedown",function(et){(et.target.get("name")==="maxHandlerShape-handler"||et.target.get("name")==="minHandlerShape-handler"||et.target===Ue.foregroundShape)&&document.addEventListener("mouseup",ot)}),this.set("timebar",Ue)},t.prototype.filterData=function(e){var r,n=e.value;if(!n){n=[];var a=this._cfgs.type;!a||a==="trend"||a==="simple"?(n[0]=this._cfgs.slider.start,n[1]=this._cfgs.slider.end):a==="tick"&&(n[0]=this._cfgs.tick.start,n[1]=this._cfgs.tick.end)}var i=null,o=this._cfgs.type;if(o==="trend"||o==="simple"?i=this._cfgs.trend.data:o==="tick"&&(i=this._cfgs.tick.data),!i||i.length===0){console.warn("\u8BF7\u914D\u7F6E TimeBar \u7EC4\u4EF6\u7684\u6570\u636E");return}var u=this.get("rangeChange"),l=this.get("graph"),h=Math.round(i.length*n[0]),y=Math.round(i.length*n[1]);y=y>=i.length?i.length-1:y,h=h>=i.length?i.length-1:h;var O=(r=this._cfgs.tick)===null||r===void 0?void 0:r.tickLabelFormatter,A=O?O(i[h]):i[h].date,z=O?O(i[y]):i[y].date;if(o!=="tick"){var $=this.get("timebar");$.setText(A,z)}if(u)u(l,A,z);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&this.cacheGraphData.nodes.length===0)&&(this.cacheGraphData=l.get("data"));var ae=this.get("filterItemTypes"),ce=this.get("changeData"),ue=this.get("getDate"),ve=this.get("shouldIgnore"),Ce=i[h].date,Re=i[y].date;if(ce||ce===void 0){var Ve=this.cacheGraphData.nodes,Ue=this.cacheGraphData.edges,$e={},ot={};l.getNodes().forEach(function(et){return $e[et.getID()]=!0}),l.getEdges().forEach(function(et){return ot[et.getID()]=!0}),ae.includes("node")&&(Ve==null||Ve.forEach(function(et){var yt=+((ue==null?void 0:ue(et))||et.date),Gt=yt>=Ce&&yt<=Re||(ve==null?void 0:ve("node",et,{min:Ce,max:Re})),yr=$e[et.id];yr&&!Gt?(l.removeItem(et.id),$e[et.id]=!1):!yr&&Gt&&(l.addItem("node",et),$e[et.id]=!0)}),Ue==null||Ue.forEach(function(et){var yt=$e[et.source]&&$e[et.target]||(ve==null?void 0:ve("edge",et,{min:Ce,max:Re})),Gt=!!l.findById(et.id);Gt&&!yt?(l.removeItem(et.id),ot[et.id]=!1):!Gt&&yt?(l.addItem("edge",et),ot[et.id]=!0):Gt||(ot[et.id]=!1)})),(this.get("filterEdge")||ae.includes("edge"))&&(Ue==null||Ue.filter(function(et){var yt=+((ue==null?void 0:ue(et))||et.date),Gt=yt>=Ce&&yt<=Re||(ve==null?void 0:ve("edge",et,{min:Ce,max:Re})),yr=$e[et.source]&&$e[et.target],kr=Gt&&yr,Mr=ot[et.id];Mr&&!kr?(ot[et.id]=!1,l.removeItem(et.id)):!Mr&&kr&&(ot[et.id]=!0,l.addItem("edge",et))}))}else ae.includes("node")&&l.getNodes().forEach(function(et){var yt=et.getModel();if(!(ve!=null&&ve("node",yt,{min:Ce,max:Re}))){var Gt=+((ue==null?void 0:ue(yt))||yt.date);Gt<Ce||Gt>Re?l.hideItem(et):l.showItem(et)}}),(this.get("filterEdge")||ae.includes("edge"))&&l.getEdges().forEach(function(et){var yt=et.getModel();if(!(ve!=null&&ve("edge",yt,{min:i[h].date,max:i[y].date}))){var Gt=+((ue==null?void 0:ue(yt))||yt.date);if(Gt<i[h].date||Gt>i[y].date)l.hideItem(et);else{var yr=et.getSource().isVisible(),kr=et.getTarget().isVisible();yr&&kr&&l.showItem(et)}}})}},t.prototype.initEvent=function(){var e=this.get("graph");e.on("afterchangedata",this.changeData),e.on("afterrender",this.afterrenderListener),e.on(Xt,this.valueChangeListener)},t.prototype.destroy=function(){var e=this.get("graph");e.off("afterchangedata",this.changeData),e.off("afterrender",this.afterrenderListener),e.off(Xt,this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),E.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var a=this.get("container");a||(a=this.get("graph").get("container")),(0,s.isString)(a)&&(a=document.getElementById(a)),a===n&&(a=a.parentElement),a.removeChild(n)}},t}(si),Tr=rr,En=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),qn=ei.applyMatrix;function ln(E,t){var e,r;if(E.naturalWidth)e=E.naturalWidth,r=E.naturalHeight;else{var n=new Image;n.src=E.src,n.onload=function(){t&&t(n.width,n.height)}}return[e,r]}var Ln=function(E){En(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},t.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},t.prototype.disableRefresh=function(){this.set("refresh",!1)},t.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},t.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},t.prototype.initViewport=function(){var e=this,r=this._cfgs,n=r.graph;if(!this.destroyed){var a=this.get("container");(0,s.isString)(a)&&(a=document.getElementById(a));var i=(0,ka.Z)("<div class=".concat(r.viewportClassName,`
style='position:absolute;
left:0;
top:0;
box-sizing:border-box;
border: 2px solid #1980ff;
cursor:move'
</div>`)),o=0,u=0,l=!1,h=0,y=0,O=0,A=0,z=0,$=0;a.addEventListener("mousedown",function(ae){if(r.refresh=!1,ae.target===i){var ce=i.style;O=parseInt(ce.width,10),A=parseInt(ce.height,10);var ue=e.get("width"),ve=e.get("height");O>ue||A>ve||($=n.getZoom(),z=e.get("ratio"),l=!0,o=ae.clientX,u=ae.clientY)}},!1),a.addEventListener("mousemove",function(ae){if(!(!l||(0,s.isNil)(ae.clientX)||(0,s.isNil)(ae.clientY))){var ce=e.get("width"),ue=e.get("height"),ve=i.style;h=parseInt(ve.left,10),y=parseInt(ve.top,10),O=parseInt(ve.width,10),A=parseInt(ve.height,10);var Ce=o-ae.clientX,Re=u-ae.clientY;h-Ce<0?Ce=h:h-Ce+O>=ce&&(Ce=0),y-Re<0?Re=y:y-Re+A>=ue&&(Re=0),h-=Ce,y-=Re,(0,aa.Z)(i,{left:"".concat(h,"px"),top:"".concat(y,"px")}),n.translate(Ce*$/z,Re*$/z),o=ae.clientX,u=ae.clientY}},!1),a.addEventListener("mouseleave",function(){l=!1,r.refresh=!0},!1),a.addEventListener("mouseup",function(){l=!1,r.refresh=!0},!1),this.set("viewport",i),a.appendChild(i)}},t.prototype.updateViewport=function(){if(!this.destroyed){var e=this.get("ratio"),r=this.get("width"),n=this.get("height"),a=this.get("graph"),i=a.get("width"),o=a.get("height"),u=i/o,l=a.getGroup(),h=l.getCanvasBBox(),y=[(h.minX+h.maxX)/2,(h.minY+h.maxY)/2],O=[h.maxX-h.minX,h.maxY-h.minY],A={centerX:y[0],centerY:y[1],width:0,height:0,minX:0,minY:0};h[0]/h[1]>u?(A.width=O[0],A.height=A.width/u):(A.height=O[1],A.width=A.height*u),A.minX=y[0]-A.width/2,A.minY=y[1]-A.height/2;var z=l.getMatrix();z||(z=[1,0,0,0,1,0,0,0,1]);var $=Fi.invert([1,0,0,0,1,0,0,0,1],z),ae=qn({x:A.minX,y:A.minY},$),ce=a.getCanvasByPoint(ae.x,ae.y),ue=this.get("viewport");ue||this.initViewport();var ve=i/A.width,Ce=ve*r,Re=ve*n,Ve=r*-ce.x/A.width,Ue=n*-ce.y/A.height,$e=Ve+Ce,ot=Ue+Re;Ve<0&&(Ce+=Ve,Ve=0),$e>r&&(Ce=Ce-($e-r)),Ue<0&&(Re+=Ue,Ue=0),ot>n&&(Re=Re-(ot-n)),this.set("ratio",e);var et="".concat(Ve,"px"),yt="".concat(Ue,"px");(0,aa.Z)(ue,{left:et,top:yt,width:"".concat(Ce,"px"),height:"".concat(Re,"px")})}},t.prototype.init=function(){this.initContainer()},t.prototype.initContainer=function(){var e=this,r=e.get("graph"),n=r.get("width"),a=r.get("height"),i=a/n,o=e.get("className"),u=e.get("container"),l=e.get("width"),h=e.get("height");!l&&!h&&(l=200),l?(h=i*l,e.set("height",h)):(l=1/i*h,e.set("width",l));var y=(0,ka.Z)("<div class='".concat(o,"' style='width: ").concat(l,"px; height: ").concat(h,"px; overflow: hidden; position: relative;'></div>"));(0,s.isString)(u)&&(u=document.getElementById(u)),u?u.appendChild(y):r.get("container").appendChild(y),e.set("container",y);var O=(0,ka.Z)('<div class="g6-minimap-container" style="position: relative; width: 100%; height: 100%; text-align: center; display: table;"></div>');y.appendChild(O);var A=(0,ka.Z)('<span style="display: table-cell; vertical-align: middle; "></span>');O.appendChild(A),e.set("containerDOM",O),e.set("containerSpan",A);var z=(0,ka.Z)('<img alt="" src="'.concat(this.get("graphImg"),'" style="display: inline-block; user-select: none;" draggable="false" />'));e.set("imgDOM",z),e.updateImgSize(),A.appendChild(z),e.updateCanvas()},t.prototype.updateImgSize=function(){var e=this,r=e.get("imgDOM"),n=e.get("width"),a=e.get("height");r.onload=function(){var i=ln(r);i[0]>i[1]?r.width=n:r.height=a}},t.prototype.updateCanvas=function(){var e=this.get("refresh");if(e){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var n=this.get("width"),a=r.get("canvas").getCanvasBBox(),i=a.width,o=n/i;this.set("ratio",o),this.updateViewport()}}},t.prototype.getViewport=function(){return this.get("viewport")},t.prototype.getContainer=function(){return this.get("container")},t.prototype.updateGraphImg=function(e){var r=this,n=r.get("imgDOM");n.remove(),r.set("graphImg",e);var a=(0,ka.Z)('<img alt="" src="'.concat(e,'" style="display: inline-block;" ondragstart="return false;" onselectstart="return false;"/>'));r.set("imgDOM",a),a.src=e,r.updateImgSize();var i=r.get("containerSpan");i.appendChild(a),r.updateCanvas()},t.prototype.destroy=function(){var e=this.get("container");e.parentNode.removeChild(e)},t}(si),Hn=Ln,wa=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ka=function(){return Ka=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},Ka.apply(this,arguments)},co=ei.distance,rl=.05,Oo={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:1,fill:"#fff"},wl=function(E){wa(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{type:"both",trigger:"mousemove",r:60,delegateStyle:(0,s.clone)(Oo),showLabel:"edge",scaleRBy:"wheel"}},t.prototype.getEvents=function(){var e;switch(this.get("trigger")){case"click":e={click:"filter"};break;case"drag":e={click:"createDelegate"};break;default:e={mousemove:"filter"};break}return e},t.prototype.init=function(){var e=this,r=e.get("showLabel"),n=r==="node"||r==="both",a=r==="edge"||r==="both";e.set("showNodeLabel",n),e.set("showEdgeLabel",a);var i=e.get("shouldShow");i||e.set("shouldShow",function(){return!0})},t.prototype.createDelegate=function(e){var r=this,n=r.get("delegate");(!n||n.destroyed)&&(r.filter(e),n=r.get("delegate"),n.on("dragstart",function(a){}),n.on("drag",function(a){r.filter(a)}),this.get("scaleRBy")==="wheel"&&n.on("mousewheel",function(a){r.scaleRByWheel(a)}))},t.prototype.scaleRByWheel=function(e){var r=this;if(!(!e||!e.originalEvent)){e.preventDefault&&e.preventDefault();var n=r.get("graph"),a,i=r.get("delegate"),o=i?{x:i.attr("x"),y:i.attr("y")}:void 0,u=o||n.getPointByClient(e.clientX,e.clientY);e.originalEvent.wheelDelta<0?a=1-rl:a=1/(1-rl);var l=r.get("maxR"),h=r.get("minR"),y=r.get("r");(y>(l||n.get("height"))&&a>1||y<(h||n.get("height")*.05)&&a<1)&&(a=1),y*=a,r.set("r",y),r.filter(e)}},t.prototype.filter=function(e){var r=this,n=r.get("graph"),a=n.getNodes(),i={},o=r.get("r"),u=r.get("type"),l={x:e.x,y:e.y};r.updateDelegate(l,o);var h=r.get("shouldShow"),y=r.get("vShapes");y&&y.forEach(function(ce){ce.remove(),ce.destroy()}),y=[],a.forEach(function(ce){var ue=ce.getModel(),ve=ue.x,Ce=ue.y;co({x:ve,y:Ce},l)<o&&(i[ue.id]=ce)});var O=n.getEdges(),A=[];O.forEach(function(ce){var ue=ce.getModel(),ve=ue.source,Ce=ue.target;h(ue)&&(u==="only-source"||u==="one"?i[ve]&&!i[Ce]&&A.push(ce):u==="only-target"||u==="one"?i[Ce]&&!i[ve]&&A.push(ce):u==="both"&&i[ve]&&i[Ce]&&A.push(ce))});var z=r.get("showNodeLabel"),$=r.get("showEdgelabel"),ae=n.get("group");A.forEach(function(ce){var ue=ce.get("group").get("children");ue.forEach(function(ve){var Ce=ve.get("type"),Re=ae.addShape(Ce,{attrs:ve.attr()});y.push(Re),z&&Ce==="text"&&Re.set("visible",!0)})}),Object.keys(i).forEach(function(ce){var ue=i[ce],ve=ue.get("group").clone();if(ae.add(ve),y.push(ve),$)for(var Ce=ve.get("children"),Re=0;Re<Ce.length;Re++){var Ve=Ce[Re];Ve.get("type")==="text"&&Ve.set("visible",!0)}}),r.set("vShapes",y)},t.prototype.updateParams=function(e){var r=this,n=e.r,a=e.trigger,i=e.minR,o=e.maxR,u=e.scaleRBy,l=e.showLabel,h=e.shouldShow;if(isNaN(e.r)||r.set("r",n),isNaN(o)||r.set("maxR",o),isNaN(i)||r.set("minR",i),(a==="mousemove"||a==="click")&&r.set("trigger",a),u==="wheel"||u==="unset"){r.set("scaleRBy",u),r.get("delegate").remove(),r.get("delegate").destroy();var y=r.get("dPercentText");y&&(y.remove(),y.destroy())}(l==="node"||l==="both")&&r.set("showNodeLabel",!0),(l==="edge"||l==="both")&&r.set("showEdgeLabel",!0),h&&r.set("shouldShow",h)},t.prototype.updateDelegate=function(e,r){var n=this,a=n.get("graph"),i=n.get("delegate");if(!i||i.destroyed){var o=a.get("group"),u=n.get("delegateStyle")||Oo;i=o.addShape("circle",{attrs:Ka({r,x:e.x,y:e.y},u),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&this.get("scaleRBy")==="wheel"&&i.on("mousewheel",function(l){n.scaleRByWheel(l)})}else i.attr({x:e.x,y:e.y,r});n.set("delegate",i)},t.prototype.clear=function(){var e=this,r=e.get("vShapes");r&&r.forEach(function(a){a.remove(),a.destroy()}),r=[],e.set("vShapes",r);var n=e.get("delegate");n&&!n.destroyed&&(n.remove(),n.destroy())},t.prototype.destroy=function(){this.clear()},t}(si),us=wl,Sl=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),Md=ei.pointLineDistance,Cd={stroke:"#FA8C16",lineWidth:1},Td=function(E){Sl(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{line:Cd,itemAlignType:"center",tolerance:5,horizontalLines:{},verticalLines:{},alignLines:[]}},t.prototype.init=function(){},t.prototype.getEvents=function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd"}},t.prototype.onDragStart=function(){this.initBoxLine()},t.prototype.onDrag=function(e){var r=e.item,n=r.get("delegateShape")||r,a=n.getBBox(),i=r.getModel(),o=i.x-a.x,u=i.y-a.y;this.show({x:a.minX+o,y:a.minY+u},{width:a.width,height:a.height})},t.prototype.onDragEnd=function(){this.destory()},t.prototype.initBoxLine=function(){var e=this._cfgs,r=e.horizontalLines,n=e.verticalLines,a=e.itemAlignType,i=this.get("graph"),o=i.getNodes();o.forEach(function(u){var l=u.getBBox(),h=u.get("id");a===!0||a==="horizontal"?(r["".concat(h,"tltr")]=[l.minX,l.minY,l.maxX,l.minY,u],r["".concat(h,"lcrc")]=[l.minX,l.centerY,l.maxX,l.centerY,u],r["".concat(h,"blbr")]=[l.minX,l.maxY,l.maxX,l.maxY,u]):a==="center"&&(r["".concat(h,"lcrc")]=[l.minX,l.centerY,l.maxX,l.centerY,u]),a===!0||a==="vertical"?(n["".concat(h,"tlbl")]=[l.minX,l.minY,l.minX,l.maxY,u],n["".concat(h,"tcbc")]=[l.centerX,l.minY,l.centerX,l.maxY,u],n["".concat(h,"trbr")]=[l.maxX,l.minY,l.maxX,l.maxY,u]):a==="center"&&(n["".concat(h,"tcbc")]=[l.centerX,l.minY,l.centerX,l.maxY,u])})},t.prototype.show=function(e,r){var n=(0,s.mix)({},e);return this.itemAlign(e,r,n),e},t.prototype.itemAlign=function(e,r,n){var a=this,i=this._cfgs,o=i.horizontalLines,u=i.verticalLines,l=i.tolerance,h={x:n.x+r.width/2,y:n.y},y={x:n.x+r.width/2,y:n.y+r.height/2},O={x:n.x+r.width/2,y:n.y+r.height},A={x:n.x,y:n.y+r.height/2},z={x:n.x+r.width,y:n.y+r.height/2},$=[],ae=[],ce=null;if(this.clearAlignLine(),(0,s.each)(o,function(ve){ve[4].isVisible&&($.push(a.getLineDisObject(ve,h)),$.push(a.getLineDisObject(ve,y)),$.push(a.getLineDisObject(ve,O)))}),(0,s.each)(u,function(ve){ve[4].isVisible&&(ae.push(a.getLineDisObject(ve,A)),ae.push(a.getLineDisObject(ve,y)),ae.push(a.getLineDisObject(ve,z)))}),$.sort(function(ve,Ce){return ve.dis-Ce.dis}),ae.sort(function(ve,Ce){return ve.dis-Ce.dis}),$.length!==0&&$[0].dis<l){e.y=$[0].line[1]-$[0].point.y+n.y,ce={type:"item",horizontals:[$[0]]};for(var ue=1;ue<3;ue++)$[0].dis===$[ue].dis&&ce.horizontals.push($[ue])}if(ae.length!==0&&ae[0].dis<l){e.x=ae[0].line[0]-ae[0].point.x+n.x,ce?ce.verticals=[ae[0]]:ce={type:"item",verticals:[ae[0]]};for(var ue=1;ue<3;ue++)ae[0].dis===ae[ue].dis&&ce.verticals.push(ae[ue])}ce&&(ce.bbox=r,this.addAlignLine(ce))},t.prototype.addAlignLine=function(e){var r=e.bbox,n=e.type,a=e.horizontals,i=e.verticals,o=this._cfgs,u=o.line,l=o.alignLines,h=this.get("graph"),y=h.get("group");n==="item"&&(a&&(0,s.each)(a,function(O){var A=O.line,z=O.point,$=(A[0]+A[2])/2,ae,ce;z.x<$?(ae=z.x-r.width/2,ce=Math.max(A[0],A[2])):(ae=z.x+r.width/2,ce=Math.min(A[0],A[2]));var ue=(0,s.mix)({x1:ae,y1:A[1],x2:ce,y2:A[1]},u),ve=y.addShape("line",{attrs:ue,capture:!1});l.push(ve)}),i&&(0,s.each)(i,function(O){var A=O.line,z=O.point,$=(A[1]+A[3])/2,ae,ce;z.y<$?(ae=z.y-r.height/2,ce=Math.max(A[1],A[3])):(ae=z.y+r.height/2,ce=Math.min(A[1],A[3]));var ue=(0,s.mix)({x1:A[0],y1:ae,x2:A[0],y2:ce},u),ve=y.addShape("line",{attrs:ue,capture:!1});l.push(ve)}))},t.prototype.getLineDisObject=function(e,r){return{line:e,point:r,dis:Md(e,r)}},t.prototype.getContainer=function(){return this.get("container")},t.prototype.clearAlignLine=function(){var e=this._cfgs.alignLines;(0,s.each)(e,function(r){r.remove()}),e.length=0},t.prototype.destory=function(){var e=this._cfgs,r=e.horizontalLines,n=e.verticalLines,a=this.get("graph"),i=a.getNodes();i.forEach(function(o){var u=o.get("id");delete r["".concat(u,"tltr")],delete r["".concat(u,"lcrc")],delete r["".concat(u,"blbr")],delete n["".concat(u,"tlbl")],delete n["".concat(u,"tcbc")],delete n["".concat(u,"trbr")]}),this.clearAlignLine()},t}(si),Id=Td,Ad=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),yi=function(){return yi=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},yi.apply(this,arguments)},Od=["click","mouseenter"],Ld=function(E){Ad(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{data:{},position:"top",padding:8,margin:8,offsetX:0,offsetY:0,layout:"horizontal",flipPage:!1,containerStyle:{},align:void 0,horiSep:8,vertiSep:8,filter:{enable:!1,trigger:"click"}}},t.prototype.init=function(){this.formatArray("padding"),this.formatArray("margin");var e=this.get("filter")||{},r=e.multiple;r&&e.trigger==="mouseenter"&&this.set("multiple",!1);var n=this.get("align");if(!n){var a=this.get("position").split("-");a.includes("left")&&(n="left"),a.includes("right")?n="right":n="center",this.set("align",n)}var i=this.get("graph"),o=i.get("container"),u=(0,ka.Z)(`<div class='g6-legend-container' style="position: absolute;"></div>`);o.appendChild(u),this.set("container",u);var l=this.render();(0,aa.Z)(u,this.getContainerPos(l)),this.bindEvents()},t.prototype.getContainerPos=function(e){e===void 0&&(e=[0,0]);var r=this,n=r.get("graph"),a=this.get("offsetX"),i=this.get("offsetY"),o=this.get("margin"),u=this.get("position").split("-"),l={top:0,right:1,bottom:2,left:3},h=0,y=0,O={left:(n.getWidth()-e[0])/2+h,top:(n.getHeight()-e[1])/2+y};return u.forEach(function(A){var z=o[l[A]],$=A;switch(A){case"top":z+=y;break;case"left":z+=h;break;case"bottom":z=n.getHeight()-e[1]-z+y,$="top";break;default:z=n.getWidth()-e[0]-z+h,$="left";break}O[$]=z}),O.top+=i+n.getContainer().offsetTop,O.left+=a+n.getContainer().offsetLeft,Object.keys(O).forEach(function(A){O[A]="".concat(O[A],"px")}),O},t.prototype.bindEvents=function(){var e=this,r=e.get("filter");if(!(!r||!r.enable)){var n=r.trigger||"click";Od.includes(n)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),n="click");var a=e.get("legendCanvas");n==="mouseenter"?(a.on("node-container:mouseenter",function(i){return e.filterData(i)}),a.on("node-container:mouseleave",function(i){e.clearFilter(),e.clearActiveLegend()})):(a.on("node-container:click",function(i){return e.filterData(i)}),a.on("click",function(i){i.target&&i.target.isCanvas&&i.target.isCanvas()&&(e.clearFilter(),e.clearActiveLegend())}))}},t.prototype.changeData=function(e){this.set("data",e);var r=this.render();(0,aa.Z)(this.get("container"),this.getContainerPos(r))},t.prototype.activateLegend=function(e){var r=this.get("filter"),n=r==null?void 0:r.multiple;n||this.clearActiveLegend();var a=e.get("parent");a.get("active")?(a.set("active",!1),this.findLegendItemsByState("active").length&&a.set("inactive",!0)):(a.set("inactive",!1),a.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(y){y.set("inactive",!0)}):this.clearActiveLegend();var i=(r==null?void 0:r.legendStateStyles)||{},o=(i==null?void 0:i.inactive)||{opacity:.5,"text-shape":{opacity:.5}},u=o["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(y){var O=y.get("children"),A=O[0],z=O[1];A.attr(yi(yi({},A.get("oriAttrs")),o)),z.attr(yi(yi({},z.get("oriAttrs")),u))});var l=(i==null?void 0:i.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},h=l["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(y){var O=y.get("children"),A=O[0],z=O[1];A.attr(yi(yi({},A.get("oriAttrs")),l)),z.attr(yi(yi({},z.get("oriAttrs")),h))})},t.prototype.findLegendItemsByState=function(e,r,n){r===void 0&&(r="all"),n===void 0&&(n=!0);var a=this.get("legendCanvas").find(function(u){return u.get("name")==="root"}),i=a.find(function(u){return u.get("name")==="node-group"}),o=a.find(function(u){return u.get("name")==="edge-group"});return r==="node"?i.get("children").filter(function(u){return!!u.get(e)===n}):r==="edge"?o.get("children").filter(function(u){return!!u.get(e)===n}):i.get("children").filter(function(u){return!!u.get(e)===n}).concat(o.get("children").filter(function(u){return!!u.get(e)===n}))},t.prototype.clearActiveLegend=function(){var e=this.get("legendCanvas"),r=e.find(function(a){return a.get("name")==="root"}),n=[r.find(function(a){return a.get("name")==="node-group"}),r.find(function(a){return a.get("name")==="edge-group"})];n.forEach(function(a){a.get("children").forEach(function(i){i.set("active",!1),i.set("inactive",!1);var o=i.get("children"),u=o[0],l=o[1];u.attr(u.get("oriAttrs")),l.attr(l.get("oriAttrs"))})})},t.prototype.filterData=function(e){var r=this.get("filter"),n=r==null?void 0:r.filterFunctions;if(!(!r||!n)){var a=this.get("legendCanvas"),i=this.get("graph"),o=r.graphActiveState||"active",u=r.graphInactiveState||"inactive",l=r.multiple;this.clearFilter(),l||this.clearActiveLegend(),this.activateLegend(e.target);var h=a.find(function(ce){return ce.get("name")==="root"}),y=h.find(function(ce){return ce.get("name")==="node-group"}),O=h.find(function(ce){return ce.get("name")==="edge-group"}),A=y.get("children").filter(function(ce){return ce.get("active")}),z=O.get("children").filter(function(ce){return ce.get("active")}),$=0,ae=["getNodes","getEdges"];ae.forEach(function(ce){i[ce]().forEach(function(ue){var ve=!1,Ce=ce==="getNodes"?A:z;Ce.forEach(function(Re){var Ve=n[Re.get("id")];ve=ve||Ve(ue.getModel())}),ve?(i.setItemState(ue,u,!1),i.setItemState(ue,o,!0),$++):(i.setItemState(ue,o,!1),i.setItemState(ue,u,!0))})}),$||ae.forEach(function(ce){i[ce]().forEach(function(ue){i.clearItemStates(ue,[u])})})}},t.prototype.clearFilter=function(){var e=this.get("graph"),r=this.get("filter");if(r){var n=r.graphActiveState||"active",a=r.graphInactiveState||"inactive";e.getNodes().forEach(function(i){e.clearItemStates(i,[n,a])}),e.getEdges().forEach(function(i){e.clearItemStates(i,[n,a])})}},t.prototype.render=function(){var e=this;this.processData();var r=this.get("legendCanvas");r?r.clear():r=new Ji.Canvas({container:this.get("container"),width:200,height:200});var n=r.addGroup({name:"root"}),a=n.addGroup({name:"node-group"}),i=n.addGroup({name:"edge-group"});this.set("legendCanvas",r);var o=this.get("itemsData"),u=["nodes","edges"],l=[a,i];u.forEach(function(dr,hn){o[dr].forEach(function(on){var cr,Rr=l[hn].addGroup({id:on.id,name:"node-container"}),Yr,Wr=on.type,sn=e.getShapeSize(on),wn=sn.width,la=sn.height,da=sn.r,Ra=e.getStyle(dr.substr(0,4),on);switch(on.type){case"circle":Yr={r:da,x:0,y:0};break;case"rect":Yr={width:wn,height:la,x:-wn/2,y:-la/2};break;case"ellipse":Yr={rx:wn,ry:la,x:0,y:0},Wr="ellipse";break;case"line":Yr={x1:-wn/2,y1:0,x2:wn/2,y2:0},Wr="line";break;case"quadratic":Yr={path:[["M",-wn/2,0],["Q",0,wn/2,wn/2,0]]},Wr="path";break;case"cubic":Yr={path:[["M",-wn/2,0],["C",-wn/6,wn/2,wn/6,-wn/2,wn/2,0]]},Wr="path";break;case"diamond":Yr={path:[["M",0,-la],["L",wn,0],["L",0,la],["L",-wn,0],["Z"]]},Wr="path";break;case"triangle":Yr={path:[["M",-wn,la],["L",0,-la],["L",wn,la],["Z"]]},Wr="path";break;case"star":Yr={path:ei.getStarPath(da*3,da*1.2)},Wr="path";break;default:Yr={r:da,x:0,y:0};break}var Ia=Rr.addShape(Wr,{attrs:yi(yi({},Yr),Ra),name:"".concat(on.type,"-node-keyShape"),oriAttrs:yi({opacity:1},Ra)});if(on.label){var Xa=Ia.getBBox(),Ga=((cr=on.labelCfg)===null||cr===void 0?void 0:cr.style)||{},ci=yi({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},Ga);Rr.addShape("text",{attrs:yi({x:Xa.maxX+4,y:0,text:on.label},ci),className:"legend-label",name:"".concat(on.type,"-node-text"),oriAttrs:ci})}})});var h=this.get("padding"),y,O=n.find(function(dr){return dr.get("name")==="title-container"}),A={height:0,maxY:0,width:0};if(this.get("title")){O||(O=n.addGroup({name:"title-container"}));var z={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:h[0]},$=this.get("titleConfig")||{},ae=Object.assign(z,$.style||{});y=O.addShape("text",{attrs:yi({text:this.get("title")},ae)}),A=O.getCanvasBBox(),O.setMatrix([1,0,0,0,1,0,$.offsetX,$.offsetY,1])}this.layoutItems();var ce=n.getCanvasBBox(),ue=a.getCanvasBBox(),ve=ue.minX<0?Math.abs(ue.minX)+h[3]:h[3],Ce=A.maxY<ue.minY?Math.abs(A.maxY-ue.minY)+h[0]:A.maxY+h[0],Re=[1,0,0,0,1,0,ve,Ce,1];a.setMatrix(Re),ce=n.getCanvasBBox();var Ve=[ce.minX+ce.width+h[1],ce.minY+ce.height+h[2]];if(y){var $=yi({position:"center",offsetX:0,offsetY:0},this.get("titleConfig"));A=O.getCanvasBBox();var Ue=O.getMatrix()||[1,0,0,0,1,0,0,0,1];$.position==="center"?Ue[6]=Ve[0]/2+$.offsetX:$.position==="right"?(Ue[6]=Ve[0]-h[3]+$.offsetX,y.attr({textAlign:"right"})):(Ue[6]=h[3]+$.offsetX,y.attr({textAlign:"left"})),O.setMatrix(Ue),A=O.getCanvasBBox(),ve=ue.minX<0?Math.abs(ue.minX)+h[3]:h[3],Ce=ue.minY<A.maxY?Math.abs(A.maxY-ue.minY)+h[0]:A.maxY+h[0],Re=[1,0,0,0,1,0,ve,Ce,1],a.setMatrix(Re);var $e=[1,0,0,0,1,0,ve,Ce,1];this.get("layout")==="vertical"?$e[6]+=ue.maxX+this.get("horiSep"):$e[7]+=ue.maxY+this.get("vertiSep"),i.setMatrix($e)}else{ue=a.getCanvasBBox();var ot=[1,0,0,0,1,0,0,0,1];this.get("layout")==="vertical"?ot[6]+=Re[6]+ue.maxX+this.get("horiSep"):ot[7]+=Re[7]+ue.maxY+this.get("vertiSep"),i.setMatrix(ot)}ce=n.getCanvasBBox(),ue=a.getCanvasBBox(),Re=a.getMatrix()||[1,0,0,0,1,0,0,0,1];var et=i.getMatrix()||[1,0,0,0,1,0,0,0,1],yt=i.getCanvasBBox();Ve=[Math.max(ue.width+Re[6],yt.width+et[6])+h[1],Math.max(ue.height+Re[7],yt.height+et[7])+h[2]],r.changeSize(Ve[0],Ve[1]);var Gt=this.get("containerStyle"),yr=n.getMatrix()||[1,0,0,0,1,0,0,0,1],kr=ei.invertMatrix({x:0,y:0},yr),Mr=n.addShape("rect",{attrs:yi({x:kr.x+(Gt.lineWidth||1),y:kr.y+(Gt.lineWidth||1),width:Ve[0]-2*(Gt.lineWidth||1),height:Ve[1]-2*(Gt.lineWidth||1),fill:"#f00",stroke:"#000",lineWidth:1,opacity:.5},Gt),name:"legend-back-rect",capture:!1});return Mr.toBack(),Ve},t.prototype.layoutItems=function(){var e=this.get("legendCanvas"),r=this.get("horiSep"),n=this.get("vertiSep"),a=this.get("layout"),i=this.get("align"),o=[0,0],u=e.find(function(Ce){return Ce.get("name")==="root"}),l=u.find(function(Ce){return Ce.get("name")==="node-group"}),h=u.find(function(Ce){return Ce.get("name")==="edge-group"}),y={min:0,max:-1/0},O=-1/0;l.get("children").forEach(function(Ce,Re){Re===0&&(y.min=o[0]);var Ve=Ce.get("children")[0],Ue=Ce.getCanvasBBox(),$e=Ve.getBBox(),ot=$e.width,et=$e.height,yt=0,Gt=0,yr=0;a==="vertical"?(Gt=o[1],yr=o[0]+ot/2,o[0]=yr+Ue.height+n,yt=Ue.maxX+Gt+ot/2):(Gt=o[0]+ot/2,yr=o[1],o[0]=Gt+Ue.width+r,yt=Ue.maxY+yr+et/2),o[0]>y.max&&(y.max=o[0]),yt>O&&(O=yt),Ce.setMatrix([1,0,0,0,1,0,Gt,yr,1])});var A=y.max-y.min,z={min:0,max:-1/0},$=l.getCanvasBBox();o[0]=0,o[1]=a==="vertical"?$.maxX+r:$.maxY+n,h.get("children").forEach(function(Ce,Re){Re===0&&(z.min=o[0]);var Ve=Ce.get("children")[0],Ue=Ce.getCanvasBBox(),$e=Ve.getBBox(),ot=$e.width,et=$e.height,yt=0,Gt=0;a==="vertical"?(yt=o[1],Gt=o[0],o[0]=Gt+Ue.height+n,Ce.setMatrix([1,0,0,0,1,0,0,Gt+et/2,1])):(yt=o[0],Gt=o[1],o[0]=yt+Ue.width+r,Ce.setMatrix([1,0,0,0,1,0,yt+ot/2,0,1])),o[0]>z.max&&(z.max=o[0])});var ae=z.max-z.min;if(i&&i!==""&&i!=="left"){var ce=A-ae,ue=i==="center"?Math.abs(ce)/2:Math.abs(ce),ve=ce<0?l:h;ve.get("children").forEach(function(Ce){var Re=Ce.getMatrix()||[1,0,0,0,1,0,0,0,1];a==="vertical"?Re[7]+=ue:Re[6]+=ue,Ce.setMatrix(Re)})}},t.prototype.processData=function(){var e=this.get("data"),r={nodes:[],edges:[]};e.nodes&&(e.nodes.sort(function(n,a){return n.order-a.order}),e.nodes.forEach(function(n){var a,i,o,u,l,h=n.size||[((a=n.style)===null||a===void 0?void 0:a.width)||((i=n.style)===null||i===void 0?void 0:i.r)||8,((o=n.style)===null||o===void 0?void 0:o.height)||((u=n.style)===null||u===void 0?void 0:u.r)||8],y=((l=n.labelCfg)===null||l===void 0?void 0:l.style)||{};r.nodes.push({id:n.id||(0,s.uniqueId)(),type:n.type||"circle",style:yi({},n.style),order:n.order,label:n.label,itemType:"node",size:h,labelCfg:{position:"right",style:yi({fontFamily:"Arial"},y)}})})),e.edges&&(e.edges.sort(function(n,a){return n.order-a.order}),e.edges.forEach(function(n){var a,i,o=n.type||"line";n.type==="cubic-horizontal"&&(o="cubic");var u=((a=n.labelCfg)===null||a===void 0?void 0:a.style)||{},l=n.size||[((i=n.style)===null||i===void 0?void 0:i.width)||8,1];r.edges.push({id:n.id||(0,s.uniqueId)(),type:o,size:l,style:yi({lineWidth:(0,s.isArray)(l)?l[1]:1},n.style),order:n.order,label:n.label,itemType:"edge",labelCfg:{position:"right",style:yi({fontFamily:"Arial"},u)}})})),this.set("itemsData",r)},t.prototype.getContainer=function(){return this.get("container")},t.prototype.formatArray=function(e){var r=this.get(e);if((0,s.isNumber)(r))this.set(e,[r,r,r,r]);else if((0,s.isArray)(r))switch(r.length){case 0:this.set(e,[0,0,0,0]);break;case 1:this.set(e,[r[0],r[0],r[0],r[0]]);break;case 2:this.set(e,[r[0],r[1],r[0],r[1]]);break;case 3:this.set(e,[r[0],r[1],r[2],r[1]]);break;default:break}return this.get(e)},t.prototype.getShapeSize=function(e){var r,n,a;return e.size&&((0,s.isArray)(e.size)?(r=e.size[0],n=e.size[1]||e.size[0],a=e.size[0]/2):(0,s.isNumber)(e.size)&&(r=e.size,n=e.size,a=e.size/2)),e.style&&(e.style.width&&(r=e.style.width),e.style.height&&(n=e.style.height),e.style.r&&(a=e.style.r)),a||(a=5),r||(r=a),n||(n=a),{width:r,height:n,r:a}},t.prototype.getStyle=function(e,r){var n=e==="node"?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1};return yi(yi({},n),r.style||{})},t.prototype.destroy=function(){var e=this.get("legendCanvas");e==null||e.destroy();var r=this.get("graph"),n=r.get("container"),a=this.get("container");n.removeChild(a)},t}(si),Dd=Ld,Nd=function(){var E=function(e,r){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},E(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");E(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),As=function(){return As=Object.assign||function(E){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(E[n]=t[n])}return E},As.apply(this,arguments)},Xl=function(E,t){var e={};for(var r in E)Object.prototype.hasOwnProperty.call(E,r)&&t.indexOf(r)<0&&(e[r]=E[r]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(E);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(E,r[n])&&(e[r[n]]=E[r[n]]);return e};typeof document!="undefined"&&Hf()(`
.g6-annotation-container {
background-color: rgba(255, 255, 255, 0.3);
padding: 8px;
}
.g6-annotation-wrapper {
background-color: #fff;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.85);
}
.g6-annotation-header-wapper {
height: fit-content;
width: 100%;
background-color: #5B8FF9;
display: inline-flex;
cursor: move;
}
.g6-annotation-title {
margin: 4px 40px 4px 8px;
cursor: text;
min-width: 32px;
}
.g6-annotation-collapse {
margin: 4px;
cursor: pointer;
}
.g6-annotation-expand {
margin: 4px;
cursor: pointer;
}
.g6-annotation-close {
margin: 4px 8px 4px 0;
cursor: pointer;
}
.g6-annotation-content {
padding: 8px;
width: fit-content;
cursor: text;
word-break: break-all;
min-width: 32px;
}
.g6-annotation-title-input-wrapper {
margin: 4px 40px 4px 8px;
}
.g6-annotation-content-input {
height: 100%;
word-break: break-all;
}
.g6-annotation-content-input-wrapper {
margin: 8px;
height: 100%;
}
`);var jl="canvas-annotation",Pd=function(E){Nd(t,E);function t(e){return E.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{trigger:"click",editable:!0,itemHighlightState:"highlight",linkHighlightStyle:{shadowColor:"#5B8FF9",shadowBlur:10},cardCfg:{minHeight:60,width:"fit-content",height:"fit-content",collapseType:"minimize",closeType:"hide",borderRadius:5,maxTitleLength:20}}},t.prototype.getEvents=function(){var e={viewportchange:"updateLinks",afterlayout:"updateLinks",aftergraphrefreshposition:"updateLinks",afterupdateitem:"updateLink",afterchangedata:"onGraphDataChange",afteritemvisibilitychange:"onGraphItemVisibilityChange"};switch(this.get("trigger")){case"click":e=As(As({},e),{"node:click":"showAnnotation","edge:click":"showAnnotation"})}return e},t.prototype.getDOMContent=function(e){if(!this.destroyed){var r=e.collapsed,n=e.maxWidth,a=e.title,i=a===void 0?"":a,o=e.content,u=o===void 0?"":o,l=e.borderRadius,h=l===void 0?5:l,y=r?"<p class='g6-annotation-expand'>+</p>":"<p class='g6-annotation-collapse'>-</p>",O=r?"":" <p class='g6-annotation-content'>".concat(u,"</p>"),A="<p class='g6-annotation-close'>x</p>",z=r?"".concat(h,"px"):"".concat(h,"px ").concat(h,"px 0 0");return'<div class="g6-annotation-wrapper" style="border-radius: '.concat(h,"px; max-width: ").concat(n,`px">
<div
class="g6-annotation-header-wapper"
style="border-radius: `).concat(z,`;"
>
<h4 class='g6-annotation-title'>`).concat(i,`</h4>
`).concat(y,`
`).concat(A,`
</div>
`).concat(O,`
</div>`)}},t.prototype.init=function(){var e=this;if(!e.destroyed){var r=e.get("graph"),n=r.getContainer(),a=e.get("container"),i=this.get("containerCfg");i?(a=this.createContainer(),n.appendChild(a)):a=n,this.set("container",a);var o=n.getBoundingClientRect(),u=new Ji.Canvas({container:n,width:o.right-o.left,height:o.bottom-o.top});(0,aa.Z)(u.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,s.debounce)(function(){return e.resizeCanvas(e)},100));var l=u.addGroup({id:"annotation-link-group"});e.set("linkGroup",l),e.set("canvas",u),e.get("getTitle")||e.set("getTitle",function(y){var O,A=((O=y==null?void 0:y.getModel)===null||O===void 0?void 0:O.call(y))||{},z=A.label,$=A.id;return z||$||"-"}),e.get("getContent")||e.set("getContent",function(y){var O,A;if(!y)return"-";var z=((O=y.getModel)===null||O===void 0?void 0:O.call(y))||{},$=z.label,ae=z.id,ce=(A=y.getType)===null||A===void 0?void 0:A.call(y),ue=ce?"".concat(ce,": "):"";return"".concat(ue).concat($||ae||"")});var h=e.get("defaultData");h&&this.readData(h)}},t.prototype.createContainer=function(){var e=this;if(!this.destroyed){var r=this.get("containerCfg"),n=this.get("graph"),a=n.getContainer(),i=a.getBoundingClientRect(),o=i.left,u=i.right,l=i.top,h=i.bottom,y=h-l,O=u-o,A=r.position,z=A===void 0?"top":A,$=r.offsetX,ae=$===void 0?0:$,ce=r.offsetY,ue=ce===void 0?0:ce,ve=Xl(r,["position","offsetX","offsetY"]),Ce=r.height,Re=Ce===void 0?"fit-content":Ce,Ve=r.width,Ue=Ve===void 0?n.getWidth():Ve;Re==="100%"&&(Re=y),Ue==="100%"&&(Ue=O);var $e="unset",ot="unset",et={};switch(z){case"right":$e="".concat(y,"px"),et={top:0,right:0},et.right+=o+ae,et.top+=l+ue;break;case"bottom":ot="".concat(O,"px"),et={bottom:0,left:0},et.left+=o+ae,et.bottom+=l+ue;break;case"top":ot="".concat(O,"px");case"left":$e="".concat(y,"px");default:et={top:0,left:0},et.left+=o+ae,et.top+=l+ue;break}Object.keys(et).forEach(function(Gt){et[Gt]="".concat(et[Gt],"px")});var yt=(0,ka.Z)("<div class='".concat(r.className," g6-annotation-container'></div>"));return(0,aa.Z)(yt,As(As({position:"absolute",display:z==="top"||z==="bottom"?"inline-flex":"unset",width:(0,s.isNumber)(Ue)?"".concat(Ue,"px"):Ue,height:(0,s.isNumber)(Re)?"".concat(Re,"px"):Re,maxHeight:$e,maxWidth:ot,overflow:"scroll"},et),ve)),a.appendChild(yt),yt.addEventListener("scroll",function(Gt){e.updateLinks()}),yt}},t.prototype.resizeCanvas=function(e){clearTimeout(e.resizeTimer),e.resizeTimer=setTimeout(function(){if(!(!e||e.destroyed)){var r=e.get("container").getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top;e.get("canvas").changeSize(n,a),e.updateOutsideCards(e)}},250)},t.prototype.updateOutsideCards=function(e){var r=e||this,n=r.get("cardInfoMap")||{},a=r.get("graph"),i=a.getPointByCanvas(0,0),o=a.getPointByCanvas(a.getWidth(),a.getHeight()),u=a.getClientByPoint(i.x,i.y),l=u.x,h=u.y,y=a.getClientByPoint(o.x,o.y),O=y.x,A=y.y;Object.values(n).forEach(function(z){var $=z.card;if($){var ae=$.style,ce=Dc(ae.left),ue=Dc(ae.top),ve=$.getBoundingClientRect(),Ce=ve.width,Re=ve.height,Ve=ce,Ue=ue;ce+Ce>O-l&&(Ve=O-l-Ce),ce<0&&(Ve=0),ue+Re>A-h&&(Ue=A-h-Re),ue<0&&(Ue=0),(0,aa.Z)($,{left:"".concat(Ve,"px"),top:"".concat(Ue,"px")})}}),r.updateLinks()},t.prototype.showAnnotation=function(e){if(!this.destroyed){var r=e.item;this.toggleAnnotation(r)}},t.prototype.hideCards=function(){var e=this;if(!e.destroyed){var r=e.get("cardInfoMap")||{};Object.keys(r).forEach(function(n){e.hideCard(n)})}},t.prototype.toggleAnnotation=function(e,r){var n,a;r===void 0&&(r={});var i=this;if(!i.destroyed){var o=i.get("cardInfoMap")||{},u=i.get("graph"),l=i.get("container"),h=i.get("containerCfg"),y=Object.assign({},i.get("cardCfg")||{},r),O=y.minHeight,A=y.minWidth,z=y.width,$=y.height,ae=y.collapsed,ce=ae===void 0?!1:ae,ue=y.x,ve=y.y,Ce=y.title,Re=y.content,Ve=y.maxTitleLength,Ue=y.defaultBegin,$e=Xl(y,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),ot=i.get("linkGroup"),et=this.get("rows")||[[]],yt=(n=e.isCanvas)===null||n===void 0?void 0:n.call(e),Gt=yt?jl:e.getID(),yr=o[Gt]||{},kr=yr.card,Mr=yr.link,dr=yr.x,hn=yr.y,on=yr.title,cr=yr.content,Rr=this.get("getTitle"),Yr=this.get("getContent"),Wr=this.get("getContentPlaceholder")||function(){return""},sn=this.get("getTitlePlaceHolder")||function(){return""},wn=Wr(e),la=sn(e),da=(0,ka.Z)(this.getDOMContent(As({itemId:Gt,collapsed:ce,title:((a=on||Ce||(Rr==null?void 0:Rr(e)))===null||a===void 0?void 0:a.substr(0,Ve))||la,content:cr||Re||(Yr==null?void 0:Yr(e))||wn},$e))),Ra=(0,s.isNumber)(O)?"".concat(O,"px"):O;(0,aa.Z)(da,{minHeight:ce?"unset":Ra,minWidth:(0,s.isNumber)(A)?"".concat(A,"px"):A,height:$,width:z});var Ia=!!kr;Ia?(Mr==null||Mr.remove(!0),l.replaceChild(da,kr)):l.appendChild(da);var Xa;if(!h){if(Xa=l.getBoundingClientRect()||{},ue!==void 0&&ve!==void 0)dr=ue,hn=ve;else if(!Ia&&!yt){var Ga=Xa.top,ci=Ue||{},ja=ci.left,Os=ci.right,ki=Os===void 0?16:Os,Ls=ci.top,Ri=Ls===void 0?8:Ls,Bi=ci.bottom,fs=ki,lo=Ri;isNaN(ja)||(fs=l.scrollWidth-ja),isNaN(Bi)||(lo=l.scrollHeight-Bi);var Lo=(0,s.isNumber)(A)?A:100;dr=l.scrollWidth-da.scrollWidth-(et.length-1)*Lo-fs;var pa=et[et.length-1],Oa=(pa[pa.length-1]||{}).bbox;hn=(Oa==null?void 0:Oa.bottom)-Ga||lo}(0,aa.Z)(da,{position:"absolute",left:"".concat(dr,"px"),top:"".concat(hn,"px"),cusor:h?"unset":"move"})}this.bindListener(da,Gt);var va=da.getBoundingClientRect();if(!yt){var La=Nl(e,va,u,this.get("canvas")),za=this.get("linkStyle");Mr=ot.addShape("path",{attrs:As({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:La},za)})}if(o[Gt]=As(As({},o[Gt]||{}),{id:Gt,collapsed:ce,card:da,link:Mr,x:dr,y:hn,cardBBox:va,content:cr||Re,title:on||Ce,contentPlaceholder:wn,titlePlaceholder:la,isCanvas:yt}),i.set("cardInfoMap",o),h)this.updateCardPositionsInConatainer(),this.updateLinks();else{var Pn=!isNaN(ue)&&!isNaN(ve);if(!Ia&&!yt&&!Pn){var Ea=Xa.bottom,xa=Ea===void 0?0:Ea,Ga=Xa.top;et[et.length-1].push({id:Gt,bbox:va}),va.top>xa-Ga-va.height-16&&et.push([]),this.set("rows",et)}}this.updateCardSize(Gt);var Ua=this.get("onAnnotationChange");Ua==null||Ua(o[Gt],Ia?"update":"create")}},t.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var r=this.get("container"),n=this.get("containerCfg").position,a=r.getBoundingClientRect().width,i=getComputedStyle(r),o=Dc(i.paddingLeft)+Dc(i.paddingRight);a-=o,Object.values(e).forEach(function(u){var l=u.card,h=l.getBoundingClientRect().width;switch(n){case"right":(0,aa.Z)(l,{marginLeft:a?"".concat(a-h,"px"):"0px"});break;case"top":case"bottom":(0,aa.Z)(l,{marginLeft:"8px"});default:break}})}}},t.prototype.handleExpandCollapseCard=function(e){if(!this.destroyed){var r=this.get("graph"),n=this.get("cardInfoMap");if(n){var a=n[e].collapsed,i=r.findById(e);if(i){var o=this.get("cardCfg").collapseType;o==="hide"&&!a?this.hideCard(e):this.toggleAnnotation(i,{collapsed:!a}),n[e]=As(As({},n[e]),{collapsed:!a})}}}},t.prototype.hideCard=function(e){if(!this.destroyed){var r=this.get("cardInfoMap");if(!(!r||!r[e])){var n=r[e],a=n.card,i=n.link;(0,aa.Z)(a,{display:"none"}),i==null||i.hide();var o=this.get("onAnnotationChange");o(r[e],"hide")}}},t.prototype.removeCard=function(e){if(!this.destroyed){var r=this.get("cardInfoMap");if(r){var n=r[e],a=n.card,i=n.link,o=this.get("container");o.removeChild(a),i==null||i.remove(!0),delete r[e];var u=this.get("onAnnotationChange");u(n,"remove")}}},t.prototype.bindListener=function(e,r){var n=this;if(!this.destroyed){e.addEventListener("mousemove",function(u){var l;if(u.target.className==="g6-annotation-collapse"?l="collapse":u.target.className==="g6-annotation-expand"?l="expand":u.target.className==="g6-annotation-close"&&(l="close"),l){var h=n.get("cardCfg").onMouseEnterIcon,y=h===void 0?function(){}:h;y(u,r,l)}}),e.addEventListener("mouseout",function(u){var l;if(u.target.className==="g6-annotation-collapse"?l="collapse":u.target.className==="g6-annotation-expand"?l="expand":u.target.className==="g6-annotation-close"&&(l="close"),l){var h=n.get("cardCfg").onMouseLeaveIcon,y=h===void 0?function(){}:h;y(u,r,l)}}),e.addEventListener("mouseenter",function(u){var l=n.get("cardInfoMap");if(l){var h=n.get("graph"),y=h.findById(r);if(y){var O=n.get("itemHighlightState");h.setItemState(y,O,!0)}var A=l[r].link;if(A){var z=n.get("linkHighlightStyle")||{};A.attr(z)}}}),e.addEventListener("mouseleave",function(u){var l=n.get("cardInfoMap");if(l){var h=n.get("graph"),y=h.findById(r);if(y){var O=n.get("itemHighlightState");h.setItemState(y,O,!1)}var A=l[r].link;if(A){var z=n.get("linkHighlightStyle")||{};Object.keys(z).forEach(function(ae){A.attr(ae,void 0),A.attr(ae,void 0)});var $=n.get("linkStyle");A.attr($)}}}),e.addEventListener("click",function(u){var l=(n.get("cardCfg")||{}).onClickIcon;if(u.target.className==="g6-annotation-collapse"||u.target.className==="g6-annotation-expand"){var h=n.get("cardCfg").collapseType;h==="hide"?n.hideCard(r):n.handleExpandCollapseCard(r),l==null||l(u,r,u.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(u.target.className==="g6-annotation-close"){var y=n.get("cardCfg").closeType;y==="remove"?n.removeCard(r):n.hideCard(r),l==null||l(u,r,"close")}});var a=this.get("editable");a&&e.addEventListener("dblclick",function(u){var l=n.get("cardInfoMap"),h=(n.get("cardCfg")||{}).maxTitleLength,y=h===void 0?20:h;if(l){var O=u.target,A=O.className;if(!(A!=="g6-annotation-title"&&A!=="g6-annotation-content")){var z=A==="g6-annotation-title"?O.getBoundingClientRect():O.parentNode.getBoundingClientRect(),$=z.width,ae=z.height,ce=getComputedStyle(O),ue=A==="g6-annotation-title"?"input":"textarea",ve=(0,ka.Z)("<".concat(ue,' class="').concat(A,'-input" type="textarea" style="width:').concat($,"px; height: ").concat(ae,'px; min-width: 16px;"/>')),Ce=(0,ka.Z)('<div class="'.concat(A,'-input-wrapper" style="width: ').concat($,"px; height: ").concat(ae,"px; min-width: 16px; margin-right: ").concat(ce.marginRight,'" />'));Ce.appendChild(ve),O.parentNode.replaceChild(Ce,O);var Re=l[r],Ve=Re.contentPlaceholder,Ue=Re.titlePlaceholder,$e=Re.content,ot=Re.title,et=$e;A==="g6-annotation-title"?(ve.name="title",ve.maxLength=y,et=ot):ve.name="content",et?(ve.innerHTML=O.innerHTML,ve.value=O.innerHTML):ve.placeholder=A==="g6-annotation-title"?Ue:Ve,ve.focus(),ve.addEventListener("blur",function(yt){ve.value&&(O.innerHTML=ve.value,Re[ve.name||"title"]=ve.value),Ce.parentNode.replaceChild(O,Ce),n.updateCardSize(r);var Gt=n.get("onAnnotationChange");Gt==null||Gt(Re,"update")})}}});var i=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];e.draggable=!0,e.addEventListener("dragstart",function(u){var l=u.target.className;if(!i.includes(l)){var h=e.style;n.set("dragging",{card:e,x:u.clientX,y:u.clientY,left:Dc(h.left),top:Dc(h.top)})}}),e.addEventListener("drag",function(u){u.preventDefault();var l=n.get("cardInfoMap");if(l){var h=u.clientX,y=u.clientY,O=n.get("dragging");if(!(isNaN(h)||isNaN(y)||!O)){var A=O.x,z=O.y,$=O.left,ae=O.top,ce=O.card,ue=h-A,ve=y-z;$+=ue,ae+=ve;var Ce=n.get("graph"),Re=Ce.getPointByCanvas(0,0),Ve=Ce.getPointByCanvas(Ce.getWidth(),Ce.getHeight()),Ue=Ce.getClientByPoint(Re.x,Re.y),$e=Ue.x,ot=Ue.y,et=Ce.getClientByPoint(Ve.x,Ve.y),yt=et.x,Gt=et.y,yr=ce.getBoundingClientRect(),kr=yr.right-yr.left,Mr=yr.bottom-yr.top;($>yt-$e-kr&&ue>0||$<0&&ue<0)&&($-=ue),(ae>Gt-ot-Mr&&ve>0||ae<0&&ve<0)&&(ae-=ve),(0,aa.Z)(ce,{left:"".concat($,"px"),top:"".concat(ae,"px"),visibility:"hidden"}),A=h,z=y;var dr=(l[r]||{}).link;if(dr){var hn=Ce.findById(r);dr.attr("path",Nl(hn,yr,Ce,n.get("canvas")))}n.set("dragging",{x:A,y:z,left:$,top:ae,card:ce})}}});var o=function(l){var h=n.get("cardInfoMap");if(h){var y=n.get("dragging");if(y){var O=y.left,A=y.top,z=y.card;h[r].x=O,h[r].y=A,(0,aa.Z)(z,{visibility:"visible"}),n.set("dragging",!1);var $=n.get("rows");$==null||$.forEach(function(ce){for(var ue=ce.length-1;ue>=0;ue--)ce[ue].id===r&&ce.splice(ue,1)});var ae=n.get("onAnnotationChange");ae==null||ae(h[r],"update")}}};e.addEventListener("dragend",o)}},t.prototype.updateCardSize=function(e){var r=this.get("cardInfoMap");if(r){var n=r[e].card,a=n.getBoundingClientRect().width,i=n.getElementsByClassName("g6-annotation-title")[0];if(i){var o=getComputedStyle(i),u=Dc(o.marginLeft),l=i.getBoundingClientRect().width;(0,aa.Z)(i,{marginRight:"".concat(a-u-24-16-l,"px")})}}},t.prototype.updateLink=function(e){var r=e.item;if(r){var n=this.get("cardInfoMap");if(n){var a=this.get("canvas"),i=this.get("graph"),o=r.getID(),u=n[o]||{},l=u.link,h=u.card;if(l){var y=Nl(r,h.getBoundingClientRect(),i,a);l.attr("path",y)}}}},t.prototype.updateLinks=function(){var e=this;if(!this.destroyed){var r=this.get("cardInfoMap");if(r){var n=this.get("graph");Object.values(r).forEach(function(a){var i=a.id,o=n.findById(i);e.updateLink({item:o})})}}},t.prototype.onGraphDataChange=function(){var e=this,r=this.get("cardInfoMap");if(r){var n=this.get("graph");Object.values(r).forEach(function(a){var i=a.id,o=a.card,u=a.isCanvas;if(!(!o||u||o.style.display==="none")){var l=n.findById(i);l&&l.isVisible()?e.toggleAnnotation(l):e.hideCard(i)}})}},t.prototype.onGraphItemVisibilityChange=function(e){var r=e.item,n=e.visible;if(!(!r||r.destroyed)){var a=this.get("cardInfoMap");if(a){var i=r.getID();a[i]&&(n||this.hideCard(i))}}},t.prototype.saveData=function(e){e===void 0&&(e=!1);var r=this.get("cardInfoMap");if(r){var n=this.get("graph"),a=this.get("getTitle"),i=this.get("getContent"),o=[];return Object.values(r).forEach(function(u){var l=u.title,h=u.content,y=u.x,O=u.y,A=u.id,z=u.collapsed,$=u.card;if(!($&&$.style.display==="none"&&!e)){var ae=n.findById(A)||n.get("canvas");o.push({id:A,x:y,y:O,collapsed:z,title:l||(a==null?void 0:a(ae)),content:h||(i==null?void 0:i(ae)),visible:$&&$.style.display!=="none"})}}),o}},t.prototype.readData=function(e){var r=this,n=this.get("graph");e.forEach(function(a){var i=a.id,o=a.x,u=a.y,l=a.title,h=a.content,y=a.collapsed,O=a.visible,A=n.findById(i);if(!A&&i===jl&&(A=n.get("canvas")),!A){var z=r.get("cardInfoMap")||{};z[i]=a,r.set("cardInfoMap",z);return}r.toggleAnnotation(A,{x:o,y:u,title:l,content:h,collapsed:y}),O||r.hideCard(i)})},t.prototype.clear=function(){var e=this.get("cardInfoMap");if(e){var r=this.get("container");Object.values(e).forEach(function(n){var a=n.card,i=n.link;r.removeChild(a),i==null||i.remove(!0)}),this.set("cardInfoMap",{})}},t.prototype.destroy=function(){var e;this.clear(),(e=this.get("canvas"))===null||e===void 0||e.destroy();var r=this.get("graph");!r||r.destroyed||(this.get("containerCfg")&&r.getContainer().removeChild(this.get("container")),this.destroyed=!0)},t}(si),kd=Pd,Rd=function(t,e){var r,n,a,i=1/0;Object.keys(t).forEach(function(l){var h=t[l];Object.keys(e).forEach(function(y){var O=e[y],A=h.x-O.x,z=h.y-O.y,$=A*A+z*z;i>$&&(i=$,r=h,n=O,a=[l,y])})});var o=20,u=ei.getControlPoint(r,n,.5,o);return[["M",r.x,r.y],["Q",u.x,u.y,n.x,n.y]]},Nl=function(t,e,r,n){var a,i,o=t.getType();if(o==="edge")i=[t.getKeyShape().getPoint(.5)];else{var u=(a=t.getKeyShape)===null||a===void 0?void 0:a.call(t).getBBox(),l=u.minX,h=u.minY,y=u.maxX,O=u.maxY,A=t.getModel(),z=A.x,$=A.y;l+=z,h+=$,y+=z,O+=$,i={left:{x:l,y:(h+O)/2},right:{x:y,y:(h+O)/2},top:{x:(l+y)/2,y:h},bottom:{x:(l+y)/2,y:O}}}Object.keys(i).forEach(function(ot){var et=i[ot],yt=et.x,Gt=et.y,yr=r.getClientByPoint(yt,Gt);i[ot]=n.getPointByClient(yr.x,yr.y)});var ae=e.top,ce=ae===void 0?0:ae,ue=e.left,ve=ue===void 0?0:ue,Ce=e.right,Re=Ce===void 0?0:Ce,Ve=e.bottom,Ue=Ve===void 0?0:Ve,$e={left:n.getPointByClient(ve,(ce+Ue)/2),right:n.getPointByClient(Re,(ce+Ue)/2),top:n.getPointByClient((ve+Re)/2,ce),bottom:n.getPointByClient((ve+Re)/2,Ue)};return Rd(i,$e)},Dc=function(t){return Number(t.replace(/\s+|px/gi,""))||0},Bd={PluginBase:si,Menu:Nu,Grid:gl,Minimap:Qf,Bundling:ml,ToolBar:ec,Tooltip:it,Fisheye:qf,TimeBar:Tr,ImageMinimap:Hn,EdgeFilterLens:us,SnapLine:Id,Legend:Dd,Annotation:kd},Fd=Bd,Pi=Fd;so("circle",{options:{size:Zr.defaultNode.size,style:{x:0,y:0,stroke:Zr.defaultNode.style.stroke,fill:Zr.defaultNode.style.fill,lineWidth:Zr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Zr.nodeLabel.style.fill,fontSize:Zr.nodeLabel.style.fontSize,fontFamily:Zr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Zr.defaultNode.linkPoints.size,lineWidth:Zr.defaultNode.linkPoints.lineWidth,fill:Zr.defaultNode.linkPoints.fill,stroke:Zr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,c.__assign)({},Zr.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=(0,s.deepMix)({},n,t.icon),o="".concat(this.type,"-keyShape"),u=e.addShape("circle",{attrs:a,className:o,name:o,draggable:!0});e.shapeMap[o]=u;var l=i.width,h=i.height,y=i.show,O=i.text;if(y){var A="".concat(this.type,"-icon");O?e.shapeMap[A]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:A,name:A,draggable:!0}):e.shapeMap[A]=e.addShape("image",{attrs:(0,c.__assign)({x:-l/2,y:-h/2},i),className:A,name:A,draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints;if(r){var n=r||{},a=n.top,i=n.left,o=n.right,u=n.bottom,l=n.size,h=n.r,y=(0,c.__rest)(n,["top","left","right","bottom","size","r"]),O=this.getSize(t),A=O[0]/2;if(i){var z="link-point-left";e.shapeMap[z]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:-A,y:0,r:l/2||h||5}),className:z,name:z,isAnchorPoint:!0})}if(o){var $="link-point-right";e.shapeMap[$]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:A,y:0,r:l/2||h||5}),className:$,name:$,isAnchorPoint:!0})}if(a){var ae="link-point-top";e.shapeMap[ae]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:-A,r:l/2||h||5}),className:ae,name:ae,isAnchorPoint:!0})}if(u){var ce="link-point-bottom";e.shapeMap[ce]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:A,r:l/2||h||5}),className:ce,name:ce,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.deepMix)({},e,r),a=this.getSize(t),i=a[0]/2,o=(0,c.__assign)({x:0,y:0,r:i},n);return o},update:function(t,e,r){var n=e.getContainer(),a=this.getSize(t),i=(0,c.__assign)({},t.style);t.style.stroke===void 0&&t.color&&(i.stroke=t.color),t.style.r===void 0&&!isNaN(a[0])&&(i.r=a[0]/2),this.updateShape(t,e,i,!0,r),this.updateLinkPoints(t,n)}},"single-node"),so("rect",{options:{size:[100,30],style:{radius:0,stroke:Zr.defaultNode.style.stroke,fill:Zr.defaultNode.style.fill,lineWidth:Zr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Zr.nodeLabel.style.fill,fontSize:Zr.nodeLabel.style.fontSize,fontFamily:Zr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Zr.defaultNode.linkPoints.size,lineWidth:Zr.defaultNode.linkPoints.lineWidth,fill:Zr.defaultNode.linkPoints.fill,stroke:Zr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,c.__assign)({},Zr.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=n,this.drawLinkPoints(t,e),n},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,u=n.bottom,l=n.size,h=n.r,y=(0,c.__rest)(n,["top","left","right","bottom","size","r"]),O=this.getSize(t),A=O[0],z=O[1];i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:-A/2,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:A/2,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:-z/2,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:z/2,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.mix)({},e,r),a=this.getSize(t),i=n.width||a[0],o=n.height||a[1],u=(0,c.__assign)({x:-i/2,y:-o/2,width:i,height:o},n);return u},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getSize(t),o=e.get("keyShape");t.size||(i[0]=o.attr("width")||a.width,i[1]=o.attr("height")||a.height);var u={stroke:t.color,x:-i[0]/2,y:-i[1]/2,width:i[0],height:i[1]},l=(0,s.mix)({},a,o.attr(),u);l=(0,s.mix)(l,t.style),this.updateShape(t,e,l,!1,r),this.updateLinkPoints(t,n)}},"single-node"),so("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Zr.defaultNode.style.stroke,fill:Zr.defaultNode.style.fill,lineWidth:Zr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Zr.nodeLabel.style.fill,fontSize:Zr.nodeLabel.style.fontSize,fontFamily:Zr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Zr.defaultNode.linkPoints.size,lineWidth:Zr.defaultNode.linkPoints.lineWidth,fill:Zr.defaultNode.linkPoints.fill,stroke:Zr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,c.__assign)({},Zr.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=e.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=i;var o=n.width,u=n.height,l=n.show,h=n.text;return l&&(h?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,c.__assign)({x:-o/2,y:-u/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,u=n.bottom,l=n.size,h=n.r,y=(0,c.__rest)(n,["top","left","right","bottom","size","r"]),O=this.getSize(t),A=O[0]/2,z=O[1]/2;i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:-A,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:A,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:-z,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:z,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.mix)({},e,r),a=this.getSize(t),i=a[0]/2,o=a[1]/2,u=(0,c.__assign)({x:0,y:0,rx:i,ry:o},n);return u},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getSize(t),o={stroke:t.color,rx:i[0]/2,ry:i[1]/2},u=e.get("keyShape"),l=(0,s.mix)({},a,u.attr(),o);l=(0,s.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)}},"single-node"),so("diamond",{options:{size:[80,80],style:{stroke:Zr.defaultNode.style.stroke,fill:Zr.defaultNode.style.fill,lineWidth:Zr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Zr.nodeLabel.style.fill,fontSize:Zr.nodeLabel.style.fontSize,fontFamily:Zr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Zr.defaultNode.linkPoints.size,lineWidth:Zr.defaultNode.linkPoints.lineWidth,fill:Zr.defaultNode.linkPoints.fill,stroke:Zr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,c.__assign)({},Zr.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=i;var o=n.width,u=n.height,l=n.show,h=n.text;return l&&(h?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,c.__assign)({x:-o/2,y:-u/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,u=n.bottom,l=n.size,h=n.r,y=(0,c.__rest)(n,["top","left","right","bottom","size","r"]),O=this.getSize(t),A=O[0],z=O[1];i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:-A/2,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:A/2,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:-z/2,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:z/2,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),r=e[0],n=e[1],a=[["M",0,-n/2],["L",r/2,0],["L",0,n/2],["L",-r/2,0],["Z"]];return a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.mix)({},e,r),a=this.getPath(t),i=(0,c.__assign)({path:a},n);return i},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},u=e.get("keyShape"),l=(0,s.mix)({},a,u.attr(),o);l=(0,s.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)}},"single-node"),so("triangle",{options:{size:40,direction:"up",style:{stroke:Zr.defaultNode.style.stroke,fill:Zr.defaultNode.style.fill,lineWidth:Zr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Zr.nodeLabel.style.fill,fontSize:Zr.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Zr.defaultNode.linkPoints.size,lineWidth:Zr.defaultNode.linkPoints.lineWidth,fill:Zr.defaultNode.linkPoints.fill,stroke:Zr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:(0,c.__assign)({},Zr.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.icon,a=n===void 0?{}:n,i=r.direction,o=this.getShapeStyle(t),u=t.direction||i,l=e.addShape("path",{attrs:o,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=l;var h=a.width,y=a.height,O=a.show,A=a.offset,z=a.text;if(O)if(z)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var $=-h/2,ae=-y/2;(u==="up"||u==="down")&&(ae+=A),(u==="left"||u==="right")&&($+=A),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,c.__assign)({x:$,y:ae},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),l},drawLinkPoints:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.linkPoints,a=n===void 0?{}:n,i=r.direction,o=t.direction||i,u=a.top,l=a.left,h=a.right,y=a.bottom,O=a.size,A=a.r,z=(0,c.__rest)(a,["top","left","right","bottom","size","r"]),$=this.getSize(t),ae=$[0];if(l){var ce=null,ue=ae*Math.sin(1/3*Math.PI),ve=ae*Math.sin(1/3*Math.PI);o==="up"?ce=[-ve,ue]:o==="down"?ce=[-ve,-ue]:o==="left"&&(ce=[-ve,ve-ue]),ce&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},z),{x:ce[0],y:ce[1],r:O/2||A||5}),className:"link-point-left",name:"link-point-left"}))}if(h){var Ce=null,ue=ae*Math.sin(1/3*Math.PI),ve=ae*Math.sin(1/3*Math.PI);o==="up"?Ce=[ve,ue]:o==="down"?Ce=[ve,-ue]:o==="right"&&(Ce=[ve,ve-ue]),Ce&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},z),{x:Ce[0],y:Ce[1],r:O/2||A||5}),className:"link-point-right",name:"link-point-right"}))}if(u){var Re=null,ue=ae*Math.sin(1/3*Math.PI),ve=ae*Math.sin(1/3*Math.PI);o==="up"?Re=[ve-ue,-ue]:o==="left"?Re=[ve,-ue]:o==="right"&&(Re=[-ve,-ue]),Re&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},z),{x:Re[0],y:Re[1],r:O/2||A||5}),className:"link-point-top",name:"link-point-top"}))}if(y){var Ve=null,ue=ae*Math.sin(1/3*Math.PI),ve=ae*Math.sin(1/3*Math.PI);o==="down"?Ve=[-ve+ue,ue]:o==="left"?Ve=[ve,ue]:o==="right"&&(Ve=[-ve,ue]),Ve&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},z),{x:Ve[0],y:Ve[1],r:O/2||A||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,r=t.direction||e,n=this.getSize(t),a=n[0],i=a*Math.sin(1/3*Math.PI),o=a*Math.sin(1/3*Math.PI),u=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return r==="down"?u=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:r==="left"?u=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:r==="right"&&(u=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),u},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.mix)({},e,r),a=this.getPath(t),i=(0,c.__assign)({path:a},n);return i},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},u=e.get("keyShape"),l=(0,s.mix)({},a,u.attr(),o);l=(0,s.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}),n=r.linkPoints,a=r.direction,i=t.direction||a,o=e.shapeMap["link-point-left"]||e.find(function(dr){return dr.get("className")==="link-point-left"}),u=e.shapeMap["link-point-right"]||e.find(function(dr){return dr.get("className")==="link-point-right"}),l=e.shapeMap["link-point-top"]||e.find(function(dr){return dr.get("className")==="link-point-top"}),h=e.shapeMap["link-point-bottom"]||e.find(function(dr){return dr.get("className")==="link-point-bottom"}),y=n,O=o||u||l||h;O&&(y=O.attr());var A=(0,s.mix)({},y,t.linkPoints),z=A.fill,$=A.stroke,ae=A.lineWidth,ce=A.size/2;ce||(ce=A.r);var ue=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},ve=ue.left,Ce=ue.right,Re=ue.top,Ve=ue.bottom,Ue=this.getSize(t),$e=Ue[0],ot={r:ce,fill:z,stroke:$,lineWidth:ae},et=null,yt=$e*Math.sin(1/3*Math.PI),Gt=$e*Math.sin(1/3*Math.PI);i==="up"?et=[-Gt,yt]:i==="down"?et=[-Gt,-yt]:i==="left"&&(et=[-Gt,Gt-yt]),et&&(o?!ve&&ve!==void 0?(o.remove(),delete e.shapeMap["link-point-left"]):o.attr((0,c.__assign)((0,c.__assign)({},ot),{x:et[0],y:et[1]})):ve&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},ot),{x:et[0],y:et[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var yr=null;i==="up"?yr=[Gt,yt]:i==="down"?yr=[Gt,-yt]:i==="right"&&(yr=[Gt,Gt-yt]),yr&&(u?!Ce&&Ce!==void 0?(u.remove(),delete e.shapeMap["link-point-right"]):u.attr((0,c.__assign)((0,c.__assign)({},ot),{x:yr[0],y:yr[1]})):Ce&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},ot),{x:yr[0],y:yr[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var kr=null;i==="up"?kr=[Gt-yt,-yt]:i==="left"?kr=[Gt,-yt]:i==="right"&&(kr=[-Gt,-yt]),kr&&(l?!Re&&Re!==void 0?(l.remove(),delete e.shapeMap["link-point-top"]):l.attr((0,c.__assign)((0,c.__assign)({},ot),{x:kr[0],y:kr[1]})):Re&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},ot),{x:kr[0],y:kr[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var Mr=null;i==="down"?Mr=[-Gt+yt,yt]:i==="left"?Mr=[Gt,yt]:i==="right"&&(Mr=[-Gt,yt]),Mr&&(h?!Ve&&Ve!==void 0?(h.remove(),delete e.shapeMap["link-point-bottom"]):h.attr((0,c.__assign)((0,c.__assign)({},ot),{x:Mr[0],y:Mr[1]})):Ve&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},ot),{x:Mr[0],y:Mr[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),so("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Zr.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Zr.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Zr.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).preRect,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=this.getSize(t),o=i[0],u=i[1],l=e.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=l;var h=n.show,y=(0,c.__rest)(n,["show"]);return h&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:(0,c.__assign)({x:-o/2,y:-u/2,height:u},y),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),l},drawLogoIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).logoIcon,n=r===void 0?{}:r,a=this.getSize(t),i=a[0];if(n.show){var o=n.width,u=n.height,l=n.x,h=n.y,y=n.offset,O=n.text,A=(0,c.__rest)(n,["width","height","x","y","offset","text"]);O?e.shapeMap["rect-logo-icon"]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},A),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.shapeMap["rect-logo-icon"]=e.addShape("image",{attrs:(0,c.__assign)((0,c.__assign)({},A),{x:l||-i/2+o+y,y:h||-u/2,width:o,height:u}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).stateIcon,n=r===void 0?{}:r,a=this.getSize(t),i=a[0];if(n.show){var o=n.width,u=n.height,l=n.x,h=n.y,y=n.offset,O=n.text,A=(0,c.__rest)(n,["width","height","x","y","offset","text"]);O?e.shapeMap["rect-state-icon"]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},A),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.shapeMap["rect-state-icon"]=e.addShape("image",{attrs:(0,c.__assign)((0,c.__assign)({},A),{x:l||i/2-o+y,y:h||-u/2,width:o,height:u}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,u=n.bottom,l=n.size,h=n.r,y=(0,c.__rest)(n,["top","left","right","bottom","size","r"]),O=this.getSize(t),A=O[0],z=O[1];i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:-A/2,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:A/2,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:-z/2,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},y),{x:0,y:z/2,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var r=this.getOptions(t),n=r.labelCfg,a=n===void 0?{}:n,i=r.logoIcon,o=i===void 0?{}:i,u=r.descriptionCfg,l=u===void 0?{}:u,h=this.getSize(t),y=h[0],O=null,A=o.show,z=o.width,$=-y/2+a.offset;A&&($=-y/2+z+a.offset);var ae=a.style,ce=l.style,ue=l.paddingTop;return(0,s.isString)(t.description)?(O=e.addShape("text",{attrs:(0,c.__assign)((0,c.__assign)({},ae),{x:$,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=O,e.shapeMap["rect-description"]=e.addShape("text",{attrs:(0,c.__assign)((0,c.__assign)({},ce),{x:$,y:17+(ue||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(O=e.addShape("text",{attrs:(0,c.__assign)((0,c.__assign)({},ae),{x:$,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=O),O},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.mix)({},e,r),a=this.getSize(t),i=n.width||a[0],o=n.height||a[1],u=(0,c.__assign)({x:-i/2,y:-o/2,width:i,height:o},n);return u},update:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.style,a=n===void 0?{}:n,i=r.labelCfg,o=i===void 0?{}:i,u=r.descriptionCfg,l=u===void 0?{}:u,h=this.getSize(t),y=h[0],O=h[1],A=e.get("keyShape");A.attr((0,c.__assign)((0,c.__assign)({},a),{x:-y/2,y:-O/2,width:y,height:O}));var z=e.getContainer(),$=z.shapeMap["rect-logo-icon"]||z.find(function(da){return da.get("className")==="rect-logo-icon"}),ae=$?$.attr():{},ce=(0,s.mix)({},ae,t.logoIcon),ue=ce.width;ue===void 0&&(ue=this.options.logoIcon.width);var ve=t.logoIcon?t.logoIcon.show:void 0,Ce=o.offset,Re=-y/2+ue+Ce;!ve&&ve!==void 0&&(Re=-y/2+Ce);var Ve=z.shapeMap["node-label"]||z.find(function(da){return da.get("className")==="node-label"}),Ue=z.shapeMap["rect-description"]||z.find(function(da){return da.get("className")==="rect-description"});if(t.label)if(!Ve)z.shapeMap["node-label"]=z.addShape("text",{attrs:(0,c.__assign)((0,c.__assign)({},o.style),{x:Re,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var $e=t.labelCfg?t.labelCfg.style:{},ot=(0,s.mix)({},Ve.attr(),$e);t.label&&(ot.text=t.label),ot.x=Re,(0,s.isString)(t.description)&&(ot.y=-5),Ue&&(Ue.resetMatrix(),Ue.attr({x:Re})),Ve.resetMatrix(),Ve.attr(ot)}if((0,s.isString)(t.description)){var et=l.paddingTop;if(!Ue)z.shapeMap["rect-description"]=z.addShape("text",{attrs:(0,c.__assign)((0,c.__assign)({},l.style),{x:Re,y:17+(et||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var $e=t.descriptionCfg?t.descriptionCfg.style:{},yt=(0,s.mix)({},Ue.attr(),$e);(0,s.isString)(t.description)&&(yt.text=t.description),yt.x=Re,Ue.resetMatrix(),Ue.attr((0,c.__assign)((0,c.__assign)({},yt),{y:17+(et||0)}))}}var Gt=z.shapeMap["pre-rect"]||z.find(function(da){return da.get("className")==="pre-rect"});if(Gt&&!Gt.destroyed){var yr=(0,s.mix)({},Gt.attr(),t.preRect);Gt.attr((0,c.__assign)((0,c.__assign)({},yr),{x:-y/2,y:-O/2,height:O}))}if($&&!$.destroyed)if(!ve&&ve!==void 0)$.remove(),delete z.shapeMap["pre-rect"];else{var kr=ce.width,Mr=ce.height,dr=ce.x,hn=ce.y,on=ce.offset,cr=(0,c.__rest)(ce,["width","height","x","y","offset"]);$.attr((0,c.__assign)((0,c.__assign)({},cr),{x:dr||-y/2+kr+on,y:hn||-Mr/2,width:kr,height:Mr}))}else ve&&this.drawLogoIcon(t,z);var Rr=z.shapeMap["rect-state-icon"]||z.find(function(da){return da.get("className")==="rect-state-icon"}),Yr=Rr?Rr.attr():{},Wr=(0,s.mix)({},Yr,t.stateIcon);if(Rr){!Wr.show&&Wr.show!==void 0&&(Rr.remove(),delete z.shapeMap["rect-state-icon"]);var sn=Wr.width,Mr=Wr.height,dr=Wr.x,hn=Wr.y,wn=Wr.offset,la=(0,c.__rest)(Wr,["width","height","x","y","offset"]);Rr.attr((0,c.__assign)((0,c.__assign)({},la),{x:dr||y/2-sn+wn,y:hn||-Mr/2,width:sn,height:Mr}))}else Wr.show&&this.drawStateIcon(t,z);this.updateLinkPoints(t,z)},getOptions:function(t,e){return e==="move"?t:(0,s.deepMix)({},this.options,this.getCustomConfig(t)||{},t)}},"single-node"),so("star",{options:{size:60,style:{stroke:Zr.defaultNode.style.stroke,fill:Zr.defaultNode.style.fill,lineWidth:Zr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Zr.nodeLabel.style.fill,fontSize:Zr.nodeLabel.style.fontSize,fontFamily:Zr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Zr.defaultNode.linkPoints.size,lineWidth:Zr.defaultNode.linkPoints.lineWidth,fill:Zr.defaultNode.linkPoints.fill,stroke:Zr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,c.__assign)({},Zr.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=i;var o=n.width,u=n.height,l=n.show,h=n.text;return l&&(h?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,c.__assign)({x:-o/2,y:-u/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,u=n.leftBottom,l=n.rightBottom,h=n.size,y=n.r,O=(0,c.__rest)(n,["top","left","right","leftBottom","rightBottom","size","r"]),A=this.getSize(t),z=A[0];if(o){var $=Math.cos(.1*Math.PI)*z,ae=Math.sin((18+72*0)/180*Math.PI)*z;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},O),{x:$,y:-ae,r:h/2||y||5}),className:"link-point-right",name:"link-point-right"})}if(a){var $=Math.cos(.5*Math.PI)*z,ae=Math.sin((18+72*1)/180*Math.PI)*z;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},O),{x:$,y:-ae,r:h/2||y||5}),className:"link-point-top",name:"link-point-top"})}if(i){var $=Math.cos(.9*Math.PI)*z,ae=Math.sin((18+72*2)/180*Math.PI)*z;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},O),{x:$,y:-ae,r:h/2||y||5}),className:"link-point-left",name:"link-point-left"})}if(u){var $=Math.cos(1.3*Math.PI)*z,ae=Math.sin((18+72*3)/180*Math.PI)*z;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},O),{x:$,y:-ae,r:h/2||y||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(l){var $=Math.cos(1.7*Math.PI)*z,ae=Math.sin((18+72*4)/180*Math.PI)*z;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},O),{x:$,y:-ae,r:h/2||y||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t),r=e[0],n=r*3/8,a=t.innerR||n;return ei.getStarPath(r,a)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,s.mix)({},e,r),a=this.getPath(t),i=(0,c.__assign)({path:a},n);return i},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},u=e.get("keyShape"),l=(0,s.mix)({},a,u.attr(),o);l=(0,s.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}).linkPoints,n=e.shapeMap["link-point-left"]||e.find(function(yt){return yt.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(yt){return yt.get("className")==="link-point-right"}),i=e.shapeMap["link-point-top"]||e.find(function(yt){return yt.get("className")==="link-point-top"}),o=e.shapeMap["link-point-left-bottom"]||e.find(function(yt){return yt.get("className")==="link-point-left-bottom"}),u=e.shapeMap["link-point-left-bottom"]||e.find(function(yt){return yt.get("className")==="link-point-right-bottom"}),l=r,h=n||a||i||o||u;h&&(l=h.attr());var y=(0,s.mix)({},l,t.linkPoints),O=y.fill,A=y.stroke,z=y.lineWidth,$=y.size/2;$||($=y.r);var ae=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},ce=ae.left,ue=ae.right,ve=ae.top,Ce=ae.leftBottom,Re=ae.rightBottom,Ve=this.getSize(t),Ue=Ve[0],$e={r:$,fill:O,stroke:A,lineWidth:z},ot=Math.cos((18+72*0)/180*Math.PI)*Ue,et=Math.sin((18+72*0)/180*Math.PI)*Ue;a?!ue&&ue!==void 0?(a.remove(),delete e.shapeMap["link-point-right"]):a.attr((0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et})):ue&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),ot=Math.cos((18+72*1)/180*Math.PI)*Ue,et=Math.sin((18+72*1)/180*Math.PI)*Ue,i?!ve&&ve!==void 0?(i.remove(),delete e.shapeMap["link-point-top"]):i.attr((0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et})):ve&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),ot=Math.cos((18+72*2)/180*Math.PI)*Ue,et=Math.sin((18+72*2)/180*Math.PI)*Ue,n?!ce&&ce!==void 0?(n.remove(),delete e.shapeMap["link-point-left"]):n.attr((0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et})):ce&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),ot=Math.cos((18+72*3)/180*Math.PI)*Ue,et=Math.sin((18+72*3)/180*Math.PI)*Ue,o?!Ce&&Ce!==void 0?(o.remove(),delete e.shapeMap["link-point-left-bottom"]):o.attr((0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et})):Ce&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),ot=Math.cos((18+72*4)/180*Math.PI)*Ue,et=Math.sin((18+72*4)/180*Math.PI)*Ue,u?!Re&&Re!==void 0?(u.remove(),delete e.shapeMap["link-point-right-bottom"]):u.attr((0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et})):Re&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,c.__assign)((0,c.__assign)({},$e),{x:ot,y:-et}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var Vl=ei.defaultSubjectColors,El="fan-shape-";so("donut",{options:{size:Zr.defaultNode.size,style:{x:0,y:0,stroke:Zr.defaultNode.style.stroke,fill:Zr.defaultNode.style.fill,lineWidth:Zr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Zr.nodeLabel.style.fill,fontSize:Zr.nodeLabel.style.fontSize,fontFamily:Zr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Zr.defaultNode.linkPoints.size,lineWidth:Zr.defaultNode.linkPoints.lineWidth,fill:Zr.defaultNode.linkPoints.fill,stroke:Zr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,c.__assign)({},Zr.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=(0,s.deepMix)({},n,t.icon),o=e.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=o;var u=i.width,l=i.height,h=i.show,y=i.text;return h&&(y?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,c.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,c.__assign)({x:-u/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),Gd(t,e,o),this.drawLinkPoints(t,e),o},updateShape:function(t,e,r,n,a){var i=e.get("keyShape");i.attr((0,c.__assign)({},r)),zd(t,e,i),this.updateLabel(t,e,a),n&&this.updateIcon(t,e)}},"circle");var Gd=function(t,e,r){var n=t.donutAttrs,a=n===void 0?{}:n,i=t.donutColorMap,o=i===void 0?{}:i,u=Object.keys(a).length;if(a&&u>1){var l=Yl(a,o),h=l.configs,y=l.totalValue;if(y){var O=Hl(r),A=O.lineWidth,z=O.arcR,$=[z,0],ae=0;if(u===1){Pl(e,{arcR:z,arcBegin:$,beginAngle:ae,config:h[0],fanIndex:0,lineWidth:A,totalValue:y,drawWhole:!0});return}for(var ce=0;ce<h.length;ce++){var ue=Pl(e,{arcR:z,arcBegin:$,beginAngle:ae,config:h[ce],fanIndex:ce,lineWidth:A,totalValue:y});if(ue.shouldEnd)return;$=ue.arcBegin,ae=ue.beginAngle}}}},Pl=function(t,e){var r=e.arcR,n=e.arcBegin,a=e.beginAngle,i=e.config,o=e.fanIndex,u=e.lineWidth,l=e.totalValue,h=e.drawWhole,y=h===void 0?!1:h,O=e.updateShape,A=O===void 0?void 0:O,z=i.value/l;if(z<.001)return{beginAngle:a,arcBegin:n,shape:void 0,shouldEnd:!1};var $,ae,ce;if(y||z>.999)$=[r,1e-4],ce=1;else{var ue=z*Math.PI*2;ae=a+ue,$=[r*Math.cos(ae),-r*Math.sin(ae)],ce=ue>Math.PI?1:0}var ve={path:[["M",n[0],n[1]],["A",r,r,0,ce,0,$[0],$[1]]],stroke:i.color||(A==null?void 0:A.attr("stroke"))||Vl[o%Vl.length],lineWidth:u};return A?A.attr(ve):t.shapeMap["".concat(El).concat(o)]=t.addShape("path",{attrs:ve,name:"".concat(El).concat(o),draggable:!0}),{beginAngle:ae,arcBegin:$,shape:t.shapeMap["".concat(El).concat(o)],shouldEnd:y||z>.999}},zd=function(t,e,r){var n=t.donutAttrs,a=t.donutColorMap,i=a===void 0?{}:a,o={},u=e.getContainer();if(n){var l=Yl(n,i),h=l.configs,y=l.totalValue;if(y)for(var O=Hl(r),A=O.lineWidth,z=O.arcR,$=[z,0],ae=0,ce=0;ce<h.length;ce++){var ue="".concat(El).concat(ce),ve=Pl(u,{arcR:z,arcBegin:$,beginAngle:ae,config:h[ce],fanIndex:ce,lineWidth:A,totalValue:y,drawWhole:h.length===1,updateShape:u.shapeMap[ue]});if(ve.shape&&(o[ue]=!0),ve.shouldEnd)break;$=ve.arcBegin,ae=ve.beginAngle}}var Ce=Object.keys(u.shapeMap).filter(function(Re){return Re.includes(El)});Ce.forEach(function(Re){o[Re]||(u.shapeMap[Re].remove(!0),delete u.shapeMap[Re])})},Yl=function(t,e){var r=0,n=[];return Object.keys(t).forEach(function(a){var i=+t[a];isNaN(i)||(n.push({key:a,value:i,color:e[a]}),r+=i)}),{totalValue:r,configs:n}},Hl=function(t){var e=t.attr("r"),r=.6*e,n=(e+r)/2,a=e-r;return{lineWidth:a,arcR:n}},_l=function(t){var e=t.x,r=t.y;return{x:e,y:r,centerX:e,centerY:r,minX:e,minY:r,maxX:e,maxY:r,height:0,width:0}},Ud=function(t){t===void 0&&(t=[]);var e=[],r=[];t.forEach(function(u){e.push(u.x),r.push(u.y)});var n=Math.min.apply(Math,e),a=Math.max.apply(Math,e),i=Math.min.apply(Math,r),o=Math.max.apply(Math,r);return{centerX:(n+a)/2,centerY:(i+o)/2,maxX:a,maxY:o,minX:n,minY:i,height:o-i,width:a-n}},tv=function(t,e){return Math.abs(t.centerX-e.centerX)*2<t.width+e.width&&Math.abs(t.centerY-e.centerY)*2<t.height+e.height},kl=function(t){for(var e=[],r={},n=t.length,a=n-1;a>=0;a--){var i=t[a];i.id="".concat(i.x,"|||").concat(i.y),r[i.id]||(r[i.id]=i,e.push(i))}return e},Zl=function(t){return kl(t)},rv=function(t,e){return[t,{x:t.x,y:e.y},e]},Ml=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},Wd=function(t,e){var r=Math.abs(t.x-e.centerX),n=Math.abs(t.y-e.centerY);return r===0&&n===0?0:r/e.width>n/e.height},Rl=function(t,e,r){var n=Wd(e,t);if(n===0){var a=t.centerX,i=t.centerY;return r.y<e.y?i=t.minY:r.x>e.x?a=t.maxX:r.x<e.x?a=t.minX:r.x===e.x&&(i=t.maxY),{x:a,y:i}}return n?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},Kl=function(t,e){var r=Math.min(t.minX,e.minX),n=Math.min(t.minY,e.minY),a=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{centerX:(r+a)/2,centerY:(n+i)/2,minX:r,minY:n,maxX:a,maxY:i,height:i-n,width:a-r}},Bl=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}]},Cl=function(t,e){var r=t.x,n=t.y;return r<e.minX||r>e.maxX||n<e.minY||n>e.maxY},Xd=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},jd=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},Vd=function(t,e){return Xd(t,e.x).concat(jd(t,e.y))},xl=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Yd=function(t,e){var r=-2,n=0;return e.forEach(function(a){a&&(t.x===a.x&&(n+=r),t.y===a.y&&(n+=r))}),n},$l=function(t,e,r,n,a){return xl(t,e)+xl(t,r)+Yd(t,[e,r,n,a])},Hd=function E(t,e,r,n,a){a===void 0&&(a=0),t.unshift(e[n]),r[n]&&r[n]!==n&&a<=100&&E(t,e,r,r[n],a+1)},nv=function(t,e){var r=t.indexOf(e);r>-1&&t.splice(r,1)},Tl=function(t,e,r,n){var a=r.x-t.x,i=r.y-t.y,o=n.x-t.x,u=n.y-t.y,l=r.x-e.x,h=r.y-e.y,y=n.x-e.x,O=n.y-e.y,A=a*u-i*o,z=l*O-h*y,$=a*h-i*l,ae=o*O-u*y;return A*z<=0&&$*ae<=0},Fl=function(t,e,r){if(r.width||r.height){var n=Bl(r),a=n[0],i=n[1],o=n[2],u=n[3];return Tl(t,e,a,i)||Tl(t,e,a,u)||Tl(t,e,i,o)||Tl(t,e,o,u)}return!1},Zd=function(t,e,r,n){var a=[];return t.forEach(function(i){if(i!==e&&(i.x===e.x||i.y===e.y)){if(Fl(i,e,r)||Fl(i,e,n))return;a.push(i)}}),kl(a)},Kd=function(t,e,r,n,a,i,o){var u,l=[],h=(u={},u[e.id]=e,u),y={},O={},A={};O[e.id]=0,A[e.id]=$l(e,r,e);var z=new ql;z.add({id:e.id,value:A[e.id]});var $={};t.forEach(function(Re){$[Re.id]=Re});for(var ae;Object.keys(h).length;){var ce=z.minId(!1);if(ce)ae=h[ce];else break;if(ae===r){var ue=[];return Hd(ue,$,y,r.id),ue}delete h[ae.id],z.remove(ae.id),l.push(ae);var ve=Zd(t,ae,n,a),Ce=function(Ve){Ve.forEach(function(Ue){if(l.indexOf(Ue)===-1){var $e=Ue.id;h[$e]||(h[$e]=Ue);var ot=A[ae.id]+xl(ae,Ue);if(O[$e]&&ot>=O[$e]){z.add({id:$e,value:A[$e]});return}y[$e]=ae.id,O[$e]=ot,A[$e]=O[$e]+$l(Ue,r,e,i,o),z.add({id:$e,value:A[$e]})}})};Ce(ve)}return[e,r]},$d=function(t,e,r){return!(t.x===e.x&&e.x===r.x||t.y===e.y&&e.y===r.y)},Qd=function(t,e,r,n){var a=xl(t,e),i=xl(r,e);a<n&&(n=a),i<n&&(n=i);var o={x:e.x-n/a*(e.x-t.x),y:e.y-n/a*(e.y-t.y)},u={x:e.x-n/i*(e.x-r.x),y:e.y-n/i*(e.y-r.y)};return[o,u]},Ql=function(t,e){var r=[],n=t[0];return r.push("M".concat(n.x," ").concat(n.y)),t.forEach(function(a,i){var o=t[i+1],u=t[i+2];if(o&&u)if($d(a,o,u)){var l=Qd(a,o,u,e),h=l[0],y=l[1];r.push("L".concat(h.x," ").concat(h.y)),r.push("Q".concat(o.x," ").concat(o.y," ").concat(y.x," ").concat(y.y)),r.push("L".concat(y.x," ").concat(y.y))}else r.push("L".concat(o.x," ").concat(o.y));else o&&r.push("L".concat(o.x," ").concat(o.y))}),r.join("")},Jl=function(t,e,r,n,a){var i,o;if(!r||!r.getType())i=_l(t);else if(r.getType()==="combo"){var u=r.getKeyShape().getBBox();if(u){var l=r.getModel(),h=l.x,y=l.y;i={x:h,y,width:u.width,height:u.height,minX:u.minX+h,maxX:u.maxX+h,minY:u.minY+y,maxY:u.maxY+y},i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2}else i=_l(t)}else i=r&&r.getBBox();if(!n||!n.getType())o=_l(e);else if(n.getType()==="combo"){var O=n.getKeyShape().getBBox();if(O){var A=n.getModel(),z=A.x,$=A.y;o={x:z,y:$,width:O.width,height:O.height,minX:O.minX+z,maxX:O.maxX+z,minY:O.minY+$,maxY:O.maxY+$},o.centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=_l(e)}else o=n&&n.getBBox();var ae=Ml(i,a),ce=Ml(o,a),ue=Rl(ae,t,e),ve=Rl(ce,e,t),Ce=Ud([ue,ve]),Re=Kl(ae,Ce),Ve=Kl(ce,Ce),Ue=[];Ue=Ue.concat(Bl(Re)).concat(Bl(Ve));var $e={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[Ce,Re,Ve].forEach(function(et){Ue=Ue.concat(Vd(et,$e).filter(function(yt){return Cl(yt,ae)&&Cl(yt,ce)}))}),[{x:ue.x,y:ve.y},{x:ve.x,y:ue.y}].forEach(function(et){Cl(et,ae)&&Cl(et,ce)&&Ue.push(et)}),Ue.unshift(ue),Ue.push(ve),Ue=kl(Ue);var ot=Kd(Ue,ue,ve,i,o,t,e);return ot.unshift(t),ot.push(e),Zl(ot)},Jd=function(t){if(!(t!=null&&t.length))return t;for(var e=t[t.length-1],r={x:e.x,y:e.y},n=[e],a=[e],i=t.length-2;i>=0;i--){var o=t[i];if(o.x===r.x?n.push(o):(n=[o],r.x=o.x),o.y===r.y?a.push(o):(a=[o],r.y=o.y),n.length>2){var u=t.indexOf(n[1]);u>-1&&t.splice(u,1);continue}if(a.length>2){var u=t.indexOf(a[1]);u>-1&&t.splice(u,1)}}return t},ql=function(){function E(){this.arr=[],this.map={},this.arr=[],this.map={}}return E.prototype._innerAdd=function(t,e){for(var r=[0,e-1];r[1]-r[0]>1;){var n=Math.floor((r[0]+r[1])/2);if(this.arr[n].value>t.value)r[1]=n;else if(this.arr[n].value<t.value)r[0]=n;else{this.arr.splice(n,0,t),this.map[t.id]=!0;return}}this.arr.splice(r[1],0,t),this.map[t.id]=!0},E.prototype.add=function(t){delete this.map[t.id];var e=this.arr.length;if(!e){this.arr.push(t),this.map[t.id]=!0;return}if(this.arr[e-1].value<t.value){this.arr.push(t),this.map[t.id]=!0;return}this._innerAdd(t,e)},E.prototype.remove=function(t){this.map[t]&&delete this.map[t]},E.prototype._clearAndGetMinId=function(){for(var t,e=this.arr.length-1;e>=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},E.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},E.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},E}(),qd=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},eh=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},th=function(t,e){return[t,e]},rh=function(t,e,r,n,a){return Zl(Jl(t,e,r,n,a.offset))},nh={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:qd,fallbackRoute:rh},av={maxAllowedDirectionChange:Math.PI/4,directions:[{stepX:1,stepY:0},{stepX:1,stepY:1},{stepX:0,stepY:1},{stepX:-1,stepY:1},{stepX:-1,stepY:0},{stepX:-1,stepY:-1},{stepX:0,stepY:-1},{stepX:1,stepY:-1}],distFunc:eh,fallbackRoute:th},df=function(t,e){var r=Math.round(Math.abs(t/e)),n=t<0?-1:1;return r<0?0:n*r},ah=function(t,e,r){var n={};return t.forEach(function(a){if(a)for(var i=Ml(a.getBBox(),r),o=df(i.minX,e);o<=df(i.maxX,e);o+=1)for(var u=df(i.minY,e);u<=df(i.maxY,e);u+=1)n["".concat(o,"|||").concat(u)]=!0}),n},Gl=function(t,e){var r=e.x-t.x,n=e.y-t.y;return r||n?Math.atan2(n,r):0},ed=function(t,e){var r=Math.abs(t-e);return r>Math.PI?2*Math.PI-r:r},td=function(t,e,r){for(var n=1/0,a=0,i=e.length;a<i;a++){var o=r(t,e[a]);o<n&&(n=o)}return n},rd=function(t,e,r,n,a){var i=[];if(!r)return[t];var o=a.directions,u=a.offset,l=r.getBBox(),h=e.x>l.minX&&e.x<l.maxX&&e.y>l.minY&&e.y<l.maxY,y=Ml(l,u);for(var O in y)y[O]=df(y[O],a.gridSize);if(h){for(var A=0,z=o;A<z.length;A++)for(var $=z[A],ae=[[{x:y.minX,y:y.minY},{x:y.maxX,y:y.minY}],[{x:y.minX,y:y.minY},{x:y.minX,y:y.maxY}],[{x:y.maxX,y:y.minY},{x:y.maxX,y:y.maxY}],[{x:y.minX,y:y.maxY},{x:y.maxX,y:y.maxY}]],O=0;O<4;O++){var ce=ae[O],ue=ei.getLineIntersect(t,{x:t.x+$.stepX*y.width,y:t.y+$.stepY*y.height},ce[0],ce[1]);ue&&!Fl(t,ue,l)&&(ue.id="".concat(ue.x,"|||").concat(ue.y),i.push(ue))}return i}var ve=Rl(y,t,n);return ve.id="".concat(ve.x,"|||").concat(ve.y),[ve]},zl=function(t,e,r,n){var a=Gl(t,e),i=r[t.id];if(!i){var o=Gl(n,t);return ed(o,a)}var u=Gl({x:i.x,y:i.y},t);return ed(u,a)},ih=function(t,e,r,n,a,i,o){var u=[n],l=n,h=t.id,y=t.x,O=t.y,A={x:y,y:O,id:h};zl(A,i,e,r)&&(l={x:i.x===n.x?n.x:A.x*o,y:i.y===n.y?n.y:A.y*o},u.unshift(l));for(var z=e[h];z&&z.id!==h;){var $={x:y,y:O,id:h},ae={x:z.x,y:z.y,id:z.id},ce=zl(ae,$,e,r);ce&&(l={x:ae.x===$.x?l.x:ae.x*o,y:ae.y===$.y?l.y:ae.y*o},u.unshift(l)),h=ae.id,y=ae.x,O=ae.y,z=e[h]}return u[0].x=y===r.x?a.x:l.x,u[0].y=O===r.y?a.y:l.y,u.unshift(a),u},oh=function(t,e,r,n,a){if(isNaN(t.x)||isNaN(e.x))return[];var i=(0,s.deepMix)(nh,a);i.obstacles=i.obstacles||[];var o=i.penalties,u=i.gridSize,l=ah(i.obstacles.concat([r,n]),u,i.offset),h={x:df(t.x,u),y:df(t.y,u)},y={x:df(e.x,u),y:df(e.y,u)};t.id="".concat(h.x,"|||").concat(h.y),e.id="".concat(y.x,"|||").concat(y.y);var O=rd(h,t,r,y,i),A=rd(y,e,n,h,i);O.forEach(function(cr){delete l[cr.id]}),A.forEach(function(cr){delete l[cr.id]});for(var z={},$={},ae={},ce={},ue={},ve=new ql,Ce=0;Ce<O.length;Ce++){var Re=O[Ce];z[Re.id]=Re,ce[Re.id]=0,ue[Re.id]=td(Re,A,i.distFunc),ve.add({id:Re.id,value:ue[Re.id]})}var Ve=i.maximumLoops,Ue,$e,ot,et,yt,Gt,yr=1/0,kr={};for(A.forEach(function(cr){kr["".concat(cr.x,"|||").concat(cr.y)]=!0}),Object.keys(z).forEach(function(cr){var Rr=z[cr].id;ue[Rr]<=yr&&(yr=ue[Rr],Ue=z[Rr])});Object.keys(z).length>0&&Ve>0;){var Mr=ve.minId((Ve+1)%30===0);if(Mr)Ue=z[Mr];else break;if(kr["".concat(Ue.x,"|||").concat(Ue.y)])return ih(Ue,ae,h,e,t,y,u);delete z[Ue.id],ve.remove(Ue.id),$[Ue.id]=!0;for(var Ce=0;Ce<i.directions.length;Ce++){$e=i.directions[Ce];var dr="".concat(Math.round(Ue.x)+$e.stepX,"|||").concat(Math.round(Ue.y)+$e.stepY);if(ot={x:Ue.x+$e.stepX,y:Ue.y+$e.stepY,id:dr},!$[dr]&&(Gt=zl(Ue,ot,ae,h),!(Gt>i.maxAllowedDirectionChange)&&!l[dr])){z[dr]||(z[dr]=ot);var hn=o[Gt];et=i.distFunc(Ue,ot)+(isNaN(hn)?u:hn),yt=ce[Ue.id]+et;var on=ce[dr];on&&yt>=on||(ae[dr]=Ue,ce[dr]=yt,ue[dr]=yt+td(ot,A,i.distFunc),ve.add({id:dr,value:ue[dr]}))}}Ve-=1}return i.fallbackRoute(t,e,r,n,i)};qu("polyline",{options:{color:Zr.defaultEdge.color,size:Zr.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Zr.defaultEdge.style.stroke,lineAppendWidth:Zr.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Zr.edgeLabel.style.fill,fontSize:Zr.edgeLabel.style.fontSize,fontFamily:Zr.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:(0,c.__assign)({},Zr.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t);r.radius===0&&delete r.radius;var n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,s.mix)({},e,r,t.style);t=this.getPathPoints(t),this.radius=n.radius,this.offset=n.offset;var a=t.startPoint,i=t.endPoint,o=this.getControlPoints(t),u=[a];o&&(u=u.concat(o)),u.push(i);var l=t.sourceNode,h=t.targetNode,y=n.radius,O=this.options.routeCfg,A=(0,s.mix)({},O,t.routeCfg);A.offset=n.offset;var z=this.getPath(u,l,h,y,A,!o);((0,s.isArray)(z)&&z.length<=1||(0,s.isString)(z)&&z.indexOf("L")===-1)&&(z="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(i.x)||isNaN(i.y))&&(z="M0 0, L0 0");var $=(0,s.mix)({},Zr.defaultEdge.style,n,{lineWidth:t.size,path:z});return $},updateShapeStyle:function(t,e){var r=e.getContainer();if(e.isVisible()){var n={stroke:t.color},a=r.shapeMap["edge-shape"]||r.find(function(Ce){return Ce.get("className")==="edge-shape"})||e.getKeyShape(),i=t.size;t=this.getPathPoints(t);var o=t.startPoint,u=t.endPoint,l=this.getControlPoints(t),h=[o];l&&(h=h.concat(l)),h.push(u);var y=a.attr(),O=(0,s.mix)({},n,y,t.style),A=t.sourceNode,z=t.targetNode,$=O.radius,ae=this.options.routeCfg,ce=(0,s.mix)({},ae,t.routeCfg);ce.offset=O.offset;var ue=this.getPath(h,A,z,$,ce,!l);((0,s.isArray)(ue)&&ue.length<=1||(0,s.isString)(ue)&&ue.indexOf("L")===-1)&&(ue="M0 0, L0 0"),(isNaN(o.x)||isNaN(o.y)||isNaN(u.x)||isNaN(u.y))&&(ue="M0 0, L0 0"),y.endArrow&&O.endArrow===!1&&(t.style.endArrow={path:""}),y.startArrow&&O.startArrow===!1&&(t.style.startArrow={path:""});var ve=(0,s.mix)(n,a.attr(),{lineWidth:i,path:ue},t.style);a&&a.attr(ve)}},getPath:function(t,e,r,n,a,i){var o=a.offset,u=a.obstacles,l=a.simple;if(!o||t.length>2||i===!1){if(n)return Ql(t,n);var h=[];return(0,s.each)(t,function(z,$){$===0?h.push(["M",z.x,z.y]):h.push(["L",z.x,z.y])}),h}l!==!1&&!(u!=null&&u.length)&&(l=!0);var y=l?Jl(t[t.length-1],t[0],r,e,o):oh(t[0],t[t.length-1],e,r,a);if(!y||!y.length)return"M0 0, L0 0";if(n){var O=Ql(y,n);return O}y=Jd(y);var A=ei.pointsToPolygon(y);return A}},"single-edge");var nd=Vo.cloneEvent,ad=Vo.isNaN,id=Math.abs,sh=10,uh=["shift","ctrl","alt","control"],fh={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,r=+t.clientX,n=+t.clientY;if(!(ad(r)||ad(n))){var a=r-e.x,i=n-e.y;this.get("direction")==="x"?i=0:this.get("direction")==="y"&&(a=0),this.origin={x:r,y:n};var o=this.graph.get("width"),u=this.graph.get("height"),l=this.graph.get("canvas").getCanvasBBox(),h=this.scalableRange,y=this.scalableRange;h<1&&h>-1&&(h=o*h,y=u*y),(l.minX<=o+h&&l.minX+a>o+h||l.maxX+h>=0&&l.maxX+h+a<0)&&(a=0),(l.minY<=u+y&&l.minY+i>u+y||l.maxY+y>=0&&l.maxY+y+i<0)&&(i=0),this.graph.translate(a,i)}},onTouchStart:function(t){var e=this,r=t.originalEvent.touches,n=r[0],a=r[1];n&&a||(t.preventDefault(),this.mousedown=!0,e.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this,r=t.originalEvent;if(!(r&&t.name!=="touchstart"&&r.button!==0)&&!(t.name!=="touchstart"&&typeof window!="undefined"&&window.event&&!window.event.buttons&&!window.event.button)&&this.shouldBegin(t,this)&&!e.keydown&&this.allowDrag(t)){if(e.origin={x:t.clientX,y:t.clientY},e.dragging=!1,this.enableOptimize){for(var n=this.graph,a=n.getEdges(),i=0,o=a.length;i<o;i++){var u=a[i].get("group").get("children");u&&u.forEach(function(ve){ve.set("ori-visibility",ve.get("ori-visibility")||ve.get("visible")),ve.hide()})}for(var l=n.getNodes(),h=0,y=l.length;h<y;h++)for(var O=l[h].getContainer(),A=O.get("children"),z=0,$=A;z<$.length;z++){var ae=$[z],ce=ae.get("isKeyShape");ce||(ae.set("ori-visibility",ae.get("ori-visibility")||ae.get("visible")),ae.hide())}}if(typeof window!="undefined"){var ue=this;this.handleDOMContextMenu=function(ve){return ue.onMouseUp(ve)},document.body.addEventListener("contextmenu",this.handleDOMContextMenu)}}},onTouchMove:function(t){var e=this,r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a){this.onMouseUp(t);return}t.preventDefault(),e.onDrag(t)},onDrag:function(t){if(this.mousedown){var e=this.graph;if(!this.keydown&&this.allowDrag(t)&&(t=nd(t),!!this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(id(this.origin.x-t.clientX)+id(this.origin.y-t.clientY)<sh)return;this.shouldBegin(t,this)&&(t.type="dragstart",e.emit("canvas:dragstart",t),this.originPosition={x:t.clientX,y:t.clientY},this.dragging=!0)}this.shouldUpdate(t,this)&&this.updateViewport(t)}}},onMouseUp:function(t){var e,r;this.mousedown=!1,this.dragstart=!1;var n=this.graph;if(!this.keydown){var a=n.getZoom(),i=n.get("modeController"),o=(r=(e=i==null?void 0:i.modes[i.mode])===null||e===void 0?void 0:e.filter(function(Ue){return Ue.type==="zoom-canvas"}))===null||r===void 0?void 0:r[0],u=o?o.optimizeZoom||.1:0;if(this.enableOptimize){for(var l=n.getEdges(),h=0,y=l.length;h<y;h++){var O=l[h].get("group").get("children");O&&O.forEach(function(Ue){var $e=Ue.get("ori-visibility");Ue.set("ori-visibility",void 0),$e&&Ue.show()})}if(a>u)for(var A=n.getNodes(),z=0,$=A.length;z<$;z++)for(var ae=A[z].getContainer(),ce=ae.get("children"),ue=0,ve=ce;ue<ve.length;ue++){var Ce=ve[ue],Re=Ce.get("isKeyShape");if(!Re){var Ve=Ce.get("ori-visibility");Ce.set("ori-visibility",void 0),Ve&&Ce.show()}}}if(!this.dragging){this.origin=null;return}t=nd(t),this.shouldEnd(t,this)&&this.updateViewport(t),t.type="dragend",t.dx=t.clientX-this.originPosition.x,t.dy=t.clientY-this.originPosition.y,n.emit("canvas:dragend",t),this.endDrag(),typeof window!="undefined"&&document.body.removeEventListener("contextmenu",this.handleDOMContextMenu)}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1,this.mousedown=!1,this.dragstart=!1},onKeyDown:function(t){var e=this,r=t.key;r&&(uh.indexOf(r.toLowerCase())>-1?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,r,n=t.target,a=n&&n.isCanvas&&n.isCanvas();if((0,s.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if((0,s.isObject)(this.allowDragOnItem)){var i=this.allowDragOnItem,o=i.node,u=i.edge,l=i.combo,h=(r=(e=t.item)===null||e===void 0?void 0:e.getType)===null||r===void 0?void 0:r.call(e);if(!o&&h==="node"||!u&&h==="edge"||!l&&h==="combo")return!1}return!0}},ch={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){if(!this.origin||!t||t.destroyed)return!1;var e=t.getType();return e==="combo"},onTouchStart:function(t){if(t.item){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,e.onDragStart(t)}},onTouchMove:function(t){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a){e.onDragEnd(t);return}t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}e.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},typeof window!="undefined"&&!this.windowEventBinded&&(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,r;if(((r=(e=t.item)===null||e===void 0?void 0:e.getType)===null||r===void 0?void 0:r.call(e))!=="node"){this.onDragEnd();return}this.mousedown&&(this.dragstart?this.onDrag((0,c.__assign)((0,c.__assign)({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,!!this.shouldBegin((0,c.__assign)((0,c.__assign)({},t),this.mousedown),this)){var r=this.mousedown,n=r.item,a=r.target;if(!(!n||n.destroyed||n.hasLocked())){var i=n.getContainer();if(i.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n),a){var o=a.get("isAnchorPoint");if(o)return}var u=this.graph;this.targets=[],this.targetCombo=null;var l=u.findAllByState("node",this.selectedState),h=n.get("id"),y=l.filter(function(A){var z=A.get("id");return h===z});if(y.length===0?this.targets.push(n):l.length>1?l.forEach(function(A){var z=A.hasLocked();z||e.targets.push(A)}):this.targets.push(n),this.graph.get("enabledStack")&&this.enableStack){var O=[];this.targets.forEach(function(A){var z=A.getModel(),$=z.x,ae=z.y,ce=z.id;O.push({x:$,y:ae,id:ce})}),this.set("beforeDragNodes",O)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(A){var z=A.getEdges();z.forEach(function($){$.isVisible()&&(e.hidenEdge[$.getID()]=!0,$.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(!(!this.mousedown||!this.origin)&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(n){e.update(n,t);var a=n.getModel().comboId;a&&(r[a]=e.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e=this,r;if(this.mousedown=!1,this.dragstart=!1,typeof window!="undefined"&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),!!this.origin){(r=this.cachedCaptureItems)===null||r===void 0||r.forEach(function(i){var o=i.getContainer();o.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(i){var o=i.getEdges();o.forEach(function(u){e.hidenEdge[u.getID()]&&u.show(),u.refresh()})}),this.hidenEdge={};var n=this.graph;if(n.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(i){a.before.nodes.push(i)}),this.targets.forEach(function(i){var o=i.getModel(),u=o.x,l=o.y,h=o.id;a.after.nodes.push({x:u,y:l,id:h})}),n.pushStack("update",(0,s.clone)(a))}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.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(e))){var r=this.graph;if(this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)r.updateCombos();else{var n=e.getModel();this.targets.map(function(a){var i=a.getModel();i.comboId!==n.id&&r.updateComboTree(a,n.id)}),r.updateCombo(e)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(r){var n=r.getModel();n.comboId&&e.updateComboTree(r)}))},onDropNode:function(t){if(!(!this.targets||this.targets.length===0)){var e=this,r=t.item,n=e.graph,a=r.getModel().comboId,i=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var o=n.findById(a);e.comboActiveState&&n.setItemState(o,e.comboActiveState,!1),this.targets.map(function(u){var l=u.getModel();a!==l.comboId&&n.updateComboTree(u,a)}),n.updateCombo(o)}else this.targets.map(function(u){var l=u.getModel();l.comboId&&n.updateComboTree(u)});n.emit("dragnodeend",{items:this.targets,targetItem:r})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var r=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map(function(n){return r.update(n,t)}):this.targets.map(function(n){return r.update(n,t,e)}))},update:function(t,e,r){var n=this.origin,a=t.get("model"),i=t.get("id");this.point[i]||(this.point[i]={x:a.x||0,y:a.y||0});var o=e.x-n.x+this.point[i].x,u=e.y-n.y+this.point[i].y;r&&(o+=n.x-e.x,u+=n.y-e.y);var l={x:o,y:u};this.get("updateEdge")?this.graph.updateItem(t,l,!1):t.updatePosition(l)},debounceUpdate:(0,s.debounce)(function(E){var t=E.targets,e=E.graph,r=E.point,n=E.origin,a=E.evt,i=E.updateEdge,o=E.onlyChangeComboSize,u=E.updateParentCombos;t.map(function(l){var h=l.get("model"),y=l.get("id");r[y]||(r[y]={x:h.x||0,y:h.y||0});var O=a.x-n.x+r[y].x,A=a.y-n.y+r[y].y,z={x:O,y:A};i?e.updateItem(l,z,!1):l.updatePosition(z)}),o&&u(e,t)},50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var O=t.x-this.origin.x+this.originPoint.minX,A=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:O,y:A})}else{var r=e.get("group"),n=(0,s.deepMix)({},qi.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),i=a.x,o=a.y,u=a.width,l=a.height,h=a.minX,y=a.minY;this.originPoint={x:i,y:o,width:u,height:l,minX:h,minY:y},this.delegateRect=r.addShape("rect",{attrs:(0,c.__assign)({width:u,height:l,x:i,y:o},n),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;e.length===0&&e.push(t.item);for(var r=1/0,n=-1/0,a=1/0,i=-1/0,o=0;o<e.length;o++){var u=e[o],l=u.getBBox(),h=l.minX,y=l.minY,O=l.maxX,A=l.maxY;h<r&&(r=h),y<a&&(a=y),O>n&&(n=O),A>i&&(i=A)}var z=Math.floor(r),$=Math.floor(a),ae=Math.ceil(n)-Math.floor(r),ce=Math.ceil(i)-Math.floor(a);return{x:z,y:$,width:ae,height:ce,minX:r,minY:a}},updateParentCombos:function(t,e){var r=t||this.graph,n=e||this.targets,a={};n==null||n.forEach(function(i){var o=i.getModel().comboId;o&&(a[o]=r.findById(o))}),Object.values(a).forEach(function(i){i&&r.updateCombo(i)})}},Il=null,lh={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}e.setAllItemStates(t)},clearOnTouchStart:function(t){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}e.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this,r=this.shouldClearStatusOnSecond;r&&(Il=null),this.timer=setTimeout(function(){e.throttleClearActiveState(t,e)},50)},throttleSetAllItemStates:(0,s.throttle)(function(E,t){var e=E.item,r=t.graph;if(!(!r||r.destroyed)&&(t.item=e,!!t.shouldUpdate(E.item,{event:E,action:"activate"},t))){var n=t.shouldClearStatusOnSecond,a=e.getModel().id;if(Il===a&&n){t.throttleClearActiveState(E,t),Il=null;return}for(var i=t.activeState,o=t.inactiveState,u=r.getNodes(),l=r.getCombos(),h=r.getEdges(),y=r.get("vedges"),O=u.length,A=l.length,z=h.length,$=y.length,ae=t.inactiveItems||{},ce=t.activeItems||{},ue=0;ue<O;ue++){var ve=u[ue],Ce=ve.getID(),Re=ve.hasState("selected");t.resetSelected&&Re&&r.setItemState(ve,"selected",!1),ce[Ce]&&(r.setItemState(ve,i,!1),delete ce[Ce]),o&&!ae[Ce]&&(r.setItemState(ve,o,!0),ae[Ce]=ve)}for(var ue=0;ue<A;ue++){var Ve=l[ue],Ue=Ve.getID(),Re=Ve.hasState("selected");t.resetSelected&&Re&&r.setItemState(Ve,"selected",!1),ce[Ue]&&(r.setItemState(Ve,i,!1),delete ce[Ue]),o&&!ae[Ue]&&(r.setItemState(Ve,o,!0),ae[Ue]=Ve)}for(var ue=0;ue<z;ue++){var $e=h[ue],ot=$e.getID();ce[ot]&&(r.setItemState($e,i,!1),delete ce[ot]),o&&!ae[ot]&&(r.setItemState($e,o,!0),ae[ot]=$e)}for(var ue=0;ue<$;ue++){var et=y[ue],yt=et.getID();ce[yt]&&(r.setItemState(et,i,!1),delete ce[yt]),o&&!ae[yt]&&(r.setItemState(et,o,!0),ae[yt]=et)}if(e&&!e.destroyed){o&&(r.setItemState(e,o,!1),delete ae[e.getID()]),ce[e.getID()]||(r.setItemState(e,i,!0),ce[e.getID()]=e);for(var Gt=e.getEdges(),yr=Gt.length,ue=0;ue<yr;ue++){var $e=Gt[ue],ot=$e.getID(),kr=void 0;$e.getSource()===e?kr=$e.getTarget():kr=$e.getSource();var Mr=kr.getID();o&&ae[Mr]&&(r.setItemState(kr,o,!1),delete ae[Mr]),ce[Mr]||(r.setItemState(kr,i,!0),ce[Mr]=kr),ae[ot]&&(r.setItemState($e,o,!1),delete ae[ot]),ce[ot]||(r.setItemState($e,i,!0),ce[ot]=$e),$e.toFront()}}t.activeItems=ce,t.inactiveItems=ae,n&&(Il=e.getModel().id),r.emit("afteractivaterelations",{item:E.item,action:"activate"})}},50,{trailing:!0,leading:!0}),throttleClearActiveState:(0,s.throttle)(function(E,t){var e=t.get("graph");if(!(!e||e.destroyed)&&t.shouldUpdate(E.item,{event:E,action:"deactivate"},t)){var r=t.activeState,n=t.inactiveState,a=t.activeItems||{},i=t.inactiveItems||{};Object.values(a).filter(function(o){return!o.destroyed}).forEach(function(o){e.clearItemStates(o,r)}),Object.values(i).filter(function(o){return!o.destroyed}).forEach(function(o){e.clearItemStates(o,n)}),t.activeItems={},t.inactiveItems={},e.emit("afteractivaterelations",{item:E.item||t.get("item"),action:"deactivate"})}},50,{trailing:!0,leading:!0})},Al=Math.min,od=Math.max,sd=Math.abs,ud="shift",dh=["drag","shift","ctrl","alt","control"],hh={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:ud,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return dh.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=ud,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,r=this.brush,n=this.selectOnCombo,a=(e==null?void 0:e.getType())==="combo";a&&!n||!a&&e||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&(this.trigger!=="drag"&&!this.keydown||this.updateBrush(t))},onMouseUp:function(t){var e=this.graph;!this.brush&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this,e=t.graph,r=t.selectedState,n=e.findAllByState("node",r),a=e.findAllByState("edge",r),i=e.findAllByState("combo",r);n.forEach(function(o){return e.setItemState(o,r,!1)}),a.forEach(function(o){return e.setItemState(o,r,!1)}),i.forEach(function(o){return e.setItemState(o,r,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,r,n,a){var i=t.getBBox();return i.centerX>=e&&i.centerX<=r&&i.centerY>=n&&i.centerY<=a},getSelectedNodes:function(t){var e=this,r=this,n=r.graph,a=r.originPoint,i=r.shouldUpdate,o=r.isBBoxCenterInRect,u=this.selectedState,l={x:t.x,y:t.y},h=n.getPointByCanvas(a.x,a.y),y=Al(l.x,h.x),O=od(l.x,h.x),A=Al(l.y,h.y),z=od(l.y,h.y),$=[],ae=[];n.getNodes().forEach(function(ve){if(ve.isVisible()&&o(ve,y,O,A,z)&&i(ve,"select",e)){$.push(ve);var Ce=ve.getModel();ae.push(Ce.id),n.setItemState(ve,u,!0)}});var ce=[];this.includeEdges&&$.forEach(function(ve){var Ce=ve.getOutEdges();Ce.forEach(function(Re){if(Re.isVisible()){var Ve=Re.getModel(),Ue=Ve.source,$e=Ve.target;ae.includes(Ue)&&ae.includes($e)&&i(Re,"select",e)&&(ce.push(Re),n.setItemState(Re,e.selectedState,!0))}})});var ue=[];this.includeCombos&&n.getCombos().forEach(function(ve){if(ve.isVisible()&&o(ve,y,O,A,z)&&i(ve,"select",e)){ue.push(ve);var Ce=ve.getModel();ae.push(Ce.id),n.setItemState(ve,u,!0)}}),this.selectedEdges=ce,this.selectedNodes=$,this.selectedCombos=ue,this.onSelect&&this.onSelect($,ce,ue),n.emit("nodeselectchange",{selectedItems:{nodes:$,edges:ce,combos:ue},select:!0})},createBrush:function(){var t=this,e=t.graph.get("canvas").addShape("rect",{attrs:t.brushStyle,capture:!1,name:"brush-shape"});return this.brush=e,this.delegate=e,e},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:sd(t.canvasX-e.x),height:sd(t.canvasY-e.y),x:Al(t.canvasX,e.x),y:Al(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();n===r||n==="control"&&r==="ctrl"||n==="ctrl"&&r==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},fd="shift",vh=["shift","ctrl","alt","control"],gh={getDefaultCfg:function(){return{multiple:!0,trigger:fd,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return vh.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=fd,console.warn("Behavior click-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),t.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,r=t.item;if(!(!r||r.destroyed)){var n=r.getType(),a=e.graph,i=e.keydown,o=e.multiple,u=e.shouldUpdate,l=e.shouldBegin;if(l(t,e)){if(!i||!o){var h=a.findAllByState("node",e.selectedState).concat(a.findAllByState("edge",e.selectedState)).concat(a.findAllByState("combo",e.selectedState));(0,s.each)(h,function($){$!==r&&a.setItemState($,e.selectedState,!1)})}var y=function(){switch(n){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}();if(!y){var O=a.findAllByState("node",e.selectedState),A=a.findAllByState("edge",e.selectedState),z=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:O,edges:A,combos:z},select:!1});return}if(r.hasState(e.selectedState)){u(t,e)&&a.setItemState(r,e.selectedState,!1);var O=a.findAllByState("node",e.selectedState),A=a.findAllByState("edge",e.selectedState),z=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:O,edges:A,combos:z},select:!1})}else{u(t,e)&&a.setItemState(r,e.selectedState,!0);var O=a.findAllByState("node",e.selectedState),A=a.findAllByState("edge",e.selectedState),z=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:O,edges:A,combos:z},select:!0})}}}},onCanvasClick:function(t){var e=this,r=this,n=r.graph,a=r.shouldBegin;if(a(t,this)){var i=n.findAllByState("node",this.selectedState);(0,s.each)(i,function(l){n.setItemState(l,e.selectedState,!1)});var o=n.findAllByState("edge",this.selectedState);(0,s.each)(o,function(l){n.setItemState(l,e.selectedState,!1)});var u=n.findAllByState("combo",this.selectedState);(0,s.each)(u,function(l){n.setItemState(l,e.selectedState,!1)}),n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=this,r=t.key;r&&(r.toLowerCase()===this.trigger.toLowerCase()||r.toLowerCase()==="control"?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.keydown=!1}},ph=Q.vs,Ol=.05,yh={getDefaultCfg:function(){return this.isFireFox=_c()==="firefox",{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];t.preventDefault(),n&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:r.pageX,pageY:r.pageY},this.moveable=!0,n&&(this.endPoint={pageX:n.pageX,pageY:n.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,r=e[0],n=e[1];if(n){this.endPoint||(this.endPoint={pageX:n.pageX,pageY:n.pageY});var a=function($,ae){return Math.hypot(ae.x-$.x,ae.y-$.y)},i=a({x:r.pageX,y:r.pageY},{x:n.pageX,y:n.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),o=this.originScale*i;this.currentScale=o;var u=this.get("minZoom")||this.graph.get("minZoom"),l=this.get("maxZoom")||this.graph.get("maxZoom");if(!(o>l||o<u)){var h=this.get("animate"),y=this.get("animateCfg"),O=this.graph.get("canvas"),A=O.getPointByClient(t.clientX,t.clientY);this.graph.zoomTo(o,{x:A.x,y:A.y},h,y),this.graph.emit("wheelzoom",t)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(t){var e=this,r=this,n=r.graph,a=r.fixSelectedItems;if(!(this.shouldBegin&&!this.shouldBegin(t,this))&&this.shouldUpdate(t,this)){t.preventDefault();var i=n.get("canvas"),o=i.getPointByClient(t.clientX,t.clientY),u=this.get("sensitivity"),l=n.getZoom(),h=l,y=l;this.isFireFox?t.deltaY>0||t.wheelDelta<0?h=1-Ol*u:h=1/(1-Ol*u):t.wheelDelta<0?h=1-Ol*u:h=1/(1-Ol*u),y=l*h;var O=this.get("minZoom")||n.get("minZoom"),A=this.get("maxZoom")||n.get("maxZoom");y>A?y=A:y<O&&(y=O);var z=this.get("enableOptimize");if(z){var $=this.get("optimizeZoom"),ae=this.get("optimized"),ce=n.getNodes(),ue=n.getEdges(),ve=ce.length,Ce=ue.length;if(!ae){for(var Re=0;Re<ve;Re++){var Ve=ce[Re];if(!Ve.destroyed)for(var Ue=Ve.get("group").get("children"),$e=Ue.length,ot=0;ot<$e;ot++){var et=Ue[ot];!et.destoryed&&!et.get("isKeyShape")&&(et.set("ori-visibility",et.get("ori-visibility")||et.get("visible")),et.hide())}}for(var yt=0;yt<Ce;yt++)for(var Gt=ue[yt],Ue=Gt.get("group").get("children"),$e=Ue.length,ot=0;ot<$e;ot++){var et=Ue[ot];et.set("ori-visibility",et.get("ori-visibility")||et.get("visible")),et.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var yr=setTimeout(function(){var pa=n.getZoom(),Oa=e.get("optimized");if(Oa){e.set("optimized",!1);for(var va=0;va<ve;va++){var La=ce[va],za=La.get("group").get("children"),Pn=za.length;if(pa<$){var Ea=La.getKeyShape(),xa=Ea.get("ori-visibility");Ea.set("ori-visibility",void 0),xa&&Ea.show()}else for(var Ua=0;Ua<Pn;Ua++){var Sa=za[Ua],xa=Sa.get("ori-visibility");Sa.set("ori-visibility",void 0),!Sa.get("visible")&&xa&&xa&&Sa.show()}}for(var Ta=0;Ta<Ce;Ta++){var li=ue[Ta],za=li.get("group").get("children"),Pn=za.length;if(pa<$){var Ea=li.getKeyShape(),xa=Ea.get("ori-visibility");Ea.set("ori-visibility",void 0),xa&&Ea.show()}else for(var Ua=0;Ua<Pn;Ua++){var Sa=za[Ua];if(!Sa.get("visible")){var xa=Sa.get("ori-visibility");Sa.set("ori-visibility",void 0),xa&&Sa.show()}}}}},100);this.set("timeout",yr)}if(l<=1){var kr=void 0,Mr=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){kr=n.findAllByState("node",a.fixState),Mr=n.findAllByState("edge",a.fixState);for(var dr=l/y,hn=kr.length,on=0;on<hn;on++){var Ve=kr[on],cr=Ve.getContainer(),Rr=Ve.getModel(),Yr=Ve.getOriginStyle(),Wr=Ve.getStateStyle(a.fixState),sn=Ve.get("shapeFactory").getShape(Rr.type).getStateStyle(a.fixState,Ve)[a.fixState];if(a.fixAll){if(y<=1){var wn=(0,s.clone)(cr.getMatrix());wn||(wn=[1,0,0,0,1,0,0,0,1]);var la=Ve.getModel(),da=la.x,Ra=la.y;wn=ph(wn,[["t",-da,-Ra],["s",dr,dr],["t",da,Ra]]),cr.setMatrix(wn)}}else for(var Ue=cr.get("children"),$e=Ue.length,ot=0;ot<$e;ot++){var et=Ue[ot],Ia=void 0,Xa=void 0;if(a.fixLabel){var Ga=et.get("type");if(Ga==="text"){Ia=et.attr("fontSize")||12;var ci=Wr[et.get("name")],ja=sn[et.get("name")],Os=ci?ci.fontSize:12,ki=ja?ja.fontSize:12,Ls=Os||ki||12;if(y<=1&&et.attr("fontSize",Ls/y),Xa)break}}if(a.fixLineWidth&&et.get("isKeyShape")){Xa=et.attr("lineWidth")||0;var Ri=Wr.lineWidth||sn.lineWidth||Yr.lineWidth||0;if(y<=1&&et.attr("lineWidth",Ri/y),Ia)break}}}for(var Bi=Mr.length,fs=0;fs<Bi;fs++)for(var Gt=Mr[fs],cr=Gt.getContainer(),Ue=cr.get("children"),Rr=Gt.getModel(),Wr=Gt.getStateStyle(a.fixState),sn=Gt.get("shapeFactory").getShape(Rr.type).getStateStyle(a.fixState,Gt)[a.fixState],$e=Ue.length,ot=0;ot<$e;ot++){var et=Ue[ot],Ia=void 0,Xa=void 0;if(a.fixLabel||a.fixAll){var Ga=et.get("type");if(Ga==="text"){Ia=et.attr("fontSize")||12;var ci=Wr[et.get("name")],ja=sn[et.get("name")],Os=ci?ci.fontSize:12,ki=ja?ja.fontSize:12,Ls=Os||ki||12;if(y<=1&&et.attr("fontSize",Ls/y),Xa)break}}if((a.fixLineWidth||a.fixAll)&&et.get("isKeyShape")){Xa=et.attr("lineWidth")||0;var Ri=Wr.lineWidth||sn.lineWidth||1;if(y<=1&&et.attr("lineWidth",Ri/y),Ia)break}}}}var lo=this.get("animate"),Lo=this.get("animateCfg");n.zoomTo(y,{x:o.x,y:o.y},lo,Lo),n.emit("wheelzoom",t)}}},cd={onMouseEnter:function(t){var e=t.item;this.currentTarget=e,this.showTooltip(t),this.graph.emit("tooltipchange",{item:t.item,action:"show"})},onMouseMove:function(t){if(!this.shouldUpdate(t,this)){this.hideTooltip();return}!this.currentTarget||t.item!==this.currentTarget||this.updatePosition(t)},onMouseLeave:function(t){this.shouldEnd(t,this)&&(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(t){var e=this.container;if(!(!t.item||t.item.destroyed)){e||(e=this.createTooltip(this.graph.get("canvas")),this.container=e);var r=this.formatText(t.item.get("model"),t);e.innerHTML=r,(0,aa.Z)(this.container,{visibility:"visible"}),this.updatePosition(t)}},hideTooltip:function(){(0,aa.Z)(this.container,{visibility:"hidden"})},updatePosition:function(t){var e=this.get("shouldBegin"),r=this,n=r.width,a=r.height,i=r.container,o=r.graph;if(!e(t,this)){(0,aa.Z)(i,{visibility:"hidden"});return}var u=o.getPointByClient(t.clientX,t.clientY),l=o.getCanvasByPoint(u.x,u.y),h=l.x,y=l.y,O=i.getBoundingClientRect();h>n/2?h-=O.width:h+=this.offset,y>a/2?y-=O.height:y+=this.offset;var A="".concat(h,"px"),z="".concat(y,"px");(0,aa.Z)(this.container,{left:A,top:z,visibility:"visible"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var r=(0,ka.Z)('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return e.parentNode.appendChild(r),(0,aa.Z)(r,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},mh=(0,c.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(e){return e.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},cd),bh=(0,c.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(e){return"source: ".concat(e.source," target: ").concat(e.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},cd),ld="click",Eh=["click","dblclick"],xh={getDefaultCfg:function(){return{trigger:ld,onChange:function(){}}},getEvents:function(){var t,e;return Eh.includes(this.trigger)?e=this.trigger:(e=ld,console.warn("Behavior collapse-expand \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),t={},t["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){e.toggle(t),clearTimeout(e.timer),e.timer=0},200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var r=this.graph.findDataById(e.get("id"));if(r){var n=r.children;if(!(!n||n.length===0)){var a=!r.collapsed;this.shouldBegin(t,a,this)&&(r.collapsed=a,e.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:t.item,collapsed:a}),this.shouldUpdate(t,a,this)&&(this.onChange(e,a,this),this.graph.layout()))}}}}},wh=Vo.calculationItemsBBox,Sh=function E(t,e){if(e(t)!==!1&&t){var r=t.get("combos");if(r.length===0)return!1;(0,s.each)(r,function(n){E(n,e)})}},_h={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;if(!e||e.destroyed||!this.shouldUpdate(t,this))return!1;var r=e.getType();return r==="combo"},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,r=this.graph,n=t.item;if(this.currentShouldEnd=!0,!!this.validationCombo(t)){this.targets=[];var a=r.findAllByState("combo",this.selectedState),i=n.get("id"),o=a.filter(function(l){var h=l.get("id");return i===h});o.length===0?this.targets.push(n):this.targets=a;var u=[];this.targets.forEach(function(l){var h=l.getModel(),y=h.x,O=h.y,A=h.id;u.push({x:y,y:O,id:A})}),this.set("beforeDragItems",u),this.activeState&&this.targets.map(function(l){var h=l.getModel();if(h.parentId){var y=r.findById(h.parentId);y&&r.setItemState(y,e.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],Sh(n,function(l){if(l.destroyed)return!1;var h=l.getModel();return e.currentItemChildCombos.push(h.id),!0})}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var r=this.graph,n=t.item,a=n.getModel(),i=r.getCombos(),o=n.getBBox(),u=o.centerX,l=o.centerY,h=o.width,y=i.filter(function(O){var A=O.getModel();return a.parentId,A.id!==a.id&&!e.currentItemChildCombos.includes(A.id)});y.map(function(O){var A=O.getBBox(),z=A.centerX,$=A.centerY,ae=A.width,ce=u-z,ue=l-$,ve=2*Math.sqrt(ce*ce+ue*ue);h+ae-ve>.8*h?r.setItemState(O,e.activeState,!0):r.setItemState(O,e.activeState,!1)})}(0,s.each)(this.targets,function(O){e.updateCombo(O,t)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var r=this;(this.enableDelegate||e)&&(0,s.each)(this.targets,function(n){r.updateCombo(n,t,e)})},onDrop:function(t){var e=this,r=t.item;if(this.currentShouldEnd=this.shouldEnd(t,r,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!r||!this.targets||r.destroyed)){var n=this.graph,a=r.getModel();this.targets.map(function(i){var o=i.getModel();o.parentId!==a.id?(e.activeState&&n.setItemState(r,e.activeState,!1),e.onlyChangeComboSize?n.updateCombo(i):n.updateComboTree(i,a.id,!1)):n.updateCombo(r)}),this.end(r,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(!(!this.targets||this.targets.length===0)){var r=this.graph,n=t.item,a=n.getModel().comboId,i=a?r.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){var o;if(a){if(this.activeState){var u=r.findById(a);r.setItemState(u,this.activeState,!1)}this.targets.map(function(l){e.onlyChangeComboSize?r.updateCombo(l):a!==l.getID()&&(o=r.findById(a),a!==l.getModel().parentId&&r.updateComboTree(l,a,!1))})}else this.targets.map(function(l){if(e.onlyChangeComboSize)r.updateCombo(l);else{var h=l.getModel();h.comboId&&r.updateComboTree(l,void 0,!1)}});this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(!(!this.targets||this.targets.length===0)){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var r=this.getParentCombo(e.getModel().parentId),n=this.graph;r&&this.activeState&&n.setItemState(r,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var r=this;if(this.origin){var n=this.graph;if(this.delegateShape){var a=n.get("delegateGroup");a.clear(),this.delegateShape=null}if(t&&this.activeState&&n.setItemState(t,this.activeState,!1),!t){var i=n.get("enabledStack")&&this.enableStack,o={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(u){if(!r.onlyChangeComboSize)n.updateComboTree(u,void 0,i);else{n.updateCombo(u);var l=u.getModel(),h=l.x,y=l.y,O=l.id;o.after.combos.push({x:h,y,id:O}),n.pushStack("update",o)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,r){var n=this;if(r===void 0&&(r={}),e(t,r)!==!1&&t){var a=t.get("combos");(0,s.each)(a,function(o){n.traverse(o,e,r)});var i=t.get("nodes");(0,s.each)(i,function(o){n.traverse(o,e,r)})}},updateCombo:function(t,e,r){this.updateSingleItem(t,e,r);var n={};this.traverse(t,function(a,i){return a.destroyed?!1:(a.getEdges().forEach(function(o){return i[o.getID()]=o}),!0)},n),Object.values(n).forEach(function(a){return a.refresh()})},updateSingleItem:function(t,e,r){var n=this.origin,a=this.graph,i=t.getModel(),o=t.get("id");this.point[o]||(this.point[o]={x:i.x,y:i.y});var u=e.x-n.x+this.point[o].x,l=e.y-n.y+this.point[o].y;r&&(u+=n.x-e.x,l+=n.y-e.y),a.updateItem(t,{x:u,y:l},!1)},getParentCombo:function(t){var e=this.graph;if(t){var r=e.findById(t);if(r)return r}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var O=t.x-this.origin.x+this.originPoint.minX,A=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:O,y:A})}else{var r=e.get("delegateGroup"),n=null;this.targets.length>1?n=wh(this.targets):n=this.targets[0].getBBox();var a=n.x,i=n.y,o=n.width,u=n.height,l=n.minX,h=n.minY;this.originPoint={x:a,y:i,width:o,height:u,minX:l,minY:h};var y=(0,c.__assign)((0,c.__assign)({},qi.delegateStyle),this.delegateStyle);this.delegateShape=r.addShape("rect",{attrs:(0,c.__assign)({width:n.width,height:n.height,x:n.x,y:n.y},y),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this,e=t.graph,r=t.targets,n={};r==null||r.forEach(function(a){var i=a.getModel().parentId;i&&(n[i]=e.findById(i))}),Object.values(n).forEach(function(a){a&&e.updateCombo(a)})}},dd="dblclick",Mh=["click","dblclick"],Ch={getDefaultCfg:function(){return{trigger:dd,relayout:!0}},getEvents:function(){var t,e;return Mh.includes(this.trigger)?e=this.trigger:(e=dd,console.warn("Behavior collapse-expand-group \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),t={},t["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,r=this,n=r.graph,a=r.relayout;if(!(!e||e.destroyed||e.getType()!=="combo")){var i=e.getModel(),o=i.id;o&&(n.collapseExpandCombo(o),a&&n.get("layout")?n.layout():n.refreshPositions())}}},Th=Vo.isPolygonsIntersect,Ih=Vo.pathToPoints,hd="shift",Ah=["drag","shift","ctrl","alt","control"],Oh=function(t,e){var r,n=t.getKeyShape();if(t.get("type")==="path")r=Ih(n.attr("path"));else{var a=n.getCanvasBBox();r=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return Th(e,r)},Lh={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:hd,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return Ah.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=hd,console.warn("Behavior lasso-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso,r=t.item;r||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&(this.trigger!=="drag"&&!this.keydown||(this.points.push({x:t.x,y:t.y}),this.updateLasso(t)))},onDragEnd:function(t){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach(function(r,n){n===0?e.push(["M",r.x,r.y]):e.push(["L",r.x,r.y])}),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){t===void 0&&(t="canvas:click");var e=this,r=e.graph,n=e.selectedState,a=e.shouldDeselect,i=r.findAllByState("node",n),o=r.findAllByState("edge",n);(!a||a({action:t,nodes:i,edges:o}))&&(i.forEach(function(u){return r.setItemState(u,n,!1)}),o.forEach(function(u){return r.setItemState(u,n,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],r.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this,r=e.graph,n=e.shouldUpdate,a=this.points.map(function(h){return[r.getCanvasByPoint(h.x,h.y).x,r.getCanvasByPoint(h.x,h.y).y]}),i=this.selectedState,o=[],u=[];r.getNodes().forEach(function(h){if(h.isVisible()&&Oh(h,a)&&n(h,"select",t)){o.push(h);var y=h.getModel();u.push(y.id),r.setItemState(h,i,!0)}});var l=[];this.includeEdges&&o.forEach(function(h){var y=h.getOutEdges();y.forEach(function(O){if(O.isVisible()){var A=O.getModel(),z=A.source,$=A.target;u.includes(z)&&u.includes($)&&n(O,"select",t)&&(l.push(O),r.setItemState(O,t.selectedState,!0))}})}),this.selectedEdges=l,this.selectedNodes=o,this.onSelect&&this.onSelect(o,l),r.emit("nodeselectchange",{selectedItems:{nodes:o,edges:l},select:!0})},createLasso:function(){var t=this,e=t.graph.get("delegateGroup").addShape("path",{attrs:(0,c.__assign)({path:[]},t.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=e,this.delegate=e,this.points=[],e},updateLasso:function(t){var e=this;this.lasso.attr({path:e.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},vd="click",Dh=["click","drag"],gd=void 0,Nh=["shift","ctrl","control","alt","meta",void 0],Ph={getDefaultCfg:function(){return{trigger:vd,key:gd,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t=this;Dh.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=vd,console.warn("Behavior create-edge \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click'\uFF0C'drag'")),t.key&&Nh.indexOf(t.key.toLowerCase())===-1&&(t.trigger=gd,console.warn("Behavior create-edge \u7684 key \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'shift'\uFF0C'ctrl'\uFF0C'alt'\uFF0C'control'\uFF0C\u6216 undefined"));var e;return t.trigger==="drag"?e={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:t.trigger==="click"&&(e={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),t.key&&(e.keydown="onKeyDown",e.keyup="onKeyUp"),e},onDragEnd:function(t){var e=this;if(!(e.key&&!e.keydown)){var r=t.item;(!r||r.getID()===e.source||r.getType()!=="node")&&e.cancelCreating({item:e.edge,x:t.x,y:t.y})}},onClick:function(t){var e=this;if(!(e.key&&!e.keydown)){var r=t.item,n=e.graph,a=r.getModel(),i=e.getEdgeConfig;if(e.addingEdge&&e.edge){if(!e.shouldEnd(t,e))return;var o=void 0;i&&(0,s.isFunction)(i)?o=i({source:e.source,target:a.id},e):o=e.edgeConfig;var u=(0,c.__assign)({target:a.id},o);if(e.source===a.id&&(u.type="loop"),n.emit("beforecreateedge",{}),n.updateItem(e.edge,u,!1),n.get("enabledStack")){var l=(0,c.__assign)((0,c.__assign)({},e.edge.getModel()),{itemType:"edge"}),h={};h.edges=[l],n.pushStack("add",{before:{},after:h})}n.emit("aftercreateedge",{edge:e.edge}),e.edge.getKeyShape().set("capture",!0),e.edge=null,e.addingEdge=!1}else{if(!e.shouldBegin(t,e))return;var o=void 0;i&&(0,s.isFunction)(i)?o=i({source:a.id,target:a.id},e):o=e.edgeConfig,e.edge=n.addItem("edge",(0,c.__assign)({source:a.id,target:a.id},o),!1),e.source=a.id,e.addingEdge=!0,e.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){var e=this;if(!(e.key&&!e.keydown)){e.edge&&e.edge.destroyed&&e.cancelCreating({item:e.edge});var r={x:t.x,y:t.y};if(!e.graph.findById(e.source)){e.addingEdge=!1;return}e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:r},!1)}},cancelCreating:function(t){var e,r,n=this;if(!(n.key&&!n.keydown)){var a=n.graph,i=t.item;if(n.addingEdge&&(n.edge===i||!((r=(e=t.target)===null||e===void 0?void 0:e.isCanvas)===null||r===void 0)&&r.call(e))){n.edge&&!n.edge.destroyed&&a.removeItem(n.edge,!1),n.edge=null,n.addingEdge=!1;return}}},onKeyDown:function(t){var e=this,r=t.key;r&&(r.toLowerCase()===e.key.toLowerCase()?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.addingEdge&&t.edge&&(t.graph.removeItem(t.edge,!1),t.addingEdge=!1,t.edge=null),this.keydown=!1}},pd="ctrl",kh=["shift","ctrl","alt","control"],Rh="1",Bh={getDefaultCfg:function(){return{trigger:pd,combinedKey:Rh,functionName:"fitView",functionParams:[]}},getEvents:function(){return kh.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=pd,console.warn("Behavior shortcuts-fit-view \u7684 trigger \u53C2\u6570 '".concat(this.trigger,"' \u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.triggerKeydown||(n===r||n==="control"&&r==="ctrl"||n==="ctrl"&&r==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view \u7684 functionName \u53C2\u6570 '".concat(this.functionName,"' \u4E0D\u5408\u6CD5\uFF0C\u5B83\u4E0D\u662F Graph \u7684\u4E00\u4E2A\u51FD\u6570\u540D")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var i=this.combinedKey.toLowerCase();this.triggerKeydown&&(n===i||n==="control"&&i==="ctrl"||n==="ctrl"&&i==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}},Fh=["shift","ctrl","alt","control","meta"],Gh={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||Fh.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var r=this.graph,n=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];n.includes("control")&&n.push("ctrl");var a=n.some(function(Rr){return t["".concat(Rr,"Key")]});if(a){var i=r.get("canvas"),o=i.getPointByClient(t.clientX,t.clientY),u=r.getZoom();t.wheelDelta>0?u=u+u*.05:u=u-u*.05,r.zoomTo(u,{x:o.x,y:o.y})}else{var l=t.deltaX||t.movementX,h=t.deltaY||t.movementY;!h&&navigator.userAgent.indexOf("Firefox")>-1&&(h=-t.wheelDelta*125/3);var y=this.graph.get("width"),O=this.graph.get("height"),A=this.graph.get("canvas").getCanvasBBox(),z=this.scalableRange,$=this.scalableRange;z<1&&z>-1&&(z=y*z,$=O*$);var ae=A.minX,ce=A.maxX,ue=A.minY,ve=A.maxY;l>0?ce<-z?l=0:ce-l<-z&&(l=ce+z):l<0&&(ae>y+z?l=0:ae-l>y+z&&(l=ae-(y+z))),h>0?ve<-$?h=0:ve-h<-$&&(h=ve+$):h<0&&(ue>O+$?h=0:ue-h>O+$&&(h=ue-(O+$))),this.get("direction")==="x"?h=0:this.get("direction")==="y"&&(l=0),r.translate(-l,-h)}t.preventDefault();var Ce=this.get("enableOptimize");if(Ce){var Re=this.get("optimizeZoom"),Ve=this.get("optimized"),Ue=r.getNodes(),$e=r.getEdges(),ot=Ue.length,et=$e.length;if(!Ve){for(var yt=0;yt<ot;yt++){var Gt=Ue[yt];if(!Gt.destroyed)for(var yr=Gt.get("group").get("children"),kr=yr.length,Mr=0;Mr<kr;Mr++){var dr=yr[Mr];!dr.destoryed&&!dr.get("isKeyShape")&&(dr.set("ori-visibility",dr.get("ori-visibility")||dr.get("visible")),dr.hide())}}for(var hn=0;hn<et;hn++)for(var on=$e[hn],yr=on.get("group").get("children"),kr=yr.length,Mr=0;Mr<kr;Mr++){var dr=yr[Mr];dr.set("ori-visibility",dr.get("ori-visibility")||dr.get("visible")),dr.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var cr=setTimeout(function(){var Rr=r.getZoom(),Yr=e.get("optimized");if(Yr){e.set("optimized",!1);for(var Wr=0;Wr<ot;Wr++){var sn=Ue[Wr],wn=sn.get("group").get("children"),la=wn.length;if(Rr<Re){var da=sn.getKeyShape(),Ra=da.get("ori-visibility");Ra&&da.show()}else for(var Ia=0;Ia<la;Ia++){var Xa=wn[Ia],Ra=Xa.get("ori-visibility");!Xa.get("visible")&&Ra&&Ra&&Xa.show()}}for(var Ga=0;Ga<et;Ga++){var ci=$e[Ga],wn=ci.get("group").get("children"),la=wn.length;if(Rr<Re){var da=ci.getKeyShape(),Ra=da.get("ori-visibility");Ra&&da.show()}else for(var Ia=0;Ia<la;Ia++){var Xa=wn[Ia];if(!Xa.get("visible")){var Ra=Xa.get("ori-visibility");Ra&&Xa.show()}}}}},100);this.set("timeout",cr)}}},allowDrag:function(t){var e,r,n=t.target,a=n&&n.isCanvas&&n.isCanvas();if((0,s.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if((0,s.isObject)(this.allowDragOnItem)){var i=this.allowDragOnItem,o=i.node,u=i.edge,l=i.combo,h=(r=(e=t.item)===null||e===void 0?void 0:e.getType)===null||r===void 0?void 0:r.call(e);if(!o&&h==="node"||!u&&h==="edge"||!l&&h==="combo")return!1}return!0}},zh={"drag-canvas":fh,"zoom-canvas":yh,"drag-node":ch,"activate-relations":lh,"brush-select":hh,"click-select":gh,"lasso-select":Lh,tooltip:mh,"edge-tooltip":bh,"collapse-expand":xh,"drag-combo":_h,"collapse-expand-combo":Ch,"create-edge":Ph,"shortcuts-call":Bh,"scroll-canvas":Gh};(0,s.each)(zh,function(E,t){_s(t,E)});var Uh=(0,c.__assign)((0,c.__assign)({},k),al),iv=Pi.Grid,ov=Pi.Minimap,sv=Pi.Bundling,uv=Pi.Menu,Wh=Pi.Fisheye,fv=Pi.ToolBar,cv=Pi.Tooltip,Xh=Pi.TimeBar,jh=Pi.ImageMinimap,Vh=Pi.EdgeFilterLens,Yh=Pi.SnapLine,lv=Pi.Legend,Hh=Pi.Annotation,yd={version:qi.version,Graph:Du,TreeGraph:hl,Util:Vo,Layout:ua.Layouts,TreeLayout:Uc,registerLayout:Wc,Global:qi,registerBehavior:_s,registerCombo:Uo,registerEdge:qu,registerNode:so,Minimap:Pi.Minimap,Grid:Pi.Grid,Bundling:Pi.Bundling,Menu:Pi.Menu,ToolBar:Pi.ToolBar,Tooltip:Pi.Tooltip,Legend:Pi.Legend,TimeBar:Xh,SnapLine:Yh,Fisheye:Wh,ImageMinimap:jh,EdgeFilterLens:Vh,Annotation:Hh,Algorithm:Uh,Arrow:To,Marker:$s,Shape:Qi};yd.version="4.8.23";var Zh=yd,dv="4.8.23"},12130:function(Mt,N,F){"use strict";F.r(N),F.d(N,{Graph:function(){return Z},GraphWithEvent:function(){return tt},algorithm:function(){return k},comparision:function(){return L},essence:function(){return U},generate:function(){return _}});var k={};F.r(k),F.d(k,{components:function(){return dt},dfs:function(){return mt},dijkstra:function(){return Cr},dijkstraAll:function(){return mr},findCycles:function(){return Rn},floydWarshall:function(){return me},isAcyclic:function(){return ie},postorder:function(){return C},preorder:function(){return S},prim:function(){return ut},tarjan:function(){return Sr},topsort:function(){return Wn}});var U={};F.r(U),F.d(U,{hasSelfLoop:function(){return Zn},isGraph:function(){return gn},isNullGraph:function(){return ra},isSimpleGraph:function(){return Tn}});var L={};F.r(L),F.d(L,{containAllSameEdges:function(){return er},containAllSameNodes:function(){return Ft},containSameEdges:function(){return st},containSameNodes:function(){return Le},getSameEdges:function(){return Nt},getSameNodes:function(){return qe},isGraphComplement:function(){return Vr},isGraphContainsAnother:function(){return Ct},isGraphOptionSame:function(){return nr},isGraphSame:function(){return Ur}});var _={};F.r(_),F.d(_,{getGraphComplement:function(){return In}});var I;(function(at){at.DEFAULT_EDGE_NAME="\0",at.GRAPH_NODE="\0",at.EDGE_KEY_DELIM=""})(I||(I={}));function T(at,D){var te=at.get(D)||0;at.set(D,te+1)}function x(at,D){var te=at.get(D);te!==void 0&&(te=te-1,te>0?at.set(D,te):at.delete(D))}function p(at,D,te,xe){var be=String(D),De=String(te);if(!at&&be>De){var Xe=be;be=De,De=Xe}return be+I.EDGE_KEY_DELIM+De+I.EDGE_KEY_DELIM+(xe===void 0?I.DEFAULT_EDGE_NAME:xe)}function v(at,D,te,xe){var be=String(D),De=String(te),Xe={v:D,w:te};if(!at&&be>De){var Je=Xe.v;Xe.v=Xe.w,Xe.w=Je}return xe!==void 0&&(Xe.name=xe),Xe}function g(at,D){return p(at,D.v,D.w,D.name)}function d(at){return typeof at=="function"}var c=function(D){return D.nodes().map(function(te){var xe=D.node(te),be=D.parent(te),De={id:te,value:xe,parent:be};return De.value===void 0&&delete De.value,De.parent===void 0&&delete De.parent,De})},s=function(D){return D.edges().map(function(te){var xe=D.edge(te),be={v:te.v,w:te.w,value:xe,name:te.name};return be.name===void 0&&delete be.name,be.value===void 0&&delete be.value,be})},m=function(D){var te={options:{directed:D.isDirected(),multigraph:D.isMultigraph(),compound:D.isCompound()},nodes:c(D),edges:s(D),value:D.graph()};return te.value===void 0&&delete te.value,te},M=function(D){var te=new Z(D.options);return D.value!==void 0&&te.setGraph(D.value),D.nodes.forEach(function(xe){te.setNode(xe.id,xe.value),xe.parent&&te.setParent(xe.id,xe.parent)}),D.edges.forEach(function(xe){te.setEdge(xe.v,xe.w,xe.value,xe.name)}),te};function P(at,D){var te=Object.keys(at);if(Object.getOwnPropertySymbols){var xe=Object.getOwnPropertySymbols(at);D&&(xe=xe.filter(function(be){return Object.getOwnPropertyDescriptor(at,be).enumerable})),te.push.apply(te,xe)}return te}function R(at){for(var D=1;D<arguments.length;D++){var te=arguments[D]!=null?arguments[D]:{};D%2?P(Object(te),!0).forEach(function(xe){j(at,xe,te[xe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(at,Object.getOwnPropertyDescriptors(te)):P(Object(te)).forEach(function(xe){Object.defineProperty(at,xe,Object.getOwnPropertyDescriptor(te,xe))})}return at}function j(at,D,te){return D in at?Object.defineProperty(at,D,{value:te,enumerable:!0,configurable:!0,writable:!0}):at[D]=te,at}function Q(at,D){if(!(at instanceof D))throw new TypeError("Cannot call a class as a function")}function G(at,D){for(var te=0;te<D.length;te++){var xe=D[te];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(at,xe.key,xe)}}function W(at,D,te){return D&&G(at.prototype,D),te&&G(at,te),Object.defineProperty(at,"prototype",{writable:!1}),at}var H={compound:!1,multigraph:!1,directed:!0},Z=function(){function at(){var D=this,te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Q(this,at),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=I.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return D.directed},this.isMultigraph=function(){return D.multigraph},this.isCompound=function(){return D.compound},this.setGraph=function(be){return D.label=be,D},this.graph=function(){return D.label},this.setDefaultNodeLabel=function(be){return d(be)?D.defaultNodeLabelFn=be:D.defaultNodeLabelFn=function(){return be},D},this.nodeCount=function(){return D.nodeCountNum},this.node=function(be){return D.nodesLabelMap.get(be)},this.nodes=function(){return Array.from(D.nodesLabelMap.keys())},this.sources=function(){return D.nodes().filter(function(be){var De;return!(!((De=D.inEdgesMap.get(be))===null||De===void 0)&&De.size)})},this.sinks=function(){return D.nodes().filter(function(be){var De;return!(!((De=D.outEdgesMap.get(be))===null||De===void 0)&&De.size)})},this.setNodes=function(be,De){return be.map(function(Xe){return D.setNode(Xe,De)}),D},this.hasNode=function(be){return D.nodesLabelMap.has(be)},this.checkCompound=function(){if(!D.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(be){if(D.isCompound()){var De,Xe=(De=D.parentMap)===null||De===void 0?void 0:De.get(be);if(Xe!==D.GRAPH_NODE)return Xe}},this.removeFromParentsChildList=function(be){var De=D.parentMap.get(be);D.childrenMap.get(De).delete(be)},this.setParent=function(be,De){var Xe,Je;D.checkCompound();for(var lt=De===void 0?D.GRAPH_NODE:De,Tt=D.parent(lt);Tt;){if(be===Tt)throw new Error("Setting "+De+" as parent of "+be+" would create a cycle");Tt=D.parent(Tt)}De&&D.setNode(De),D.setNode(be),D.removeFromParentsChildList(be),(Xe=D.parentMap)===null||Xe===void 0||Xe.set(be,lt);var Ht=D.childrenMap.get(lt);return Ht.set(be,!0),(Je=D.childrenMap)===null||Je===void 0||Je.set(lt,Ht),D},this.children=function(be){var De=be===void 0?D.GRAPH_NODE:be;if(D.isCompound()){var Xe,Je=(Xe=D.childrenMap)===null||Xe===void 0?void 0:Xe.get(De);return Je?Array.from(Je.keys()):void 0}if(De===D.GRAPH_NODE)return D.nodes();if(be&&D.hasNode(be))return[]},this.predecessors=function(be){var De=D.predecessorsMap.get(be);return De?Array.from(De.keys()):void 0},this.successors=function(be){var De=D.successorsMap.get(be);return De?Array.from(De.keys()):void 0},this.neighbors=function(be){var De;if(D.hasNode(be))return Array.from(new Set((De=D.predecessors(be))===null||De===void 0?void 0:De.concat(D.successors(be))))},this.isLeaf=function(be){var De;if(D.isDirected()){var Xe;return!(!((Xe=D.successors(be))===null||Xe===void 0)&&Xe.length)}return!(!((De=D.neighbors(be))===null||De===void 0)&&De.length)},this.filterNodes=function(be){var De=D.directed,Xe=D.multigraph,Je=D.compound,lt=new at({directed:De,multigraph:Xe,compound:Je});if(lt.setGraph(D.graph()),D.nodes().forEach(function(Ht){be(Ht)&&lt.setNode(Ht,D.node(Ht))}),D.edges().forEach(function(Ht){lt.hasNode(Ht.v)&&lt.hasNode(Ht.w)&&lt.setEdgeObj(Ht,D.edge(Ht))}),Je){var Tt=function(ir){for(var Kr=D.parent(ir);Kr!==void 0&&!lt.hasNode(Kr);)Kr=D.parent(Kr);return Kr};lt.nodes().forEach(function(Ht){lt.setParent(Ht,Tt(Ht))})}return lt},this.setDefaultEdgeLabel=function(be){return d(be)?D.defaultEdgeLabelFn=be:D.defaultEdgeLabelFn=function(){return be},D},this.edgeCount=function(){return D.edgeCountNum},this.setEdgeObj=function(be,De){return D.setEdge(be.v,be.w,De,be.name)},this.setPath=function(be,De){return be.reduce(function(Xe,Je){return D.setEdge(Xe,Je,De),Je}),D},this.edgeFromArgs=function(be,De,Xe){return D.edge({v:be,w:De,name:Xe})},this.edge=function(be){return D.edgesLabelsMap.get(g(D.isDirected(),be))},this.hasEdge=function(be,De,Xe){return D.edgesLabelsMap.has(g(D.isDirected(),{v:be,w:De,name:Xe}))},this.removeEdgeObj=function(be){var De=be.v,Xe=be.w,Je=be.name;return D.removeEdge(De,Xe,Je)},this.edges=function(){return Array.from(D.edgesMap.values())},this.inEdges=function(be,De){var Xe=D.inEdgesMap.get(be);if(Xe)return Array.from(Xe.values()).filter(function(Je){return!De||Je.v===De})},this.outEdges=function(be,De){var Xe=D.outEdgesMap.get(be);if(Xe)return Array.from(Xe.values()).filter(function(Je){return!De||Je.w===De})},this.nodeEdges=function(be,De){var Xe;if(D.hasNode(be))return(Xe=D.inEdges(be,De))===null||Xe===void 0?void 0:Xe.concat(D.outEdges(be,De))},this.toJSON=function(){return m(D)},this.nodeInDegree=function(be){var De=D.inEdgesMap.get(be);return De?De.size:0},this.nodeOutDegree=function(be){var De=D.outEdgesMap.get(be);return De?De.size:0},this.nodeDegree=function(be){return D.nodeInDegree(be)+D.nodeOutDegree(be)},this.source=function(be){return be.v},this.target=function(be){return be.w};var xe=R(R({},H),te);this.compound=xe.compound,this.directed=xe.directed,this.multigraph=xe.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return W(at,[{key:"setNode",value:function(te,xe){var be=this.nodesLabelMap,De=this.defaultNodeLabelFn,Xe=this.isCompound,Je=this.parentMap,lt=this.childrenMap,Tt=this.inEdgesMap,Ht=this.outEdgesMap,ir=this.predecessorsMap,Kr=this.successorsMap;if(be.has(te))return xe!==void 0&&be.set(te,xe),this;if(be.set(te,xe||De(te)),Xe()){var nn;Je==null||Je.set(te,this.GRAPH_NODE),lt==null||lt.set(te,new Map),lt!=null&&lt.has(this.GRAPH_NODE)||lt==null||lt.set(this.GRAPH_NODE,new Map),lt==null||(nn=lt.get(this.GRAPH_NODE))===null||nn===void 0||nn.set(te,!0)}return[Tt,Ht,ir,Kr].forEach(function(mn){return mn.set(te,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(te){var xe=this;if(this.hasNode(te)){var be=function(jn){xe.removeEdge(jn.v,jn.w,jn.name)},De=this.inEdgesMap,Xe=this.outEdgesMap,Je=this.predecessorsMap,lt=this.successorsMap,Tt=this.nodesLabelMap;if(this.isCompound()){var Ht,ir,Kr;this.removeFromParentsChildList(te),(Ht=this.parentMap)===null||Ht===void 0||Ht.delete(te),(ir=this.children(te))===null||ir===void 0||ir.forEach(function(Jr){return xe.setParent(Jr)}),(Kr=this.childrenMap)===null||Kr===void 0||Kr.delete(te)}var nn=De.get(te),mn=Xe.get(te);Array.from(nn.values()).forEach(function(Jr){return be(Jr)}),Array.from(mn.values()).forEach(function(Jr){return be(Jr)}),Tt.delete(te),De.delete(te),Xe.delete(te),Je.delete(te),lt.delete(te),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(te,xe,be,De){var Xe,Je,lt=v(this.isDirected(),te,xe,De),Tt=g(this.isDirected(),lt),Ht=lt.v,ir=lt.w;if(this.edgesLabelsMap.has(Tt))return this.edgesLabelsMap.set(Tt,be),this;if(De!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(Ht),this.setNode(ir),this.edgesLabelsMap.set(Tt,be||this.defaultEdgeLabelFn(Ht,ir,De)),Object.freeze(lt),this.edgesMap.set(Tt,lt);var Kr=this.predecessorsMap.get(ir),nn=this.successorsMap.get(Ht);return T(Kr,Ht),T(nn,ir),(Xe=this.inEdgesMap.get(ir))===null||Xe===void 0||Xe.set(Tt,lt),(Je=this.outEdgesMap.get(Ht))===null||Je===void 0||Je.set(Tt,lt),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(te,xe,be){var De=p(this.isDirected(),te,xe,be),Xe=this.edgesMap.get(De);if(Xe){var Je=v(this.isDirected(),te,xe,be),lt=Je.v,Tt=Je.w;this.edgesLabelsMap.delete(De),this.edgesMap.delete(De);var Ht=this.predecessorsMap.get(Tt),ir=this.successorsMap.get(lt);x(Ht,lt),x(ir,Tt),this.inEdgesMap.get(Tt).delete(De),this.outEdgesMap.get(lt).delete(De),this.edgeCountNum-=1}return this}}]),at}();Z.fromJSON=M;function J(at){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},J(at)}function K(at,D){if(!(at instanceof D))throw new TypeError("Cannot call a class as a function")}function ne(at,D){for(var te=0;te<D.length;te++){var xe=D[te];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(at,xe.key,xe)}}function se(at,D,te){return D&&ne(at.prototype,D),te&&ne(at,te),Object.defineProperty(at,"prototype",{writable:!1}),at}function fe(){return typeof Reflect!="undefined"&&Reflect.get?fe=Reflect.get:fe=function(D,te,xe){var be=Ie(D,te);if(be){var De=Object.getOwnPropertyDescriptor(be,te);return De.get?De.get.call(arguments.length<3?D:xe):De.value}},fe.apply(this,arguments)}function Ie(at,D){for(;!Object.prototype.hasOwnProperty.call(at,D)&&(at=Ge(at),at!==null););return at}function ye(at,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function");at.prototype=Object.create(D&&D.prototype,{constructor:{value:at,writable:!0,configurable:!0}}),Object.defineProperty(at,"prototype",{writable:!1}),D&&Ae(at,D)}function Ae(at,D){return Ae=Object.setPrototypeOf||function(xe,be){return xe.__proto__=be,xe},Ae(at,D)}function Se(at){var D=ke();return function(){var xe=Ge(at),be;if(D){var De=Ge(this).constructor;be=Reflect.construct(xe,arguments,De)}else be=xe.apply(this,arguments);return we(this,be)}}function we(at,D){if(D&&(J(D)==="object"||typeof D=="function"))return D;if(D!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Te(at)}function Te(at){if(at===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return at}function ke(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(at){return!1}}function Ge(at){return Ge=Object.setPrototypeOf?Object.getPrototypeOf:function(te){return te.__proto__||Object.getPrototypeOf(te)},Ge(at)}var tt=function(at){ye(te,at);var D=Se(te);function te(){var xe;K(this,te);for(var be=arguments.length,De=new Array(be),Xe=0;Xe<be;Xe++)De[Xe]=arguments[Xe];return xe=D.call.apply(D,[this].concat(De)),xe.eventPool={},xe}return se(te,[{key:"appendEvent",value:function(be,De){this.eventPool[be]||(this.eventPool[be]=[]),this.eventPool[be].push(De)}},{key:"removeEvent",value:function(be,De){if(this.eventPool[be]){var Xe=this.eventPool[be].indexOf(De);Xe>-1&&this.eventPool[be].splice(Xe,1)}}},{key:"emitEvent",value:function(be){for(var De=arguments.length,Xe=new Array(De>1?De-1:0),Je=1;Je<De;Je++)Xe[Je-1]=arguments[Je];this.eventPool[be]&&this.eventPool[be].forEach(function(lt){lt.apply(void 0,Xe)})}},{key:"setNode",value:function(be,De){return fe(Ge(te.prototype),"setNode",this).call(this,be,De),this.emitEvent("nodeAdd",be,De),this}},{key:"removeNode",value:function(be){return fe(Ge(te.prototype),"removeNode",this).call(this,be),this.emitEvent("nodeRemove",be),this}},{key:"setEdge",value:function(be,De,Xe,Je){return fe(Ge(te.prototype),"setEdge",this).call(this,be,De,Xe,Je),this.emitEvent("edgeAdd",be,De,Xe,Je),this}},{key:"removeEdge",value:function(be,De,Xe){return fe(Ge(te.prototype),"removeEdge",this).call(this,be,De,Xe),this.emitEvent("edgeRemove",be,De,Xe),this}}]),te}(Z);function He(at,D){for(var te=0;te<D.length;te++){var xe=D[te];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(at,xe.key,xe)}}function ft(at,D,te){return D&&He(at.prototype,D),te&&He(at,te),Object.defineProperty(at,"prototype",{writable:!1}),at}function Lt(at,D){if(!(at instanceof D))throw new TypeError("Cannot call a class as a function")}var Jt=ft(function at(){var D=this;Lt(this,at),this.arr=[],this.keyIndice=new Map,this.size=function(){return D.arr.length},this.keys=function(){return D.arr.map(function(te){return te.key})},this.has=function(te){return D.keyIndice.has(te)},this.priority=function(te){var xe=D.keyIndice.get(te);if(xe!==void 0)return D.arr[xe].priority},this.swap=function(te,xe){var be=D.arr,De=D.keyIndice,Xe=[be[te],be[xe]],Je=Xe[0],lt=Xe[1];be[te]=lt,be[xe]=Je,De.set(Je.key,xe),De.set(lt.key,te)},this.innerDecrease=function(te){for(var xe=D.arr,be=xe[te].priority,De,Xe=te;Xe!==0;){var Je;if(De=Xe>>1,((Je=xe[De])===null||Je===void 0?void 0:Je.priority)<be)break;D.swap(Xe,De),Xe=De}},this.heapify=function(te){var xe=D.arr,be=te<<1,De=be+1,Xe=te;be<xe.length&&(Xe=xe[be].priority<xe[Xe].priority?be:Xe,De<xe.length&&(Xe=xe[De].priority<xe[Xe].priority?De:Xe),Xe!==te&&(D.swap(te,Xe),D.heapify(Xe)))},this.min=function(){if(D.size()===0)throw new Error("Queue underflow");return D.arr[0].key},this.add=function(te,xe){var be=D.keyIndice,De=D.arr;if(!be.has(te)){var Xe=De.length;return be.set(te,Xe),De.push({key:te,priority:xe}),D.innerDecrease(Xe),!0}return!1},this.removeMin=function(){D.swap(0,D.arr.length-1);var te=D.arr.pop();return D.keyIndice.delete(te.key),D.heapify(0),te.key},this.decrease=function(te,xe){if(!D.has(te))throw new Error("There's no key named ".concat(te));var be=D.keyIndice.get(te);if(xe>D.arr[be].priority)throw new Error("New priority is greater than current priority.Key: ".concat(te," Old: + ").concat(D.arr[be].priority," New: ").concat(xe));D.arr[be].priority=xe,D.innerDecrease(be)}}),Qe=function(D,te){var xe=new Z,be=new Map,De=new Jt,Xe;function Je(Ht){var ir=Ht.v===Xe?Ht.w:Ht.v,Kr=De.priority(ir);if(Kr!==void 0){var nn=te(Ht);nn<Kr&&(be.set(ir,Xe),De.decrease(ir,nn))}}if(D.nodeCount()===0)return xe;D.nodes().forEach(function(Ht){De.add(Ht,Number.POSITIVE_INFINITY),xe.setNode(Ht)}),De.decrease(D.nodes()[0],0);for(var lt=!1;De.size()>0;){var Tt;if(Xe=De.removeMin(),be.has(Xe))xe.setEdge(Xe,be.get(Xe));else{if(lt)throw new Error("Input graph is not connected: "+D.graph());lt=!0}(Tt=D.nodeEdges(Xe))===null||Tt===void 0||Tt.forEach(Je)}return xe},ut=Qe,xt=function(D){var te=new Set,xe=[],be=D.nodes();return be.forEach(function(De){for(var Xe=[],Je=[De];Je.length>0;){var lt=Je.pop();if(!te.has(lt)){var Tt,Ht;te.add(lt),Xe.push(lt),(Tt=D.successors(lt))===null||Tt===void 0||Tt.forEach(function(ir){return Je.push(ir)}),(Ht=D.predecessors(lt))===null||Ht===void 0||Ht.forEach(function(ir){return Je.push(ir)})}}Xe.length&&xe.push(Xe)}),xe},dt=xt,pt=function at(D,te,xe,be,De,Xe){be.includes(te)||(be.push(te),xe||Xe.push(te),De(te).forEach(function(Je){return at(D,Je,xe,be,De,Xe)}),xe&&Xe.push(te))},wt=function(D,te,xe){var be=Array.isArray(te)?te:[te],De=function(Tt){return D.isDirected()?D.successors(Tt):D.neighbors(Tt)},Xe=[],Je=[];return be.forEach(function(lt){if(D.hasNode(lt))pt(D,lt,xe==="post",Je,De,Xe);else throw new Error("Graph does not have node: "+lt)}),Xe},mt=wt;function ur(at,D){return qt(at)||It(at,D)||Nr(at,D)||Ir()}function Ir(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nr(at,D){if(at){if(typeof at=="string")return Hr(at,D);var te=Object.prototype.toString.call(at).slice(8,-1);if(te==="Object"&&at.constructor&&(te=at.constructor.name),te==="Map"||te==="Set")return Array.from(at);if(te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(te))return Hr(at,D)}}function Hr(at,D){(D==null||D>at.length)&&(D=at.length);for(var te=0,xe=new Array(D);te<D;te++)xe[te]=at[te];return xe}function It(at,D){var te=at==null?null:typeof Symbol!="undefined"&&at[Symbol.iterator]||at["@@iterator"];if(te!=null){var xe=[],be=!0,De=!1,Xe,Je;try{for(te=te.call(at);!(be=(Xe=te.next()).done)&&(xe.push(Xe.value),!(D&&xe.length===D));be=!0);}catch(lt){De=!0,Je=lt}finally{try{!be&&te.return!=null&&te.return()}finally{if(De)throw Je}}return xe}}function qt(at){if(Array.isArray(at))return at}var ar=function(){return 1},Oe=function(D,te,xe,be){return Pr(D,te,xe||ar,be||function(De){return D.outEdges(De)})},Pr=function(D,te,xe,be){var De=new Map,Xe=new Jt,Je,lt,Tt=function(Kr){var nn=Kr.v!==Je?Kr.v:Kr.w,mn=De.get(nn),Jr=xe(Kr),jn=lt.distance+Jr;if(Jr<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+Kr+" Weight: "+Jr);jn<mn.distance&&(mn.distance=jn,mn.predecessor=Je,Xe.decrease(nn,jn))};for(D.nodes().forEach(function(ir){var Kr=ir===te?0:Number.POSITIVE_INFINITY;De.set(ir,{distance:Kr}),Xe.add(ir,Kr)});Xe.size()>0&&(Je=Xe.removeMin(),lt=De.get(Je),!(lt&&lt.distance===Number.POSITIVE_INFINITY));)be(Je).forEach(Tt);var Ht={};return Array.from(De.entries()).forEach(function(ir){var Kr=ur(ir,2),nn=Kr[0],mn=Kr[1];return Ht[String(nn)]=mn,Ht}),Ht},Cr=Oe,Gr=function(D,te,xe){var be={};return D.nodes().forEach(function(De){return be[String(De)]=Cr(D,De,te,xe),be}),be},mr=Gr,rn=function(D){var te=0,xe=[],be=new Map,De=[];function Xe(Je){var lt,Tt={onStack:!0,lowlink:te,index:te};if(be.set(Je,Tt),te+=1,xe.push(Je),(lt=D.successors(Je))===null||lt===void 0||lt.forEach(function(nn){var mn;if(be.has(nn)){if(!((mn=be.get(nn))===null||mn===void 0)&&mn.onStack){var jn=be.get(nn);Tt.lowlink=Math.min(Tt.lowlink,jn.index)}}else{Xe(nn);var Jr=be.get(nn);Tt.lowlink=Math.min(Tt.lowlink,Jr.lowlink)}}),Tt.lowlink===Tt.index){var Ht=[],ir;do{ir=xe.pop();var Kr=be.get(ir);Kr.onStack=!1,Ht.push(ir)}while(Je!==ir);De.push(Ht)}}return D.nodes().forEach(function(Je){be.has(Je)||Xe(Je)}),De},Sr=rn,qr=function(D){return Sr(D).filter(function(te){return te.length>1||te.length===1&&D.hasEdge(te[0],te[0])})},Rn=qr;function yn(at){"@babel/helpers - typeof";return yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},yn(at)}function zr(at,D){for(var te=0;te<D.length;te++){var xe=D[te];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(at,xe.key,xe)}}function Rt(at,D,te){return D&&zr(at.prototype,D),te&&zr(at,te),Object.defineProperty(at,"prototype",{writable:!1}),at}function zt(at,D){if(!(at instanceof D))throw new TypeError("Cannot call a class as a function")}function Vt(at,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function");at.prototype=Object.create(D&&D.prototype,{constructor:{value:at,writable:!0,configurable:!0}}),Object.defineProperty(at,"prototype",{writable:!1}),D&&jr(at,D)}function hr(at){var D=Sn();return function(){var xe=xn(at),be;if(D){var De=xn(this).constructor;be=Reflect.construct(xe,arguments,De)}else be=xe.apply(this,arguments);return Ar(this,be)}}function Ar(at,D){if(D&&(yn(D)==="object"||typeof D=="function"))return D;if(D!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return en(at)}function en(at){if(at===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return at}function Fr(at){var D=typeof Map=="function"?new Map:void 0;return Fr=function(xe){if(xe===null||!oa(xe))return xe;if(typeof xe!="function")throw new TypeError("Super expression must either be null or a function");if(typeof D!="undefined"){if(D.has(xe))return D.get(xe);D.set(xe,be)}function be(){return Cn(xe,arguments,xn(this).constructor)}return be.prototype=Object.create(xe.prototype,{constructor:{value:be,enumerable:!1,writable:!0,configurable:!0}}),jr(be,xe)},Fr(at)}function Cn(at,D,te){return Sn()?Cn=Reflect.construct:Cn=function(be,De,Xe){var Je=[null];Je.push.apply(Je,De);var lt=Function.bind.apply(be,Je),Tt=new lt;return Xe&&jr(Tt,Xe.prototype),Tt},Cn.apply(null,arguments)}function Sn(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(at){return!1}}function oa(at){return Function.toString.call(at).indexOf("[native code]")!==-1}function jr(at,D){return jr=Object.setPrototypeOf||function(xe,be){return xe.__proto__=be,xe},jr(at,D)}function xn(at){return xn=Object.setPrototypeOf?Object.getPrototypeOf:function(te){return te.__proto__||Object.getPrototypeOf(te)},xn(at)}var vn=function(at){Vt(te,at);var D=hr(te);function te(){return zt(this,te),D.apply(this,arguments)}return Rt(te)}(Fr(Error));function un(at){var D=new Set,te=new Set,xe=[];function be(De){if(te.has(De))throw new vn;if(!D.has(De)){var Xe;te.add(De),D.add(De),(Xe=at.predecessors(De))===null||Xe===void 0||Xe.forEach(be),te.delete(De),xe.push(De)}}if(at.sinks().forEach(be),D.size!==at.nodeCount())throw new vn;return xe}var Wn=un,Y=function(D){try{Wn(D)}catch(te){if(te instanceof vn)return!1;throw te}return!0},ie=Y,ee=function(D,te){return mt(D,te,"post")},C=ee,b=function(D,te){return mt(D,te,"pre")},S=b,X=function(){return 1};function pe(at,D,te){return Me(at,D||X,te||function(xe){return at.outEdges(xe)})}function Me(at,D,te){var xe={},be=at.nodes();return be.forEach(function(De){var Xe=String(De);xe[Xe]={},xe[Xe][Xe]={distance:0},be.forEach(function(Je){De!==Je&&(xe[Xe][String(Je)]={distance:Number.POSITIVE_INFINITY})}),te(De).forEach(function(Je){var lt=Je.v===De?Je.w:Je.v,Tt=D(Je);xe[Xe][String(lt)]={distance:Tt,predecessor:De}})}),be.forEach(function(De){var Xe=String(De),Je=xe[Xe];be.forEach(function(lt){var Tt=String(lt),Ht=xe[Tt];be.forEach(function(ir){var Kr=String(ir),nn=Ht[Xe],mn=Je[Kr],Jr=Ht[Kr],jn=nn.distance+mn.distance;jn<Jr.distance&&(Jr.distance=jn,Jr.predecessor=mn.predecessor)})})}),xe}var me=pe,Le=function(D,te){for(var xe=D.nodes(),be=0;be<xe.length;be++){var De=xe[be];if(te.hasNode(De))return!0}return!1},st=function(D,te){for(var xe=D.edges(),be=0;be<xe.length;be++){var De=xe[be];if(te.hasEdge(De.v,De.w,De.name))return!0}return!1},qe=function(D,te){var xe=D.nodes(),be=xe.filter(function(De){return te.hasNode(De)});return be},Nt=function(D,te){var xe=D.edges(),be=xe.filter(function(De){return te.hasEdge(De.v,De.w,De.name)});return be},nr=function(D,te){return D.isCompound()===te.isCompound()&&D.isDirected()===te.isDirected()&&D.isMultigraph()===te.isMultigraph()},Ft=function(D,te){var xe=qe(D,te);return xe.length===D.nodes().length},er=function(D,te){var xe=Nt(D,te);return xe.length===D.edges().length},Ur=function(D,te){return nr(D,te)&&D.nodeCount()===te.nodeCount()&&Ft(D,te)&&D.edgeCount()===te.edgeCount()&&er(D,te)},Ct=function(D,te){return Ft(D,te)&&er(D,te)};function Kt(at,D){return ea(at)||sa(at,D)||Dr(at,D)||lr()}function lr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dr(at,D){if(at){if(typeof at=="string")return br(at,D);var te=Object.prototype.toString.call(at).slice(8,-1);if(te==="Object"&&at.constructor&&(te=at.constructor.name),te==="Map"||te==="Set")return Array.from(at);if(te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(te))return br(at,D)}}function br(at,D){(D==null||D>at.length)&&(D=at.length);for(var te=0,xe=new Array(D);te<D;te++)xe[te]=at[te];return xe}function sa(at,D){var te=at==null?null:typeof Symbol!="undefined"&&at[Symbol.iterator]||at["@@iterator"];if(te!=null){var xe=[],be=!0,De=!1,Xe,Je;try{for(te=te.call(at);!(be=(Xe=te.next()).done)&&(xe.push(Xe.value),!(D&&xe.length===D));be=!0);}catch(lt){De=!0,Je=lt}finally{try{!be&&te.return!=null&&te.return()}finally{if(De)throw Je}}return xe}}function ea(at){if(Array.isArray(at))return at}function gn(at){return at instanceof Z}function Tn(at){if(at.isMultigraph())return!1;for(var D=at.edges(),te=new Map,xe=0;xe<D.length;xe++){var be=D[xe];if(be.v===be.w)return!1;var De=[be.v,be.w].sort(),Xe=Kt(De,2),Je=Xe[0],lt=Xe[1],Tt="".concat(Je,"-").concat(lt);if(te.has(Tt))return!1;te.set(Tt,!0)}return!0}function ra(at){return at.nodes().length===0}function Zn(at){for(var D=at.edges(),te=0;te<D.length;te++){var xe=D[te];if(xe.v===xe.w)return!0}return!1}var Vr=function(D,te){if(!Tn(D)||!Tn(te)||!Ft(D,te)||st(D,te))return!1;var xe=D.nodeCount();return D.edgeCount()+te.edgeCount()===xe*(xe-1)/2},In=function(D){if(!Tn(D))return null;for(var te=D.nodeCount(),xe=new Z({compound:D.isCompound(),directed:D.isDirected(),multigraph:D.isMultigraph()}),be=D.nodes(),De=0;De<te;De++){var Xe=be[De];xe.setNode(Xe,D.node(Xe));for(var Je=De+1;Je<te;Je++){var lt=be[Je];D.hasEdge(Xe,lt)||xe.setEdge(Xe,lt)}}return xe}},72407:function(Mt){(function(F,k){Mt.exports=k()})(typeof self!="undefined"?self:this,function(){return function(N){var F={};function k(U){if(F[U])return F[U].exports;var L=F[U]={i:U,l:!1,exports:{}};return N[U].call(L.exports,L,L.exports,k),L.l=!0,L.exports}return k.m=N,k.c=F,k.d=function(U,L,_){k.o(U,L)||Object.defineProperty(U,L,{configurable:!1,enumerable:!0,get:_})},k.n=function(U){var L=U&&U.__esModule?function(){return U.default}:function(){return U};return k.d(L,"a",L),L},k.o=function(U,L){return Object.prototype.hasOwnProperty.call(U,L)},k.p="",k(k.s=36)}([function(N,F,k){"use strict";var U=k(3);F.a=function(L){return Array.isArray?Array.isArray(L):Object(U.a)(L,"Array")}},function(N,F,k){"use strict";var U=function(L){return L!==null&&typeof L!="function"&&isFinite(L.length)};F.a=U},function(N,F,k){"use strict";var U=k(3);F.a=function(L){return Object(U.a)(L,"Function")}},function(N,F,k){"use strict";var U={}.toString,L=function(_,I){return U.call(_)==="[object "+I+"]"};F.a=L},function(N,F,k){"use strict";var U=k(3);F.a=function(L){return Object(U.a)(L,"String")}},function(N,F,k){"use strict";var U=k(3),L=function(_){return Object(U.a)(_,"Number")};F.a=L},function(N,F,k){var U=k(38),L=U.mix;function _(I,T,x,p){return p===void 0&&(p="height"),x==="center"?(I[p]+T[p])/2:I.height}N.exports={assign:L,getHeight:_}},function(N,F,k){"use strict";var U=function(L){return L==null};F.a=U},function(N,F,k){"use strict";var U=k(0),L=k(12);function _(I,T){if(I){var x;if(Object(U.a)(I))for(var p=0,v=I.length;p<v&&(x=T(I[p],p),x!==!1);p++);else if(Object(L.a)(I)){for(var g in I)if(I.hasOwnProperty(g)&&(x=T(I[g],g),x===!1))break}}}F.a=_},function(N,F,k){"use strict";var U=k(7);F.a=function(L){return Object(U.a)(L)?"":L.toString()}},function(N,F,k){"use strict";var U=k(14),L=k(3),_=function(I){if(!Object(U.a)(I)||!Object(L.a)(I,"Object"))return!1;if(Object.getPrototypeOf(I)===null)return!0;for(var T=I;Object.getPrototypeOf(T)!==null;)T=Object.getPrototypeOf(T);return Object.getPrototypeOf(I)===T};F.a=_},function(N,F,k){var U=k(18),L=function(){function _(T,x){x===void 0&&(x={});var p=this;p.options=x,p.rootNode=U(T,x)}var I=_.prototype;return I.execute=function(){throw new Error("please override this method")},_}();N.exports=L},function(N,F,k){"use strict";F.a=function(U){var L=typeof U;return U!==null&&L==="object"||L==="function"}},function(N,F,k){"use strict";var U=k(1),L=function(_,I){return Object(U.a)(_)?_.indexOf(I)>-1:!1};F.a=L},function(N,F,k){"use strict";var U=function(L){return typeof L=="object"&&L!==null};F.a=U},function(N,F,k){"use strict";var U=k(8),L=k(2),_=Object.values?function(I){return Object.values(I)}:function(I){var T=[];return Object(U.a)(I,function(x,p){Object(L.a)(I)&&p==="prototype"||T.push(x)}),T};F.a=_},function(N,F,k){"use strict";F.a=L;function U(_,I){for(var T in I)I.hasOwnProperty(T)&&T!=="constructor"&&I[T]!==void 0&&(_[T]=I[T])}function L(_,I,T,x){return I&&U(_,I),T&&U(_,T),x&&U(_,x),_}},function(N,F,k){var U=k(35),L=["LR","RL","TB","BT","H","V"],_=["LR","RL","H"],I=function(p){return _.indexOf(p)>-1},T=L[0];N.exports=function(x,p,v){var g=p.direction||T;if(p.isHorizontal=I(g),g&&L.indexOf(g)===-1)throw new TypeError("Invalid direction: "+g);if(g===L[0])v(x,p);else if(g===L[1])v(x,p),x.right2left();else if(g===L[2])v(x,p);else if(g===L[3])v(x,p),x.bottom2top();else if(g===L[4]||g===L[5]){var d=U(x,p),c=d.left,s=d.right;v(c,p),v(s,p),p.isHorizontal?c.right2left():c.bottom2top(),s.translate(c.x-s.x,c.y-s.y),x.x=c.x,x.y=s.y;var m=x.getBoundingBox();p.isHorizontal?m.top<0&&x.translate(0,-m.top):m.left<0&&x.translate(-m.left,0)}var M=p.fixedRoot;return M===void 0&&(M=!0),M&&x.translate(-(x.x+x.width/2+x.hgap),-(x.y+x.height/2+x.vgap)),x}},function(N,F,k){var U=k(6),L=18,_=L*2,I=L,T={getId:function(g){return g.id||g.name},getPreH:function(g){return g.preH||0},getPreV:function(g){return g.preV||0},getHGap:function(g){return g.hgap||I},getVGap:function(g){return g.vgap||I},getChildren:function(g){return g.children},getHeight:function(g){return g.height||_},getWidth:function(g){var d=g.label||" ";return g.width||d.split("").length*L}};function x(v,g){var d=this;if(d.vgap=d.hgap=0,v instanceof x)return v;d.data=v;var c=g.getHGap(v),s=g.getVGap(v);return d.preH=g.getPreH(v),d.preV=g.getPreV(v),d.width=g.getWidth(v),d.height=g.getHeight(v),d.width+=d.preH,d.height+=d.preV,d.id=g.getId(v),d.x=d.y=0,d.depth=0,d.children||(d.children=[]),d.addGap(c,s),d}U.assign(x.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(g,d){var c=this;c.hgap+=g,c.vgap+=d,c.width+=2*g,c.height+=2*d},eachNode:function(g){for(var d=this,c=[d],s;s=c.shift();)g(s),c=s.children.concat(c)},DFTraverse:function(g){this.eachNode(g)},BFTraverse:function(g){for(var d=this,c=[d],s;s=c.shift();)g(s),c=c.concat(s.children)},getBoundingBox:function(){var g={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(d){g.left=Math.min(g.left,d.x),g.top=Math.min(g.top,d.y),g.width=Math.max(g.width,d.x+d.width),g.height=Math.max(g.height,d.y+d.height)}),g},translate:function(g,d){g===void 0&&(g=0),d===void 0&&(d=0),this.eachNode(function(c){c.x+=g,c.y+=d,c.x+=c.preH,c.y+=c.preV})},right2left:function(){var g=this,d=g.getBoundingBox();g.eachNode(function(c){c.x=c.x-(c.x-d.left)*2-c.width}),g.translate(d.width,0)},bottom2top:function(){var g=this,d=g.getBoundingBox();g.eachNode(function(c){c.y=c.y-(c.y-d.top)*2-c.height}),g.translate(0,d.height)}});function p(v,g,d){g===void 0&&(g={}),g=U.assign({},T,g);var c=new x(v,g),s=[c],m;if(!d&&!v.collapsed){for(;m=s.shift();)if(!m.data.collapsed){var M=g.getChildren(m.data),P=M?M.length:0;if(m.children=new Array(P),M&&P)for(var R=0;R<P;R++){var j=new x(M[R],g);m.children[R]=j,s.push(j),j.parent=m,j.depth=m.depth+1}}}return c}N.exports=p},function(N,F,k){"use strict";var U=k(1),L=function(_,I){if(!Object(U.a)(_))return _;for(var T=[],x=0;x<_.length;x++){var p=_[x];I(p,x)&&T.push(p)}return T};F.a=L},function(N,F,k){"use strict";var U=k(7),L=k(21);function _(I,T){var x=Object(L.a)(T),p=x.length;if(Object(U.a)(I))return!p;for(var v=0;v<p;v+=1){var g=x[v];if(T[g]!==I[g]||!(g in I))return!1}return!0}F.a=_},function(N,F,k){"use strict";var U=k(8),L=k(2),_=Object.keys?function(I){return Object.keys(I)}:function(I){var T=[];return Object(U.a)(I,function(x,p){Object(L.a)(I)&&p==="prototype"||T.push(p)}),T};F.a=_},function(N,F,k){"use strict";var U=k(0);F.a=function(L){if(Object(U.a)(L))return L.reduce(function(_,I){return Math.max(_,I)},L[0])}},function(N,F,k){"use strict";var U=k(0);F.a=function(L){if(Object(U.a)(L))return L.reduce(function(_,I){return Math.min(_,I)},L[0])}},function(N,F,k){"use strict";var U=k(1),L=Array.prototype.splice,_=function(T,x){if(!Object(U.a)(T))return[];for(var p=T?x.length:0,v=p-1;p--;){var g=void 0,d=x[p];(p===v||d!==g)&&(g=d,L.call(T,d,1))}return T};F.a=_},function(N,F,k){"use strict";var U=k(8),L=k(0),_=k(10),I=function(T,x,p){if(!Object(L.a)(T)&&!Object(_.a)(T))return T;var v=p;return Object(U.a)(T,function(g,d){v=x(v,g,d)}),v};F.a=I},function(N,F,k){"use strict";F.a=U;function U(L,_){_===void 0&&(_=new Map);var I=[];if(Array.isArray(L))for(var T=0,x=L.length;T<x;T++){var p=L[T];_.has(p)||(I.push(p),_.set(p,!0))}return I}},function(N,F,k){"use strict";F.a=I;var U=k(0),L=k(2),_=k(28);function I(T,x){if(!x)return{0:T};if(!Object(L.a)(x)){var p=Object(U.a)(x)?x:x.replace(/\s+/g,"").split("*");x=function(v){for(var g="_",d=0,c=p.length;d<c;d++)g+=v[p[d]]&&v[p[d]].toString();return g}}return Object(_.a)(T,x)}},function(N,F,k){"use strict";var U=k(0),L=k(2),_=Object.prototype.hasOwnProperty;function I(T,x){if(!x||!Object(U.a)(T))return{};for(var p={},v=Object(L.a)(x)?x:function(s){return s[x]},g,d=0;d<T.length;d++){var c=T[d];g=v(c),_.call(p,g)?p[g].push(c):p[g]=[c]}return p}F.a=I},function(N,F,k){"use strict";F.a=function(U,L){return U.hasOwnProperty(L)}},function(N,F,k){"use strict";var U={}.toString,L=function(_){return U.call(_).replace(/^\[object /,"").replace(/]$/,"")};F.a=L},function(N,F,k){"use strict";var U=Object.prototype,L=function(_){var I=_&&_.constructor,T=typeof I=="function"&&I.prototype||U;return _===T};F.a=L},function(N,F,k){"use strict";var U=k(2);F.a=function(L,_){if(!Object(U.a)(L))throw new TypeError("Expected a function");var I=function(){for(var T=[],x=0;x<arguments.length;x++)T[x]=arguments[x];var p=_?_.apply(this,T):T[0],v=I.cache;if(v.has(p))return v.get(p);var g=L.apply(this,T);return v.set(p,g),g};return I.cache=new Map,I}},function(N,F,k){"use strict";var U=k(14),L=k(1),_=k(4),I=function(T,x){if(T===x)return!0;if(!T||!x||Object(_.a)(T)||Object(_.a)(x))return!1;if(Object(L.a)(T)||Object(L.a)(x)){if(T.length!==x.length)return!1;for(var p=!0,v=0;v<T.length&&(p=I(T[v],x[v]),!!p);v++);return p}if(Object(U.a)(T)||Object(U.a)(x)){var g=Object.keys(T),d=Object.keys(x);if(g.length!==d.length)return!1;for(var p=!0,v=0;v<g.length&&(p=I(T[g[v]],x[g[v]]),!!p);v++);return p}return!1};F.a=I},function(N,F,k){"use strict";var U=k(116),L=k(15),_=k(32),I=k(4),T;F.a=Object(_.a)(function(x,p){p===void 0&&(p={});var v=p.fontSize,g=p.fontFamily,d=p.fontWeight,c=p.fontStyle,s=p.fontVariant;return T||(T=document.createElement("canvas").getContext("2d")),T.font=[c,s,d,v+"px",g].join(" "),T.measureText(Object(I.a)(x)?x:"").width},function(x,p){return p===void 0&&(p={}),Object(U.a)([x],Object(L.a)(p)).join("")})},function(N,F,k){var U=k(18);N.exports=function(L,_){for(var I=U(L.data,_,!0),T=U(L.data,_,!0),x=L.children.length,p=Math.round(x/2),v=_.getSide||function(s,m){return m<p?"right":"left"},g=0;g<x;g++){var d=L.children[g],c=v(d,g);c==="right"?T.children.push(d):I.children.push(d)}return I.eachNode(function(s){s.isRoot()||(s.side="left")}),T.eachNode(function(s){s.isRoot()||(s.side="right")}),{left:I,right:T}}},function(N,F,k){var U={compactBox:k(37),dendrogram:k(120),indented:k(122),mindmap:k(124)};N.exports=U},function(N,F,k){function U(d,c){d.prototype=Object.create(c.prototype),d.prototype.constructor=d,L(d,c)}function L(d,c){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,M){return m.__proto__=M,m},L(d,c)}var _=k(11),I=k(119),T=k(17),x=k(6),p=function(d){U(c,d);function c(){return d.apply(this,arguments)||this}var s=c.prototype;return s.execute=function(){var M=this;return T(M.rootNode,M.options,I)},c}(_),v={};function g(d,c){return c=x.assign({},v,c),new p(d,c).execute()}N.exports=g},function(N,F,k){"use strict";Object.defineProperty(F,"__esModule",{value:!0});var U=k(13);k.d(F,"contains",function(){return U.a}),k.d(F,"includes",function(){return U.a});var L=k(39);k.d(F,"difference",function(){return L.a});var _=k(40);k.d(F,"find",function(){return _.a});var I=k(41);k.d(F,"findIndex",function(){return I.a});var T=k(42);k.d(F,"firstValue",function(){return T.a});var x=k(43);k.d(F,"flatten",function(){return x.a});var p=k(44);k.d(F,"flattenDeep",function(){return p.a});var v=k(45);k.d(F,"getRange",function(){return v.a});var g=k(46);k.d(F,"pull",function(){return g.a});var d=k(24);k.d(F,"pullAt",function(){return d.a});var c=k(25);k.d(F,"reduce",function(){return c.a});var s=k(47);k.d(F,"remove",function(){return s.a});var m=k(48);k.d(F,"sortBy",function(){return m.a});var M=k(49);k.d(F,"union",function(){return M.a});var P=k(26);k.d(F,"uniq",function(){return P.a});var R=k(50);k.d(F,"valuesOfKey",function(){return R.a});var j=k(51);k.d(F,"head",function(){return j.a});var Q=k(52);k.d(F,"last",function(){return Q.a});var G=k(53);k.d(F,"startsWith",function(){return G.a});var W=k(54);k.d(F,"endsWith",function(){return W.a});var H=k(19);k.d(F,"filter",function(){return H.a});var Z=k(55);k.d(F,"every",function(){return Z.a});var J=k(56);k.d(F,"some",function(){return J.a});var K=k(57);k.d(F,"group",function(){return K.a});var ne=k(28);k.d(F,"groupBy",function(){return ne.a});var se=k(27);k.d(F,"groupToMap",function(){return se.a});var fe=k(58);k.d(F,"getWrapBehavior",function(){return fe.a});var Ie=k(59);k.d(F,"wrapBehavior",function(){return Ie.a});var ye=k(60);k.d(F,"number2color",function(){return ye.a});var Ae=k(61);k.d(F,"parseRadius",function(){return Ae.a});var Se=k(62);k.d(F,"clamp",function(){return Se.a});var we=k(63);k.d(F,"fixedBase",function(){return we.a});var Te=k(64);k.d(F,"isDecimal",function(){return Te.a});var ke=k(65);k.d(F,"isEven",function(){return ke.a});var Ge=k(66);k.d(F,"isInteger",function(){return Ge.a});var tt=k(67);k.d(F,"isNegative",function(){return tt.a});var He=k(68);k.d(F,"isNumberEqual",function(){return He.a});var ft=k(69);k.d(F,"isOdd",function(){return ft.a});var Lt=k(70);k.d(F,"isPositive",function(){return Lt.a});var Jt=k(22);k.d(F,"max",function(){return Jt.a});var Qe=k(71);k.d(F,"maxBy",function(){return Qe.a});var ut=k(23);k.d(F,"min",function(){return ut.a});var xt=k(72);k.d(F,"minBy",function(){return xt.a});var dt=k(73);k.d(F,"mod",function(){return dt.a});var pt=k(74);k.d(F,"toDegree",function(){return pt.a});var wt=k(75);k.d(F,"toInteger",function(){return wt.a});var mt=k(76);k.d(F,"toRadian",function(){return mt.a});var ur=k(77);k.d(F,"forIn",function(){return ur.a});var Ir=k(29);k.d(F,"has",function(){return Ir.a});var Nr=k(78);k.d(F,"hasKey",function(){return Nr.a});var Hr=k(79);k.d(F,"hasValue",function(){return Hr.a});var It=k(21);k.d(F,"keys",function(){return It.a});var qt=k(20);k.d(F,"isMatch",function(){return qt.a});var ar=k(15);k.d(F,"values",function(){return ar.a});var Oe=k(80);k.d(F,"lowerCase",function(){return Oe.a});var Pr=k(81);k.d(F,"lowerFirst",function(){return Pr.a});var Cr=k(82);k.d(F,"substitute",function(){return Cr.a});var Gr=k(83);k.d(F,"upperCase",function(){return Gr.a});var mr=k(84);k.d(F,"upperFirst",function(){return mr.a});var rn=k(30);k.d(F,"getType",function(){return rn.a});var Sr=k(85);k.d(F,"isArguments",function(){return Sr.a});var qr=k(0);k.d(F,"isArray",function(){return qr.a});var Rn=k(1);k.d(F,"isArrayLike",function(){return Rn.a});var yn=k(86);k.d(F,"isBoolean",function(){return yn.a});var zr=k(87);k.d(F,"isDate",function(){return zr.a});var Rt=k(88);k.d(F,"isError",function(){return Rt.a});var zt=k(2);k.d(F,"isFunction",function(){return zt.a});var Vt=k(89);k.d(F,"isFinite",function(){return Vt.a});var hr=k(7);k.d(F,"isNil",function(){return hr.a});var Ar=k(90);k.d(F,"isNull",function(){return Ar.a});var en=k(5);k.d(F,"isNumber",function(){return en.a});var Fr=k(12);k.d(F,"isObject",function(){return Fr.a});var Cn=k(14);k.d(F,"isObjectLike",function(){return Cn.a});var Sn=k(10);k.d(F,"isPlainObject",function(){return Sn.a});var oa=k(31);k.d(F,"isPrototype",function(){return oa.a});var jr=k(91);k.d(F,"isRegExp",function(){return jr.a});var xn=k(4);k.d(F,"isString",function(){return xn.a});var vn=k(3);k.d(F,"isType",function(){return vn.a});var un=k(92);k.d(F,"isUndefined",function(){return un.a});var Wn=k(93);k.d(F,"isElement",function(){return Wn.a});var Y=k(94);k.d(F,"requestAnimationFrame",function(){return Y.a});var ie=k(95);k.d(F,"clearAnimationFrame",function(){return ie.a});var ee=k(96);k.d(F,"augment",function(){return ee.a});var C=k(97);k.d(F,"clone",function(){return C.a});var b=k(98);k.d(F,"debounce",function(){return b.a});var S=k(32);k.d(F,"memoize",function(){return S.a});var X=k(99);k.d(F,"deepMix",function(){return X.a});var pe=k(8);k.d(F,"each",function(){return pe.a});var Me=k(100);k.d(F,"extend",function(){return Me.a});var me=k(101);k.d(F,"indexOf",function(){return me.a});var Le=k(102);k.d(F,"isEmpty",function(){return Le.a});var st=k(33);k.d(F,"isEqual",function(){return st.a});var qe=k(103);k.d(F,"isEqualWith",function(){return qe.a});var Nt=k(104);k.d(F,"map",function(){return Nt.a});var nr=k(105);k.d(F,"mapValues",function(){return nr.a});var Ft=k(16);k.d(F,"mix",function(){return Ft.a}),k.d(F,"assign",function(){return Ft.a});var er=k(106);k.d(F,"get",function(){return er.a});var Ur=k(107);k.d(F,"set",function(){return Ur.a});var Ct=k(108);k.d(F,"pick",function(){return Ct.a});var Kt=k(109);k.d(F,"omit",function(){return Kt.a});var lr=k(110);k.d(F,"throttle",function(){return lr.a});var Dr=k(111);k.d(F,"toArray",function(){return Dr.a});var br=k(9);k.d(F,"toString",function(){return br.a});var sa=k(112);k.d(F,"uniqueId",function(){return sa.a});var ea=k(113);k.d(F,"noop",function(){return ea.a});var gn=k(114);k.d(F,"identity",function(){return gn.a});var Tn=k(115);k.d(F,"size",function(){return Tn.a});var ra=k(34);k.d(F,"measureTextWidth",function(){return ra.a});var Zn=k(117);k.d(F,"getEllipsisText",function(){return Zn.a});var Vr=k(118);k.d(F,"Cache",function(){return Vr.a})},function(N,F,k){"use strict";var U=k(19),L=k(13),_=function(I,T){return T===void 0&&(T=[]),Object(U.a)(I,function(x){return!Object(L.a)(T,x)})};F.a=_},function(N,F,k){"use strict";var U=k(2),L=k(20),_=k(0),I=k(10);function T(x,p){if(!Object(_.a)(x))return null;var v;if(Object(U.a)(p)&&(v=p),Object(I.a)(p)&&(v=function(d){return Object(L.a)(d,p)}),v){for(var g=0;g<x.length;g+=1)if(v(x[g]))return x[g]}return null}F.a=T},function(N,F,k){"use strict";function U(L,_,I){I===void 0&&(I=0);for(var T=I;T<L.length;T++)if(_(L[T],T))return T;return-1}F.a=U},function(N,F,k){"use strict";var U=k(7),L=k(0),_=function(I,T){for(var x=null,p=0;p<I.length;p++){var v=I[p],g=v[T];if(!Object(U.a)(g)){Object(L.a)(g)?x=g[0]:x=g;break}}return x};F.a=_},function(N,F,k){"use strict";var U=k(0),L=function(_){if(!Object(U.a)(_))return[];for(var I=[],T=0;T<_.length;T++)I=I.concat(_[T]);return I};F.a=L},function(N,F,k){"use strict";var U=k(0),L=function(_,I){if(I===void 0&&(I=[]),!Object(U.a)(_))I.push(_);else for(var T=0;T<_.length;T+=1)L(_[T],I);return I};F.a=L},function(N,F,k){"use strict";var U=k(0),L=k(22),_=k(23),I=function(T){var x=T.filter(function(c){return!isNaN(c)});if(!x.length)return{min:0,max:0};if(Object(U.a)(T[0])){for(var p=[],v=0;v<T.length;v++)p=p.concat(T[v]);x=p}var g=Object(L.a)(x),d=Object(_.a)(x);return{min:d,max:g}};F.a=I},function(N,F,k){"use strict";var U=Array.prototype,L=U.splice,_=U.indexOf,I=function(T){for(var x=[],p=1;p<arguments.length;p++)x[p-1]=arguments[p];for(var v=0;v<x.length;v++)for(var g=x[v],d=-1;(d=_.call(T,g))>-1;)L.call(T,d,1);return T};F.a=I},function(N,F,k){"use strict";var U=k(1),L=k(24),_=function(I,T){var x=[];if(!Object(U.a)(I))return x;for(var p=-1,v=[],g=I.length;++p<g;){var d=I[p];T(d,p,I)&&(x.push(d),v.push(p))}return Object(L.a)(I,v),x};F.a=_},function(N,F,k){"use strict";var U=k(0),L=k(4),_=k(2);function I(T,x){var p;if(Object(_.a)(x))p=function(g,d){return x(g)-x(d)};else{var v=[];Object(L.a)(x)?v.push(x):Object(U.a)(x)&&(v=x),p=function(g,d){for(var c=0;c<v.length;c+=1){var s=v[c];if(g[s]>d[s])return 1;if(g[s]<d[s])return-1}return 0}}return T.sort(p),T}F.a=I},function(N,F,k){"use strict";var U=k(26),L=function(){for(var _=[],I=0;I<arguments.length;I++)_[I]=arguments[I];return Object(U.a)([].concat.apply([],_))};F.a=L},function(N,F,k){"use strict";var U=k(0),L=k(7);F.a=function(_,I){for(var T=[],x={},p=0;p<_.length;p++){var v=_[p],g=v[I];if(!Object(L.a)(g)){Object(U.a)(g)||(g=[g]);for(var d=0;d<g.length;d++){var c=g[d];x[c]||(T.push(c),x[c]=!0)}}}return T}},function(N,F,k){"use strict";F.a=L;var U=k(1);function L(_){if(Object(U.a)(_))return _[0]}},function(N,F,k){"use strict";F.a=L;var U=k(1);function L(_){if(Object(U.a)(_)){var I=_;return I[I.length-1]}}},function(N,F,k){"use strict";var U=k(0),L=k(4);function _(I,T){return Object(U.a)(I)||Object(L.a)(I)?I[0]===T:!1}F.a=_},function(N,F,k){"use strict";var U=k(0),L=k(4);function _(I,T){return Object(U.a)(I)||Object(L.a)(I)?I[I.length-1]===T:!1}F.a=_},function(N,F,k){"use strict";var U=function(L,_){for(var I=0;I<L.length;I++)if(!_(L[I],I))return!1;return!0};F.a=U},function(N,F,k){"use strict";var U=function(L,_){for(var I=0;I<L.length;I++)if(_(L[I],I))return!0;return!1};F.a=U},function(N,F,k){"use strict";var U=k(27);F.a=function(L,_){if(!_)return[L];var I=Object(U.a)(L,_),T=[];for(var x in I)T.push(I[x]);return T}},function(N,F,k){"use strict";function U(L,_){return L["_wrap_"+_]}F.a=U},function(N,F,k){"use strict";function U(L,_){if(L["_wrap_"+_])return L["_wrap_"+_];var I=function(T){L[_](T)};return L["_wrap_"+_]=I,I}F.a=U},function(N,F,k){"use strict";var U={};function L(_){var I=U[_];if(!I){for(var T=_.toString(16),x=T.length;x<6;x++)T="0"+T;I="#"+T,U[_]=I}return I}F.a=L},function(N,F,k){"use strict";var U=k(0);function L(_){var I=0,T=0,x=0,p=0;return Object(U.a)(_)?_.length===1?I=T=x=p=_[0]:_.length===2?(I=x=_[0],T=p=_[1]):_.length===3?(I=_[0],T=p=_[1],x=_[2]):(I=_[0],T=_[1],x=_[2],p=_[3]):I=T=x=p=_,{r1:I,r2:T,r3:x,r4:p}}F.a=L},function(N,F,k){"use strict";var U=function(L,_,I){return L<_?_:L>I?I:L};F.a=U},function(N,F,k){"use strict";var U=function(L,_){var I=_.toString(),T=I.indexOf(".");if(T===-1)return Math.round(L);var x=I.substr(T+1).length;return x>20&&(x=20),parseFloat(L.toFixed(x))};F.a=U},function(N,F,k){"use strict";var U=k(5),L=function(_){return Object(U.a)(_)&&_%1!==0};F.a=L},function(N,F,k){"use strict";var U=k(5),L=function(_){return Object(U.a)(_)&&_%2===0};F.a=L},function(N,F,k){"use strict";var U=k(5),L=Number.isInteger?Number.isInteger:function(_){return Object(U.a)(_)&&_%1===0};F.a=L},function(N,F,k){"use strict";var U=k(5),L=function(_){return Object(U.a)(_)&&_<0};F.a=L},function(N,F,k){"use strict";F.a=L;var U=1e-5;function L(_,I,T){return T===void 0&&(T=U),Math.abs(_-I)<T}},function(N,F,k){"use strict";var U=k(5),L=function(_){return Object(U.a)(_)&&_%2!==0};F.a=L},function(N,F,k){"use strict";var U=k(5),L=function(_){return Object(U.a)(_)&&_>0};F.a=L},function(N,F,k){"use strict";var U=k(0),L=k(2);F.a=function(_,I){if(Object(U.a)(_)){for(var T,x=-1/0,p=0;p<_.length;p++){var v=_[p],g=Object(L.a)(I)?I(v):v[I];g>x&&(T=v,x=g)}return T}}},function(N,F,k){"use strict";var U=k(0),L=k(2);F.a=function(_,I){if(Object(U.a)(_)){for(var T,x=1/0,p=0;p<_.length;p++){var v=_[p],g=Object(L.a)(I)?I(v):v[I];g<x&&(T=v,x=g)}return T}}},function(N,F,k){"use strict";var U=function(L,_){return(L%_+_)%_};F.a=U},function(N,F,k){"use strict";var U=180/Math.PI,L=function(_){return U*_};F.a=L},function(N,F,k){"use strict";F.a=parseInt},function(N,F,k){"use strict";var U=Math.PI/180,L=function(_){return U*_};F.a=L},function(N,F,k){"use strict";var U=k(8);F.a=U.a},function(N,F,k){"use strict";var U=k(29);F.a=U.a},function(N,F,k){"use strict";var U=k(13),L=k(15);F.a=function(_,I){return Object(U.a)(Object(L.a)(_),I)}},function(N,F,k){"use strict";var U=k(9),L=function(_){return Object(U.a)(_).toLowerCase()};F.a=L},function(N,F,k){"use strict";var U=k(9),L=function(_){var I=Object(U.a)(_);return I.charAt(0).toLowerCase()+I.substring(1)};F.a=L},function(N,F,k){"use strict";function U(L,_){return!L||!_?L:L.replace(/\\?\{([^{}]+)\}/g,function(I,T){return I.charAt(0)==="\\"?I.slice(1):_[T]===void 0?"":_[T]})}F.a=U},function(N,F,k){"use strict";var U=k(9),L=function(_){return Object(U.a)(_).toUpperCase()};F.a=L},function(N,F,k){"use strict";var U=k(9),L=function(_){var I=Object(U.a)(_);return I.charAt(0).toUpperCase()+I.substring(1)};F.a=L},function(N,F,k){"use strict";var U=k(3),L=function(_){return Object(U.a)(_,"Arguments")};F.a=L},function(N,F,k){"use strict";var U=k(3),L=function(_){return Object(U.a)(_,"Boolean")};F.a=L},function(N,F,k){"use strict";var U=k(3),L=function(_){return Object(U.a)(_,"Date")};F.a=L},function(N,F,k){"use strict";var U=k(3),L=function(_){return Object(U.a)(_,"Error")};F.a=L},function(N,F,k){"use strict";var U=k(5);F.a=function(L){return Object(U.a)(L)&&isFinite(L)}},function(N,F,k){"use strict";var U=function(L){return L===null};F.a=U},function(N,F,k){"use strict";var U=k(3),L=function(_){return Object(U.a)(_,"RegExp")};F.a=L},function(N,F,k){"use strict";var U=function(L){return L===void 0};F.a=U},function(N,F,k){"use strict";var U=function(L){return L instanceof Element||L instanceof HTMLDocument};F.a=U},function(N,F,k){"use strict";F.a=U;function U(L){var _=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(I){return setTimeout(I,16)};return _(L)}},function(N,F,k){"use strict";F.a=U;function U(L){var _=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;_(L)}},function(N,F,k){"use strict";var U=k(16),L=k(2),_=function(){for(var I=[],T=0;T<arguments.length;T++)I[T]=arguments[T];for(var x=I[0],p=1;p<I.length;p++){var v=I[p];Object(L.a)(v)&&(v=v.prototype),Object(U.a)(x.prototype,v)}};F.a=_},function(N,F,k){"use strict";var U=k(0),L=function(_){if(typeof _!="object"||_===null)return _;var I;if(Object(U.a)(_)){I=[];for(var T=0,x=_.length;T<x;T++)typeof _[T]=="object"&&_[T]!=null?I[T]=L(_[T]):I[T]=_[T]}else{I={};for(var p in _)typeof _[p]=="object"&&_[p]!=null?I[p]=L(_[p]):I[p]=_[p]}return I};F.a=L},function(N,F,k){"use strict";function U(L,_,I){var T;return function(){var x=this,p=arguments,v=function(){T=null,I||L.apply(x,p)},g=I&&!T;clearTimeout(T),T=setTimeout(v,_),g&&L.apply(x,p)}}F.a=U},function(N,F,k){"use strict";var U=k(0),L=k(10),_=5;function I(x,p,v,g){v=v||0,g=g||_;for(var d in p)if(p.hasOwnProperty(d)){var c=p[d];c!==null&&Object(L.a)(c)?(Object(L.a)(x[d])||(x[d]={}),v<g?I(x[d],c,v+1,g):x[d]=p[d]):Object(U.a)(c)?(x[d]=[],x[d]=x[d].concat(c)):c!==void 0&&(x[d]=c)}}var T=function(x){for(var p=[],v=1;v<arguments.length;v++)p[v-1]=arguments[v];for(var g=0;g<p.length;g+=1)I(x,p[g]);return x};F.a=T},function(N,F,k){"use strict";var U=k(16),L=k(2),_=function(I,T,x,p){Object(L.a)(T)||(x=T,T=I,I=function(){});var v=Object.create?function(d,c){return Object.create(d,{constructor:{value:c}})}:function(d,c){function s(){}s.prototype=d;var m=new s;return m.constructor=c,m},g=v(T.prototype,I);return I.prototype=Object(U.a)(g,I.prototype),I.superclass=v(T.prototype,T),Object(U.a)(g,x),Object(U.a)(I,p),I};F.a=_},function(N,F,k){"use strict";var U=k(1),L=function(_,I){if(!Object(U.a)(_))return-1;var T=Array.prototype.indexOf;if(T)return T.call(_,I);for(var x=-1,p=0;p<_.length;p++)if(_[p]===I){x=p;break}return x};F.a=L},function(N,F,k){"use strict";var U=k(7),L=k(1),_=k(30),I=k(31),T=Object.prototype.hasOwnProperty;function x(p){if(Object(U.a)(p))return!0;if(Object(L.a)(p))return!p.length;var v=Object(_.a)(p);if(v==="Map"||v==="Set")return!p.size;if(Object(I.a)(p))return!Object.keys(p).length;for(var g in p)if(T.call(p,g))return!1;return!0}F.a=x},function(N,F,k){"use strict";var U=k(2),L=k(33);F.a=function(_,I,T){return Object(U.a)(T)?!!T(_,I):Object(L.a)(_,I)}},function(N,F,k){"use strict";var U=k(1),L=function(_,I){if(!Object(U.a)(_))return _;for(var T=[],x=0;x<_.length;x++){var p=_[x];T.push(I(p,x))}return T};F.a=L},function(N,F,k){"use strict";var U=k(7),L=k(12),_=function(I){return I};F.a=function(I,T){T===void 0&&(T=_);var x={};return Object(L.a)(I)&&!Object(U.a)(I)&&Object.keys(I).forEach(function(p){x[p]=T(I[p],p)}),x}},function(N,F,k){"use strict";var U=k(4);F.a=function(L,_,I){for(var T=0,x=Object(U.a)(_)?_.split("."):_;L&&T<x.length;)L=L[x[T++]];return L===void 0||T<x.length?I:L}},function(N,F,k){"use strict";var U=k(12),L=k(4),_=k(5);F.a=function(I,T,x){var p=I,v=Object(L.a)(T)?T.split("."):T;return v.forEach(function(g,d){d<v.length-1?(Object(U.a)(p[g])||(p[g]=Object(_.a)(v[d+1])?[]:{}),p=p[g]):p[g]=x}),I}},function(N,F,k){"use strict";var U=k(8),L=k(10),_=Object.prototype.hasOwnProperty;F.a=function(I,T){if(I===null||!Object(L.a)(I))return{};var x={};return Object(U.a)(T,function(p){_.call(I,p)&&(x[p]=I[p])}),x}},function(N,F,k){"use strict";var U=k(25);F.a=function(L,_){return Object(U.a)(L,function(I,T,x){return _.includes(x)||(I[x]=T),I},{})}},function(N,F,k){"use strict";F.a=function(U,L,_){var I,T,x,p,v=0;_||(_={});var g=function(){v=_.leading===!1?0:Date.now(),I=null,p=U.apply(T,x),I||(T=x=null)},d=function(){var c=Date.now();!v&&_.leading===!1&&(v=c);var s=L-(c-v);return T=this,x=arguments,s<=0||s>L?(I&&(clearTimeout(I),I=null),v=c,p=U.apply(T,x),I||(T=x=null)):!I&&_.trailing!==!1&&(I=setTimeout(g,s)),p};return d.cancel=function(){clearTimeout(I),v=0,I=T=x=null},d}},function(N,F,k){"use strict";var U=k(1);F.a=function(L){return Object(U.a)(L)?Array.prototype.slice.call(L):[]}},function(N,F,k){"use strict";var U={};F.a=function(L){return L=L||"g",U[L]?U[L]+=1:U[L]=1,L+U[L]}},function(N,F,k){"use strict";F.a=function(){}},function(N,F,k){"use strict";F.a=function(U){return U}},function(N,F,k){"use strict";F.a=_;var U=k(7),L=k(1);function _(I){return Object(U.a)(I)?0:Object(L.a)(I)?I.length:Object.keys(I).length}},function(N,F,k){"use strict";F.a=G;var U=function(we,Te){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ke,Ge){ke.__proto__=Ge}||function(ke,Ge){for(var tt in Ge)Object.prototype.hasOwnProperty.call(Ge,tt)&&(ke[tt]=Ge[tt])},U(we,Te)};function L(we,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Class extends value "+String(Te)+" is not a constructor or null");U(we,Te);function ke(){this.constructor=we}we.prototype=Te===null?Object.create(Te):(ke.prototype=Te.prototype,new ke)}var _=function(){return _=Object.assign||function(Te){for(var ke,Ge=1,tt=arguments.length;Ge<tt;Ge++){ke=arguments[Ge];for(var He in ke)Object.prototype.hasOwnProperty.call(ke,He)&&(Te[He]=ke[He])}return Te},_.apply(this,arguments)};function I(we,Te){var ke={};for(var Ge in we)Object.prototype.hasOwnProperty.call(we,Ge)&&Te.indexOf(Ge)<0&&(ke[Ge]=we[Ge]);if(we!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tt=0,Ge=Object.getOwnPropertySymbols(we);tt<Ge.length;tt++)Te.indexOf(Ge[tt])<0&&Object.prototype.propertyIsEnumerable.call(we,Ge[tt])&&(ke[Ge[tt]]=we[Ge[tt]]);return ke}function T(we,Te,ke,Ge){var tt=arguments.length,He=tt<3?Te:Ge===null?Ge=Object.getOwnPropertyDescriptor(Te,ke):Ge,ft;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")He=Reflect.decorate(we,Te,ke,Ge);else for(var Lt=we.length-1;Lt>=0;Lt--)(ft=we[Lt])&&(He=(tt<3?ft(He):tt>3?ft(Te,ke,He):ft(Te,ke))||He);return tt>3&&He&&Object.defineProperty(Te,ke,He),He}function x(we,Te){return function(ke,Ge){Te(ke,Ge,we)}}function p(we,Te,ke,Ge,tt,He){function ft(Ir){if(Ir!==void 0&&typeof Ir!="function")throw new TypeError("Function expected");return Ir}for(var Lt=Ge.kind,Jt=Lt==="getter"?"get":Lt==="setter"?"set":"value",Qe=!Te&&we?Ge.static?we:we.prototype:null,ut=Te||(Qe?Object.getOwnPropertyDescriptor(Qe,Ge.name):{}),xt,dt=!1,pt=ke.length-1;pt>=0;pt--){var wt={};for(var mt in Ge)wt[mt]=mt==="access"?{}:Ge[mt];for(var mt in Ge.access)wt.access[mt]=Ge.access[mt];wt.addInitializer=function(Ir){if(dt)throw new TypeError("Cannot add initializers after decoration has completed");He.push(ft(Ir||null))};var ur=(0,ke[pt])(Lt==="accessor"?{get:ut.get,set:ut.set}:ut[Jt],wt);if(Lt==="accessor"){if(ur===void 0)continue;if(ur===null||typeof ur!="object")throw new TypeError("Object expected");(xt=ft(ur.get))&&(ut.get=xt),(xt=ft(ur.set))&&(ut.set=xt),(xt=ft(ur.init))&&tt.push(xt)}else(xt=ft(ur))&&(Lt==="field"?tt.push(xt):ut[Jt]=xt)}Qe&&Object.defineProperty(Qe,Ge.name,ut),dt=!0}function v(we,Te,ke){for(var Ge=arguments.length>2,tt=0;tt<Te.length;tt++)ke=Ge?Te[tt].call(we,ke):Te[tt].call(we);return Ge?ke:void 0}function g(we){return typeof we=="symbol"?we:"".concat(we)}function d(we,Te,ke){return typeof Te=="symbol"&&(Te=Te.description?"[".concat(Te.description,"]"):""),Object.defineProperty(we,"name",{configurable:!0,value:ke?"".concat(ke," ",Te):Te})}function c(we,Te){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(we,Te)}function s(we,Te,ke,Ge){function tt(He){return He instanceof ke?He:new ke(function(ft){ft(He)})}return new(ke||(ke=Promise))(function(He,ft){function Lt(ut){try{Qe(Ge.next(ut))}catch(xt){ft(xt)}}function Jt(ut){try{Qe(Ge.throw(ut))}catch(xt){ft(xt)}}function Qe(ut){ut.done?He(ut.value):tt(ut.value).then(Lt,Jt)}Qe((Ge=Ge.apply(we,Te||[])).next())})}function m(we,Te){var ke={label:0,sent:function(){if(He[0]&1)throw He[1];return He[1]},trys:[],ops:[]},Ge,tt,He,ft;return ft={next:Lt(0),throw:Lt(1),return:Lt(2)},typeof Symbol=="function"&&(ft[Symbol.iterator]=function(){return this}),ft;function Lt(Qe){return function(ut){return Jt([Qe,ut])}}function Jt(Qe){if(Ge)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,Qe[0]&&(ke=0)),ke;)try{if(Ge=1,tt&&(He=Qe[0]&2?tt.return:Qe[0]?tt.throw||((He=tt.return)&&He.call(tt),0):tt.next)&&!(He=He.call(tt,Qe[1])).done)return He;switch(tt=0,He&&(Qe=[Qe[0]&2,He.value]),Qe[0]){case 0:case 1:He=Qe;break;case 4:return ke.label++,{value:Qe[1],done:!1};case 5:ke.label++,tt=Qe[1],Qe=[0];continue;case 7:Qe=ke.ops.pop(),ke.trys.pop();continue;default:if(He=ke.trys,!(He=He.length>0&&He[He.length-1])&&(Qe[0]===6||Qe[0]===2)){ke=0;continue}if(Qe[0]===3&&(!He||Qe[1]>He[0]&&Qe[1]<He[3])){ke.label=Qe[1];break}if(Qe[0]===6&&ke.label<He[1]){ke.label=He[1],He=Qe;break}if(He&&ke.label<He[2]){ke.label=He[2],ke.ops.push(Qe);break}He[2]&&ke.ops.pop(),ke.trys.pop();continue}Qe=Te.call(we,ke)}catch(ut){Qe=[6,ut],tt=0}finally{Ge=He=0}if(Qe[0]&5)throw Qe[1];return{value:Qe[0]?Qe[1]:void 0,done:!0}}}var M=Object.create?function(we,Te,ke,Ge){Ge===void 0&&(Ge=ke);var tt=Object.getOwnPropertyDescriptor(Te,ke);(!tt||("get"in tt?!Te.__esModule:tt.writable||tt.configurable))&&(tt={enumerable:!0,get:function(){return Te[ke]}}),Object.defineProperty(we,Ge,tt)}:function(we,Te,ke,Ge){Ge===void 0&&(Ge=ke),we[Ge]=Te[ke]};function P(we,Te){for(var ke in we)ke!=="default"&&!Object.prototype.hasOwnProperty.call(Te,ke)&&M(Te,we,ke)}function R(we){var Te=typeof Symbol=="function"&&Symbol.iterator,ke=Te&&we[Te],Ge=0;if(ke)return ke.call(we);if(we&&typeof we.length=="number")return{next:function(){return we&&Ge>=we.length&&(we=void 0),{value:we&&we[Ge++],done:!we}}};throw new TypeError(Te?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(we,Te){var ke=typeof Symbol=="function"&&we[Symbol.iterator];if(!ke)return we;var Ge=ke.call(we),tt,He=[],ft;try{for(;(Te===void 0||Te-- >0)&&!(tt=Ge.next()).done;)He.push(tt.value)}catch(Lt){ft={error:Lt}}finally{try{tt&&!tt.done&&(ke=Ge.return)&&ke.call(Ge)}finally{if(ft)throw ft.error}}return He}function Q(){for(var we=[],Te=0;Te<arguments.length;Te++)we=we.concat(j(arguments[Te]));return we}function G(){for(var we=0,Te=0,ke=arguments.length;Te<ke;Te++)we+=arguments[Te].length;for(var Ge=Array(we),tt=0,Te=0;Te<ke;Te++)for(var He=arguments[Te],ft=0,Lt=He.length;ft<Lt;ft++,tt++)Ge[tt]=He[ft];return Ge}function W(we,Te,ke){if(ke||arguments.length===2)for(var Ge=0,tt=Te.length,He;Ge<tt;Ge++)(He||!(Ge in Te))&&(He||(He=Array.prototype.slice.call(Te,0,Ge)),He[Ge]=Te[Ge]);return we.concat(He||Array.prototype.slice.call(Te))}function H(we){return this instanceof H?(this.v=we,this):new H(we)}function Z(we,Te,ke){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Ge=ke.apply(we,Te||[]),tt,He=[];return tt={},ft("next"),ft("throw"),ft("return"),tt[Symbol.asyncIterator]=function(){return this},tt;function ft(dt){Ge[dt]&&(tt[dt]=function(pt){return new Promise(function(wt,mt){He.push([dt,pt,wt,mt])>1||Lt(dt,pt)})})}function Lt(dt,pt){try{Jt(Ge[dt](pt))}catch(wt){xt(He[0][3],wt)}}function Jt(dt){dt.value instanceof H?Promise.resolve(dt.value.v).then(Qe,ut):xt(He[0][2],dt)}function Qe(dt){Lt("next",dt)}function ut(dt){Lt("throw",dt)}function xt(dt,pt){dt(pt),He.shift(),He.length&&Lt(He[0][0],He[0][1])}}function J(we){var Te,ke;return Te={},Ge("next"),Ge("throw",function(tt){throw tt}),Ge("return"),Te[Symbol.iterator]=function(){return this},Te;function Ge(tt,He){Te[tt]=we[tt]?function(ft){return(ke=!ke)?{value:H(we[tt](ft)),done:!1}:He?He(ft):ft}:He}}function K(we){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Te=we[Symbol.asyncIterator],ke;return Te?Te.call(we):(we=typeof R=="function"?R(we):we[Symbol.iterator](),ke={},Ge("next"),Ge("throw"),Ge("return"),ke[Symbol.asyncIterator]=function(){return this},ke);function Ge(He){ke[He]=we[He]&&function(ft){return new Promise(function(Lt,Jt){ft=we[He](ft),tt(Lt,Jt,ft.done,ft.value)})}}function tt(He,ft,Lt,Jt){Promise.resolve(Jt).then(function(Qe){He({value:Qe,done:Lt})},ft)}}function ne(we,Te){return Object.defineProperty?Object.defineProperty(we,"raw",{value:Te}):we.raw=Te,we}var se=Object.create?function(we,Te){Object.defineProperty(we,"default",{enumerable:!0,value:Te})}:function(we,Te){we.default=Te};function fe(we){if(we&&we.__esModule)return we;var Te={};if(we!=null)for(var ke in we)ke!=="default"&&Object.prototype.hasOwnProperty.call(we,ke)&&M(Te,we,ke);return se(Te,we),Te}function Ie(we){return we&&we.__esModule?we:{default:we}}function ye(we,Te,ke,Ge){if(ke==="a"&&!Ge)throw new TypeError("Private accessor was defined without a getter");if(typeof Te=="function"?we!==Te||!Ge:!Te.has(we))throw new TypeError("Cannot read private member from an object whose class did not declare it");return ke==="m"?Ge:ke==="a"?Ge.call(we):Ge?Ge.value:Te.get(we)}function Ae(we,Te,ke,Ge,tt){if(Ge==="m")throw new TypeError("Private method is not writable");if(Ge==="a"&&!tt)throw new TypeError("Private accessor was defined without a setter");if(typeof Te=="function"?we!==Te||!tt:!Te.has(we))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Ge==="a"?tt.call(we,ke):tt?tt.value=ke:Te.set(we,ke),ke}function Se(we,Te){if(Te===null||typeof Te!="object"&&typeof Te!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof we=="function"?Te===we:we.has(Te)}},function(N,F,k){"use strict";var U=k(4),L=k(9),_=k(34);F.a=function(I,T,x,p){p===void 0&&(p="...");var v=16,g=Object(_.a)(p,x),d=Object(U.a)(I)?I:Object(L.a)(I),c=T,s=[],m,M;if(Object(_.a)(I,x)<=T)return I;for(;m=d.substr(0,v),M=Object(_.a)(m,x),!(M+g>c&&M>c);)if(s.push(m),c-=M,d=d.substr(v),!d)return s.join("");for(;m=d.substr(0,1),M=Object(_.a)(m,x),!(M+g>c);)if(s.push(m),c-=M,d=d.substr(1),!d)return s.join("");return""+s.join("")+p}},function(N,F,k){"use strict";var U=function(){function L(){this.map={}}return L.prototype.has=function(_){return this.map[_]!==void 0},L.prototype.get=function(_,I){var T=this.map[_];return T===void 0?I:T},L.prototype.set=function(_,I){this.map[_]=I},L.prototype.clear=function(){this.map={}},L.prototype.delete=function(_){delete this.map[_]},L.prototype.size=function(){return Object.keys(this.map).length},L}();F.a=U},function(N,F){function k(x,p,v,g){g===void 0&&(g=[]);var d=this;d.w=x||0,d.h=p||0,d.y=v||0,d.x=0,d.c=g||[],d.cs=g.length,d.prelim=0,d.mod=0,d.shift=0,d.change=0,d.tl=null,d.tr=null,d.el=null,d.er=null,d.msel=0,d.mser=0}k.fromNode=function(x,p){if(!x)return null;var v=[];return x.children.forEach(function(g){v.push(k.fromNode(g,p))}),p?new k(x.height,x.width,x.x,v):new k(x.width,x.height,x.y,v)};function U(x,p,v){v?x.y+=p:x.x+=p,x.children.forEach(function(g){U(g,p,v)})}function L(x,p){var v=p?x.y:x.x;return x.children.forEach(function(g){v=Math.min(L(g,p),v)}),v}function _(x,p){var v=L(x,p);U(x,-v,p)}function I(x,p,v){v?p.y=x.x:p.x=x.x,x.c.forEach(function(g,d){I(g,p.children[d],v)})}function T(x,p,v){v===void 0&&(v=0),p?(x.x=v,v+=x.width):(x.y=v,v+=x.height),x.children.forEach(function(g){T(g,p,v)})}N.exports=function(x,p){p===void 0&&(p={});var v=p.isHorizontal;function g(K){if(K.cs===0){d(K);return}g(K.c[0]);for(var ne=Z(P(K.c[0].el),0,null),se=1;se<K.cs;++se){g(K.c[se]);var fe=P(K.c[se].er);c(K,se,ne),ne=Z(fe,se,ne)}Q(K),d(K)}function d(K){K.cs===0?(K.el=K,K.er=K,K.msel=K.mser=0):(K.el=K.c[0].el,K.msel=K.c[0].msel,K.er=K.c[K.cs-1].er,K.mser=K.c[K.cs-1].mser)}function c(K,ne,se){for(var fe=K.c[ne-1],Ie=fe.mod,ye=K.c[ne],Ae=ye.mod;fe!==null&&ye!==null;){P(fe)>se.low&&(se=se.nxt);var Se=Ie+fe.prelim+fe.w-(Ae+ye.prelim);Se>0&&(Ae+=Se,s(K,ne,se.index,Se));var we=P(fe),Te=P(ye);we<=Te&&(fe=M(fe),fe!==null&&(Ie+=fe.mod)),we>=Te&&(ye=m(ye),ye!==null&&(Ae+=ye.mod))}!fe&&ye?R(K,ne,ye,Ae):fe&&!ye&&j(K,ne,fe,Ie)}function s(K,ne,se,fe){K.c[ne].mod+=fe,K.c[ne].msel+=fe,K.c[ne].mser+=fe,W(K,ne,se,fe)}function m(K){return K.cs===0?K.tl:K.c[0]}function M(K){return K.cs===0?K.tr:K.c[K.cs-1]}function P(K){return K.y+K.h}function R(K,ne,se,fe){var Ie=K.c[0].el;Ie.tl=se;var ye=fe-se.mod-K.c[0].msel;Ie.mod+=ye,Ie.prelim-=ye,K.c[0].el=K.c[ne].el,K.c[0].msel=K.c[ne].msel}function j(K,ne,se,fe){var Ie=K.c[ne].er;Ie.tr=se;var ye=fe-se.mod-K.c[ne].mser;Ie.mod+=ye,Ie.prelim-=ye,K.c[ne].er=K.c[ne-1].er,K.c[ne].mser=K.c[ne-1].mser}function Q(K){K.prelim=(K.c[0].prelim+K.c[0].mod+K.c[K.cs-1].mod+K.c[K.cs-1].prelim+K.c[K.cs-1].w)/2-K.w/2}function G(K,ne){ne+=K.mod,K.x=K.prelim+ne,H(K);for(var se=0;se<K.cs;se++)G(K.c[se],ne)}function W(K,ne,se,fe){if(se!==ne-1){var Ie=ne-se;K.c[se+1].shift+=fe/Ie,K.c[ne].shift-=fe/Ie,K.c[ne].change-=fe-fe/Ie}}function H(K){for(var ne=0,se=0,fe=0;fe<K.cs;fe++)ne+=K.c[fe].shift,se+=ne+K.c[fe].change,K.c[fe].mod+=se}function Z(K,ne,se){for(;se!==null&&K>=se.low;)se=se.nxt;return{low:K,index:ne,nxt:se}}T(x,v);var J=k.fromNode(x,v);return g(J),G(J,0),I(J,x,v),_(x,v),x}},function(N,F,k){function U(d,c){d.prototype=Object.create(c.prototype),d.prototype.constructor=d,L(d,c)}function L(d,c){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,M){return m.__proto__=M,m},L(d,c)}var _=k(11),I=k(121),T=k(17),x=k(6),p=function(d){U(c,d);function c(){return d.apply(this,arguments)||this}var s=c.prototype;return s.execute=function(){var M=this;return M.rootNode.width=0,T(M.rootNode,M.options,I)},c}(_),v={};function g(d,c){return c=x.assign({},v,c),new p(d,c).execute()}N.exports=g},function(N,F,k){var U=k(6);function L(T,x){T===void 0&&(T=0),x===void 0&&(x=[]);var p=this;p.x=p.y=0,p.leftChild=p.rightChild=null,p.height=0,p.children=x}var _={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function I(T,x,p){p?(x.x=T.x,x.y=T.y):(x.x=T.y,x.y=T.x),T.children.forEach(function(v,g){I(v,x.children[g],p)})}N.exports=function(T,x){x===void 0&&(x={}),x=U.assign({},_,x);var p=0;function v(m){if(!m)return null;m.width=0,m.depth&&m.depth>p&&(p=m.depth);var M=m.children,P=M.length,R=new L(m.height,[]);return M.forEach(function(j,Q){var G=v(j);R.children.push(G),Q===0&&(R.leftChild=G),Q===P-1&&(R.rightChild=G)}),R.originNode=m,R.isLeaf=m.isLeaf(),R}function g(m){if(m.isLeaf||m.children.length===0)m.drawingDepth=p;else{var M=m.children.map(function(R){return g(R)}),P=Math.min.apply(null,M);m.drawingDepth=P-1}return m.drawingDepth}var d;function c(m){m.x=m.drawingDepth*x.rankSep,m.isLeaf?(m.y=0,d&&(m.y=d.y+d.height+x.nodeSep,m.originNode.parent!==d.originNode.parent&&(m.y+=x.subTreeSep)),d=m):(m.children.forEach(function(M){c(M)}),m.y=(m.leftChild.y+m.rightChild.y)/2)}var s=v(T);return g(s),c(s),I(s,T,x.isHorizontal),T}},function(N,F,k){function U(s,m){s.prototype=Object.create(m.prototype),s.prototype.constructor=s,L(s,m)}function L(s,m){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(P,R){return P.__proto__=R,P},L(s,m)}var _=k(11),I=k(123),T=k(35),x=k(6),p=["LR","RL","H"],v=p[0],g=function(s){U(m,s);function m(){return s.apply(this,arguments)||this}var M=m.prototype;return M.execute=function(){var R=this,j=R.options,Q=R.rootNode;j.isHorizontal=!0;var G=j.indent,W=G===void 0?20:G,H=j.dropCap,Z=H===void 0?!0:H,J=j.direction,K=J===void 0?v:J,ne=j.align;if(K&&p.indexOf(K)===-1)throw new TypeError("Invalid direction: "+K);if(K===p[0])I(Q,W,Z,ne);else if(K===p[1])I(Q,W,Z,ne),Q.right2left();else if(K===p[2]){var se=T(Q,j),fe=se.left,Ie=se.right;I(fe,W,Z,ne),fe.right2left(),I(Ie,W,Z,ne);var ye=fe.getBoundingBox();Ie.translate(ye.width,0),Q.x=Ie.x-Q.width/2}return Q},m}(_),d={};function c(s,m){return m=x.assign({},d,m),new g(s,m).execute()}N.exports=c},function(N,F,k){var U=k(6);function L(_,I,T,x,p){var v=typeof T=="function"?T(_):T*_.depth;if(!x)try{if(_.id===_.parent.children[0].id){_.x+=v,_.y=I?I.y:0;return}}catch(c){}if(_.x+=v,I){if(_.y=I.y+U.getHeight(I,_,p),I.parent&&_.parent.id!==I.parent.id){var g=I.parent,d=g.y+U.getHeight(g,_,p);_.y=d>_.y?d:_.y}}else _.y=0}N.exports=function(_,I,T,x){var p=null;_.eachNode(function(v){L(v,p,I,T,x),p=v})}},function(N,F,k){function U(d,c){d.prototype=Object.create(c.prototype),d.prototype.constructor=d,L(d,c)}function L(d,c){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,M){return m.__proto__=M,m},L(d,c)}var _=k(11),I=k(125),T=k(17),x=k(6),p=function(d){U(c,d);function c(){return d.apply(this,arguments)||this}var s=c.prototype;return s.execute=function(){var M=this;return T(M.rootNode,M.options,I)},c}(_),v={};function g(d,c){return c=x.assign({},v,c),new p(d,c).execute()}N.exports=g},function(N,F,k){var U=k(6);function L(T,x){var p=0;return T.children.length?T.children.forEach(function(v){p+=L(v,x)}):p=T.height,T._subTreeSep=x.getSubTreeSep(T.data),T.totalHeight=Math.max(T.height,p)+2*T._subTreeSep,T.totalHeight}function _(T){var x=T.children,p=x.length;if(p){x.forEach(function(m){_(m)});var v=x[0],g=x[p-1],d=g.y-v.y+g.height,c=0;if(x.forEach(function(m){c+=m.totalHeight}),d>T.height)T.y=v.y+d/2-T.height/2;else if(x.length!==1||T.height>c){var s=T.y+(T.height-d)/2-v.y;x.forEach(function(m){m.translate(0,s)})}else T.y=(v.y+v.height/2+g.y+g.height/2)/2-T.height/2}}var I={getSubTreeSep:function(){return 0}};N.exports=function(T,x){x===void 0&&(x={}),x=U.assign({},I,x),T.parent={x:0,width:0,height:0,y:0},T.BFTraverse(function(p){p.x=p.parent.x+p.parent.width}),T.parent=null,L(T,x),T.startY=0,T.y=T.totalHeight/2-T.height/2,T.eachNode(function(p){var v=p.children,g=v.length;if(g){var d=v[0];if(d.startY=p.startY+p._subTreeSep,g===1)d.y=p.y+p.height/2-d.height/2;else{d.y=d.startY+d.totalHeight/2-d.height/2;for(var c=1;c<g;c++){var s=v[c];s.startY=v[c-1].startY+v[c-1].totalHeight,s.y=s.startY+s.totalHeight/2-s.height/2}}}}),_(T)}}])})},20378:function(Mt,N,F){"use strict";var k=this&&this.__createBinding||(Object.create?function(_,I,T,x){x===void 0&&(x=T);var p=Object.getOwnPropertyDescriptor(I,T);(!p||("get"in p?!I.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return I[T]}}),Object.defineProperty(_,x,p)}:function(_,I,T,x){x===void 0&&(x=T),_[x]=I[T]}),U=this&&this.__exportStar||function(_,I){for(var T in _)T!=="default"&&!Object.prototype.hasOwnProperty.call(I,T)&&k(I,_,T)};Object.defineProperty(N,"__esModule",{value:!0}),N.getLayoutByName=N.unRegisterLayout=N.registerLayout=void 0;var L=F(56559);Object.defineProperty(N,"registerLayout",{enumerable:!0,get:function(){return L.registerLayout}}),Object.defineProperty(N,"unRegisterLayout",{enumerable:!0,get:function(){return L.unRegisterLayout}}),Object.defineProperty(N,"getLayoutByName",{enumerable:!0,get:function(){return L.getLayoutByName}}),U(F(68609),N)},46833:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.Base=void 0;var F=function(){function k(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return k.prototype.layout=function(U){return this.init(U),this.execute(!0)},k.prototype.init=function(U){this.nodes=U.nodes||[],this.edges=U.edges||[],this.combos=U.combos||[],this.comboEdges=U.comboEdges||[],this.hiddenNodes=U.hiddenNodes||[],this.hiddenEdges=U.hiddenEdges||[],this.hiddenCombos=U.hiddenCombos||[],this.vedges=U.vedges||[]},k.prototype.execute=function(U){},k.prototype.executeWithWorker=function(){},k.prototype.getDefaultCfg=function(){return{}},k.prototype.updateCfg=function(U){U&&Object.assign(this,U)},k.prototype.getType=function(){return"base"},k.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},k}();N.Base=F},30716:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var p=function(v,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,c){d.__proto__=c}||function(d,c){for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(d[s]=c[s])},p(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");p(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.CircularLayout=void 0;var U=F(46833),L=F(44941);function _(p,v,g,d){p.forEach(function(c,s){p[s].children=[],p[s].parent=[]}),d?v.forEach(function(c){var s=(0,L.getEdgeTerminal)(c,"source"),m=(0,L.getEdgeTerminal)(c,"target"),M=0;s&&(M=g[s]);var P=0;m&&(P=g[m]);var R=p[M].children,j=p[P].parent;R.push(p[P].id),j.push(p[M].id)}):v.forEach(function(c){var s=(0,L.getEdgeTerminal)(c,"source"),m=(0,L.getEdgeTerminal)(c,"target"),M=0;s&&(M=g[s]);var P=0;m&&(P=g[m]);var R=p[M].children,j=p[P].children;R.push(p[P].id),j.push(p[M].id)})}function I(p,v,g){for(var d=g.length,c=0;c<d;c++){var s=(0,L.getEdgeTerminal)(g[c],"source"),m=(0,L.getEdgeTerminal)(g[c],"target");if(p.id===s&&v.id===m||v.id===s&&p.id===m)return!0}return!1}function T(p,v){var g=p.degree,d=v.degree;return g<d?-1:g>d?1:0}var x=function(p){k(v,p);function v(g){var d=p.call(this)||this;return d.radius=null,d.nodeSize=void 0,d.startRadius=null,d.endRadius=null,d.startAngle=0,d.endAngle=2*Math.PI,d.clockwise=!0,d.divisions=1,d.ordering=null,d.angleRatio=1,d.nodes=[],d.edges=[],d.nodeMap={},d.degrees=[],d.width=300,d.height=300,d.updateCfg(g),d}return v.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},v.prototype.execute=function(){var g,d=this,c=d.nodes,s=d.edges,m=c.length;if(m===0){d.onLayoutEnd&&d.onLayoutEnd();return}!d.width&&typeof window!="undefined"&&(d.width=window.innerWidth),!d.height&&typeof window!="undefined"&&(d.height=window.innerHeight),d.center||(d.center=[d.width/2,d.height/2]);var M=d.center;if(m===1){c[0].x=M[0],c[0].y=M[1],d.onLayoutEnd&&d.onLayoutEnd();return}var P=d.radius,R=d.startRadius,j=d.endRadius,Q=d.divisions,G=d.startAngle,W=d.endAngle,H=d.angleRatio,Z=d.ordering,J=d.clockwise,K=d.nodeSpacing,ne=d.nodeSize,se=(W-G)/m,fe={};c.forEach(function(Lt,Jt){fe[Lt.id]=Jt}),d.nodeMap=fe;var Ie=(0,L.getDegree)(c.length,fe,s);if(d.degrees=Ie,K){var ye=(0,L.getFuncByUnknownType)(10,K),Ae=(0,L.getFuncByUnknownType)(10,ne),Se=-1/0;c.forEach(function(Lt){var Jt=Ae(Lt);Se<Jt&&(Se=Jt)});var we=0;c.forEach(function(Lt,Jt){Jt===0?we+=Se||10:we+=(ye(Lt)||0)+(Se||10)}),P=we/(2*Math.PI)}else!P&&!R&&!j?P=d.height>d.width?d.width/2:d.height/2:!R&&j?R=j:R&&!j&&(j=R);var Te=se*H,ke=[];Z==="topology"?ke=d.topologyOrdering():Z==="topology-directed"?ke=d.topologyOrdering(!0):Z==="degree"?ke=d.degreeOrdering():ke=c;for(var Ge=Math.ceil(m/Q),tt=0;tt<m;++tt){var He=P;!He&&R!==null&&j!==null&&(He=R+tt*(j-R)/(m-1)),He||(He=10+tt*100/(m-1));var ft=G+tt%Ge*Te+2*Math.PI/Q*Math.floor(tt/Ge);J||(ft=W-tt%Ge*Te-2*Math.PI/Q*Math.floor(tt/Ge)),ke[tt].x=M[0]+Math.cos(ft)*He,ke[tt].y=M[1]+Math.sin(ft)*He,ke[tt].weight=Ie[tt].all}return(g=d.onLayoutEnd)===null||g===void 0||g.call(d),{nodes:ke,edges:this.edges}},v.prototype.topologyOrdering=function(g){g===void 0&&(g=!1);var d=this,c=d.degrees,s=d.edges,m=d.nodes,M=(0,L.clone)(m),P=d.nodeMap,R=[M[0]],j=[m[0]],Q=[],G=m.length;Q[0]=!0,_(M,s,P,g);var W=0;return M.forEach(function(H,Z){if(Z!==0)if((Z===G-1||c[Z].all!==c[Z+1].all||I(R[W],H,s))&&!Q[Z])R.push(H),j.push(m[P[H.id]]),Q[Z]=!0,W++;else{for(var J=R[W].children,K=!1,ne=0;ne<J.length;ne++){var se=P[J[ne]];if(c[se].all===c[Z].all&&!Q[se]){R.push(M[se]),j.push(m[P[M[se].id]]),Q[se]=!0,K=!0;break}}for(var fe=0;!K&&(Q[fe]||(R.push(M[fe]),j.push(m[P[M[fe].id]]),Q[fe]=!0,K=!0),fe++,fe!==G););}}),j},v.prototype.degreeOrdering=function(){var g=this,d=g.nodes,c=[],s=g.degrees;return d.forEach(function(m,M){m.degree=s[M].all,c.push(m)}),c.sort(T),c},v.prototype.getType=function(){return"circular"},v}(U.Base);N.CircularLayout=x},59506:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var p=function(v,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,c){d.__proto__=c}||function(d,c){for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(d[s]=c[s])},p(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");p(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}(),U=this&&this.__assign||function(){return U=Object.assign||function(p){for(var v,g=1,d=arguments.length;g<d;g++){v=arguments[g];for(var c in v)Object.prototype.hasOwnProperty.call(v,c)&&(p[c]=v[c])}return p},U.apply(this,arguments)};Object.defineProperty(N,"__esModule",{value:!0}),N.ComboCombinedLayout=void 0;var L=F(72939),_=F(46833),I=F(44941),T=F(68609),x=function(p){k(v,p);function v(g){var d=p.call(this)||this;return d.center=[0,0],d.nodes=[],d.edges=[],d.combos=[],d.comboEdges=[],d.comboPadding=10,d.comboTrees=[],d.updateCfg(g),d}return v.prototype.getDefaultCfg=function(){return{}},v.prototype.execute=function(){var g=this,d=g.nodes,c=g.center;if(!d||d.length===0){g.onLayoutEnd&&g.onLayoutEnd();return}if(d.length===1){d[0].x=c[0],d[0].y=c[1],g.onLayoutEnd&&g.onLayoutEnd();return}g.initVals(),g.run(),g.onLayoutEnd&&g.onLayoutEnd()},v.prototype.run=function(){var g,d=this,c=d.nodes,s=d.edges,m=d.combos,M=d.comboEdges,P=d.center,R={};c.forEach(function(Se){R[Se.id]=Se});var j={};m.forEach(function(Se){j[Se.id]=Se});var Q=d.getInnerGraphs(R),G=[],W=[],H={},Z=!0;this.comboTrees.forEach(function(Se){var we=Q[Se.id],Te=U(U({},Se),{x:we.x||j[Se.id].x,y:we.y||j[Se.id].y,fx:we.fx||j[Se.id].fx,fy:we.fy||j[Se.id].fy,mass:we.mass||j[Se.id].mass,size:we.size});W.push(Te),!isNaN(Te.x)&&Te.x!==0&&!isNaN(Te.y)&&Te.y!==0?Z=!1:(Te.x=Math.random()*100,Te.y=Math.random()*100),G.push(Se.id),(0,I.traverseTreeUp)(Se,function(ke){return ke.id!==Se.id&&(H[ke.id]=Se.id),!0})}),c.forEach(function(Se){if(!(Se.comboId&&j[Se.comboId])){var we=U({},Se);W.push(we),!isNaN(we.x)&&we.x!==0&&!isNaN(we.y)&&we.y!==0?Z=!1:(we.x=Math.random()*100,we.y=Math.random()*100),G.push(Se.id)}});var J=[];if(s.concat(M).forEach(function(Se){var we=H[Se.source]||Se.source,Te=H[Se.target]||Se.target;we!==Te&&G.includes(we)&&G.includes(Te)&&J.push({source:we,target:Te})}),W!=null&&W.length){if(W.length===1)W[0].x=P[0],W[0].y=P[1];else{var K={nodes:W,edges:J},ne=this.outerLayout||new T.GForceLayout({gravity:1,factor:4,linkDistance:function(Se,we,Te){var ke,Ge,tt=((((ke=we.size)===null||ke===void 0?void 0:ke[0])||30)+(((Ge=Te.size)===null||Ge===void 0?void 0:Ge[0])||30))/2;return Math.min(tt*1.5,700)}}),se=(g=ne.getType)===null||g===void 0?void 0:g.call(ne);if(ne.updateCfg({center:P,kg:5,preventOverlap:!0,animate:!1}),Z&&L.FORCE_LAYOUT_TYPE_MAP[se]){var fe=W.length<100?new T.MDSLayout:new T.GridLayout;fe.layout(K)}ne.layout(K)}W.forEach(function(Se){var we=Q[Se.id];if(!we){var Te=R[Se.id];Te&&(Te.x=Se.x,Te.y=Se.y);return}we.visited=!0,we.x=Se.x,we.y=Se.y,we.nodes.forEach(function(ke){ke.x+=Se.x,ke.y+=Se.y})})}for(var Ie=Object.keys(Q),ye=function(Se){var we=Ie[Se],Te=Q[we];if(!Te)return"continue";Te.nodes.forEach(function(ke){Te.visited||(ke.x+=Te.x||0,ke.y+=Te.y||0),R[ke.id]&&(R[ke.id].x=ke.x,R[ke.id].y=ke.y)}),j[we]&&(j[we].x=Te.x,j[we].y=Te.y)},Ae=Ie.length-1;Ae>=0;Ae--)ye(Ae);return{nodes:c,edges:s,combos:m,comboEdges:M}},v.prototype.getInnerGraphs=function(g){var d=this,c=d.comboTrees,s=d.nodeSize,m=d.edges,M=d.comboPadding,P=d.spacing,R={},j=this.innerLayout||new T.ConcentricLayout({type:"concentric",sortBy:"id"});return j.center=[0,0],j.preventOverlap=!0,j.nodeSpacing=P,(c||[]).forEach(function(Q){(0,I.traverseTreeUp)(Q,function(G){var W,H=(M==null?void 0:M(G))||10;if((0,I.isArray)(H)&&(H=Math.max.apply(Math,H)),!((W=G.children)===null||W===void 0)&&W.length){var J=G.children.map(function(Ge){if(Ge.itemType==="combo")return R[Ge.id];var tt=g[Ge.id]||{};return U(U({},tt),Ge)}),K=J.map(function(Ge){return Ge.id}),ne={nodes:J,edges:m.filter(function(Ge){return K.includes(Ge.source)&&K.includes(Ge.target)})},se=1/0;J.forEach(function(Ge){var tt;Ge.size||(Ge.size=((tt=R[Ge.id])===null||tt===void 0?void 0:tt.size)||(s==null?void 0:s(Ge))||[30,30]),(0,I.isNumber)(Ge.size)&&(Ge.size=[Ge.size,Ge.size]),se>Ge.size[0]&&(se=Ge.size[0]),se>Ge.size[1]&&(se=Ge.size[1])}),j.layout(ne);var fe=(0,I.getLayoutBBox)(J),Ie=fe.minX,ye=fe.minY,Ae=fe.maxX,Se=fe.maxY,we={x:(Ae+Ie)/2,y:(Se+ye)/2};ne.nodes.forEach(function(Ge){Ge.x-=we.x,Ge.y-=we.y});var Te=Math.max(Ae-Ie,se)+H*2,ke=Math.max(Se-ye,se)+H*2;R[G.id]={id:G.id,nodes:J,size:[Te,ke]}}else if(G.itemType==="combo"){var Z=H?[H*2,H*2]:[30,30];R[G.id]={id:G.id,nodes:[],size:Z}}return!0})}),R},v.prototype.initVals=function(){var g=this,d=g.nodeSize,c=g.spacing,s,m;if((0,I.isNumber)(c)?m=function(){return c}:(0,I.isFunction)(c)?m=c:m=function(){return 0},this.spacing=m,!d)s=function(G){var W=m(G);if(G.size){if((0,I.isArray)(G.size)){var H=G.size[0]>G.size[1]?G.size[0]:G.size[1];return(H+W)/2}if((0,I.isObject)(G.size)){var H=G.size.width>G.size.height?G.size.width:G.size.height;return(H+W)/2}return(G.size+W)/2}return 10+W/2};else if((0,I.isFunction)(d))s=function(G){var W=d(G),H=m(G);if((0,I.isArray)(G.size)){var Z=G.size[0]>G.size[1]?G.size[0]:G.size[1];return(Z+H)/2}return((W||10)+H)/2};else if((0,I.isArray)(d)){var M=d[0]>d[1]?d[0]:d[1],P=M/2;s=function(G){return P+m(G)/2}}else{var R=d/2;s=function(G){return R+m(G)/2}}this.nodeSize=s;var j=g.comboPadding,Q;(0,I.isNumber)(j)?Q=function(){return j}:(0,I.isArray)(j)?Q=function(){return Math.max.apply(null,j)}:(0,I.isFunction)(j)?Q=j:Q=function(){return 0},this.comboPadding=Q},v.prototype.getType=function(){return"comboCombined"},v}(_.Base);N.ComboCombinedLayout=x},80808:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var I=function(T,x){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(p[g]=v[g])},I(T,x)};return function(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");I(T,x);function p(){this.constructor=T}T.prototype=x===null?Object.create(x):(p.prototype=x.prototype,new p)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.ComboForceLayout=void 0;var U=F(46833),L=F(44941),_=function(I){k(T,I);function T(x){var p=I.call(this)||this;return p.center=[0,0],p.maxIteration=100,p.gravity=10,p.comboGravity=10,p.linkDistance=10,p.alpha=1,p.alphaMin=.001,p.alphaDecay=1-Math.pow(p.alphaMin,1/300),p.alphaTarget=0,p.velocityDecay=.6,p.edgeStrength=.6,p.nodeStrength=30,p.preventOverlap=!1,p.preventNodeOverlap=!1,p.preventComboOverlap=!1,p.collideStrength=void 0,p.nodeCollideStrength=.5,p.comboCollideStrength=.5,p.comboSpacing=20,p.comboPadding=10,p.optimizeRangeFactor=1,p.onTick=function(){},p.onLayoutEnd=function(){},p.depthAttractiveForceScale=1,p.depthRepulsiveForceScale=2,p.nodes=[],p.edges=[],p.combos=[],p.comboTrees=[],p.width=300,p.height=300,p.bias=[],p.nodeMap={},p.oriComboMap={},p.indexMap={},p.comboMap={},p.previousLayouted=!1,p.updateCfg(x),p}return T.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},T.prototype.execute=function(){var x=this,p=x.nodes,v=x.center;if(x.comboTree={id:"comboTreeRoot",depth:-1,children:x.comboTrees},!p||p.length===0){x.onLayoutEnd&&x.onLayoutEnd();return}if(p.length===1){p[0].x=v[0],p[0].y=v[1],x.onLayoutEnd&&x.onLayoutEnd();return}x.initVals(),x.run(),x.onLayoutEnd&&x.onLayoutEnd()},T.prototype.run=function(){var x=this,p=x.nodes,v=x.previousLayouted?x.maxIteration/5:x.maxIteration;!x.width&&typeof window!="undefined"&&(x.width=window.innerWidth),!x.height&&typeof window!="undefined"&&(x.height=window.innerHeight);var g=x.center,d=x.velocityDecay,c=x.comboMap;x.previousLayouted||x.initPos(c);for(var s=function(R){var j=[];p.forEach(function(Q,G){j[G]={x:0,y:0}}),x.applyCalculate(j),x.applyComboCenterForce(j),p.forEach(function(Q,G){!(0,L.isNumber)(Q.x)||!(0,L.isNumber)(Q.y)||(Q.x+=j[G].x*d,Q.y+=j[G].y*d)}),x.alpha+=(x.alphaTarget-x.alpha)*x.alphaDecay,x.onTick()},m=0;m<v;m++)s(m);var M=[0,0];p.forEach(function(R){!(0,L.isNumber)(R.x)||!(0,L.isNumber)(R.y)||(M[0]+=R.x,M[1]+=R.y)}),M[0]/=p.length,M[1]/=p.length;var P=[g[0]-M[0],g[1]-M[1]];p.forEach(function(R,j){!(0,L.isNumber)(R.x)||!(0,L.isNumber)(R.y)||(R.x+=P[0],R.y+=P[1])}),x.combos.forEach(function(R){var j=c[R.id];j&&j.empty&&(R.x=j.cx||R.x,R.y=j.cy||R.y)}),x.previousLayouted=!0},T.prototype.initVals=function(){var x=this,p=x.edges,v=x.nodes,g=x.combos,d={},c={},s={};v.forEach(function(He,ft){c[He.id]=He,s[He.id]=ft}),x.nodeMap=c,x.indexMap=s;var m={};g.forEach(function(He){m[He.id]=He}),x.oriComboMap=m,x.comboMap=x.getComboMap();var M=x.preventOverlap;x.preventComboOverlap=x.preventComboOverlap||M,x.preventNodeOverlap=x.preventNodeOverlap||M;var P=x.collideStrength;P&&(x.comboCollideStrength=P,x.nodeCollideStrength=P),x.comboCollideStrength=x.comboCollideStrength?x.comboCollideStrength:0,x.nodeCollideStrength=x.nodeCollideStrength?x.nodeCollideStrength:0;for(var R=0;R<p.length;++R){var j=(0,L.getEdgeTerminal)(p[R],"source"),Q=(0,L.getEdgeTerminal)(p[R],"target");d[j]?d[j]++:d[j]=1,d[Q]?d[Q]++:d[Q]=1}for(var G=[],R=0;R<p.length;++R){var j=(0,L.getEdgeTerminal)(p[R],"source"),Q=(0,L.getEdgeTerminal)(p[R],"target");G[R]=d[j]/(d[j]+d[Q])}this.bias=G;var W=x.nodeSize,H=x.nodeSpacing,Z,J;if((0,L.isNumber)(H)?J=function(){return H}:(0,L.isFunction)(H)?J=H:J=function(){return 0},this.nodeSpacing=J,!W)Z=function(He){if(He.size){if((0,L.isArray)(He.size)){var ft=He.size[0]>He.size[1]?He.size[0]:He.size[1];return ft/2}if((0,L.isObject)(He.size)){var ft=He.size.width>He.size.height?He.size.width:He.size.height;return ft/2}return He.size/2}return 10};else if((0,L.isFunction)(W))Z=function(He){return W(He)};else if((0,L.isArray)(W)){var K=W[0]>W[1]?W[0]:W[1],ne=K/2;Z=function(He){return ne}}else{var se=W/2;Z=function(He){return se}}this.nodeSize=Z;var fe=x.comboSpacing,Ie;(0,L.isNumber)(fe)?Ie=function(){return fe}:(0,L.isFunction)(fe)?Ie=fe:Ie=function(){return 0},this.comboSpacing=Ie;var ye=x.comboPadding,Ae;(0,L.isNumber)(ye)?Ae=function(){return ye}:(0,L.isArray)(ye)?Ae=function(){return Math.max.apply(null,ye)}:(0,L.isFunction)(ye)?Ae=ye:Ae=function(){return 0},this.comboPadding=Ae;var Se=this.linkDistance,we;Se||(Se=10),(0,L.isNumber)(Se)?we=function(He){return Se}:we=Se,this.linkDistance=we;var Te=this.edgeStrength,ke;Te||(Te=1),(0,L.isNumber)(Te)?ke=function(He){return Te}:ke=Te,this.edgeStrength=ke;var Ge=this.nodeStrength,tt;Ge||(Ge=30),(0,L.isNumber)(Ge)?tt=function(He){return Ge}:tt=Ge,this.nodeStrength=tt},T.prototype.initPos=function(x){var p=this,v=p.nodes;v.forEach(function(g,d){var c=g.comboId,s=x[c];c&&s?(g.x=s.cx+100/(d+1),g.y=s.cy+100/(d+1)):(g.x=100/(d+1),g.y=100/(d+1))})},T.prototype.getComboMap=function(){var x=this,p=x.nodeMap,v=x.comboTrees,g=x.oriComboMap,d={};return(v||[]).forEach(function(c){var s=[];(0,L.traverseTreeUp)(c,function(m){if(m.itemType==="node"||!g[m.id])return!0;if(d[m.id]===void 0){var M={id:m.id,name:m.id,cx:0,cy:0,count:0,depth:x.oriComboMap[m.id].depth||0,children:[]};d[m.id]=M}var P=m.children;P&&P.forEach(function(Q){if(!d[Q.id]&&!p[Q.id])return!0;s.push(Q)});var R=d[m.id];if(R.cx=0,R.cy=0,s.length===0){R.empty=!0;var j=g[m.id];R.cx=j.x,R.cy=j.y}return s.forEach(function(Q){if(R.count++,Q.itemType!=="node"){var G=d[Q.id];(0,L.isNumber)(G.cx)&&(R.cx+=G.cx),(0,L.isNumber)(G.cy)&&(R.cy+=G.cy);return}var W=p[Q.id];W&&((0,L.isNumber)(W.x)&&(R.cx+=W.x),(0,L.isNumber)(W.y)&&(R.cy+=W.y))}),R.cx/=R.count||1,R.cy/=R.count||1,R.children=s,!0})}),d},T.prototype.applyComboCenterForce=function(x){var p=this,v=p.gravity,g=p.comboGravity||v,d=this.alpha,c=p.comboTrees,s=p.indexMap,m=p.nodeMap,M=p.comboMap;(c||[]).forEach(function(P){(0,L.traverseTreeUp)(P,function(R){if(R.itemType==="node")return!0;var j=M[R.id];if(!j)return!0;var Q=M[R.id],G=(Q.depth+1)/10*.5,W=Q.cx,H=Q.cy;return Q.cx=0,Q.cy=0,Q.children.forEach(function(Z){if(Z.itemType!=="node"){var J=M[Z.id];J&&(0,L.isNumber)(J.cx)&&(Q.cx+=J.cx),J&&(0,L.isNumber)(J.cy)&&(Q.cy+=J.cy);return}var K=m[Z.id],ne=K.x-W||.005,se=K.y-H||.005,fe=Math.sqrt(ne*ne+se*se),Ie=s[K.id],ye=g*d/fe*G;x[Ie].x-=ne*ye,x[Ie].y-=se*ye,(0,L.isNumber)(K.x)&&(Q.cx+=K.x),(0,L.isNumber)(K.y)&&(Q.cy+=K.y)}),Q.cx/=Q.count||1,Q.cy/=Q.count||1,!0})})},T.prototype.applyCalculate=function(x){var p=this,v=p.comboMap,g=p.nodes,d={};g.forEach(function(s,m){g.forEach(function(M,P){if(!(m<P)){var R=s.x-M.x||.005,j=s.y-M.y||.005,Q=R*R+j*j,G=Math.sqrt(Q);Q<1&&(Q=G),d["".concat(s.id,"-").concat(M.id)]={vx:R,vy:j,vl2:Q,vl:G},d["".concat(M.id,"-").concat(s.id)]={vl2:Q,vl:G,vx:-R,vy:-j}}})}),p.updateComboSizes(v),p.calRepulsive(x,d),p.calAttractive(x,d);var c=p.preventComboOverlap;c&&p.comboNonOverlapping(x,v)},T.prototype.updateComboSizes=function(x){var p=this,v=p.comboTrees,g=p.nodeMap,d=p.nodeSize,c=p.comboSpacing,s=p.comboPadding;(v||[]).forEach(function(m){var M=[];(0,L.traverseTreeUp)(m,function(P){if(P.itemType==="node")return!0;var R=x[P.id];if(!R)return!1;var j=P.children;j&&j.forEach(function(W){!x[W.id]&&!g[W.id]||M.push(W)}),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0,M.forEach(function(W){if(W.itemType!=="node")return!0;var H=g[W.id];if(!H)return!0;var Z=d(H),J=H.x-Z,K=H.y-Z,ne=H.x+Z,se=H.y+Z;R.minX>J&&(R.minX=J),R.minY>K&&(R.minY=K),R.maxX<ne&&(R.maxX=ne),R.maxY<se&&(R.maxY=se)});var Q=p.oriComboMap[P.id].size||10;(0,L.isArray)(Q)&&(Q=Q[0]);var G=Math.max(R.maxX-R.minX,R.maxY-R.minY,Q);return R.r=G/2+c(R)/2+s(R),!0})})},T.prototype.comboNonOverlapping=function(x,p){var v=this,g=v.comboTree,d=v.comboCollideStrength,c=v.indexMap,s=v.nodeMap;(0,L.traverseTreeUp)(g,function(m){if(!p[m.id]&&!s[m.id]&&m.id!=="comboTreeRoot")return!1;var M=m.children;return M&&M.length>1&&M.forEach(function(P,R){if(P.itemType==="node")return!1;var j=p[P.id];j&&M.forEach(function(Q,G){if(R<=G||Q.itemType==="node")return!1;var W=p[Q.id];if(!W)return!1;var H=j.cx-W.cx||.005,Z=j.cy-W.cy||.005,J=H*H+Z*Z,K=j.r||1,ne=W.r||1,se=K+ne,fe=ne*ne,Ie=K*K;if(J<se*se){var ye=P.children;if(!ye||ye.length===0)return!1;var Ae=Q.children;if(!Ae||Ae.length===0)return!1;var Se=Math.sqrt(J),we=(se-Se)/Se*d,Te=H*we,ke=Z*we,Ge=fe/(Ie+fe),tt=1-Ge;ye.forEach(function(He){if(He.itemType!=="node")return!1;if(s[He.id]){var ft=c[He.id];Ae.forEach(function(Lt){if(Lt.itemType!=="node"||!s[Lt.id])return!1;var Jt=c[Lt.id];x[ft].x+=Te*Ge,x[ft].y+=ke*Ge,x[Jt].x-=Te*tt,x[Jt].y-=ke*tt})}})}})}),!0})},T.prototype.calRepulsive=function(x,p){var v=this,g=v.nodes,d=v.width*v.optimizeRangeFactor,c=v.nodeStrength,s=v.alpha,m=v.nodeCollideStrength,M=v.preventNodeOverlap,P=v.nodeSize,R=v.nodeSpacing,j=v.depthRepulsiveForceScale,Q=v.center;g.forEach(function(G,W){if(!(!G.x||!G.y)){if(Q){var H=v.gravity,Z=G.x-Q[0]||.005,J=G.y-Q[1]||.005,K=Math.sqrt(Z*Z+J*J);x[W].x-=Z*H*s/K,x[W].y-=J*H*s/K}g.forEach(function(ne,se){if(W!==se&&!(!ne.x||!ne.y)){var fe=p["".concat(G.id,"-").concat(ne.id)],Ie=fe.vl2,ye=fe.vl;if(!(ye>d)){var Ae=p["".concat(G.id,"-").concat(ne.id)],Se=Ae.vx,we=Ae.vy,Te=Math.log(Math.abs(ne.depth-G.depth)/10)+1||1;Te=Te<1?1:Te,ne.comboId!==G.comboId&&(Te+=1);var ke=Te?Math.pow(j,Te):1,Ge=c(ne)*s/Ie*ke;if(x[W].x+=Se*Ge,x[W].y+=we*Ge,W<se&&M){var tt=P(G)+R(G)||1,He=P(ne)+R(ne)||1,ft=tt+He;if(Ie<ft*ft){var Lt=(ft-ye)/ye*m,Jt=He*He,Qe=Jt/(tt*tt+Jt),ut=Se*Lt,xt=we*Lt;x[W].x+=ut*Qe,x[W].y+=xt*Qe,Qe=1-Qe,x[se].x-=ut*Qe,x[se].y-=xt*Qe}}}}})}})},T.prototype.calAttractive=function(x,p){var v=this,g=v.edges,d=v.linkDistance,c=v.alpha,s=v.edgeStrength,m=v.bias,M=v.depthAttractiveForceScale;g.forEach(function(P,R){var j=(0,L.getEdgeTerminal)(P,"source"),Q=(0,L.getEdgeTerminal)(P,"target");if(!(!j||!Q||j===Q)){var G=v.indexMap[j],W=v.indexMap[Q],H=v.nodeMap[j],Z=v.nodeMap[Q];if(!(!H||!Z)){var J=H.depth===Z.depth?0:Math.log(Math.abs(H.depth-Z.depth)/10);H.comboId===Z.comboId&&(J=J/2);var K=J?Math.pow(M,J):1;if(H.comboId!==Z.comboId&&K===1?K=M/2:H.comboId===Z.comboId&&(K=2),!(!(0,L.isNumber)(Z.x)||!(0,L.isNumber)(H.x)||!(0,L.isNumber)(Z.y)||!(0,L.isNumber)(H.y))){var ne=p["".concat(Q,"-").concat(j)],se=ne.vl,fe=ne.vx,Ie=ne.vy,ye=(se-d(P))/se*c*s(P)*K,Ae=fe*ye,Se=Ie*ye,we=m[R];x[W].x-=Ae*we,x[W].y-=Se*we,x[G].x+=Ae*(1-we),x[G].y+=Se*(1-we)}}}})},T.prototype.getType=function(){return"comboForce"},T}(U.Base);N.ComboForceLayout=_},370:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var I=function(T,x){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(p[g]=v[g])},I(T,x)};return function(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");I(T,x);function p(){this.constructor=T}T.prototype=x===null?Object.create(x):(p.prototype=x.prototype,new p)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.ConcentricLayout=void 0;var U=F(44941),L=F(46833),_=function(I){k(T,I);function T(x){var p=I.call(this)||this;return p.nodeSize=30,p.minNodeSpacing=10,p.nodeSpacing=10,p.preventOverlap=!1,p.equidistant=!1,p.startAngle=3/2*Math.PI,p.clockwise=!0,p.sortBy="degree",p.nodes=[],p.edges=[],p.width=300,p.height=300,p.onLayoutEnd=function(){},p.updateCfg(x),p}return T.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},T.prototype.execute=function(){var x,p,v=this,g=v.nodes,d=v.edges,c=g.length;if(c===0){(x=v.onLayoutEnd)===null||x===void 0||x.call(v);return}!v.width&&typeof window!="undefined"&&(v.width=window.innerWidth),!v.height&&typeof window!="undefined"&&(v.height=window.innerHeight),v.center||(v.center=[v.width/2,v.height/2]);var s=v.center;if(c===1){g[0].x=s[0],g[0].y=s[1],(p=v.onLayoutEnd)===null||p===void 0||p.call(v);return}var m=v.nodeSize,M=v.nodeSpacing,P=[],R,j=0;(0,U.isArray)(m)?R=Math.max(m[0],m[1]):R=m,(0,U.isArray)(M)?j=Math.max(M[0],M[1]):(0,U.isNumber)(M)&&(j=M),g.forEach(function(Te){P.push(Te);var ke=R;(0,U.isArray)(Te.size)?ke=Math.max(Te.size[0],Te.size[1]):(0,U.isNumber)(Te.size)?ke=Te.size:(0,U.isObject)(Te.size)&&(ke=Math.max(Te.size.width,Te.size.height)),R=Math.max(R,ke),(0,U.isFunction)(M)&&(j=Math.max(M(Te),j))}),v.clockwise=v.counterclockwise!==void 0?!v.counterclockwise:v.clockwise;var Q={},G={};if(P.forEach(function(Te,ke){Q[Te.id]=Te,G[Te.id]=ke}),(v.sortBy==="degree"||!(0,U.isString)(v.sortBy)||P[0][v.sortBy]===void 0)&&(v.sortBy="degree",!(0,U.isNumber)(g[0].degree))){var W=(0,U.getDegree)(g.length,G,d);P.forEach(function(Te,ke){Te.degree=W[ke].all})}P.sort(function(Te,ke){return ke[v.sortBy]-Te[v.sortBy]}),v.maxValueNode=P[0],v.maxLevelDiff=v.maxLevelDiff||v.maxValueNode[v.sortBy]/4;var H=[[]],Z=H[0];P.forEach(function(Te){if(Z.length>0){var ke=Math.abs(Z[0][v.sortBy]-Te[v.sortBy]);v.maxLevelDiff&&ke>=v.maxLevelDiff&&(Z=[],H.push(Z))}Z.push(Te)});var J=R+(j||v.minNodeSpacing);if(!v.preventOverlap){var K=H.length>0&&H[0].length>1,ne=Math.min(v.width,v.height)/2-J,se=ne/(H.length+(K?1:0));J=Math.min(J,se)}var fe=0;if(H.forEach(function(Te){var ke=v.sweep;ke===void 0&&(ke=2*Math.PI-2*Math.PI/Te.length);var Ge=Te.dTheta=ke/Math.max(1,Te.length-1);if(Te.length>1&&v.preventOverlap){var tt=Math.cos(Ge)-Math.cos(0),He=Math.sin(Ge)-Math.sin(0),ft=Math.sqrt(J*J/(tt*tt+He*He));fe=Math.max(ft,fe)}Te.r=fe,fe+=J}),v.equidistant){for(var Ie=0,ye=0,Ae=0;Ae<H.length;Ae++){var Se=H[Ae],we=Se.r-ye;Ie=Math.max(Ie,we)}ye=0,H.forEach(function(Te,ke){ke===0&&(ye=Te.r),Te.r=ye,ye+=Ie})}return H.forEach(function(Te){var ke=Te.dTheta,Ge=Te.r;Te.forEach(function(tt,He){var ft=v.startAngle+(v.clockwise?1:-1)*ke*He;tt.x=s[0]+Ge*Math.cos(ft),tt.y=s[1]+Ge*Math.sin(ft)})}),v.onLayoutEnd&&v.onLayoutEnd(),{nodes:g,edges:d}},T.prototype.getType=function(){return"concentric"},T}(L.Base);N.ConcentricLayout=_},72939:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.FORCE_LAYOUT_TYPE_MAP=N.LAYOUT_MESSAGE=void 0,N.LAYOUT_MESSAGE={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"},N.FORCE_LAYOUT_TYPE_MAP={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0}},95511:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var v=function(g,d){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,s){c.__proto__=s}||function(c,s){for(var m in s)Object.prototype.hasOwnProperty.call(s,m)&&(c[m]=s[m])},v(g,d)};return function(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");v(g,d);function c(){this.constructor=g}g.prototype=d===null?Object.create(d):(c.prototype=d.prototype,new c)}}(),U=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(N,"__esModule",{value:!0}),N.DagreLayout=void 0;var L=U(F(57007)),_=F(44941),I=F(46833),T=F(61283),x=function(v){k(g,v);function g(d){var c=v.call(this)||this;return c.rankdir="TB",c.nodesep=50,c.ranksep=50,c.controlPoints=!1,c.sortByCombo=!1,c.edgeLabelSpace=!0,c.radial=!1,c.nodes=[],c.edges=[],c.onLayoutEnd=function(){},c.layoutNode=function(s){var m=c,M=m.nodes,P=M.find(function(j){return j.id===s});if(P){var R=P.layout!==!1;return R}return!0},c.updateCfg(d),c}return g.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},g.prototype.execute=function(){var d=this,c,s,m,M,P=this,R=P.nodes,j=P.nodeSize,Q=P.rankdir,G=P.combos,W=P.begin,H=P.radial,Z=P.comboEdges,J=Z===void 0?[]:Z,K=P.vedges,ne=K===void 0?[]:K;if(R){var se=P.edges||[],fe=new T.Graph({multigraph:!0,compound:!0});P.nodeMap={};var Ie={};R.forEach(function(Rt){P.nodeMap[Rt.id]=Rt,Rt.comboId&&(Ie[Rt.comboId]=Ie[Rt.comboId]||[],Ie[Rt.comboId].push(Rt.id))});var ye=[],Ae={};!((c=P.nodeOrder)===null||c===void 0)&&c.length?(P.nodeOrder.forEach(function(Rt){Ae[Rt]=!0,ye.push(P.nodeMap[Rt])}),R.forEach(function(Rt){Ae[Rt.id]||ye.push(Rt)})):ye=R;var Se;j?(0,_.isArray)(j)?Se=function(){return j}:Se=function(){return[j,j]}:Se=function(Rt){return Rt.size?(0,_.isArray)(Rt.size)?Rt.size:(0,_.isObject)(Rt.size)?[Rt.size.width||40,Rt.size.height||40]:[Rt.size,Rt.size]:[40,40]};var we=(0,_.getFunc)(P.ranksep,50,P.ranksepFunc),Te=(0,_.getFunc)(P.nodesep,50,P.nodesepFunc),ke=Te,Ge=we;(Q==="LR"||Q==="RL")&&(ke=we,Ge=Te),fe.setDefaultEdgeLabel(function(){return{}}),fe.setGraph(P);var tt={};this.sortByCombo&&G&&G.forEach(function(Rt){if(tt[Rt.id]=Rt,Rt.collapsed){var zt=Se(Rt),Vt=Ge(Rt),hr=ke(Rt),Ar=zt[0]+2*hr,en=zt[1]+2*Vt;fe.setNode(Rt.id,{width:Ar,height:en})}Rt.parentId&&(tt[Rt.parentId]||fe.setNode(Rt.parentId,{}),fe.setParent(Rt.id,Rt.parentId))}),ye.filter(function(Rt){return Rt.layout!==!1}).forEach(function(Rt){var zt=Se(Rt),Vt=Ge(Rt),hr=ke(Rt),Ar=zt[0]+2*hr,en=zt[1]+2*Vt,Fr=Rt.layer;(0,_.isNumber)(Fr)?fe.setNode(Rt.id,{width:Ar,height:en,layer:Fr}):fe.setNode(Rt.id,{width:Ar,height:en}),d.sortByCombo&&Rt.comboId&&(tt[Rt.comboId]||(tt[Rt.comboId]={id:Rt.comboId},fe.setNode(Rt.comboId,{})),fe.setParent(Rt.id,Rt.comboId))}),se.forEach(function(Rt){var zt=(0,_.getEdgeTerminal)(Rt,"source"),Vt=(0,_.getEdgeTerminal)(Rt,"target");d.layoutNode(zt)&&d.layoutNode(Vt)&&fe.setEdge(zt,Vt,{weight:Rt.weight||1})}),(s=J==null?void 0:J.concat(ne||[]))===null||s===void 0||s.forEach(function(Rt){var zt,Vt,hr=Rt.source,Ar=Rt.target,en=!((zt=tt[hr])===null||zt===void 0)&&zt.collapsed?[hr]:Ie[hr]||[hr],Fr=!((Vt=tt[Ar])===null||Vt===void 0)&&Vt.collapsed?[Ar]:Ie[Ar]||[Ar];en.forEach(function(Cn){Fr.forEach(function(Sn){fe.setEdge(Cn,Sn,{weight:Rt.weight||1})})})});var He=void 0;!((m=P.preset)===null||m===void 0)&&m.nodes&&(He=new T.Graph({multigraph:!0,compound:!0}),P.preset.nodes.forEach(function(Rt){He==null||He.setNode(Rt.id,Rt)})),L.default.layout(fe,{prevGraph:He,edgeLabelSpace:P.edgeLabelSpace,keepNodeOrder:!!P.nodeOrder,nodeOrder:P.nodeOrder});var ft=[0,0];if(W){var Lt=1/0,Jt=1/0;fe.nodes().forEach(function(Rt){var zt=fe.node(Rt);Lt>zt.x&&(Lt=zt.x),Jt>zt.y&&(Jt=zt.y)}),fe.edges().forEach(function(Rt){var zt,Vt=fe.edge(Rt);(zt=Vt.points)===null||zt===void 0||zt.forEach(function(hr){Lt>hr.x&&(Lt=hr.x),Jt>hr.y&&(Jt=hr.y)})}),ft[0]=W[0]-Lt,ft[1]=W[1]-Jt}var Qe=Q==="LR"||Q==="RL";if(H){var ut=this,xt=ut.focusNode,dt=ut.ranksep,pt=ut.getRadialPos,wt=(0,_.isString)(xt)?xt:xt==null?void 0:xt.id,mt=wt?(M=fe.node(wt))===null||M===void 0?void 0:M._rank:0,ur=[],Ir=Qe?"y":"x",Nr=Qe?"height":"width",Hr=1/0,It=-1/0;fe.nodes().forEach(function(Rt){var zt=fe.node(Rt);if(P.nodeMap[Rt]){var Vt=Te(P.nodeMap[Rt]);if(mt===0)ur[zt._rank]||(ur[zt._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),ur[zt._rank].nodes.push(Rt),ur[zt._rank].totalWidth+=Vt*2+zt[Nr],ur[zt._rank].maxSize<Math.max(zt.width,zt.height)&&(ur[zt._rank].maxSize=Math.max(zt.width,zt.height));else{var hr=zt._rank-mt;if(hr===0)ur[hr]||(ur[hr]={nodes:[],totalWidth:0,maxSize:-1/0}),ur[hr].nodes.push(Rt),ur[hr].totalWidth+=Vt*2+zt[Nr],ur[hr].maxSize<Math.max(zt.width,zt.height)&&(ur[hr].maxSize=Math.max(zt.width,zt.height));else{var Ar=Math.abs(hr);ur[Ar]||(ur[Ar]={left:[],right:[],totalWidth:0,maxSize:-1/0}),ur[Ar].totalWidth+=Vt*2+zt[Nr],ur[Ar].maxSize<Math.max(zt.width,zt.height)&&(ur[Ar].maxSize=Math.max(zt.width,zt.height)),hr<0?ur[Ar].left.push(Rt):ur[Ar].right.push(Rt)}}var en=zt[Ir]-zt[Nr]/2-Vt,Fr=zt[Ir]+zt[Nr]/2+Vt;en<Hr&&(Hr=en),Fr>It&&(It=Fr)}});var qt=dt||50,ar={},Oe=(It-Hr)/.9,Pr=[(Hr+It-Oe)*.5,(Hr+It+Oe)*.5],Cr=function(Rt,zt,Vt,hr){Vt===void 0&&(Vt=-1/0),hr===void 0&&(hr=[0,1]);var Ar=Vt;return Rt.forEach(function(en){var Fr=fe.node(en);ar[en]=zt;var Cn=pt(Fr[Ir],Pr,Oe,zt,hr),Sn=Cn.x,oa=Cn.y;if(P.nodeMap[en]){P.nodeMap[en].x=Sn+ft[0],P.nodeMap[en].y=oa+ft[1],P.nodeMap[en]._order=Fr._order;var jr=we(P.nodeMap[en]);Ar<jr&&(Ar=jr)}}),Ar},Gr=!0,mr=0;ur.forEach(function(Rt){var zt,Vt,hr,Ar,en,Fr,Cn;if(!(!(!((zt=Rt==null?void 0:Rt.nodes)===null||zt===void 0)&&zt.length)&&!(!((Vt=Rt==null?void 0:Rt.left)===null||Vt===void 0)&&Vt.length)&&!(!((hr=Rt==null?void 0:Rt.right)===null||hr===void 0)&&hr.length))){if(Gr&&Rt.nodes.length===1){var Sn=Rt.nodes[0];if(!P.nodeMap[Sn])return;P.nodeMap[Sn].x=ft[0],P.nodeMap[Sn].y=ft[1],ar[Rt.nodes[0]]=0,qt=we(P.nodeMap[Sn]),Gr=!1;return}qt=Math.max(qt,Rt.totalWidth/(2*Math.PI));var oa=-1/0;if(mt===0||!((Ar=Rt.nodes)===null||Ar===void 0)&&Ar.length)oa=Cr(Rt.nodes,qt,oa,[0,1]);else{var jr=((en=Rt.left)===null||en===void 0?void 0:en.length)/(((Fr=Rt.left)===null||Fr===void 0?void 0:Fr.length)+((Cn=Rt.right)===null||Cn===void 0?void 0:Cn.length));oa=Cr(Rt.left,qt,oa,[0,jr]),oa=Cr(Rt.right,qt,oa,[jr+.05,1])}qt+=oa,Gr=!1,mr-Rt.maxSize}}),fe.edges().forEach(function(Rt){var zt,Vt,hr,Ar=fe.edge(Rt),en=se.findIndex(function(un){var Wn=(0,_.getEdgeTerminal)(un,"source"),Y=(0,_.getEdgeTerminal)(un,"target");return Wn===Rt.v&&Y===Rt.w});if(!(en<=-1)&&P.edgeLabelSpace&&P.controlPoints&&se[en].type!=="loop"){var Fr=Ir==="x"?"y":"x",Cn=(zt=Ar==null?void 0:Ar.points)===null||zt===void 0?void 0:zt.slice(1,Ar.points.length-1),Sn=[],oa=(Vt=fe.node(Rt.v))===null||Vt===void 0?void 0:Vt[Fr],jr=oa-((hr=fe.node(Rt.w))===null||hr===void 0?void 0:hr[Fr]),xn=ar[Rt.v],vn=xn-ar[Rt.w];Cn==null||Cn.forEach(function(un){var Wn=(un[Fr]-oa)/jr*vn+xn,Y=pt(un[Ir],Pr,Oe,Wn);Sn.push({x:Y.x+ft[0],y:Y.y+ft[1]})}),se[en].controlPoints=Sn}})}else{var rn=new Set,Sr=Q==="BT"||Q==="RL",qr=Sr?function(Rt,zt){return zt-Rt}:function(Rt,zt){return Rt-zt};fe.nodes().forEach(function(Rt){var zt=fe.node(Rt);if(zt){var Vt=d.nodeMap[Rt];Vt||(Vt=G==null?void 0:G.find(function(hr){return hr.id===Rt})),Vt&&(Vt.x=zt.x+ft[0],Vt.y=zt.y+ft[1],Vt._order=zt._order,rn.add(Qe?Vt.x:Vt.y))}});var Rn=Array.from(rn).sort(qr),yn=Qe?function(Rt,zt){return Rt.x!==zt.x}:function(Rt,zt){return Rt.y!==zt.y},zr=Qe?function(Rt,zt,Vt){var hr=Math.max(zt.y,Vt.y),Ar=Math.min(zt.y,Vt.y);return Rt.filter(function(en){return en.y<=hr&&en.y>=Ar})}:function(Rt,zt,Vt){var hr=Math.max(zt.x,Vt.x),Ar=Math.min(zt.x,Vt.x);return Rt.filter(function(en){return en.x<=hr&&en.x>=Ar})};fe.edges().forEach(function(Rt){var zt,Vt=fe.edge(Rt),hr=se.findIndex(function(Fr){var Cn=(0,_.getEdgeTerminal)(Fr,"source"),Sn=(0,_.getEdgeTerminal)(Fr,"target");return Cn===Rt.v&&Sn===Rt.w});if(!(hr<=-1)&&P.edgeLabelSpace&&P.controlPoints&&se[hr].type!=="loop"){(zt=Vt==null?void 0:Vt.points)===null||zt===void 0||zt.forEach(function(Fr){Fr.x+=ft[0],Fr.y+=ft[1]});var Ar=P.nodeMap[Rt.v],en=P.nodeMap[Rt.w];se[hr].controlPoints=p(Vt==null?void 0:Vt.points,Ar,en,Rn,Qe,yn,zr)}})}return P.onLayoutEnd&&P.onLayoutEnd(),{nodes:R,edges:se}}},g.prototype.getRadialPos=function(d,c,s,m,M){M===void 0&&(M=[0,1]);var P=(d-c[0])/s;P=P*(M[1]-M[0])+M[0];var R=P*2*Math.PI;return{x:Math.cos(R)*m,y:Math.sin(R)*m}},g.prototype.getType=function(){return"dagre"},g}(I.Base);N.DagreLayout=x;var p=function(v,g,d,c,s,m,M){var P=(v==null?void 0:v.slice(1,v.length-1))||[];if(g&&d){var R=g.x,j=g.y,Q=d.x,G=d.y;if(s&&(R=g.y,j=g.x,Q=d.y,G=d.x),G!==j&&R!==Q){var W=c.indexOf(j),H=c[W+1];if(H){var Z=P[0],J=s?{x:(j+H)/2,y:(Z==null?void 0:Z.y)||Q}:{x:(Z==null?void 0:Z.x)||Q,y:(j+H)/2};(!Z||m(Z,J))&&P.unshift(J)}var K=c.indexOf(G),ne=Math.abs(K-W);if(ne===1)P=M(P,g,d),P.length||P.push(s?{x:(j+G)/2,y:R}:{x:R,y:(j+G)/2});else if(ne>1){var se=c[K-1];if(se){var fe=P[P.length-1],Ie=s?{x:(G+se)/2,y:(fe==null?void 0:fe.y)||Q}:{x:(fe==null?void 0:fe.x)||R,y:(G+se)/2};(!fe||m(fe,Ie))&&P.push(Ie)}}}}return P}},19268:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var p=function(v,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,c){d.__proto__=c}||function(d,c){for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(d[s]=c[s])},p(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");p(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}(),U=this&&this.__assign||function(){return U=Object.assign||function(p){for(var v,g=1,d=arguments.length;g<d;g++){v=arguments[g];for(var c in v)Object.prototype.hasOwnProperty.call(v,c)&&(p[c]=v[c])}return p},U.apply(this,arguments)},L=this&&this.__spreadArray||function(p,v,g){if(g||arguments.length===2)for(var d=0,c=v.length,s;d<c;d++)(s||!(d in v))&&(s||(s=Array.prototype.slice.call(v,0,d)),s[d]=v[d]);return p.concat(s||Array.prototype.slice.call(v))};Object.defineProperty(N,"__esModule",{value:!0}),N.DagreCompoundLayout=void 0;var _=F(46833),I=F(42891),T=F(44941),x=function(p){k(v,p);function v(g){var d=p.call(this)||this;return d.rankdir="TB",d.nodesep=50,d.edgesep=5,d.ranksep=50,d.controlPoints=!0,d.anchorPoint=!0,d.nodes=[],d.edges=[],d.combos=[],d.onLayoutEnd=function(){},d.updateCfg(g),d}return v.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},v.prototype.init=function(g){var d=g.hiddenNodes||[],c=g.hiddenEdges||[],s=g.hiddenCombos||[];this.nodes=this.getDataByOrder((g.nodes||[]).concat(d)),this.edges=this.getDataByOrder((g.edges||[]).concat(c)),this.combos=(g.combos||[]).concat(s.map(function(m){return U(U({},m),{collapsed:!0})}))},v.prototype.execute=function(){var g=this,d=g.nodes,c=g.edges;if(d){var s=g.getLayoutConfig(),m=s.graphDef,M=s.graphOption,P=s.graphSettings,R=(0,I.buildGraph)(m,M,P),j=(0,I.flatGraph)(R,!0);return this.updatePosition(j),g.onLayoutEnd&&g.onLayoutEnd(),{nodes:d,edges:c}}},v.prototype.getNodePath=function(g){var d=this,c=d.nodes,s=d.combos,m=c.find(function(P){return P.id===g}),M=function(P,R){R===void 0&&(R=[]);var j=s.find(function(Q){return Q.id===P});return j?(R.unshift(P),j.parentId?M(j.parentId,R):R):R};return m&&m.comboId?M(m.comboId,[g]):[g]},v.prototype.getLayoutConfig=function(){var g,d,c,s=this,m=s.nodes,M=s.edges,P=s.combos,R=s.nodeSize,j=s.rankdir,Q=s.align,G=s.edgesep,W=s.nodesep,H=s.ranksep,Z=s.settings,J=(P||[]).reduce(function(Lt,Jt){var Qe=m.filter(function(xt){return xt.comboId===Jt.id}).map(function(xt){return xt.id}),ut=(P||[]).filter(function(xt){return xt.parentId===Jt.id}).map(function(xt){return xt.id});return(Qe.length||ut.length)&&(Lt[Jt.id]=L(L([],Qe,!0),ut,!0)),Lt},{}),K;R?(0,T.isArray)(R)?K=function(){return R}:K=function(){return[R,R]}:K=function(Lt){return Lt&&Lt.size?(0,T.isArray)(Lt.size)?Lt.size:(0,T.isObject)(Lt.size)?[Lt.size.width||40,Lt.size.height||40]:[Lt.size,Lt.size]:[40,40]};var ne=function(Lt){return Lt&&Lt.size?(0,T.isArray)(Lt.size)?Lt.size:[Lt.size,Lt.size]:[80,40]},se=ne(P==null?void 0:P[0]),fe=se[0],Ie=se[1],ye=(d=(g=s.graphSettings)===null||g===void 0?void 0:g.subScene)===null||d===void 0?void 0:d.meta,Ae=((c=P.find(function(Lt){return!Lt.collapsed}))===null||c===void 0?void 0:c.padding)||[20,20,20,20],Se=Ae[0],we=Ae[1],Te=Ae[2],ke=Ae[3],Ge={compound:J,nodes:L([],(m||[]).map(function(Lt){var Jt=K(Lt),Qe=Jt[0],ut=Jt[1];return U(U({},Lt),{width:Qe,height:ut})}),!0),edges:L([],(M||[]).map(function(Lt){return U(U({},Lt),{v:Lt.source,w:Lt.target})}),!0)},tt={expanded:(P||[]).filter(function(Lt){return!Lt.collapsed}).map(function(Lt){return Lt.id})},He={graph:{meta:{align:Q,rankDir:j,nodeSep:W,edgeSep:G,rankSep:H}},subScene:{meta:{paddingTop:Se||(ye==null?void 0:ye.paddingTop)||20,paddingRight:we||(ye==null?void 0:ye.paddingRight)||20,paddingBottom:Te||(ye==null?void 0:ye.paddingBottom)||20,paddingLeft:ke||(ye==null?void 0:ye.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:fe,height:Ie}}},ft=(0,I.mergeConfig)(Z,U({},(0,I.mergeConfig)(He,I.LAYOUT_CONFIG)));return s.graphSettings=ft,{graphDef:Ge,graphOption:tt,graphSettings:ft}},v.prototype.updatePosition=function(g){var d=g.nodes,c=g.edges;this.updateNodePosition(d,c),this.updateEdgePosition(d,c)},v.prototype.getBegin=function(g,d){var c=this,s=c.begin,m=[0,0];if(s){var M=1/0,P=1/0;g.forEach(function(R){M>R.x&&(M=R.x),P>R.y&&(P=R.y)}),d.forEach(function(R){R.points.forEach(function(j){M>j.x&&(M=j.x),P>j.y&&(P=j.y)})}),m[0]=s[0]-M,m[1]=s[1]-P}return m},v.prototype.updateNodePosition=function(g,d){var c=this,s=c.combos,m=c.nodes,M=c.edges,P=c.anchorPoint,R=c.graphSettings,j=this.getBegin(g,d);g.forEach(function(Q){var G,W=Q.x,H=Q.y,Z=Q.id,J=Q.type,K=Q.coreBox;if(J===I.HierarchyNodeType.META&&Z!==I.ROOT_NAME){var ne=s.findIndex(function(Ae){return Ae.id===Z}),se=(G=R==null?void 0:R.subScene)===null||G===void 0?void 0:G.meta;s[ne].offsetX=W+j[0],s[ne].offsetY=H+j[1],s[ne].fixSize=[K.width,K.height],s[ne].fixCollapseSize=[K.width,K.height],Q.expanded?s[ne].padding=[se==null?void 0:se.paddingTop,se==null?void 0:se.paddingRight,se==null?void 0:se.paddingBottom,se==null?void 0:se.paddingLeft]:s[ne].padding=[0,0,0,0]}else if(J===I.HierarchyNodeType.OP){var ne=m.findIndex(function(Se){return Se.id===Z});if(m[ne].x=W+j[0],m[ne].y=H+j[1],P){var fe=[],Ie=d.filter(function(Se){return Se.v===Z}),ye=d.filter(function(Se){return Se.w===Z});Ie.length>0&&Ie.forEach(function(Se){var we=Se.points[0],Te=(we.x-W)/Q.width+.5,ke=(we.y-H)/Q.height+.5;fe.push([Te,ke]),Se.baseEdgeList.forEach(function(Ge){var tt=M.find(function(He){return He.source===Ge.v&&He.target===Ge.w});tt&&(tt.sourceAnchor=fe.length-1)})}),ye.length>0&&ye.forEach(function(Se){var we=Se.points[Se.points.length-1],Te=(we.x-W)/Q.width+.5,ke=(we.y-H)/Q.height+.5;fe.push([Te,ke]),Se.baseEdgeList.forEach(function(Ge){var tt=M.find(function(He){return He.source===Ge.v&&He.target===Ge.w});tt&&(tt.targetAnchor=fe.length-1)})}),m[ne].anchorPoints=fe.length>0?fe:m[ne].anchorPoints||[]}}})},v.prototype.updateEdgePosition=function(g,d){var c=this,s=c.combos,m=c.edges,M=c.controlPoints,P=this.getBegin(g,d);M&&(s.forEach(function(R){R.inEdges=[],R.outEdges=[]}),m.forEach(function(R){var j,Q,G,W,H=g.find(function(Ae){return Ae.id===R.source}),Z=g.find(function(Ae){return Ae.id===R.target}),J=[],K=[];if(H&&Z)K=(0,I.getEdges)(H==null?void 0:H.id,Z==null?void 0:Z.id,g);else if(!H||!Z){var ne=c.getNodePath(R.source),se=c.getNodePath(R.target),fe=ne.reverse().slice(H?0:1).find(function(Ae){return g.find(function(Se){return Se.id===Ae})}),Ie=se.reverse().slice(Z?0:1).find(function(Ae){return g.find(function(Se){return Se.id===Ae})});H=g.find(function(Ae){return Ae.id===fe}),Z=g.find(function(Ae){return Ae.id===Ie}),K=(0,I.getEdges)(H==null?void 0:H.id,Z==null?void 0:Z.id,g,{v:R.source,w:R.target})}if(J=K.reduce(function(Ae,Se){return L(L([],Ae,!0),Se.points.map(function(we){return U(U({},we),{x:we.x+P[0],y:we.y+P[1]})}),!0)},[]),J=J.slice(1,-1),R.controlPoints=J,(Z==null?void 0:Z.type)===I.NodeType.META){var ye=s.findIndex(function(Ae){return Ae.id===(Z==null?void 0:Z.id)});if(!s[ye]||!((j=s[ye].inEdges)===null||j===void 0)&&j.some(function(Ae){return Ae.source===H.id&&Ae.target===Z.id}))return;(Q=s[ye].inEdges)===null||Q===void 0||Q.push({source:H.id,target:Z.id,controlPoints:J})}if((H==null?void 0:H.type)===I.NodeType.META){var ye=s.findIndex(function(Se){return Se.id===(H==null?void 0:H.id)});if(!s[ye]||!((G=s[ye].outEdges)===null||G===void 0)&&G.some(function(Se){return Se.source===H.id&&Se.target===Z.id}))return;(W=s[ye].outEdges)===null||W===void 0||W.push({source:H.id,target:Z.id,controlPoints:J})}}))},v.prototype.getType=function(){return"dagreCompound"},v.prototype.getDataByOrder=function(g){return g.every(function(d){return d.layoutOrder!==void 0})||g.forEach(function(d,c){d.layoutOrder=c}),g.sort(function(d,c){return d.layoutOrder-c.layoutOrder})},v}(_.Base);N.DagreCompoundLayout=x},61283:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var _=function(I,T){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,p){x.__proto__=p}||function(x,p){for(var v in p)Object.prototype.hasOwnProperty.call(p,v)&&(x[v]=p[v])},_(I,T)};return function(I,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");_(I,T);function x(){this.constructor=I}I.prototype=T===null?Object.create(T):(x.prototype=T.prototype,new x)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.Graph=void 0;var U=F(12130),L=function(_){k(I,_);function I(){return _!==null&&_.apply(this,arguments)||this}return I}(U.Graph);N.Graph=L},57007:function(Mt,N,F){"use strict";var k=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(N,"__esModule",{value:!0});var U=k(F(21277)),L=F(96744);N.default={layout:U.default,util:{time:L.time,notime:L.notime}}},57157:function(Mt,N,F){"use strict";var k=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(N,"__esModule",{value:!0});var U=k(F(3221)),L=function(T){var x=function(v){return function(g){var d;return((d=v.edge(g))===null||d===void 0?void 0:d.weight)||1}},p=T.graph().acyclicer==="greedy"?(0,U.default)(T,x(T)):_(T);p==null||p.forEach(function(v){var g=T.edge(v);T.removeEdgeObj(v),g.forwardName=v.name,g.reversed=!0,T.setEdge(v.w,v.v,g,"rev-".concat(Math.random()))})},_=function(T){var x=[],p={},v={},g=function(d){var c;v[d]||(v[d]=!0,p[d]=!0,(c=T.outEdges(d))===null||c===void 0||c.forEach(function(s){p[s.w]?x.push(s):g(s.w)}),delete p[d])};return T.nodes().forEach(g),x},I=function(T){T.edges().forEach(function(x){var p=T.edge(x);if(p.reversed){T.removeEdgeObj(x);var v=p.forwardName;delete p.reversed,delete p.forwardName,T.setEdge(x.w,x.v,p,v)}})};N.default={run:L,undo:I}},14600:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(96744),U=function(_){var I,T=function(x){var p=_.children(x),v=_.node(x);if(p!=null&&p.length&&p.forEach(function(c){return T(c)}),v.hasOwnProperty("minRank")){v.borderLeft=[],v.borderRight=[];for(var g=v.minRank,d=v.maxRank+1;g<d;g+=1)L(_,"borderLeft","_bl",x,v,g),L(_,"borderRight","_br",x,v,g)}};(I=_.children())===null||I===void 0||I.forEach(function(x){return T(x)})},L=function(_,I,T,x,p,v){var g={rank:v,borderType:I,width:0,height:0},d=p[I][v-1],c=(0,k.addDummyNode)(_,"border",g,T);p[I][v]=c,_.setParent(c,x),d&&_.setEdge(d,c,{weight:1})};N.default=U},70398:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(p){var v,g=(v=p.graph().rankdir)===null||v===void 0?void 0:v.toLowerCase();(g==="lr"||g==="rl")&&U(p)},k=function(p){var v,g=(v=p.graph().rankdir)===null||v===void 0?void 0:v.toLowerCase();(g==="bt"||g==="rl")&&_(p),(g==="lr"||g==="rl")&&(T(p),U(p))},U=function(p){p.nodes().forEach(function(v){L(p.node(v))}),p.edges().forEach(function(v){L(p.edge(v))})},L=function(p){var v=p.width;p.width=p.height,p.height=v},_=function(p){p.nodes().forEach(function(v){I(p.node(v))}),p.edges().forEach(function(v){var g,d=p.edge(v);(g=d.points)===null||g===void 0||g.forEach(function(c){return I(c)}),d.hasOwnProperty("y")&&I(d)})},I=function(p){p!=null&&p.y&&(p.y=-p.y)},T=function(p){p.nodes().forEach(function(v){x(p.node(v))}),p.edges().forEach(function(v){var g,d=p.edge(v);(g=d.points)===null||g===void 0||g.forEach(function(c){return x(c)}),d.hasOwnProperty("x")&&x(d)})},x=function(p){var v=p.x;p.x=p.y,p.y=v};N.default={adjust:F,undo:k}},47108:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(L,_){if(L!=="next"&&L!=="prev")return _},k=function(L){L.prev.next=L.next,L.next.prev=L.prev,delete L.next,delete L.prev},U=function(){function L(){var _={};_.prev=_,_.next=_.prev,this.shortcut=_}return L.prototype.dequeue=function(){var _=this.shortcut,I=_.prev;if(I&&I!==_)return k(I),I},L.prototype.enqueue=function(_){var I=this.shortcut;_.prev&&_.next&&k(_),_.next=I.next,I.next.prev=_,I.next=_,_.prev=I},L.prototype.toString=function(){for(var _=[],I=this.shortcut,T=I.prev;T!==I;)_.push(JSON.stringify(T,F)),T=T==null?void 0:T.prev;return"[".concat(_.join(", "),"]")},L}();N.default=U},3221:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var s=function(m,M){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,R){P.__proto__=R}||function(P,R){for(var j in R)Object.prototype.hasOwnProperty.call(R,j)&&(P[j]=R[j])},s(m,M)};return function(m,M){if(typeof M!="function"&&M!==null)throw new TypeError("Class extends value "+String(M)+" is not a constructor or null");s(m,M);function P(){this.constructor=m}m.prototype=M===null?Object.create(M):(P.prototype=M.prototype,new P)}}(),U=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(N,"__esModule",{value:!0});var L=U(F(47108)),_=F(12130),I=function(s){k(m,s);function m(){return s!==null&&s.apply(this,arguments)||this}return m}(L.default),T=function(s){k(m,s);function m(){return s!==null&&s.apply(this,arguments)||this}return m}(_.Graph),x=function(){return 1},p=function(s,m){var M;if(s.nodeCount()<=1)return[];var P=d(s,m||x),R=v(P.graph,P.buckets,P.zeroIdx);return(M=R.map(function(j){return s.outEdges(j.v,j.w)}))===null||M===void 0?void 0:M.flat()},v=function(s,m,M){for(var P=[],R=m[m.length-1],j=m[0],Q;s.nodeCount();){for(;Q=j.dequeue();)g(s,m,M,Q);for(;Q=R.dequeue();)g(s,m,M,Q);if(s.nodeCount()){for(var G=m.length-2;G>0;--G)if(Q=m[G].dequeue(),Q){P=P.concat(g(s,m,M,Q,!0));break}}}return P},g=function(s,m,M,P,R){var j,Q,G=[];return(j=s.inEdges(P.v))===null||j===void 0||j.forEach(function(W){var H=s.edge(W),Z=s.node(W.v);R&&G.push({v:W.v,w:W.w,in:0,out:0}),Z.out===void 0&&(Z.out=0),Z.out-=H,c(m,M,Z)}),(Q=s.outEdges(P.v))===null||Q===void 0||Q.forEach(function(W){var H=s.edge(W),Z=W.w,J=s.node(Z);J.in===void 0&&(J.in=0),J.in-=H,c(m,M,J)}),s.removeNode(P.v),R?G:void 0},d=function(s,m){var M=new T,P=0,R=0;s.nodes().forEach(function(H){M.setNode(H,{v:H,in:0,out:0})}),s.edges().forEach(function(H){var Z=M.edge(H)||0,J=(m==null?void 0:m(H))||1,K=Z+J;M.setEdge(H.v,H.w,K),R=Math.max(R,M.node(H.v).out+=J),P=Math.max(P,M.node(H.w).in+=J)});for(var j=[],Q=R+P+3,G=0;G<Q;G++)j.push(new I);var W=P+1;return M.nodes().forEach(function(H){c(j,W,M.node(H))}),{buckets:j,zeroIdx:W,graph:M}},c=function(s,m,M){M.out?M.in?s[M.out-M.in+m].enqueue(M):s[s.length-1].enqueue(M):s[0].enqueue(M)};N.default=p},21277:function(Mt,N,F){"use strict";var k=this&&this.__assign||function(){return k=Object.assign||function(Qe){for(var ut,xt=1,dt=arguments.length;xt<dt;xt++){ut=arguments[xt];for(var pt in ut)Object.prototype.hasOwnProperty.call(ut,pt)&&(Qe[pt]=ut[pt])}return Qe},k.apply(this,arguments)},U=this&&this.__importDefault||function(Qe){return Qe&&Qe.__esModule?Qe:{default:Qe}};Object.defineProperty(N,"__esModule",{value:!0});var L=U(F(57157)),_=U(F(63122)),I=U(F(95564)),T=F(96744),x=U(F(38481)),p=U(F(3794)),v=U(F(14600)),g=U(F(70398)),d=U(F(93256)),c=U(F(96634)),s=U(F(48211)),m=F(61283),M=function(Qe,ut){var xt=ut&&ut.debugTiming?T.time:T.notime;xt("layout",function(){ut&&!ut.keepNodeOrder&&ut.prevGraph&&xt(" inheritOrder",function(){R(Qe,ut.prevGraph)});var dt=xt(" buildLayoutGraph",function(){return se(Qe)});ut&&ut.edgeLabelSpace===!1||xt(" makeSpaceForEdgeLabels",function(){fe(dt)});try{xt(" runLayout",function(){P(dt,xt,ut)})}catch(pt){if(pt.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
`,pt);return}throw pt}xt(" updateInputGraph",function(){j(Qe,dt)})})},P=function(Qe,ut,xt){ut(" removeSelfEdges",function(){tt(Qe)}),ut(" acyclic",function(){L.default.run(Qe)}),ut(" nestingGraph.run",function(){p.default.run(Qe)}),ut(" rank",function(){(0,I.default)((0,T.asNonCompoundGraph)(Qe))}),ut(" injectEdgeLabelProxies",function(){Ie(Qe)}),ut(" removeEmptyRanks",function(){(0,T.removeEmptyRanks)(Qe)}),ut(" nestingGraph.cleanup",function(){p.default.cleanup(Qe)}),ut(" normalizeRanks",function(){(0,T.normalizeRanks)(Qe)}),ut(" assignRankMinMax",function(){ye(Qe)}),ut(" removeEdgeLabelProxies",function(){Ae(Qe)}),ut(" normalize.run",function(){_.default.run(Qe)}),ut(" parentDummyChains",function(){(0,x.default)(Qe)}),ut(" addBorderSegments",function(){(0,v.default)(Qe)}),xt&&xt.keepNodeOrder&&ut(" initDataOrder",function(){(0,s.default)(Qe,xt.nodeOrder)}),ut(" order",function(){(0,d.default)(Qe,xt==null?void 0:xt.keepNodeOrder)}),ut(" insertSelfEdges",function(){He(Qe)}),ut(" adjustCoordinateSystem",function(){g.default.adjust(Qe)}),ut(" position",function(){(0,c.default)(Qe)}),ut(" positionSelfEdges",function(){ft(Qe)}),ut(" removeBorderNodes",function(){Ge(Qe)}),ut(" normalize.undo",function(){_.default.undo(Qe)}),ut(" fixupEdgeLabelCoords",function(){Te(Qe)}),ut(" undoCoordinateSystem",function(){g.default.undo(Qe)}),ut(" translateGraph",function(){Se(Qe)}),ut(" assignNodeIntersects",function(){we(Qe)}),ut(" reversePoints",function(){ke(Qe)}),ut(" acyclic.undo",function(){L.default.undo(Qe)})},R=function(Qe,ut){Qe.nodes().forEach(function(xt){var dt=Qe.node(xt),pt=ut.node(xt);pt!==void 0?(dt.fixorder=pt._order,delete pt._order):delete dt.fixorder})},j=function(Qe,ut){Qe.nodes().forEach(function(xt){var dt,pt=Qe.node(xt);if(pt){var wt=ut.node(xt);pt.x=wt.x,pt.y=wt.y,pt._order=wt.order,pt._rank=wt.rank,!((dt=ut.children(xt))===null||dt===void 0)&&dt.length&&(pt.width=wt.width,pt.height=wt.height)}}),Qe.edges().forEach(function(xt){var dt=Qe.edge(xt),pt=ut.edge(xt);dt.points=pt?pt.points:[],pt&&pt.hasOwnProperty("x")&&(dt.x=pt.x,dt.y=pt.y)}),Qe.graph().width=ut.graph().width,Qe.graph().height=ut.graph().height},Q=["nodesep","edgesep","ranksep","marginx","marginy"],G={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},W=["acyclicer","ranker","rankdir","align"],H=["width","height","layer","fixorder"],Z={width:0,height:0},J=["minlen","weight","width","height","labeloffset"],K={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ne=["labelpos"],se=function(Qe){var ut=new m.Graph({multigraph:!0,compound:!0}),xt=Jt(Qe.graph()),dt={};return W==null||W.forEach(function(pt){xt[pt]!==void 0&&(dt[pt]=xt[pt])}),ut.setGraph(Object.assign({},G,Lt(xt,Q),dt)),Qe.nodes().forEach(function(pt){var wt=Jt(Qe.node(pt)),mt=k(k({},Z),wt),ur=Lt(mt,H);ut.setNode(pt,ur),ut.setParent(pt,Qe.parent(pt))}),Qe.edges().forEach(function(pt){var wt=Jt(Qe.edge(pt)),mt={};ne==null||ne.forEach(function(ur){wt[ur]!==void 0&&(mt[ur]=wt[ur])}),ut.setEdgeObj(pt,Object.assign({},K,Lt(wt,J),mt))}),ut},fe=function(Qe){var ut=Qe.graph();ut.ranksep||(ut.ranksep=0),ut.ranksep/=2,Qe.nodes().forEach(function(xt){var dt=Qe.node(xt);isNaN(dt.layer)||dt.layer||(dt.layer=0)}),Qe.edges().forEach(function(xt){var dt,pt=Qe.edge(xt);pt.minlen*=2,((dt=pt.labelpos)===null||dt===void 0?void 0:dt.toLowerCase())!=="c"&&(ut.rankdir==="TB"||ut.rankdir==="BT"?pt.width+=pt.labeloffset:pt.height+=pt.labeloffset)})},Ie=function(Qe){Qe.edges().forEach(function(ut){var xt=Qe.edge(ut);if(xt.width&&xt.height){var dt=Qe.node(ut.v),pt=Qe.node(ut.w),wt={e:ut,rank:(pt.rank-dt.rank)/2+dt.rank};(0,T.addDummyNode)(Qe,"edge-proxy",wt,"_ep")}})},ye=function(Qe){var ut=0;Qe.nodes().forEach(function(xt){var dt,pt,wt=Qe.node(xt);wt.borderTop&&(wt.minRank=(dt=Qe.node(wt.borderTop))===null||dt===void 0?void 0:dt.rank,wt.maxRank=(pt=Qe.node(wt.borderBottom))===null||pt===void 0?void 0:pt.rank,ut=Math.max(ut,wt.maxRank||-1/0))}),Qe.graph().maxRank=ut},Ae=function(Qe){Qe.nodes().forEach(function(ut){var xt=Qe.node(ut);xt.dummy==="edge-proxy"&&(Qe.edge(xt.e).labelRank=xt.rank,Qe.removeNode(ut))})},Se=function(Qe){var ut,xt=0,dt,pt=0,wt=Qe.graph(),mt=wt.marginx||0,ur=wt.marginy||0,Ir=function(Nr){if(Nr){var Hr=Nr.x,It=Nr.y,qt=Nr.width,ar=Nr.height;!isNaN(Hr)&&!isNaN(qt)&&(ut===void 0&&(ut=Hr-qt/2),ut=Math.min(ut,Hr-qt/2),xt=Math.max(xt,Hr+qt/2)),!isNaN(It)&&!isNaN(ar)&&(dt===void 0&&(dt=It-ar/2),dt=Math.min(dt,It-ar/2),pt=Math.max(pt,It+ar/2))}};Qe.nodes().forEach(function(Nr){Ir(Qe.node(Nr))}),Qe.edges().forEach(function(Nr){var Hr=Qe.edge(Nr);Hr!=null&&Hr.hasOwnProperty("x")&&Ir(Hr)}),ut-=mt,dt-=ur,Qe.nodes().forEach(function(Nr){var Hr=Qe.node(Nr);Hr&&(Hr.x-=ut,Hr.y-=dt)}),Qe.edges().forEach(function(Nr){var Hr,It=Qe.edge(Nr);(Hr=It.points)===null||Hr===void 0||Hr.forEach(function(qt){qt.x-=ut,qt.y-=dt}),It.hasOwnProperty("x")&&(It.x-=ut),It.hasOwnProperty("y")&&(It.y-=dt)}),wt.width=xt-ut+mt,wt.height=pt-dt+ur},we=function(Qe){Qe.edges().forEach(function(ut){var xt=Qe.edge(ut),dt=Qe.node(ut.v),pt=Qe.node(ut.w),wt,mt;xt.points?(wt=xt.points[0],mt=xt.points[xt.points.length-1]):(xt.points=[],wt=pt,mt=dt),xt.points.unshift((0,T.intersectRect)(dt,wt)),xt.points.push((0,T.intersectRect)(pt,mt))})},Te=function(Qe){Qe.edges().forEach(function(ut){var xt=Qe.edge(ut);if(xt!=null&&xt.hasOwnProperty("x"))switch((xt.labelpos==="l"||xt.labelpos==="r")&&(xt.width-=xt.labeloffset),xt.labelpos){case"l":xt.x-=xt.width/2+xt.labeloffset;break;case"r":xt.x+=xt.width/2+xt.labeloffset;break}})},ke=function(Qe){Qe.edges().forEach(function(ut){var xt,dt=Qe.edge(ut);dt.reversed&&((xt=dt.points)===null||xt===void 0||xt.reverse())})},Ge=function(Qe){Qe.nodes().forEach(function(ut){var xt,dt,pt;if(!((xt=Qe.children(ut))===null||xt===void 0)&&xt.length){var wt=Qe.node(ut),mt=Qe.node(wt.borderTop),ur=Qe.node(wt.borderBottom),Ir=Qe.node(wt.borderLeft[((dt=wt.borderLeft)===null||dt===void 0?void 0:dt.length)-1]),Nr=Qe.node(wt.borderRight[((pt=wt.borderRight)===null||pt===void 0?void 0:pt.length)-1]);wt.width=Math.abs((Nr==null?void 0:Nr.x)-(Ir==null?void 0:Ir.x))||10,wt.height=Math.abs((ur==null?void 0:ur.y)-(mt==null?void 0:mt.y))||10,wt.x=((Ir==null?void 0:Ir.x)||0)+wt.width/2,wt.y=((mt==null?void 0:mt.y)||0)+wt.height/2}}),Qe.nodes().forEach(function(ut){var xt;((xt=Qe.node(ut))===null||xt===void 0?void 0:xt.dummy)==="border"&&Qe.removeNode(ut)})},tt=function(Qe){Qe.edges().forEach(function(ut){if(ut.v===ut.w){var xt=Qe.node(ut.v);xt.selfEdges||(xt.selfEdges=[]),xt.selfEdges.push({e:ut,label:Qe.edge(ut)}),Qe.removeEdgeObj(ut)}})},He=function(Qe){var ut=(0,T.buildLayerMatrix)(Qe);ut==null||ut.forEach(function(xt){var dt=0;xt==null||xt.forEach(function(pt,wt){var mt,ur=Qe.node(pt);ur.order=wt+dt,(mt=ur.selfEdges)===null||mt===void 0||mt.forEach(function(Ir){(0,T.addDummyNode)(Qe,"selfedge",{width:Ir.label.width,height:Ir.label.height,rank:ur.rank,order:wt+ ++dt,e:Ir.e,label:Ir.label},"_se")}),delete ur.selfEdges})})},ft=function(Qe){Qe.nodes().forEach(function(ut){var xt=Qe.node(ut);if(xt.dummy==="selfedge"){var dt=Qe.node(xt.e.v),pt=dt.x+dt.width/2,wt=dt.y,mt=xt.x-pt,ur=dt.height/2;Qe.setEdgeObj(xt.e,xt.label),Qe.removeNode(ut),xt.label.points=[{x:pt+2*mt/3,y:wt-ur},{x:pt+5*mt/6,y:wt-ur},{y:wt,x:pt+mt},{x:pt+5*mt/6,y:wt+ur},{x:pt+2*mt/3,y:wt+ur}],xt.label.x=xt.x,xt.label.y=xt.y}})},Lt=function(Qe,ut){var xt={};return ut==null||ut.forEach(function(dt){Qe[dt]!==void 0&&(xt[dt]=+Qe[dt])}),xt},Jt=function(Qe){Qe===void 0&&(Qe={});var ut={};return Object.keys(Qe).forEach(function(xt){ut[xt.toLowerCase()]=Qe[xt]}),ut};N.default=M},3794:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(96744),U=function(x){var p,v=(0,k.addDummyNode)(x,"root",{},"_root"),g=_(x),d=Math.max.apply(Math,Object.values(g));Math.abs(d)===1/0&&(d=1);var c=d-1,s=2*c+1;x.graph().nestingRoot=v,x.edges().forEach(function(M){x.edge(M).minlen*=s});var m=I(x)+1;(p=x.children())===null||p===void 0||p.forEach(function(M){L(x,v,s,m,c,g,M)}),x.graph().nodeRankFactor=s},L=function(x,p,v,g,d,c,s){var m=x.children(s);if(!(m!=null&&m.length)){s!==p&&x.setEdge(p,s,{weight:0,minlen:v});return}var M=(0,k.addBorderNode)(x,"_bt"),P=(0,k.addBorderNode)(x,"_bb"),R=x.node(s);x.setParent(M,s),R.borderTop=M,x.setParent(P,s),R.borderBottom=P,m==null||m.forEach(function(j){L(x,p,v,g,d,c,j);var Q=x.node(j),G=Q.borderTop?Q.borderTop:j,W=Q.borderBottom?Q.borderBottom:j,H=Q.borderTop?g:2*g,Z=G!==W?1:d-c[s]+1;x.setEdge(M,G,{minlen:Z,weight:H,nestingEdge:!0}),x.setEdge(W,P,{minlen:Z,weight:H,nestingEdge:!0})}),x.parent(s)||x.setEdge(p,M,{weight:0,minlen:d+c[s]})},_=function(x){var p,v={},g=function(d,c){var s=x.children(d);s==null||s.forEach(function(m){return g(m,c+1)}),v[d]=c};return(p=x.children())===null||p===void 0||p.forEach(function(d){return g(d,1)}),v},I=function(x){var p=0;return x.edges().forEach(function(v){p+=x.edge(v).weight}),p},T=function(x){var p=x.graph();p.nestingRoot&&x.removeNode(p.nestingRoot),delete p.nestingRoot,x.edges().forEach(function(v){var g=x.edge(v);g.nestingEdge&&x.removeEdgeObj(v)})};N.default={run:U,cleanup:T}},63122:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(96744),U=function(I){I.graph().dummyChains=[],I.edges().forEach(function(T){return L(I,T)})},L=function(I,T){var x=T.v,p=I.node(x).rank,v=T.w,g=I.node(v).rank,d=T.name,c=I.edge(T),s=c.labelRank;if(g!==p+1){I.removeEdgeObj(T);var m=I.graph(),M,P,R;for(R=0,++p;p<g;++R,++p)c.points=[],P={edgeLabel:c,width:0,height:0,edgeObj:T,rank:p},M=(0,k.addDummyNode)(I,"edge",P,"_d"),p===s&&(P.width=c.width,P.height=c.height,P.dummy="edge-label",P.labelpos=c.labelpos),I.setEdge(x,M,{weight:c.weight},d),R===0&&(m.dummyChains||(m.dummyChains=[]),m.dummyChains.push(M)),x=M;I.setEdge(x,v,{weight:c.weight},d)}},_=function(I){var T;(T=I.graph().dummyChains)===null||T===void 0||T.forEach(function(x){var p=I.node(x),v=p.edgeLabel,g;p.edgeObj&&I.setEdgeObj(p.edgeObj,v);for(var d=x;p.dummy;)g=I.successors(d)[0],I.removeNode(d),v.points.push({x:p.x,y:p.y}),p.dummy==="edge-label"&&(v.x=p.x,v.y=p.y,v.width=p.width,v.height=p.height),d=g,p=I.node(d)})};N.default={run:U,undo:_}},66431:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(k,U,L){var _={},I;L==null||L.forEach(function(T){for(var x=k.parent(T),p,v;x;){if(p=k.parent(x),p?(v=_[p],_[p]=x):(v=I,I=x),v&&v!==x){U.setEdge(v,x);return}x=p}})};N.default=F},82580:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(k,U){return U.map(function(L){var _=k.inEdges(L);if(!(_!=null&&_.length))return{v:L};{var I={sum:0,weight:0};return _==null||_.forEach(function(T){var x=k.edge(T),p=k.node(T.v);I.sum+=x.weight*p.order,I.weight+=x.weight}),{v:L,barycenter:I.sum/I.weight,weight:I.weight}}})};N.default=F},53512:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(61283),U=function(_,I,T){var x=L(_),p=new k.Graph({compound:!0}).setGraph({root:x}).setDefaultNodeLabel(function(v){return _.node(v)});return _.nodes().forEach(function(v){var g,d=_.node(v),c=_.parent(v);(d.rank===I||d.minRank<=I&&I<=d.maxRank)&&(p.setNode(v),p.setParent(v,c||x),(g=_[T](v))===null||g===void 0||g.forEach(function(s){var m=s.v===v?s.w:s.v,M=p.edgeFromArgs(m,v),P=M!==void 0?M.weight:0;p.setEdge(m,v,{weight:_.edge(s).weight+P})}),d.hasOwnProperty("minRank")&&p.setNode(v,{borderLeft:d.borderLeft[I],borderRight:d.borderRight[I]}))}),p},L=function(_){for(var I;_.hasNode(I="_root".concat(Math.random())););return I};N.default=U},51576:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(96744),U=function(_,I,T){for(var x=(0,k.zipObject)(T,T.map(function(m,M){return M})),p=I.map(function(m){var M,P=(M=_.outEdges(m))===null||M===void 0?void 0:M.map(function(R){return{pos:x[R.w]||0,weight:_.edge(R).weight}});return P==null?void 0:P.sort(function(R,j){return R.pos-j.pos})}),v=p.flat().filter(function(m){return m!==void 0}),g=1;g<T.length;)g<<=1;var d=2*g-1;g-=1;var c=Array(d).fill(0,0,d),s=0;return v==null||v.forEach(function(m){if(m){var M=m.pos+g;c[M]+=m.weight;for(var P=0;M>0;)M%2&&(P+=c[M+1]),M=M-1>>1,c[M]+=m.weight;s+=m.weight*P}}),s},L=function(_,I){for(var T=0,x=1;x<(I==null?void 0:I.length);x+=1)T+=U(_,I[x-1],I[x]);return T};N.default=L},93256:function(Mt,N,F){"use strict";var k=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(N,"__esModule",{value:!0});var U=k(F(78583)),L=k(F(51576)),_=k(F(53512)),I=k(F(66431)),T=k(F(63776)),x=F(44941),p=F(61283),v=F(96744),g=function(m,M){for(var P=(0,v.maxRank)(m),R=[],j=[],Q=1;Q<P+1;Q++)R.push(Q);for(var Q=P-1;Q>-1;Q--)j.push(Q);var G=d(m,R,"inEdges"),W=d(m,j,"outEdges"),H=(0,U.default)(m);s(m,H);for(var Z=Number.POSITIVE_INFINITY,J,Q=0,K=0;K<4;++Q,++K){c(Q%2?G:W,Q%4>=2,!1,M),H=(0,v.buildLayerMatrix)(m);var ne=(0,L.default)(m,H);ne<Z&&(K=0,J=(0,x.clone)(H),Z=ne)}H=(0,U.default)(m),s(m,H);for(var Q=0,K=0;K<4;++Q,++K){c(Q%2?G:W,Q%4>=2,!0,M),H=(0,v.buildLayerMatrix)(m);var ne=(0,L.default)(m,H);ne<Z&&(K=0,J=(0,x.clone)(H),Z=ne)}s(m,J)},d=function(m,M,P){return M.map(function(R){return(0,_.default)(m,R,P)})},c=function(m,M,P,R){var j=new p.Graph;m==null||m.forEach(function(Q){for(var G,W=Q.graph().root,H=(0,T.default)(Q,W,j,M,P,R),Z=0;Z<((G=H.vs)===null||G===void 0?void 0:G.length);Z++){var J=Q.node(H.vs[Z]);J&&(J.order=Z)}(0,I.default)(Q,j,H.vs)})},s=function(m,M){M==null||M.forEach(function(P){P==null||P.forEach(function(R,j){m.node(R).order=j})})};N.default=g},48211:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(k,U){for(var L=k.nodes().filter(function(p){var v;return!(!((v=k.children(p))===null||v===void 0)&&v.length)}),_=L.map(function(p){return k.node(p).rank}),I=Math.max.apply(Math,_),T=[],x=0;x<I+1;x++)T[x]=[];U==null||U.forEach(function(p){var v=k.node(p);!v||v!=null&&v.dummy||isNaN(v.rank)||(v.fixorder=T[v.rank].length,T[v.rank].push(p))})};N.default=F},78583:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(50037),U=function(L){for(var _={},I=L.nodes().filter(function(m){var M;return!(!((M=L.children(m))===null||M===void 0)&&M.length)}),T=I.map(function(m){return L.node(m).rank}),x=(0,k.max)(T),p=[],v=0;v<x+1;v++)p.push([]);var g=function(m){var M;if(!_.hasOwnProperty(m)){_[m]=!0;var P=L.node(m);isNaN(P.rank)||p[P.rank].push(m),(M=L.successors(m))===null||M===void 0||M.forEach(function(R){return g(R)})}},d=I.sort(function(m,M){return L.node(m).rank-L.node(M).rank}),c=d.filter(function(m){return L.node(m).fixorder!==void 0}),s=c.sort(function(m,M){return L.node(m).fixorder-L.node(M).fixorder});return s==null||s.forEach(function(m){isNaN(L.node(m).rank)||p[L.node(m).rank].push(m),_[m]=!0}),d==null||d.forEach(g),p};N.default=U},11059:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(L,_){var I,T,x,p={};L==null||L.forEach(function(g,d){p[g.v]={i:d,indegree:0,in:[],out:[],vs:[g.v]};var c=p[g.v];g.barycenter!==void 0&&(c.barycenter=g.barycenter,c.weight=g.weight)}),(I=_.edges())===null||I===void 0||I.forEach(function(g){var d=p[g.v],c=p[g.w];d!==void 0&&c!==void 0&&(c.indegree++,d.out.push(p[g.w]))});var v=(x=(T=Object.values(p)).filter)===null||x===void 0?void 0:x.call(T,function(g){return!g.indegree});return k(v)},k=function(L){for(var _,I,T=[],x=function(c){return function(s){s.merged||(s.barycenter===void 0||c.barycenter===void 0||s.barycenter>=c.barycenter)&&U(c,s)}},p=function(c){return function(s){s.in.push(c),--s.indegree===0&&L.push(s)}},v=function(){var c=L.pop();T.push(c),(_=c.in.reverse())===null||_===void 0||_.forEach(function(s){return x(c)(s)}),(I=c.out)===null||I===void 0||I.forEach(function(s){return p(c)(s)})};L!=null&&L.length;)v();var g=T.filter(function(c){return!c.merged}),d=["vs","i","barycenter","weight"];return g.map(function(c){var s={};return d==null||d.forEach(function(m){c[m]!==void 0&&(s[m]=c[m])}),s})},U=function(L,_){var I,T=0,x=0;L.weight&&(T+=L.barycenter*L.weight,x+=L.weight),_.weight&&(T+=_.barycenter*_.weight,x+=_.weight),L.vs=(I=_.vs)===null||I===void 0?void 0:I.concat(L.vs),L.barycenter=T/x,L.weight=x,L.i=Math.min(_.i,L.i),_.merged=!0};N.default=F},63776:function(Mt,N,F){"use strict";var k=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(N,"__esModule",{value:!0});var U=k(F(82580)),L=k(F(11059)),_=k(F(59832)),I=function(p,v,g,d,c,s){var m,M,P,R,j=p.children(v),Q=p.node(v),G=Q?Q.borderLeft:void 0,W=Q?Q.borderRight:void 0,H={};G&&(j=j==null?void 0:j.filter(function(fe){return fe!==G&&fe!==W}));var Z=(0,U.default)(p,j||[]);Z==null||Z.forEach(function(fe){var Ie;if(!((Ie=p.children(fe.v))===null||Ie===void 0)&&Ie.length){var ye=I(p,fe.v,g,d,s);H[fe.v]=ye,ye.hasOwnProperty("barycenter")&&x(fe,ye)}});var J=(0,L.default)(Z,g);T(J,H),(m=J.filter(function(fe){return fe.vs.length>0}))===null||m===void 0||m.forEach(function(fe){var Ie=p.node(fe.vs[0]);Ie&&(fe.fixorder=Ie.fixorder,fe.order=Ie.order)});var K=(0,_.default)(J,d,c,s);if(G&&(K.vs=[G,K.vs,W].flat(),!((M=p.predecessors(G))===null||M===void 0)&&M.length)){var ne=p.node(((P=p.predecessors(G))===null||P===void 0?void 0:P[0])||""),se=p.node(((R=p.predecessors(W))===null||R===void 0?void 0:R[0])||"");K.hasOwnProperty("barycenter")||(K.barycenter=0,K.weight=0),K.barycenter=(K.barycenter*K.weight+ne.order+se.order)/(K.weight+2),K.weight+=2}return K},T=function(p,v){p==null||p.forEach(function(g){var d,c=(d=g.vs)===null||d===void 0?void 0:d.map(function(s){return v[s]?v[s].vs:s});g.vs=c.flat()})},x=function(p,v){p.barycenter!==void 0?(p.barycenter=(p.barycenter*p.weight+v.barycenter*v.weight)/(p.weight+v.weight),p.weight+=v.weight):(p.barycenter=v.barycenter,p.weight=v.weight)};N.default=I},59832:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(96744),U=function(I,T,x,p){var v=(0,k.partition)(I,function(R){var j=R.hasOwnProperty("fixorder")&&!isNaN(R.fixorder);return p?!j&&R.hasOwnProperty("barycenter"):j||R.hasOwnProperty("barycenter")}),g=v.lhs,d=v.rhs.sort(function(R,j){return-R.i- -j.i}),c=[],s=0,m=0,M=0;g==null||g.sort(_(!!T,!!x)),M=L(c,d,M),g==null||g.forEach(function(R){var j;M+=(j=R.vs)===null||j===void 0?void 0:j.length,c.push(R.vs),s+=R.barycenter*R.weight,m+=R.weight,M=L(c,d,M)});var P={vs:c.flat()};return m&&(P.barycenter=s/m,P.weight=m),P},L=function(I,T,x){for(var p=x,v;T.length&&(v=T[T.length-1]).i<=p;)T.pop(),I==null||I.push(v.vs),p++;return p},_=function(I,T){return function(x,p){if(x.fixorder!==void 0&&p.fixorder!==void 0)return x.fixorder-p.fixorder;if(x.barycenter<p.barycenter)return-1;if(x.barycenter>p.barycenter)return 1;if(T&&x.order!==void 0&&p.order!==void 0){if(x.order<p.order)return-1;if(x.order>p.order)return 1}return I?p.i-x.i:x.i-p.i}};N.default=U},38481:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(L){var _,I={},T=0,x=function(p){var v,g=T;(v=L.children(p))===null||v===void 0||v.forEach(x),I[p]={low:g,lim:T++}};return(_=L.children())===null||_===void 0||_.forEach(x),I},k=function(L,_,I,T){var x=[],p=[],v=Math.min(_[I].low,_[T].low),g=Math.max(_[I].lim,_[T].lim),d,c;d=I;do d=L.parent(d),x.push(d);while(d&&(_[d].low>v||g>_[d].lim));for(c=d,d=T;d&&d!==c;)p.push(d),d=L.parent(d);return{lca:c,path:x.concat(p.reverse())}},U=function(L){var _,I=F(L);(_=L.graph().dummyChains)===null||_===void 0||_.forEach(function(T){var x,p,v=T,g=L.node(v),d=g.edgeObj;if(d)for(var c=k(L,I,d.v,d.w),s=c.path,m=c.lca,M=0,P=s[M],R=!0;v!==d.w;){if(g=L.node(v),R){for(;P!==m&&((x=L.node(P))===null||x===void 0?void 0:x.maxRank)<g.rank;)M++,P=s[M];P===m&&(R=!1)}if(!R){for(;M<s.length-1&&((p=L.node(s[M+1]))===null||p===void 0?void 0:p.minRank)<=g.rank;)M++;P=s[M]}L.setParent(v,P),v=L.successors(v)[0]}})};N.default=U},61236:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var G=function(W,H){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,J){Z.__proto__=J}||function(Z,J){for(var K in J)Object.prototype.hasOwnProperty.call(J,K)&&(Z[K]=J[K])},G(W,H)};return function(W,H){if(typeof H!="function"&&H!==null)throw new TypeError("Class extends value "+String(H)+" is not a constructor or null");G(W,H);function Z(){this.constructor=W}W.prototype=H===null?Object.create(H):(Z.prototype=H.prototype,new Z)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.width=N.sep=N.positionX=N.balance=N.alignCoordinates=N.findSmallestWidthAlignment=N.buildBlockGraph=N.horizontalCompaction=N.verticalAlignment=N.hasConflict=N.addConflict=N.findOtherInnerSegmentNode=N.findType2Conflicts=N.findType1Conflicts=void 0;var U=F(12130),L=F(50037),_=F(96744),I=function(G){k(W,G);function W(){return G!==null&&G.apply(this,arguments)||this}return W}(U.Graph),T=function(G,W){var H={},Z=function(J,K){var ne=0,se=0,fe=J.length,Ie=K==null?void 0:K[(K==null?void 0:K.length)-1];return K==null||K.forEach(function(ye,Ae){var Se,we=(0,N.findOtherInnerSegmentNode)(G,ye),Te=we?G.node(we).order:fe;(we||ye===Ie)&&((Se=K.slice(se,Ae+1))===null||Se===void 0||Se.forEach(function(ke){var Ge;(Ge=G.predecessors(ke))===null||Ge===void 0||Ge.forEach(function(tt){var He,ft=G.node(tt),Lt=ft.order;(Lt<ne||Te<Lt)&&!(ft.dummy&&(!((He=G.node(ke))===null||He===void 0)&&He.dummy))&&(0,N.addConflict)(H,tt,ke)})}),se=Ae+1,ne=Te)}),K};return W!=null&&W.length&&W.reduce(Z),H};N.findType1Conflicts=T;var x=function(G,W){var H={};function Z(se,fe,Ie,ye,Ae){for(var Se,we,Te,ke=fe;ke<Ie;ke++)Te=se[ke],!((Se=G.node(Te))===null||Se===void 0)&&Se.dummy&&((we=G.predecessors(Te))===null||we===void 0||we.forEach(function(Ge){var tt=G.node(Ge);tt.dummy&&(tt.order<ye||tt.order>Ae)&&(0,N.addConflict)(H,Ge,Te)}))}function J(se){return JSON.stringify(se.slice(1))}function K(se,fe){var Ie=J(se);fe.get(Ie)||(Z.apply(void 0,se),fe.set(Ie,!0))}var ne=function(se,fe){var Ie=-1,ye,Ae=0,Se=new Map;return fe==null||fe.forEach(function(we,Te){var ke;if(((ke=G.node(we))===null||ke===void 0?void 0:ke.dummy)==="border"){var Ge=G.predecessors(we)||[];Ge.length&&(ye=G.node(Ge[0]).order,K([fe,Ae,Te,Ie,ye],Se),Ae=Te,Ie=ye)}K([fe,Ae,fe.length,ye,se.length],Se)}),fe};return W!=null&&W.length&&W.reduce(ne),H};N.findType2Conflicts=x;var p=function(G,W){var H,Z;if(!((H=G.node(W))===null||H===void 0)&&H.dummy)return(Z=G.predecessors(W))===null||Z===void 0?void 0:Z.find(function(J){return G.node(J).dummy})};N.findOtherInnerSegmentNode=p;var v=function(G,W,H){var Z=W,J=H;if(Z>J){var K=Z;Z=J,J=K}var ne=G[Z];ne||(G[Z]=ne={}),ne[J]=!0};N.addConflict=v;var g=function(G,W,H){var Z=W,J=H;if(Z>J){var K=W;Z=J,J=K}return!!G[Z]};N.hasConflict=g;var d=function(G,W,H,Z){var J={},K={},ne={};return W==null||W.forEach(function(se){se==null||se.forEach(function(fe,Ie){J[fe]=fe,K[fe]=fe,ne[fe]=Ie})}),W==null||W.forEach(function(se){var fe=-1;se==null||se.forEach(function(Ie){var ye=Z(Ie);if(ye.length){ye=ye.sort(function(ke,Ge){return ne[ke]-ne[Ge]});for(var Ae=(ye.length-1)/2,Se=Math.floor(Ae),we=Math.ceil(Ae);Se<=we;++Se){var Te=ye[Se];K[Ie]===Ie&&fe<ne[Te]&&!(0,N.hasConflict)(H,Ie,Te)&&(K[Te]=Ie,K[Ie]=J[Ie]=J[Te],fe=ne[Te])}}})}),{root:J,align:K}};N.verticalAlignment=d;var c=function(G,W,H,Z,J){var K,ne={},se=(0,N.buildBlockGraph)(G,W,H,J),fe=J?"borderLeft":"borderRight",Ie=function(Se,we){for(var Te=se.nodes(),ke=Te.pop(),Ge={};ke;)Ge[ke]?Se(ke):(Ge[ke]=!0,Te.push(ke),Te=Te.concat(we(ke))),ke=Te.pop()},ye=function(Se){ne[Se]=(se.inEdges(Se)||[]).reduce(function(we,Te){return Math.max(we,(ne[Te.v]||0)+se.edge(Te))},0)},Ae=function(Se){var we=(se.outEdges(Se)||[]).reduce(function(ke,Ge){return Math.min(ke,(ne[Ge.w]||0)-se.edge(Ge))},Number.POSITIVE_INFINITY),Te=G.node(Se);we!==Number.POSITIVE_INFINITY&&Te.borderType!==fe&&(ne[Se]=Math.max(ne[Se],we))};return Ie(ye,se.predecessors.bind(se)),Ie(Ae,se.successors.bind(se)),(K=Object.values(Z))===null||K===void 0||K.forEach(function(Se){ne[Se]=ne[H[Se]]}),ne};N.horizontalCompaction=c;var s=function(G,W,H,Z){var J=new I,K=G.graph(),ne=(0,N.sep)(K.nodesep,K.edgesep,Z);return W==null||W.forEach(function(se){var fe;se==null||se.forEach(function(Ie){var ye=H[Ie];if(J.setNode(ye),fe){var Ae=H[fe],Se=J.edgeFromArgs(Ae,ye);J.setEdge(Ae,ye,Math.max(ne(G,Ie,fe),Se||0))}fe=Ie})}),J};N.buildBlockGraph=s;var m=function(G,W){return(0,_.minBy)(Object.values(W),function(H){var Z,J=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY;return(Z=Object.keys(H))===null||Z===void 0||Z.forEach(function(ne){var se=H[ne],fe=(0,N.width)(G,ne)/2;J=Math.max(se+fe,J),K=Math.min(se-fe,K)}),J-K})};N.findSmallestWidthAlignment=m;function M(G,W){var H=Object.values(W),Z=(0,L.min)(H),J=(0,L.max)(H);["u","d"].forEach(function(K){["l","r"].forEach(function(ne){var se=K+ne,fe=G[se],Ie;if(fe!==W){var ye=Object.values(fe);Ie=ne==="l"?Z-(0,L.min)(ye):J-(0,L.max)(ye),Ie&&(G[se]={},Object.keys(fe).forEach(function(Ae){G[se][Ae]=fe[Ae]+Ie}))}})})}N.alignCoordinates=M;var P=function(G,W){var H={};return Object.keys(G.ul).forEach(function(Z){if(W)H[Z]=G[W.toLowerCase()][Z];else{var J=Object.values(G).map(function(K){return K[Z]});H[Z]=(J[0]+J[1])/2}}),H};N.balance=P;var R=function(G){var W=(0,_.buildLayerMatrix)(G),H=Object.assign((0,N.findType1Conflicts)(G,W),(0,N.findType2Conflicts)(G,W)),Z={},J;["u","d"].forEach(function(ne){J=ne==="u"?W:Object.values(W).reverse(),["l","r"].forEach(function(se){se==="r"&&(J=J.map(function(Ae){return Object.values(Ae).reverse()}));var fe=(ne==="u"?G.predecessors:G.successors).bind(G),Ie=(0,N.verticalAlignment)(G,J,H,fe),ye=(0,N.horizontalCompaction)(G,J,Ie.root,Ie.align,se==="r");se==="r"&&Object.keys(ye).forEach(function(Ae){ye[Ae]=-ye[Ae]}),Z[ne+se]=ye})});var K=(0,N.findSmallestWidthAlignment)(G,Z);return M(Z,K),(0,N.balance)(Z,G.graph().align)};N.positionX=R;var j=function(G,W,H){return function(Z,J,K){var ne=Z.node(J),se=Z.node(K),fe=0,Ie;if(fe+=ne.width/2,ne.hasOwnProperty("labelpos"))switch((ne.labelpos||"").toLowerCase()){case"l":Ie=-ne.width/2;break;case"r":Ie=ne.width/2;break}if(Ie&&(fe+=H?Ie:-Ie),Ie=0,fe+=(ne.dummy?W:G)/2,fe+=(se.dummy?W:G)/2,fe+=se.width/2,se.labelpos)switch((se.labelpos||"").toLowerCase()){case"l":Ie=se.width/2;break;case"r":Ie=-se.width/2;break}return Ie&&(fe+=H?Ie:-Ie),Ie=0,fe}};N.sep=j;var Q=function(G,W){return G.node(W).width||0};N.width=Q},96634:function(Mt,N,F){"use strict";var k=this&&this.__spreadArray||function(x,p,v){if(v||arguments.length===2)for(var g=0,d=p.length,c;g<d;g++)(c||!(g in p))&&(c||(c=Array.prototype.slice.call(p,0,g)),c[g]=p[g]);return x.concat(c||Array.prototype.slice.call(p))};Object.defineProperty(N,"__esModule",{value:!0});var U=F(96744),L=F(61236),_=function(x){var p=(0,U.buildLayerMatrix)(x),v=x.graph().ranksep,g=0;p==null||p.forEach(function(d){var c=d.map(function(m){return x.node(m).height}),s=Math.max.apply(Math,k(k([],c,!1),[0],!1));d==null||d.forEach(function(m){x.node(m).y=g+s/2}),g+=s+v})},I=function(x){var p=(0,U.buildLayerMatrix)(x),v=Object.assign((0,L.findType1Conflicts)(x,p),(0,L.findType2Conflicts)(x,p)),g={},d=[];["u","d"].forEach(function(s){d=s==="u"?p:Object.values(p).reverse(),["l","r"].forEach(function(m){m==="r"&&(d=d.map(function(j){return Object.values(j).reverse()}));var M=(s==="u"?x.predecessors:x.successors).bind(x),P=(0,L.verticalAlignment)(x,d,v,M),R=(0,L.horizontalCompaction)(x,d,P.root,P.align,m==="r");m==="r"&&Object.keys(R).forEach(function(j){return R[j]=-R[j]}),g[s+m]=R})});var c=(0,L.findSmallestWidthAlignment)(x,g);return c&&(0,L.alignCoordinates)(g,c),(0,L.balance)(g,x.graph().align)},T=function(x){var p,v=(0,U.asNonCompoundGraph)(x);_(v);var g=I(v);(p=Object.keys(g))===null||p===void 0||p.forEach(function(d){v.node(d).x=g[d]})};N.default=T},7085:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.feasibleTreeWithLayer=N.feasibleTree=void 0;var k=F(78433),U=F(96744),L=F(61283),_=function(g){var d=new L.Graph({directed:!1}),c=g.nodes()[0],s=g.nodeCount();d.setNode(c,{});for(var m,M;I(d,g)<s;)m=p(d,g),M=d.hasNode(m.v)?(0,k.slack)(g,m):-(0,k.slack)(g,m),v(d,g,M);return d};N.feasibleTree=_;var I=function(g,d){var c=function(s){d.nodeEdges(s).forEach(function(m){var M=m.v,P=s===M?m.w:M;!g.hasNode(P)&&!(0,k.slack)(d,m)&&(g.setNode(P,{}),g.setEdge(s,P,{}),c(P))})};return g.nodes().forEach(c),g.nodeCount()},T=function(g){var d=new L.Graph({directed:!1}),c=g.nodes()[0],s=g.nodes().filter(function(P){return!!g.node(P)}).length;d.setNode(c,{});for(var m,M;x(d,g)<s;)m=p(d,g),M=d.hasNode(m.v)?(0,k.slack)(g,m):-(0,k.slack)(g,m),v(d,g,M);return d};N.feasibleTreeWithLayer=T;var x=function(g,d){var c=function(s){var m;(m=d.nodeEdges(s))===null||m===void 0||m.forEach(function(M){var P=M.v,R=s===P?M.w:P;!g.hasNode(R)&&(d.node(R).layer!==void 0||!(0,k.slack)(d,M))&&(g.setNode(R,{}),g.setEdge(s,R,{}),c(R))})};return g.nodes().forEach(c),g.nodeCount()},p=function(g,d){return(0,U.minBy)(d.edges(),function(c){return g.hasNode(c.v)!==g.hasNode(c.w)?(0,k.slack)(d,c):1/0})},v=function(g,d,c){g.nodes().forEach(function(s){d.node(s).rank||(d.node(s).rank=0),d.node(s).rank+=c})};N.default={feasibleTree:_,feasibleTreeWithLayer:T}},95564:function(Mt,N,F){"use strict";var k=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(N,"__esModule",{value:!0});var U=F(78433),L=F(7085),_=k(F(52910)),I=function(v){switch(v.graph().ranker){case"network-simplex":p(v);break;case"tight-tree":x(v);break;case"longest-path":T(v);break;default:x(v)}},T=U.longestPath,x=function(v){(0,U.longestPathWithLayer)(v),(0,L.feasibleTreeWithLayer)(v)},p=function(v){(0,_.default)(v)};N.default=I},52910:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.exchangeEdges=N.enterEdge=N.leaveEdge=N.initLowLimValues=N.calcCutValue=N.initCutValues=void 0;var k=F(7085),U=F(78433),L=F(96744),_=F(12130),I=_.algorithm.preorder,T=_.algorithm.postorder,x=function(Q){var G=(0,L.simplify)(Q);(0,U.longestPath)(G);var W=(0,k.feasibleTree)(G);(0,N.initLowLimValues)(W),(0,N.initCutValues)(W,G);for(var H,Z;H=(0,N.leaveEdge)(W);)Z=(0,N.enterEdge)(W,G,H),(0,N.exchangeEdges)(W,G,H,Z)},p=function(Q,G){var W=T(Q,Q.nodes());W=W==null?void 0:W.slice(0,(W==null?void 0:W.length)-1),W==null||W.forEach(function(H){v(Q,G,H)})};N.initCutValues=p;var v=function(Q,G,W){var H=Q.node(W),Z=H.parent;Q.edgeFromArgs(W,Z).cutvalue=(0,N.calcCutValue)(Q,G,W)},g=function(Q,G,W){var H,Z=Q.node(W),J=Z.parent,K=!0,ne=G.edgeFromArgs(W,J),se=0;return ne||(K=!1,ne=G.edgeFromArgs(J,W)),se=ne.weight,(H=G.nodeEdges(W))===null||H===void 0||H.forEach(function(fe){var Ie=fe.v===W,ye=Ie?fe.w:fe.v;if(ye!==J){var Ae=Ie===K,Se=G.edge(fe).weight;if(se+=Ae?Se:-Se,R(Q,W,ye)){var we=Q.edgeFromArgs(W,ye).cutvalue;se+=Ae?-we:we}}}),se};N.calcCutValue=g;var d=function(Q,G){G===void 0&&(G=Q.nodes()[0]),c(Q,{},1,G)};N.initLowLimValues=d;var c=function(Q,G,W,H,Z){var J,K=W,ne=W,se=Q.node(H);return G[H]=!0,(J=Q.neighbors(H))===null||J===void 0||J.forEach(function(fe){G[fe]||(ne=c(Q,G,ne,fe,H))}),se.low=K,se.lim=ne++,Z?se.parent=Z:delete se.parent,ne},s=function(Q){return Q.edges().find(function(G){return Q.edge(G).cutvalue<0})};N.leaveEdge=s;var m=function(Q,G,W){var H=W.v,Z=W.w;G.hasEdge(H,Z)||(H=W.w,Z=W.v);var J=Q.node(H),K=Q.node(Z),ne=J,se=!1;J.lim>K.lim&&(ne=K,se=!0);var fe=G.edges().filter(function(Ie){return se===j(Q,Q.node(Ie.v),ne)&&se!==j(Q,Q.node(Ie.w),ne)});return(0,L.minBy)(fe,function(Ie){return(0,U.slack)(G,Ie)})};N.enterEdge=m;var M=function(Q,G,W,H){var Z=W.v,J=W.w;Q.removeEdge(Z,J),Q.setEdge(H.v,H.w,{}),(0,N.initLowLimValues)(Q),(0,N.initCutValues)(Q,G),P(Q,G)};N.exchangeEdges=M;var P=function(Q,G){var W=Q.nodes().find(function(Z){var J;return!(!((J=G.node(Z))===null||J===void 0)&&J.parent)}),H=I(Q,W);H=H==null?void 0:H.slice(1),H==null||H.forEach(function(Z){var J=Q.node(Z).parent,K=G.edgeFromArgs(Z,J),ne=!1;K||(K=G.edgeFromArgs(J,Z),ne=!0),G.node(Z).rank=G.node(J).rank+(ne?K.minlen:-K.minlen)})},R=function(Q,G,W){return Q.hasEdge(G,W)},j=function(Q,G,W){return W.low<=G.lim&&G.lim<=W.lim};N.default=x},78433:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.slack=N.longestPathWithLayer=N.longestPath=void 0;var F=function(L){var _,I={},T=function(x){var p,v=L.node(x);if(!v)return 0;if(I[x])return v.rank;I[x]=!0;var g;return(p=L.outEdges(x))===null||p===void 0||p.forEach(function(d){var c=T(d.w),s=L.edge(d).minlen,m=c-s;m&&(g===void 0||m<g)&&(g=m)}),g||(g=0),v.rank=g,g};(_=L.sources())===null||_===void 0||_.forEach(function(x){return T(x)})};N.longestPath=F;var k=function(L){var _,I={},T,x=function(g){var d,c=L.node(g);if(!c)return 0;if(I[g])return c.rank;I[g]=!0;var s;return(d=L.outEdges(g))===null||d===void 0||d.forEach(function(m){var M=x(m.w),P=L.edge(m).minlen,R=M-P;R&&(s===void 0||R<s)&&(s=R)}),s||(s=0),(T===void 0||s<T)&&(T=s),c.rank=s,s};(_=L.sources())===null||_===void 0||_.forEach(function(g){L.node(g)&&x(g)}),T===void 0&&(T=0);var p={},v=function(g,d){var c,s=L.node(g),m=isNaN(s.layer)?d:s.layer;(s.rank===void 0||s.rank<m)&&(s.rank=m),!p[g]&&(p[g]=!0,(c=L.outEdges(g))===null||c===void 0||c.map(function(M){v(M.w,m+L.edge(M).minlen)}))};L.nodes().forEach(function(g){var d=L.node(g);d&&(isNaN(d.layer)?d.rank-=T:v(g,d.layer))})};N.longestPathWithLayer=k;var U=function(L,_){return L.node(_.w).rank-L.node(_.v).rank-L.edge(_).minlen};N.slack=U,N.default={longestPath:F,longestPathWithLayer:k,slack:U}},96744:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.minBy=N.notime=N.time=N.partition=N.maxRank=N.addBorderNode=N.removeEmptyRanks=N.normalizeRanks=N.buildLayerMatrix=N.intersectRect=N.predecessorWeights=N.successorWeights=N.zipObject=N.asNonCompoundGraph=N.simplify=N.addDummyNode=void 0;var k=F(44941),U=F(61283),L=function(G,W){return Number(G)-Number(W)},_=function(G,W,H,Z){var J;do J="".concat(Z).concat(Math.random());while(G.hasNode(J));return H.dummy=W,G.setNode(J,H),J};N.addDummyNode=_;var I=function(G){var W=new U.Graph().setGraph(G.graph());return G.nodes().forEach(function(H){W.setNode(H,G.node(H))}),G.edges().forEach(function(H){var Z=W.edgeFromArgs(H.v,H.w)||{weight:0,minlen:1},J=G.edge(H);W.setEdge(H.v,H.w,{weight:Z.weight+J.weight,minlen:Math.max(Z.minlen,J.minlen)})}),W};N.simplify=I;var T=function(G){var W=new U.Graph({multigraph:G.isMultigraph()}).setGraph(G.graph());return G.nodes().forEach(function(H){var Z;!((Z=G.children(H))===null||Z===void 0)&&Z.length||W.setNode(H,G.node(H))}),G.edges().forEach(function(H){W.setEdgeObj(H,G.edge(H))}),W};N.asNonCompoundGraph=T;var x=function(G,W){return G==null?void 0:G.reduce(function(H,Z,J){return H[Z]=W[J],H},{})};N.zipObject=x;var p=function(G){var W={};return G.nodes().forEach(function(H){var Z,J={};(Z=G.outEdges(H))===null||Z===void 0||Z.forEach(function(K){var ne;J[K.w]=(J[K.w]||0)+(((ne=G.edge(K))===null||ne===void 0?void 0:ne.weight)||0)}),W[H]=J}),W};N.successorWeights=p;var v=function(G){var W=G.nodes(),H=W.map(function(Z){var J,K={};return(J=G.inEdges(Z))===null||J===void 0||J.forEach(function(ne){K[ne.v]=(K[ne.v]||0)+G.edge(ne).weight}),K});return(0,N.zipObject)(W,H)};N.predecessorWeights=v;var g=function(G,W){var H=Number(G.x),Z=Number(G.y),J=Number(W.x)-H,K=Number(W.y)-Z,ne=Number(G.width)/2,se=Number(G.height)/2;if(!J&&!K)return{x:0,y:0};var fe,Ie;return Math.abs(K)*ne>Math.abs(J)*se?(K<0&&(se=-se),fe=se*J/K,Ie=se):(J<0&&(ne=-ne),fe=ne,Ie=ne*K/J),{x:H+fe,y:Z+Ie}};N.intersectRect=g;var d=function(G){for(var W=[],H=(0,N.maxRank)(G)+1,Z=0;Z<H;Z++)W.push([]);G.nodes().forEach(function(J){var K=G.node(J);if(K){var ne=K.rank;ne!==void 0&&W[ne]&&W[ne].push(J)}});for(var Z=0;Z<H;Z++)W[Z]=W[Z].sort(function(K,ne){var se,fe;return L((se=G.node(K))===null||se===void 0?void 0:se.order,(fe=G.node(ne))===null||fe===void 0?void 0:fe.order)});return W};N.buildLayerMatrix=d;var c=function(G){var W=G.nodes().filter(function(Z){var J;return((J=G.node(Z))===null||J===void 0?void 0:J.rank)!==void 0}).map(function(Z){return G.node(Z).rank}),H=Math.min.apply(Math,W);G.nodes().forEach(function(Z){var J=G.node(Z);J.hasOwnProperty("rank")&&H!==1/0&&(J.rank-=H)})};N.normalizeRanks=c;var s=function(G){var W=G.nodes(),H=W.filter(function(Ie){var ye;return((ye=G.node(Ie))===null||ye===void 0?void 0:ye.rank)!==void 0}).map(function(Ie){return G.node(Ie).rank}),Z=Math.min.apply(Math,H),J=[];W.forEach(function(Ie){var ye,Ae=(((ye=G.node(Ie))===null||ye===void 0?void 0:ye.rank)||0)-Z;J[Ae]||(J[Ae]=[]),J[Ae].push(Ie)});for(var K=0,ne=G.graph().nodeRankFactor||0,se=0;se<J.length;se++){var fe=J[se];fe===void 0?se%ne!==0&&(K-=1):K&&(fe==null||fe.forEach(function(Ie){var ye=G.node(Ie);ye&&(ye.rank=ye.rank||0,ye.rank+=K)}))}};N.removeEmptyRanks=s;var m=function(G,W,H,Z){var J={width:0,height:0};return(0,k.isNumber)(H)&&(0,k.isNumber)(Z)&&(J.rank=H,J.order=Z),(0,N.addDummyNode)(G,"border",J,W)};N.addBorderNode=m;var M=function(G){var W;return G.nodes().forEach(function(H){var Z,J=(Z=G.node(H))===null||Z===void 0?void 0:Z.rank;J!==void 0&&(W===void 0||J>W)&&(W=J)}),W||(W=0),W};N.maxRank=M;var P=function(G,W){var H={lhs:[],rhs:[]};return G==null||G.forEach(function(Z){W(Z)?H.lhs.push(Z):H.rhs.push(Z)}),H};N.partition=P;var R=function(G,W){var H=Date.now();try{return W()}finally{console.log("".concat(G," time: ").concat(Date.now()-H,"ms"))}};N.time=R;var j=function(G,W){return W()};N.notime=j;var Q=function(G,W){return G.reduce(function(H,Z){var J=W(H),K=W(Z);return J>K?Z:H})};N.minBy=Q},77620:function(Mt,N,F){"use strict";var k=this&&this.__assign||function(){return k=Object.assign||function(d){for(var c,s=1,m=arguments.length;s<m;s++){c=arguments[s];for(var M in c)Object.prototype.hasOwnProperty.call(c,M)&&(d[M]=c[M])}return d},k.apply(this,arguments)},U=this&&this.__createBinding||(Object.create?function(d,c,s,m){m===void 0&&(m=s);var M=Object.getOwnPropertyDescriptor(c,s);(!M||("get"in M?!c.__esModule:M.writable||M.configurable))&&(M={enumerable:!0,get:function(){return c[s]}}),Object.defineProperty(d,m,M)}:function(d,c,s,m){m===void 0&&(m=s),d[m]=c[s]}),L=this&&this.__setModuleDefault||(Object.create?function(d,c){Object.defineProperty(d,"default",{enumerable:!0,value:c})}:function(d,c){d.default=c}),_=this&&this.__importStar||function(d){if(d&&d.__esModule)return d;var c={};if(d!=null)for(var s in d)s!=="default"&&Object.prototype.hasOwnProperty.call(d,s)&&U(c,d,s);return L(c,d),c},I=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(N,"__esModule",{value:!0});var T=_(F(36074)),x=I(F(78755)),p=I(F(89683)),v=F(95511);function g(d,c){var s=d.nodes,m=d.edges,M=c.width,P=c.height;if(!(s!=null&&s.length))return Promise.resolve();var R=[];s.forEach(function(K){var ne=m.filter(function(fe){return fe.source===K.id||fe.target===K.id});if(ne.length>1){var se=k({},K);delete se.size,R.push(se)}});var j=[];m.forEach(function(K){var ne=R.find(function(fe){return fe.id===K.source}),se=R.find(function(fe){return fe.id===K.target});ne&&se&&j.push(K)});var Q=new v.DagreLayout({type:"dagre",ranksep:c.nodeMinGap,nodesep:c.nodeMinGap}),G=Q.layout({nodes:R,edges:j}).nodes;s.forEach(function(K){var ne=(G||[]).find(function(se){return se.id===K.id});K.x=(ne==null?void 0:ne.x)||M/2,K.y=(ne==null?void 0:ne.y)||P/2});var W=JSON.parse(JSON.stringify(s)),H=JSON.parse(JSON.stringify(m)),Z=T.forceSimulation().nodes(W).force("link",T.forceLink(H).id(function(K){return K.id}).distance(function(K){var ne=j.find(function(se){return se.source===K.source&&se.target===K.target});return ne?30:20})).force("charge",T.forceManyBody()).force("center",T.forceCenter(M/2,P/2)).force("x",T.forceX(M/2)).force("y",T.forceY(P/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),J=new Promise(function(K){Z.on("end",function(){s.forEach(function(Se){var we=W.find(function(Te){return Te.id===Se.id});we&&(Se.x=we.x,Se.y=we.y)});var ne=Math.min.apply(Math,s.map(function(Se){return Se.x})),se=Math.max.apply(Math,s.map(function(Se){return Se.x})),fe=Math.min.apply(Math,s.map(function(Se){return Se.y})),Ie=Math.max.apply(Math,s.map(function(Se){return Se.y})),ye=M/(se-ne),Ae=P/(Ie-fe);s.forEach(function(Se){Se.x!==void 0&&ye<1&&(Se.x=(Se.x-ne)*ye),Se.y!==void 0&&Ae<1&&(Se.y=(Se.y-fe)*Ae)}),s.forEach(function(Se){Se.sizeTemp=Se.size,Se.size=[10,10]}),(0,p.default)(s,m),s.forEach(function(Se){Se.size=Se.sizeTemp||[],delete Se.sizeTemp}),(0,x.default)({nodes:s,edges:m},c),K()})});return J}N.default=g},78755:function(Mt,N,F){"use strict";var k=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(N,"__esModule",{value:!0});var U=k(F(11761));function L(_,I){if(!_.nodes||_.nodes.length===0)return _;var T=I.width,x=I.height,p=I.nodeMinGap,v=1e4,g=1e4;_.nodes.forEach(function(H){var Z=H.size[0]||50,J=H.size[1]||50;v=Math.min(Z,v),g=Math.min(J,g)});var d=new U.default;d.init(T,x,{CELL_H:g,CELL_W:v}),_.nodes.forEach(function(H){var Z=d.occupyNearest(H);Z&&(Z.node={id:H.id,size:H.size},H.x=Z.x,H.y=Z.y,H.dx=Z.dx,H.dy=Z.dy)});for(var c=0;c<_.nodes.length;c++){var s=_.nodes[c],m=d.findGridByNodeId(s.id);if(!m)throw new Error("can not find node cell");var M=m.column,P=m.row;if(s.size[0]+p>v){for(var R=Math.ceil((s.size[0]+p)/v)-1,j=R,Q=0;Q<R;Q++){var G=d.additionColumn.indexOf(M+Q+1)>-1;if(G&&!d.cells[M+Q+1][P].node)j--;else break}d.insertColumn(M,j)}if(s.size[1]+p>g){for(var R=Math.ceil((s.size[1]+p)/g)-1,j=R,Q=0;Q<R;Q++){var G=d.additionRow.indexOf(P+Q+1)>-1;if(G&&!d.cells[M][P+Q+1].node)j--;else break}d.insertRow(P,j)}}for(var c=0;c<d.columnNum;c++)for(var W=function(Z){var J=d.cells[c][Z];if(J.node){var K=_.nodes.find(function(ne){var se;return ne.id===((se=J==null?void 0:J.node)===null||se===void 0?void 0:se.id)});K&&(K.x=J.x+K.size[0]/2,K.y=J.y+K.size[1]/2)}},Q=0;Q<d.rowNum;Q++)W(Q)}N.default=L},11761:function(Mt,N){"use strict";var F=this&&this.__assign||function(){return F=Object.assign||function(U){for(var L,_=1,I=arguments.length;_<I;_++){L=arguments[_];for(var T in L)Object.prototype.hasOwnProperty.call(L,T)&&(U[T]=L[T])}return U},F.apply(this,arguments)};Object.defineProperty(N,"__esModule",{value:!0});var k=function(){function U(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return U.prototype.init=function(L,_,I){this.cells=[],this.CELL_W=I.CELL_W||U.DEFAULT_CELL_W,this.CELL_H=I.CELL_H||U.DEFAULT_CELL_H,this.columnNum=Math.ceil(L/this.CELL_W),this.rowNum=Math.ceil(_/this.CELL_H),U.MIN_DIST=Math.pow(L,2)+Math.pow(_,2);for(var T=0;T<this.columnNum;T++){for(var x=[],p=0;p<this.rowNum;p++){var v={dx:T,dy:p,x:T*this.CELL_W,y:p*this.CELL_H,occupied:!1};x.push(v)}this.cells.push(x)}},U.prototype.findGridByNodeId=function(L){for(var _,I,T=0;T<this.columnNum;T++)for(var x=0;x<this.rowNum;x++)if(this.cells[T][x].node&&((I=(_=this.cells[T][x])===null||_===void 0?void 0:_.node)===null||I===void 0?void 0:I.id)===L)return{column:T,row:x};return null},U.prototype.sqdist=function(L,_){return Math.pow(L.x-_.x,2)+Math.pow(L.y-_.y,2)},U.prototype.occupyNearest=function(L){for(var _=U.MIN_DIST,I,T=null,x=0;x<this.columnNum;x++)for(var p=0;p<this.rowNum;p++)!this.cells[x][p].occupied&&(I=this.sqdist(L,this.cells[x][p]))<_&&(_=I,T=this.cells[x][p]);return T&&(T.occupied=!0),T},U.prototype.insertColumn=function(L,_){if(!(_<=0)){for(var I=0;I<_;I++){this.cells[I+this.columnNum]=[];for(var T=0;T<this.rowNum;T++)this.cells[I+this.columnNum][T]={dx:I,dy:T,x:I*this.CELL_W,y:T*this.CELL_H,occupied:!1,node:null}}for(var I=this.columnNum-1;I>L;I--)for(var T=0;T<this.rowNum;T++)this.cells[I+_][T]=F(F({},this.cells[I][T]),{x:(I+_)*this.CELL_W,y:T*this.CELL_H}),this.cells[I][T]={x:I*this.CELL_W,y:T*this.CELL_H,occupied:!0,node:null};for(var T=0;T<this.additionColumn.length;T++)this.additionColumn[T]>=L&&(this.additionColumn[T]+=_);for(var I=0;I<_;I++)this.additionColumn.push(L+I+1);this.columnNum+=_}},U.prototype.insertRow=function(L,_){if(!(_<=0)){for(var I=0;I<_;I++)for(var T=0;T<this.columnNum;T++)this.cells[T][I+this.rowNum]={dx:T,dy:I,x:T*this.CELL_W,y:I*this.CELL_H,occupied:!1,node:null};for(var T=0;T<this.columnNum;T++)for(var I=this.rowNum-1;I>L;I--)this.cells[T][I+_]=F(F({},this.cells[T][I]),{dx:T,dy:I+_,x:T*this.CELL_W,y:(I+_)*this.CELL_H}),this.cells[T][I]={dx:T,dy:I,x:T*this.CELL_W,y:I*this.CELL_H,occupied:!1,node:null};for(var I=0;I<this.additionRow.length;I++)this.additionRow[I]>=L&&(this.additionRow[I]+=_);for(var T=0;T<_;T++)this.additionRow.push(L+T+1);this.rowNum+=_}},U.prototype.getNodes=function(){for(var L=[],_=0;_<this.columnNum;_++)for(var I=0;I<this.rowNum;I++)this.cells[_][I].node&&L.push(this.cells[_][I]);return L},U.MIN_DIST=50,U.DEFAULT_CELL_W=80,U.DEFAULT_CELL_H=80,U}();N.default=k},71443:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var T=function(x,p){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},T(x,p)};return function(x,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");T(x,p);function v(){this.constructor=x}x.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}(),U=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(N,"__esModule",{value:!0}),N.ERLayout=void 0;var L=F(46833),_=U(F(77620)),I=function(T){k(x,T);function x(p){var v=T.call(this)||this;return v.width=300,v.height=300,v.nodeMinGap=50,v.onLayoutEnd=function(){},p&&v.updateCfg(p),v}return x.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},x.prototype.execute=function(){var p=this,v=p.nodes,g=p.edges;return v==null||v.forEach(function(d){d.size||(d.size=[50,50])}),(0,_.default)({nodes:v,edges:g},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then(function(){p.onLayoutEnd&&p.onLayoutEnd()})},x.prototype.getType=function(){return"er"},x}(L.Base);N.ERLayout=I},89683:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=1200,k=800,U=1e7,L=10,_=3.141592653589793,I=1.5707963267948966,T=_*.375,x=_*.625,p=new Map,v=10,g=10,d=.8,c=.1,s=.5;function m(W,H,Z){var J=W.x-W.size[0]/2,K=W.y-W.size[1]/2,ne=W.x+W.size[0]/2,se=W.y+W.size[1]/2,fe=H.x-H.size[0]/2,Ie=H.y-H.size[1]/2,ye=H.x+H.size[0]/2,Ae=H.y+H.size[1]/2,Se=W.x,we=W.y,Te=H.x,ke=H.y,Ge=Te-Se,tt=Math.atan2(Ge,ke-we),He=0,ft=0,Lt=0,Jt=0;tt>I?(ft=K-Ae,He=fe-ne,Lt=parseFloat(ft?(ft/Math.cos(tt)).toFixed(2):He.toFixed(2)),Jt=parseFloat(He?(He/Math.sin(tt)).toFixed(2):ft.toFixed(2))):0<tt&&tt<=I?(ft=Ie-se,He=fe-ne,ft>He?Lt=Jt=parseFloat(ft?(ft/Math.cos(tt)).toFixed(2):He.toFixed(2)):Lt=Jt=parseFloat(He?(He/Math.sin(tt)).toFixed(2):ft.toFixed(2))):tt<-I?(ft=K-Ae,He=-(ye-J),ft>He?Lt=Jt=parseFloat(ft?(ft/Math.cos(tt)).toFixed(2):He.toFixed(2)):Lt=Jt=parseFloat(He?(He/Math.sin(tt)).toFixed(2):ft.toFixed(2))):(ft=Ie-se,Math.abs(Ge)>(ne-J)/2?He=J-ye:He=Ge,ft>He?Lt=Jt=parseFloat(ft?(ft/Math.cos(tt)).toFixed(2):He.toFixed(2)):Lt=Jt=parseFloat(He&&tt!==0?(He/Math.sin(tt)).toFixed(2):ft.toFixed(2)));var Qe=parseFloat(tt.toFixed(2)),ut=Z;return Z&&(ut=T<Qe&&Qe<x),{distance:Math.abs(Lt<Jt?Lt:Jt),isHoriz:ut}}function M(W,H){var Z=p.get(W.id)||[],J=Z.find(function(It){return It.source===H.id||It.target===H.id}),K=W.size[0]*W.size[1],ne=H.size[0]*H.size[1],se=K>ne?H:W,fe=K>ne?W:H,Ie=se.x-se.size[0]/2,ye=se.y-se.size[1]/2,Ae=se.x+se.size[0]/2,Se=se.y+se.size[1]/2,we=fe.x-fe.size[0]/2,Te=fe.y-fe.size[1]/2,ke=fe.x+fe.size[0]/2,Ge=fe.y+fe.size[1]/2,tt=se.x,He=se.y,ft=fe.x,Lt=fe.y,Jt=Ae>=we&&ke>=Ie&&Se>=Te&&Ge>=ye,Qe=0,ut=0;if(Jt){ut=Math.sqrt(Math.pow(ft-tt,2)+Math.pow(Lt-He,2));var xt=Ie>we?Ie:we,dt=ye>Te?ye:Te,pt=Ae<ke?Ae:ke,wt=Se<Ge?Se:Ge,mt=pt-xt,ur=wt-dt,Ir=mt*ur;ut===0&&(ut=1e-7),Qe=L*1/ut*100+Ir,Qe*=U}else{var Nr=!1,Hr=m(se,fe,Nr);ut=Hr.distance,Nr=Hr.isHoriz,ut<=L?ut!==0?J?Qe+=L+U*1/ut:Qe+=L+U*L/ut:Qe+=U:(Qe+=ut,J&&(Qe+=ut*ut))}return Qe}function P(W){for(var H=0,Z=0;Z<W.length;Z++){var J=W[Z];(J.x<0||J.y<0||J.x>F||J.y>k)&&(H+=1e12);for(var K=Z+1;K<W.length;K++)H+=M(J,W[K])}return H}function R(W,H,Z,J){var K=new Map;Z.forEach(function(tt,He){K.set(tt.id,tt)});var ne=J.filter(function(tt){return tt.source===W.id||tt.target===W.id})||[],se=[];ne.forEach(function(tt){var He=tt.source===W.id?tt.target:tt.source,ft=K.get(He);ft&&se.push(ft)});for(var fe=!0,Ie=0;Ie<se.length;Ie++){var ye=se[Ie],Ae=Math.atan((W.y-ye.y)/(ye.x-W.y))*180,Se=Math.atan((H.y-ye.y)/(ye.x-H.y))*180,we=Ae<30||Ae>150,Te=Se<30||Se>150,ke=Ae>70&&Ae<110,Ge=Se>70&&Se<110;if(we&&!Te||Ae*Se<0){fe=!1;break}else if(ke&&!Ge||Ae*Se<0){fe=!1;break}else if((ye.x-W.x)*(ye.x-H.x)<0){fe=!1;break}else if((ye.y-W.y)*(ye.y-H.y)<0){fe=!1;break}}return fe}function j(W,H){for(var Z=!1,J=1,K=v*J,ne=g*J,se=[K,-K,0,0],fe=[0,0,ne,-ne],Ie=0;Ie<W.length;++Ie)for(var ye=W[Ie],Ae=Q(ye,W),Se=0;Se<se.length;Se++){var we=R(ye,{x:ye.x+se[Se],y:ye.y+fe[Se]},W,H);if(we){ye.x+=se[Se],ye.y+=fe[Se];var Te=Q(ye,W),ke=Math.random();Te<Ae||ke<d&&ke>c?(Ae=Te,Z=!0):(ye.x-=se[Se],ye.y-=fe[Se])}}return d>c&&(d*=s),Z?P(W):0}function Q(W,H){var Z=0;(W.x<0||W.y<0||W.x+W.size[0]+20>F||W.y+W.size[1]+20>k)&&(Z+=1e12);for(var J=0;J<H.length;++J)W.id!==H[J].id&&(Z+=M(W,H[J]));return Z}function G(W,H){if(W.length===0)return{nodes:W,edges:H};W.forEach(function(ye){var Ae=H.filter(function(Se){return Se.source===ye.id||Se.target===ye.id});p.set(ye,Ae)}),W.sort(function(ye,Ae){var Se,we;return((Se=p.get(ye.id))===null||Se===void 0?void 0:Se.length)-((we=p.get(Ae.id))===null||we===void 0?void 0:we.length)});for(var Z=P(W),J=20,K=1,ne=0,se=50,fe=0;J>0&&(fe++,!(fe>=se));){var Ie=j(W,H);Ie!==0&&(ne=Ie),K=ne-Z,Z=ne,K===0?--J:J=20}return W.forEach(function(ye){ye.x=ye.x-ye.size[0]/2,ye.y=ye.y-ye.size[1]/2}),{nodes:W,edges:H}}N.default=G},45515:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.forceNBody=void 0;var k=F(80789),U=.81,L=.1;function _(p,v,g,d,c){var s=g/d,m=p.map(function(P,R){var j=v[P.id],Q=j.data,G=j.x,W=j.y,H=j.size,Z=Q.layout.force.nodeStrength;return{x:G,y:W,size:H,index:R,vx:0,vy:0,weight:s*Z}}),M=(0,k.quadtree)(m,function(P){return P.x},function(P){return P.y}).visitAfter(I);return m.forEach(function(P){x(P,M)}),m.map(function(P,R){var j=v[p[R].id],Q=j.data.layout.force.mass,G=Q===void 0?1:Q;c[2*R]=P.vx/G,c[2*R+1]=P.vy/G}),c}N.forceNBody=_;function I(p){var v=0,g=0,d=0;if(p.length){for(var c=0;c<4;c++){var s=p[c];s&&s.weight&&(v+=s.weight,g+=s.x*s.weight,d+=s.y*s.weight)}p.x=g/v,p.y=d/v,p.weight=v}else{var s=p;p.x=s.data.x,p.y=s.data.y,p.weight=s.data.weight}}var T=function(p,v,g,d,c,s){var m=s.x-p.x||L,M=s.y-p.y||L,P=d-v,R=m*m+M*M,j=Math.sqrt(R)*R;if(P*P*U<R){var Q=p.weight/j;return s.vx+=m*Q,s.vy+=M*Q,!0}if(p.length)return!1;if(p.data!==s){var Q=p.data.weight/j;s.vx+=m*Q,s.vy+=M*Q}};function x(p,v){v.visit(function(g,d,c,s,m){return T(g,d,c,s,m,p)})}},41142:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var p=function(v,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,c){d.__proto__=c}||function(d,c){for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(d[s]=c[s])},p(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");p(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}(),U=this&&this.__assign||function(){return U=Object.assign||function(p){for(var v,g=1,d=arguments.length;g<d;g++){v=arguments[g];for(var c in v)Object.prototype.hasOwnProperty.call(v,c)&&(p[c]=v[c])}return p},U.apply(this,arguments)};Object.defineProperty(N,"__esModule",{value:!0}),N.Force2Layout=void 0;var L=F(46833),_=F(44941),I=F(45515),T=function(p,v){var g;return p?(0,_.isNumber)(p)?g=function(d){return p}:g=p:g=function(d){return v||1},g},x=function(p){k(v,p);function v(g){var d=p.call(this)||this;d.maxIteration=1e3,d.workerEnabled=!1,d.edgeStrength=200,d.nodeStrength=1e3,d.coulombDisScale=.005,d.damping=.9,d.maxSpeed=500,d.minMovement=.4,d.interval=.02,d.factor=1,d.linkDistance=200,d.gravity=0,d.clusterNodeStrength=20,d.preventOverlap=!0,d.distanceThresholdMode="mean",d.tick=function(){},d.nodes=[],d.edges=[],d.width=300,d.height=300,d.nodeMap={},d.nodeIdxMap={},d.judgingDistance=0,d.centripetalOptions={leaf:2,single:2,others:1,center:function(s){return{x:d.width/2,y:d.height/2}}};var c=g.getMass;return d.propsGetMass=c,d.updateCfg(g),d}return v.prototype.getCentripetalOptions=function(){var g=this,d=g.leafCluster,c=g.clustering,s=g.nodeClusterBy,m=g.nodes,M=g.nodeMap,P=g.clusterNodeStrength,R=function(se){return typeof P=="function"?P(se):P},j={},Q;if(d){Q=this.getSameTypeLeafMap()||{};var G=Array.from(new Set(m==null?void 0:m.map(function(se){return se[s]})))||[];j={single:100,leaf:function(se,fe,Ie){var ye=Q[se.id]||{},Ae=ye.relativeLeafNodes,Se=ye.sameTypeLeafNodes;return(Se==null?void 0:Se.length)===(Ae==null?void 0:Ae.length)||(G==null?void 0:G.length)===1?1:R(se)},others:1,center:function(se,fe,Ie){var ye,Ae=(((ye=se.data)===null||ye===void 0?void 0:ye.layout)||{}).degree;if(!Ae)return{x:100,y:100};var Se;if(Ae===1){var we=(Q[se.id]||{}).sameTypeLeafNodes,Te=we===void 0?[]:we;Te.length===1?Se=void 0:Te.length>1&&(Se=(0,_.getAvgNodePosition)(Te))}else Se=void 0;return{x:Se==null?void 0:Se.x,y:Se==null?void 0:Se.y}}}}if(c){Q||(Q=this.getSameTypeLeafMap());var W=Array.from(new Set(m.map(function(se,fe){return se[s]}))).filter(function(se){return se!==void 0}),H={};W.forEach(function(se){var fe=m.filter(function(Ie){return Ie[s]===se}).map(function(Ie){return M[Ie.id]});H[se]=(0,_.getAvgNodePosition)(fe)}),j={single:function(se){return R(se)},leaf:function(se){return R(se)},others:function(se){return R(se)},center:function(se,fe,Ie){var ye=H[se[s]];return{x:ye==null?void 0:ye.x,y:ye==null?void 0:ye.y}}}}this.centripetalOptions=U(U({},this.centripetalOptions),j);var Z=this.centripetalOptions,J=Z.leaf,K=Z.single,ne=Z.others;J&&typeof J!="function"&&(this.centripetalOptions.leaf=function(){return J}),K&&typeof K!="function"&&(this.centripetalOptions.single=function(){return K}),ne&&typeof ne!="function"&&(this.centripetalOptions.others=function(){return ne})},v.prototype.updateCfg=function(g){g&&Object.assign(this,g)},v.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},v.prototype.execute=function(){var g=this;g.stop();var d=g.nodes,c=g.edges,s=g.defSpringLen;if(g.judgingDistance=0,!d||d.length===0){g.onLayoutEnd([]);return}!g.width&&typeof window!="undefined"&&(g.width=window.innerWidth),!g.height&&typeof window!="undefined"&&(g.height=window.innerHeight),g.center||(g.center=[g.width/2,g.height/2]);var m=g.center;if(d.length===1){d[0].x=m[0],d[0].y=m[1],g.onLayoutEnd([U({},d[0])]);return}g.degreesMap=(0,_.getDegreeMap)(d,c),g.propsGetMass?g.getMass=g.propsGetMass:g.getMass=function(W){var H=1;(0,_.isNumber)(W.mass)&&(H=W.mass);var Z=g.degreesMap[W.id].all;return!Z||Z<5?H:Z*5*H};var M=g.nodeSize,P;if(g.preventOverlap){var R=g.nodeSpacing,j;(0,_.isNumber)(R)?j=function(){return R}:(0,_.isFunction)(R)?j=R:j=function(){return 0},M?(0,_.isArray)(M)?P=function(W){return Math.max(M[0],M[1])+j(W)}:P=function(W){return M+j(W)}:P=function(W){return W.size?(0,_.isArray)(W.size)?Math.max(W.size[0],W.size[1])+j(W):(0,_.isObject)(W.size)?Math.max(W.size.width,W.size.height)+j(W):W.size+j(W):10+j(W)}}g.nodeSize=P,g.linkDistance=T(g.linkDistance,1),g.nodeStrength=T(g.nodeStrength,1),g.edgeStrength=T(g.edgeStrength,1);var Q={},G={};d.forEach(function(W,H){(0,_.isNumber)(W.x)||(W.x=Math.random()*g.width),(0,_.isNumber)(W.y)||(W.y=Math.random()*g.height);var Z=g.degreesMap[W.id];Q[W.id]=U(U({},W),{data:U(U({},W.data),{size:g.nodeSize(W)||30,layout:{inDegree:Z.in,outDegree:Z.out,degree:Z.all,tDegree:Z.in,sDegree:Z.out,force:{mass:g.getMass(W),nodeStrength:g.nodeStrength(W,c)}}})}),G[W.id]=H}),g.nodeMap=Q,g.nodeIdxMap=G,g.edgeInfos=[],c==null||c.forEach(function(W){var H=Q[W.source],Z=Q[W.target];!H||!Z?elf.edgeInfos.push({}):g.edgeInfos.push({edgeStrength:g.edgeStrength(W),linkDistance:s?s(U(U({},W),{source:H,target:Z}),H,Z):g.linkDistance(W,H,Z)||1+(M(H)+M(H)||0)/2})}),this.getCentripetalOptions(),g.onLayoutEnd=g.onLayoutEnd||function(){},g.run()},v.prototype.run=function(){var g=this,d=g.maxIteration,c=g.nodes,s=g.edges,m=g.workerEnabled,M=g.minMovement,P=g.animate,R=g.nodeMap,j=g.height;if(g.currentMinY=0,g.currentMaxY=j,!!c){var Q=[];if(c.forEach(function(ne,se){Q[2*se]=0,Q[2*se+1]=0}),this.defSideCoe&&typeof this.defSideCoe=="function"){var G={};s.forEach(function(ne){var se=ne.source,fe=ne.target;G[se]=G[se]||[],G[se].push(ne),G[fe]=G[fe]||[],G[fe].push(ne)}),this.relatedEdges=G}var W=d,H=!P;if(m||H){for(var Z=0,J=0;(g.judgingDistance>M||J<1)&&J<W;J++)Z=J,g.runOneStep(J,Q);g.onLayoutEnd(Object.values(R))}else{if(typeof window=="undefined")return;var K=0;this.timeInterval=window.setInterval(function(){c&&(g.runOneStep(K,Q),K++,(K>=W||g.judgingDistance<M)&&(g.onLayoutEnd(Object.values(R)),window.clearInterval(g.timeInterval)))},0)}}},v.prototype.runOneStep=function(g,d){var c,s=this,m=s.nodes,M=s.edges,P=s.nodeMap,R=s.monitor,j=[];if(m!=null&&m.length){s.calRepulsive(j),M&&s.calAttractive(j),s.calGravity(j),s.attractToSide(j);var Q=s.interval;if(s.updateVelocity(j,d,Q),s.updatePosition(d,Q),(c=s.tick)===null||c===void 0||c.call(s),R){var G=this.calTotalEnergy(j);R({energy:G,nodes:m,edges:M,iterations:g})}}},v.prototype.calTotalEnergy=function(g){var d=this,c=d.nodes,s=d.nodeMap;if(!(c!=null&&c.length))return 0;var m=0;return c.forEach(function(M,P){var R=g[2*P],j=g[2*P+1],Q=R*R+j*j,G=s[M.id].data.layout.force.mass,W=G===void 0?1:G;m+=W*Q*.5}),m},v.prototype.calRepulsive=function(g){var d=this,c=d.nodes,s=d.nodeMap,m=d.factor,M=d.coulombDisScale,P=d.nodeSize;(0,I.forceNBody)(c,s,m,M*M,g)},v.prototype.calAttractive=function(g){var d=this,c=d.edges,s=d.nodeMap,m=d.nodeIdxMap,M=d.edgeInfos,P=d.nodeSize;c.forEach(function(R,j){var Q=(0,_.getEdgeTerminal)(R,"source"),G=(0,_.getEdgeTerminal)(R,"target"),W=s[Q],H=s[G];if(!(!W||!H)){var Z=H.x-W.x,J=H.y-W.y;!Z&&!J&&(Z=Math.random()*.01,J=Math.random()*.01);var K=Math.sqrt(Z*Z+J*J),ne=Z/K,se=J/K,fe=M[j]||{},Ie=fe.linkDistance,ye=Ie===void 0?200:Ie,Ae=fe.edgeStrength,Se=Ae===void 0?200:Ae,we=ye-K,Te=we*Se,ke=W.data.layout.force.mass||1,Ge=H.data.layout.force.mass||1,tt=1/ke,He=1/Ge,ft=ne*Te,Lt=se*Te,Jt=2*m[Q],Qe=2*m[G];g[Jt]-=ft*tt,g[Jt+1]-=Lt*tt,g[Qe]+=ft*He,g[Qe+1]+=Lt*He}})},v.prototype.calGravity=function(g){var d,c=this,s=c.nodes,m=c.edges,M=m===void 0?[]:m,P=c.nodeMap,R=c.width,j=c.height,Q=c.center,G=c.gravity,W=c.degreesMap,H=c.centripetalOptions;if(s)for(var Z=s.length,J=0;J<Z;J++){var K=2*J,ne=P[s[J].id],se=ne.data.layout.force.mass,fe=se===void 0?1:se,Ie=0,ye=0,Ae=G,Se=W[ne.id],we=Se.in,Te=Se.out,ke=Se.all,Ge=(d=c.getCenter)===null||d===void 0?void 0:d.call(c,ne,ke);if(Ge){var tt=Ge[0],He=Ge[1],ft=Ge[2];Ie=ne.x-tt,ye=ne.y-He,Ae=ft}else Ie=ne.x-Q[0],ye=ne.y-Q[1];if(Ae&&(g[K]-=Ae*Ie/fe,g[K+1]-=Ae*ye/fe),H){var Lt=H.leaf,Jt=H.single,Qe=H.others,ut=H.center,xt=(ut==null?void 0:ut(ne,s,M,R,j))||{x:0,y:0,centerStrength:0},dt=xt.x,pt=xt.y,wt=xt.centerStrength;if(!(0,_.isNumber)(dt)||!(0,_.isNumber)(pt))continue;var mt=(ne.x-dt)/fe,ur=(ne.y-pt)/fe;if(wt&&(g[K]-=wt*mt,g[K+1]-=wt*ur),ke===0){var Ir=Jt(ne);if(!Ir)continue;g[K]-=Ir*mt,g[K+1]-=Ir*ur;continue}if(we===0||Te===0){var Nr=Lt(ne,s,M);if(!Nr)continue;g[K]-=Nr*mt,g[K+1]-=Nr*ur;continue}var Hr=Qe(ne);if(!Hr)continue;g[K]-=Hr*mt,g[K+1]-=Hr*ur}}},v.prototype.attractToSide=function(g){var d=this,c=d.defSideCoe,s=d.height,m=d.nodes,M=d.relatedEdges,P=d.currentMinY,R=P===void 0?0:P,j=d.currentMaxY,Q=j===void 0?this.height:j;!c||typeof c!="function"||!(m!=null&&m.length)||m.forEach(function(G,W){var H=c(G,M[G.id]||[]);if(H!==0){var Z=H<0?R:Q,J=Math.abs(H);g[2*W+1]-=J*(G.y-Z)}})},v.prototype.updateVelocity=function(g,d,c){var s=this,m=s.nodes,M=s.damping,P=s.maxSpeed;m!=null&&m.length&&m.forEach(function(R,j){var Q=(d[2*j]+g[2*j]*c)*M||.01,G=(d[2*j+1]+g[2*j+1]*c)*M||.01,W=Math.sqrt(Q*Q+G*G);if(W>P){var H=P/W;Q=H*Q,G=H*G}d[2*j]=Q,d[2*j+1]=G})},v.prototype.updatePosition=function(g,d){var c=this,s=c.nodes,m=c.distanceThresholdMode,M=c.nodeMap;if(!(s!=null&&s.length)){this.judgingDistance=0;return}var P=0;m==="max"?c.judgingDistance=-1/0:m==="min"&&(c.judgingDistance=1/0);var R=1/0,j=-1/0;s.forEach(function(Q,G){var W=M[Q.id];if((0,_.isNumber)(Q.fx)&&(0,_.isNumber)(Q.fy)){Q.x=Q.fx,Q.y=Q.fy,W.x=Q.x,W.y=Q.y;return}var H=g[2*G]*d,Z=g[2*G+1]*d;Q.x+=H,Q.y+=Z,W.x=Q.x,W.y=Q.y,Q.y<R&&(R=Q.y),Q.y>j&&(j=Q.y);var J=Math.sqrt(H*H+Z*Z);switch(m){case"max":c.judgingDistance<J&&(c.judgingDistance=J);break;case"min":c.judgingDistance>J&&(c.judgingDistance=J);break;default:P=P+J;break}}),this.currentMinY=R,this.currentMaxY=j,(!m||m==="mean")&&(c.judgingDistance=P/s.length)},v.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},v.prototype.destroy=function(){var g=this;g.stop(),g.tick=null,g.nodes=null,g.edges=null,g.destroyed=!0},v.prototype.getType=function(){return"force2"},v.prototype.getSameTypeLeafMap=function(){var g=this,d=g.nodeClusterBy,c=g.nodes,s=g.edges,m=g.nodeMap,M=g.degreesMap;if(c!=null&&c.length){var P={};return c.forEach(function(R,j){var Q=M[R.id].all;Q===1&&(P[R.id]=(0,_.getCoreNodeAndRelativeLeafNodes)("leaf",R,s,d,M,m))}),P}},v}(L.Base);N.Force2Layout=x},69445:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(){function k(U){this.id=U.id||0,this.rx=U.rx,this.ry=U.ry,this.fx=0,this.fy=0,this.mass=U.mass,this.degree=U.degree,this.g=U.g||0}return k.prototype.distanceTo=function(U){var L=this.rx-U.rx,_=this.ry-U.ry;return Math.hypot(L,_)},k.prototype.setPos=function(U,L){this.rx=U,this.ry=L},k.prototype.resetForce=function(){this.fx=0,this.fy=0},k.prototype.addForce=function(U){var L=U.rx-this.rx,_=U.ry-this.ry,I=Math.hypot(L,_);I=I<1e-4?1e-4:I;var T=this.g*(this.degree+1)*(U.degree+1)/I;this.fx+=T*L/I,this.fy+=T*_/I},k.prototype.in=function(U){return U.contains(this.rx,this.ry)},k.prototype.add=function(U){var L=this.mass+U.mass,_=(this.rx*this.mass+U.rx*U.mass)/L,I=(this.ry*this.mass+U.ry*U.mass)/L,T=this.degree+U.degree,x={rx:_,ry:I,mass:L,degree:T};return new k(x)},k}();N.default=F},54255:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var v=function(g,d){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,s){c.__proto__=s}||function(c,s){for(var m in s)Object.prototype.hasOwnProperty.call(s,m)&&(c[m]=s[m])},v(g,d)};return function(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");v(g,d);function c(){this.constructor=g}g.prototype=d===null?Object.create(d):(c.prototype=d.prototype,new c)}}(),U=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(N,"__esModule",{value:!0}),N.ForceAtlas2Layout=void 0;var L=F(46833),_=F(44941),I=U(F(69445)),T=U(F(16067)),x=U(F(80374)),p=function(v){k(g,v);function g(d){var c=v.call(this)||this;return c.center=[0,0],c.width=300,c.height=300,c.nodes=[],c.edges=[],c.kr=5,c.kg=1,c.mode="normal",c.preventOverlap=!1,c.dissuadeHubs=!1,c.barnesHut=void 0,c.maxIteration=0,c.ks=.1,c.ksmax=10,c.tao=.1,c.onLayoutEnd=function(){},c.prune=void 0,c.updateCfg(d),c}return g.prototype.getDefaultCfg=function(){return{}},g.prototype.execute=function(){var d=this,c=d.nodes,s=d.onLayoutEnd,m=d.prune,M=d.maxIteration;!d.width&&typeof window!="undefined"&&(d.width=window.innerWidth),!d.height&&typeof window!="undefined"&&(d.height=window.innerHeight);for(var P=[],R=c.length,j=0;j<R;j+=1){var Q=c[j],G=10,W=10;(0,_.isNumber)(Q.size)&&(G=Q.size,W=Q.size),(0,_.isArray)(Q.size)?(isNaN(Q.size[0])||(G=Q.size[0]),isNaN(Q.size[1])||(W=Q.size[1])):(0,_.isObject)(Q.size)&&(G=Q.size.width,W=Q.size.height),d.getWidth&&!isNaN(d.getWidth(Q))&&(W=d.getWidth(Q)),d.getHeight&&!isNaN(d.getHeight(Q))&&(G=d.getHeight(Q));var H=Math.max(G,W);P.push(H)}d.barnesHut===void 0&&R>250&&(d.barnesHut=!0),d.prune===void 0&&R>100&&(d.prune=!0),this.maxIteration===0&&!d.prune?(M=250,R<=200&&R>100?M=1e3:R>200&&(M=1200),this.maxIteration=M):this.maxIteration===0&&m&&(M=100,R<=200&&R>100?M=500:R>200&&(M=950),this.maxIteration=M),d.kr||(d.kr=50,R>100&&R<=500?d.kr=20:R>500&&(d.kr=1)),d.kg||(d.kg=20,R>100&&R<=500?d.kg=10:R>500&&(d.kg=1)),this.nodes=d.updateNodesByForces(P),s()},g.prototype.updateNodesByForces=function(d){for(var c=this,s=c.edges,m=c.maxIteration,M=c.nodes,P=s.filter(function(Se){var we=(0,_.getEdgeTerminal)(Se,"source"),Te=(0,_.getEdgeTerminal)(Se,"target");return we!==Te}),R=M.length,j=P.length,Q=[],G={},W={},H=[],Z=0;Z<R;Z+=1)G[M[Z].id]=Z,Q[Z]=0,(M[Z].x===void 0||isNaN(M[Z].x))&&(M[Z].x=Math.random()*1e3),(M[Z].y===void 0||isNaN(M[Z].y))&&(M[Z].y=Math.random()*1e3),H.push({x:M[Z].x,y:M[Z].y});for(var Z=0;Z<j;Z+=1){for(var J=void 0,K=void 0,ne=0,se=0,fe=0;fe<R;fe+=1){var Ie=(0,_.getEdgeTerminal)(P[Z],"source"),ye=(0,_.getEdgeTerminal)(P[Z],"target");M[fe].id===Ie?(J=M[fe],ne=fe):M[fe].id===ye&&(K=M[fe],se=fe),W[Z]={sourceIdx:ne,targetIdx:se}}J&&(Q[G[J.id]]+=1),K&&(Q[G[K.id]]+=1)}var Ae=m;if(M=this.iterate(Ae,G,W,j,Q,d),c.prune){for(var fe=0;fe<j;fe+=1)Q[W[fe].sourceIdx]<=1?(M[W[fe].sourceIdx].x=M[W[fe].targetIdx].x,M[W[fe].sourceIdx].y=M[W[fe].targetIdx].y):Q[W[fe].targetIdx]<=1&&(M[W[fe].targetIdx].x=M[W[fe].sourceIdx].x,M[W[fe].targetIdx].y=M[W[fe].sourceIdx].y);c.prune=!1,c.barnesHut=!1,Ae=100,M=this.iterate(Ae,G,W,j,Q,d)}return M},g.prototype.iterate=function(d,c,s,m,M,P){for(var R=this,j=R.nodes,Q=R.kr,G=R.preventOverlap,W=R.barnesHut,H=j.length,Z=0,J=100,K=d,ne=50,se=[],fe=[],Ie=[],ye=0;ye<H;ye+=1)if(se[2*ye]=0,se[2*ye+1]=0,W){var Ae={id:ye,rx:j[ye].x,ry:j[ye].y,mass:1,g:Q,degree:M[ye]};Ie[ye]=new I.default(Ae)}for(;K>0;){for(var ye=0;ye<H;ye+=1)fe[2*ye]=se[2*ye],fe[2*ye+1]=se[2*ye+1],se[2*ye]=0,se[2*ye+1]=0;se=this.getAttrForces(K,ne,m,c,s,M,P,se),W&&(G&&K>ne||!G)?se=this.getOptRepGraForces(se,Ie,M):se=this.getRepGraForces(K,ne,se,J,P,M);var Se=this.updatePos(se,fe,Z,M);j=Se.nodes,Z=Se.sg,K--,R.tick&&R.tick()}return j},g.prototype.getAttrForces=function(d,c,s,m,M,P,R,j){for(var Q=this,G=Q.nodes,W=Q.preventOverlap,H=Q.dissuadeHubs,Z=Q.mode,J=Q.prune,K=0;K<s;K+=1){var ne=G[M[K].sourceIdx],se=M[K].sourceIdx,fe=G[M[K].targetIdx],Ie=M[K].targetIdx;if(!(J&&(P[se]<=1||P[Ie]<=1))){var ye=[fe.x-ne.x,fe.y-ne.y],Ae=Math.hypot(ye[0],ye[1]);Ae=Ae<1e-4?1e-4:Ae,ye[0]=ye[0]/Ae,ye[1]=ye[1]/Ae,W&&d<c&&(Ae=Ae-R[se]-R[Ie]);var Se=Ae,we=Se;Z==="linlog"&&(Se=Math.log(1+Ae),we=Se),H&&(Se=Ae/P[se],we=Ae/P[Ie]),W&&d<c&&Ae<=0?(Se=0,we=0):W&&d<c&&Ae>0&&(Se=Ae,we=Ae),j[2*m[ne.id]]+=Se*ye[0],j[2*m[fe.id]]-=we*ye[0],j[2*m[ne.id]+1]+=Se*ye[1],j[2*m[fe.id]+1]-=we*ye[1]}}return j},g.prototype.getRepGraForces=function(d,c,s,m,M,P){for(var R=this,j=R.nodes,Q=R.preventOverlap,G=R.kr,W=R.kg,H=R.center,Z=R.prune,J=j.length,K=0;K<J;K+=1){for(var ne=K+1;ne<J;ne+=1)if(!(Z&&(P[K]<=1||P[ne]<=1))){var se=[j[ne].x-j[K].x,j[ne].y-j[K].y],fe=Math.hypot(se[0],se[1]);fe=fe<1e-4?1e-4:fe,se[0]=se[0]/fe,se[1]=se[1]/fe,Q&&d<c&&(fe=fe-M[K]-M[ne]);var Ie=G*(P[K]+1)*(P[ne]+1)/fe;Q&&d<c&&fe<0?Ie=m*(P[K]+1)*(P[ne]+1):Q&&d<c&&fe===0?Ie=0:Q&&d<c&&fe>0&&(Ie=G*(P[K]+1)*(P[ne]+1)/fe),s[2*K]-=Ie*se[0],s[2*ne]+=Ie*se[0],s[2*K+1]-=Ie*se[1],s[2*ne+1]+=Ie*se[1]}var ye=[j[K].x-H[0],j[K].y-H[1]],Ae=Math.hypot(ye[0],ye[1]);ye[0]=ye[0]/Ae,ye[1]=ye[1]/Ae;var Se=W*(P[K]+1);s[2*K]-=Se*ye[0],s[2*K+1]-=Se*ye[1]}return s},g.prototype.getOptRepGraForces=function(d,c,s){for(var m=this,M=m.nodes,P=m.kg,R=m.center,j=m.prune,Q=M.length,G=9e10,W=-9e10,H=9e10,Z=-9e10,J=0;J<Q;J+=1)j&&s[J]<=1||(c[J].setPos(M[J].x,M[J].y),M[J].x>=W&&(W=M[J].x),M[J].x<=G&&(G=M[J].x),M[J].y>=Z&&(Z=M[J].y),M[J].y<=H&&(H=M[J].y));for(var K=Math.max(W-G,Z-H),ne={xmid:(W+G)/2,ymid:(Z+H)/2,length:K,massCenter:R,mass:Q},se=new T.default(ne),fe=new x.default(se),J=0;J<Q;J+=1)j&&s[J]<=1||c[J].in(se)&&fe.insert(c[J]);for(var J=0;J<Q;J+=1)if(!(j&&s[J]<=1)){c[J].resetForce(),fe.updateForce(c[J]),d[2*J]-=c[J].fx,d[2*J+1]-=c[J].fy;var Ie=[M[J].x-R[0],M[J].y-R[1]],ye=Math.hypot(Ie[0],Ie[1]);ye=ye<1e-4?1e-4:ye,Ie[0]=Ie[0]/ye,Ie[1]=Ie[1]/ye;var Ae=P*(s[J]+1);d[2*J]-=Ae*Ie[0],d[2*J+1]-=Ae*Ie[1]}return d},g.prototype.updatePos=function(d,c,s,m){for(var M=this,P=M.nodes,R=M.ks,j=M.tao,Q=M.prune,G=M.ksmax,W=P.length,H=[],Z=[],J=0,K=0,ne=0;ne<W;ne+=1)if(!(Q&&m[ne]<=1)){var se=[d[2*ne]-c[2*ne],d[2*ne+1]-c[2*ne+1]],fe=Math.hypot(se[0],se[1]),Ie=[d[2*ne]+c[2*ne],d[2*ne+1]+c[2*ne+1]],ye=Math.hypot(Ie[0],Ie[1]);H[ne]=fe,Z[ne]=ye/2,J+=(m[ne]+1)*H[ne],K+=(m[ne]+1)*Z[ne]}var Ae=s;s=j*K/J,Ae!==0&&(s=s>1.5*Ae?1.5*Ae:s);for(var ne=0;ne<W;ne+=1)if(!(Q&&m[ne]<=1)&&!((0,_.isNumber)(P[ne].fx)&&(0,_.isNumber)(P[ne].fy))){var Se=R*s/(1+s*Math.sqrt(H[ne])),we=Math.hypot(d[2*ne],d[2*ne+1]);we=we<1e-4?1e-4:we;var Te=G/we;Se=Se>Te?Te:Se;var ke=Se*d[2*ne],Ge=Se*d[2*ne+1];P[ne].x+=ke,P[ne].y+=Ge}return{nodes:P,sg:s}},g}(L.Base);N.ForceAtlas2Layout=p},16067:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(){function k(U){this.xmid=U.xmid,this.ymid=U.ymid,this.length=U.length,this.massCenter=U.massCenter||[0,0],this.mass=U.mass||1}return k.prototype.getLength=function(){return this.length},k.prototype.contains=function(U,L){var _=this.length/2;return U<=this.xmid+_&&U>=this.xmid-_&&L<=this.ymid+_&&L>=this.ymid-_},k.prototype.NW=function(){var U=this.xmid-this.length/4,L=this.ymid+this.length/4,_=this.length/2,I={xmid:U,ymid:L,length:_},T=new k(I);return T},k.prototype.NE=function(){var U=this.xmid+this.length/4,L=this.ymid+this.length/4,_=this.length/2,I={xmid:U,ymid:L,length:_},T=new k(I);return T},k.prototype.SW=function(){var U=this.xmid-this.length/4,L=this.ymid-this.length/4,_=this.length/2,I={xmid:U,ymid:L,length:_},T=new k(I);return T},k.prototype.SE=function(){var U=this.xmid+this.length/4,L=this.ymid-this.length/4,_=this.length/2,I={xmid:U,ymid:L,length:_},T=new k(I);return T},k}();N.default=F},80374:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=function(){function k(U){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,U!=null&&(this.quad=U)}return k.prototype.insert=function(U){if(this.body==null){this.body=U;return}this._isExternal()?(this.quad&&(this.NW=new k(this.quad.NW()),this.NE=new k(this.quad.NE()),this.SW=new k(this.quad.SW()),this.SE=new k(this.quad.SE())),this._putBody(this.body),this._putBody(U),this.body=this.body.add(U)):(this.body=this.body.add(U),this._putBody(U))},k.prototype._putBody=function(U){this.quad&&(U.in(this.quad.NW())&&this.NW?this.NW.insert(U):U.in(this.quad.NE())&&this.NE?this.NE.insert(U):U.in(this.quad.SW())&&this.SW?this.SW.insert(U):U.in(this.quad.SE())&&this.SE&&this.SE.insert(U))},k.prototype._isExternal=function(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null},k.prototype.updateForce=function(U){if(!(this.body==null||U===this.body))if(this._isExternal())U.addForce(this.body);else{var L=this.quad?this.quad.getLength():0,_=this.body.distanceTo(U);L/_<this.theta?U.addForce(this.body):(this.NW&&this.NW.updateForce(U),this.NE&&this.NE.updateForce(U),this.SW&&this.SW.updateForce(U),this.SE&&this.SE.updateForce(U))}},k}();N.default=F},8689:function(Mt,N,F){"use strict";var k=this&&this.__createBinding||(Object.create?function(x,p,v,g){g===void 0&&(g=v);var d=Object.getOwnPropertyDescriptor(p,v);(!d||("get"in d?!p.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return p[v]}}),Object.defineProperty(x,g,d)}:function(x,p,v,g){g===void 0&&(g=v),x[g]=p[v]}),U=this&&this.__setModuleDefault||(Object.create?function(x,p){Object.defineProperty(x,"default",{enumerable:!0,value:p})}:function(x,p){x.default=p}),L=this&&this.__importStar||function(x){if(x&&x.__esModule)return x;var p={};if(x!=null)for(var v in x)v!=="default"&&Object.prototype.hasOwnProperty.call(x,v)&&k(p,x,v);return U(p,x),p};Object.defineProperty(N,"__esModule",{value:!0});var _=L(F(36074)),I=F(44941);function T(){function x(wt){return function(){return wt}}var p=function(wt){return wt.cluster},v=x(1),g=x(-1),d=x(100),c=x(.1),s=[0,0],m=[],M={},P=[],R=100,j=100,Q={none:{x:0,y:0}},G=[],W,H="force",Z=!0,J=.1;function K(wt){if(!Z)return K;W.tick(),Ae();for(var mt=0,ur=m.length,Ir=void 0,Nr=wt*J;mt<ur;++mt)Ir=m[mt],Ir.vx+=(Q[p(Ir)].x-Ir.x)*Nr,Ir.vy+=(Q[p(Ir)].y-Ir.y)*Nr}function ne(){m&&se()}function se(){if(!(!m||!m.length)){if(p(m[0])===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var wt=fe();W=_.forceSimulation(wt.nodes).force("x",_.forceX(R).strength(.1)).force("y",_.forceY(j).strength(.1)).force("collide",_.forceCollide(function(mt){return mt.r}).iterations(4)).force("charge",_.forceManyBody().strength(g)).force("links",_.forceLink(wt.nodes.length?wt.links:[]).distance(d).strength(c)),G=W.nodes(),Ae()}}function fe(){var wt=[],mt=[],ur={},Ir=[],Nr={},Hr=[];return Nr=Ie(m),Hr=ye(P),Ir=Object.keys(Nr),Ir.forEach(function(It,qt){var ar=Nr[It];wt.push({id:It,size:ar.count,r:Math.sqrt(ar.sumforceNodeSize/Math.PI)}),ur[It]=qt}),Hr.forEach(function(It){var qt=(0,I.getEdgeTerminal)(It,"source"),ar=(0,I.getEdgeTerminal)(It,"target"),Oe=ur[qt],Pr=ur[ar];Oe!==void 0&&Pr!==void 0&&mt.push({source:Oe,target:Pr,count:It.count})}),{nodes:wt,links:mt}}function Ie(wt){var mt={};return wt.forEach(function(ur){var Ir=p(ur);mt[Ir]||(mt[Ir]={count:0,sumforceNodeSize:0})}),wt.forEach(function(ur){var Ir=p(ur),Nr=v(ur),Hr=mt[Ir];Hr.count=Hr.count+1,Hr.sumforceNodeSize=Hr.sumforceNodeSize+Math.PI*(Nr*Nr)*1.3,mt[Ir]=Hr}),mt}function ye(wt){var mt={},ur=[];wt.forEach(function(Nr){var Hr=Se(Nr),It=0;mt[Hr]!==void 0&&(It=mt[Hr]),It+=1,mt[Hr]=It});var Ir=Object.entries(mt);return Ir.forEach(function(Nr){var Hr=Nr[0],It=Nr[1],qt=Hr.split("~")[0],ar=Hr.split("~")[1];qt!==void 0&&ar!==void 0&&ur.push({source:qt,target:ar,count:It})}),ur}function Ae(){return Q={none:{x:0,y:0}},G.forEach(function(wt){Q[wt.id]={x:wt.x-s[0],y:wt.y-s[1]}}),Q}function Se(wt){var mt=(0,I.getEdgeTerminal)(wt,"source"),ur=(0,I.getEdgeTerminal)(wt,"target"),Ir=p(M[mt]),Nr=p(M[ur]);return Ir<=Nr?"".concat(Ir,"~").concat(Nr):"".concat(Nr,"~").concat(Ir)}function we(wt){M={},wt.forEach(function(mt){M[mt.id]=mt})}function Te(wt){return arguments.length?(H=wt,ne(),K):H}function ke(wt){return arguments.length?typeof wt=="string"?(p=function(mt){return mt[wt]},K):(p=wt,K):p}function Ge(wt){return arguments.length?(Z=wt,K):Z}function tt(wt){return arguments.length?(J=wt,K):J}function He(wt){return arguments.length?(R=wt,K):R}function ft(wt){return arguments.length?(j=wt,K):j}function Lt(wt){return arguments.length?(we(wt||[]),m=wt||[],K):m}function Jt(wt){return arguments.length?(P=wt||[],ne(),K):P}function Qe(wt){return arguments.length?(typeof wt=="function"?v=wt:v=x(+wt),ne(),K):v}function ut(wt){return arguments.length?(typeof wt=="function"?g=wt:g=x(+wt),ne(),K):g}function xt(wt){return arguments.length?(typeof wt=="function"?d=wt:d=x(+wt),ne(),K):d}function dt(wt){return arguments.length?(typeof wt=="function"?c=wt:c=x(+wt),ne(),K):c}function pt(wt){return arguments.length?(s=wt,K):s}return K.initialize=function(wt){m=wt,ne()},K.template=Te,K.groupBy=ke,K.enableGrouping=Ge,K.strength=tt,K.centerX=He,K.centerY=ft,K.nodes=Lt,K.links=Jt,K.forceNodeSize=Qe,K.nodeSize=K.forceNodeSize,K.forceCharge=ut,K.forceLinkDistance=xt,K.forceLinkStrength=dt,K.offset=pt,K.getFocis=Ae,K}N.default=T},84022:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var m=function(M,P){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,j){R.__proto__=j}||function(R,j){for(var Q in j)Object.prototype.hasOwnProperty.call(j,Q)&&(R[Q]=j[Q])},m(M,P)};return function(M,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");m(M,P);function R(){this.constructor=M}M.prototype=P===null?Object.create(P):(R.prototype=P.prototype,new R)}}(),U=this&&this.__createBinding||(Object.create?function(m,M,P,R){R===void 0&&(R=P);var j=Object.getOwnPropertyDescriptor(M,P);(!j||("get"in j?!M.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return M[P]}}),Object.defineProperty(m,R,j)}:function(m,M,P,R){R===void 0&&(R=P),m[R]=M[P]}),L=this&&this.__setModuleDefault||(Object.create?function(m,M){Object.defineProperty(m,"default",{enumerable:!0,value:M})}:function(m,M){m.default=M}),_=this&&this.__importStar||function(m){if(m&&m.__esModule)return m;var M={};if(m!=null)for(var P in m)P!=="default"&&Object.prototype.hasOwnProperty.call(m,P)&&U(M,m,P);return L(M,m),M},I=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(N,"__esModule",{value:!0}),N.ForceLayout=void 0;var T=_(F(36074)),x=I(F(8689)),p=F(44941),v=F(46833),g=F(72939),d=function(m){k(M,m);function M(P){var R=m.call(this)||this;return R.center=[0,0],R.nodeStrength=null,R.edgeStrength=null,R.preventOverlap=!1,R.clusterNodeStrength=null,R.clusterEdgeStrength=null,R.clusterEdgeDistance=null,R.clusterNodeSize=null,R.clusterFociStrength=null,R.linkDistance=50,R.alphaDecay=.028,R.alphaMin=.001,R.alpha=.3,R.collideStrength=1,R.workerEnabled=!1,R.tick=function(){},R.onLayoutEnd=function(){},R.ticking=void 0,P&&R.updateCfg(P),R}return M.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},M.prototype.init=function(P){var R=this;R.nodes=P.nodes||[];var j=P.edges||[];R.edges=j.map(function(Q){var G={},W=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(Q).forEach(function(H){W.indexOf(H)>-1||(G[H]=Q[H])}),G}),R.ticking=!1},M.prototype.execute=function(P){var R=this,j=R.nodes,Q=R.edges;if(!R.ticking){var G=R.forceSimulation,W=R.alphaMin,H=R.alphaDecay,Z=R.alpha;if(G){if(P){if(R.clustering&&R.clusterForce&&(R.clusterForce.nodes(j),R.clusterForce.links(Q)),G.nodes(j),Q&&R.edgeForce)R.edgeForce.links(Q);else if(Q&&!R.edgeForce){var ne=T.forceLink().id(function(ye){return ye.id}).links(Q);R.edgeStrength&&ne.strength(R.edgeStrength),R.linkDistance&&ne.distance(R.linkDistance),R.edgeForce=ne,G.force("link",ne)}}R.preventOverlap&&R.overlapProcess(G),G.alpha(Z).restart(),this.ticking=!0}else try{var J=T.forceManyBody();if(R.nodeStrength&&J.strength(R.nodeStrength),G=T.forceSimulation().nodes(j),R.clustering){var K=(0,x.default)();K.centerX(R.center[0]).centerY(R.center[1]).template("force").strength(R.clusterFociStrength),Q&&K.links(Q),j&&K.nodes(j),K.forceLinkDistance(R.clusterEdgeDistance).forceLinkStrength(R.clusterEdgeStrength).forceCharge(R.clusterNodeStrength).forceNodeSize(R.clusterNodeSize),R.clusterForce=K,G.force("group",K)}if(G.force("center",T.forceCenter(R.center[0],R.center[1])).force("charge",J).alpha(Z).alphaDecay(H).alphaMin(W),R.preventOverlap&&R.overlapProcess(G),Q){var ne=T.forceLink().id(function(Ie){return Ie.id}).links(Q);R.edgeStrength&&ne.strength(R.edgeStrength),R.linkDistance&&ne.distance(R.linkDistance),R.edgeForce=ne,G.force("link",ne)}if(R.workerEnabled&&!s()&&(R.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!R.workerEnabled)G.on("tick",function(){R.tick()}).on("end",function(){R.ticking=!1,R.onLayoutEnd&&R.onLayoutEnd()}),R.ticking=!0;else{G.stop();for(var se=c(G),fe=1;fe<=se;fe++)G.tick(),postMessage({nodes:j,currentTick:fe,totalTicks:se,type:g.LAYOUT_MESSAGE.TICK},void 0);R.ticking=!1}R.forceSimulation=G,R.ticking=!0}catch(Ie){R.ticking=!1,console.warn(Ie)}}},M.prototype.overlapProcess=function(P){var R=this,j=R.nodeSize,Q=R.nodeSpacing,G,W,H=R.collideStrength;if((0,p.isNumber)(Q)?W=function(){return Q}:(0,p.isFunction)(Q)?W=Q:W=function(){return 0},!j)G=function(ne){if(ne.size){if((0,p.isArray)(ne.size)){var se=ne.size[0]>ne.size[1]?ne.size[0]:ne.size[1];return se/2+W(ne)}if((0,p.isObject)(ne.size)){var se=ne.size.width>ne.size.height?ne.size.width:ne.size.height;return se/2+W(ne)}return ne.size/2+W(ne)}return 10+W(ne)};else if((0,p.isFunction)(j))G=function(ne){var se=j(ne);return se+W(ne)};else if((0,p.isArray)(j)){var Z=j[0]>j[1]?j[0]:j[1],J=Z/2;G=function(ne){return J+W(ne)}}else if((0,p.isNumber)(j)){var K=j/2;G=function(ne){return K+W(ne)}}else G=function(){return 10};P.force("collisionForce",T.forceCollide(G).strength(H))},M.prototype.updateCfg=function(P){var R=this;R.ticking&&(R.forceSimulation.stop(),R.ticking=!1),R.forceSimulation=null,Object.assign(R,P)},M.prototype.destroy=function(){var P=this;P.ticking&&(P.forceSimulation.stop(),P.ticking=!1),P.nodes=null,P.edges=null,P.destroyed=!0},M}(v.Base);N.ForceLayout=d;function c(m){var M=m.alphaMin(),P=m.alphaTarget(),R=m.alpha(),j=Math.log((M-P)/(R-P))/Math.log(1-m.alphaDecay()),Q=Math.ceil(j);return Q}function s(){return typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope}},22457:function(Mt,N,F){"use strict";var k=this&&this.__createBinding||(Object.create?function(L,_,I,T){T===void 0&&(T=I);var x=Object.getOwnPropertyDescriptor(_,I);(!x||("get"in x?!_.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return _[I]}}),Object.defineProperty(L,T,x)}:function(L,_,I,T){T===void 0&&(T=I),L[T]=_[I]}),U=this&&this.__exportStar||function(L,_){for(var I in L)I!=="default"&&!Object.prototype.hasOwnProperty.call(_,I)&&k(_,L,I)};Object.defineProperty(N,"__esModule",{value:!0}),U(F(84022),N)},92627:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var T=function(x,p){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},T(x,p)};return function(x,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");T(x,p);function v(){this.constructor=x}x.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.FruchtermanLayout=void 0;var U=F(46833),L=F(44941),_=800,I=function(T){k(x,T);function x(p){var v=T.call(this)||this;return v.maxIteration=1e3,v.workerEnabled=!1,v.gravity=10,v.speed=5,v.clustering=!1,v.clusterGravity=10,v.nodes=[],v.edges=[],v.width=300,v.height=300,v.nodeMap={},v.nodeIdxMap={},v.onLayoutEnd=function(){},v.tick=function(){},v.animate=!0,v.updateCfg(p),v}return x.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},x.prototype.execute=function(){var p=this,v,g,d=this,c=d.nodes;if(d.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(d.timeInterval),!c||c.length===0){(v=d.onLayoutEnd)===null||v===void 0||v.call(d);return}!d.width&&typeof window!="undefined"&&(d.width=window.innerWidth),!d.height&&typeof window!="undefined"&&(d.height=window.innerHeight),d.center||(d.center=[d.width/2,d.height/2]);var s=d.center;if(c.length===1){c[0].x=s[0],c[0].y=s[1],(g=d.onLayoutEnd)===null||g===void 0||g.call(d);return}var m={},M={};return c.forEach(function(P,R){(0,L.isNumber)(P.x)||(P.x=Math.random()*p.width),(0,L.isNumber)(P.y)||(P.y=Math.random()*p.height),m[P.id]=P,M[P.id]=R}),d.nodeMap=m,d.nodeIdxMap=M,d.run()},x.prototype.run=function(){var p,v=this,g=v.nodes;if(g){var d=v.edges,c=v.maxIteration,s=v.workerEnabled,m=v.clustering,M=v.animate,P={};if(m&&g.forEach(function(Q){P[Q.cluster]===void 0&&(P[Q.cluster]={name:Q.cluster,cx:0,cy:0,count:0})}),s||!M){for(var R=0;R<c;R++)v.runOneStep(P);(p=v.onLayoutEnd)===null||p===void 0||p.call(v)}else{if(typeof window=="undefined")return;var j=0;this.timeInterval=window.setInterval(function(){var Q;v.runOneStep(P),j++,j>=c&&((Q=v.onLayoutEnd)===null||Q===void 0||Q.call(v),window.clearInterval(v.timeInterval))},0)}return{nodes:g,edges:d}}},x.prototype.runOneStep=function(p){var v,g=this,d=g.nodes;if(d){var c=g.edges,s=g.center,m=g.gravity,M=g.speed,P=g.clustering,R=g.height*g.width,j=Math.sqrt(R)/10,Q=R/(d.length+1),G=Math.sqrt(Q),W=[];if(d.forEach(function(J,K){W[K]={x:0,y:0}}),g.applyCalculate(d,c,W,G,Q),P){for(var H in p)p[H].cx=0,p[H].cy=0,p[H].count=0;d.forEach(function(J){var K=p[J.cluster];(0,L.isNumber)(J.x)&&(K.cx+=J.x),(0,L.isNumber)(J.y)&&(K.cy+=J.y),K.count++});for(var H in p)p[H].cx/=p[H].count,p[H].cy/=p[H].count;var Z=g.clusterGravity||m;d.forEach(function(J,K){if(!(!(0,L.isNumber)(J.x)||!(0,L.isNumber)(J.y))){var ne=p[J.cluster],se=Math.sqrt((J.x-ne.cx)*(J.x-ne.cx)+(J.y-ne.cy)*(J.y-ne.cy)),fe=G*Z;W[K].x-=fe*(J.x-ne.cx)/se,W[K].y-=fe*(J.y-ne.cy)/se}})}d.forEach(function(J,K){if(!(!(0,L.isNumber)(J.x)||!(0,L.isNumber)(J.y))){var ne=.01*G*m;W[K].x-=ne*(J.x-s[0]),W[K].y-=ne*(J.y-s[1])}}),d.forEach(function(J,K){if((0,L.isNumber)(J.fx)&&(0,L.isNumber)(J.fy)){J.x=J.fx,J.y=J.fy;return}if(!(!(0,L.isNumber)(J.x)||!(0,L.isNumber)(J.y))){var ne=Math.sqrt(W[K].x*W[K].x+W[K].y*W[K].y);if(ne>0){var se=Math.min(j*(M/_),ne);J.x+=W[K].x/ne*se,J.y+=W[K].y/ne*se}}}),(v=g.tick)===null||v===void 0||v.call(g)}},x.prototype.applyCalculate=function(p,v,g,d,c){var s=this;s.calRepulsive(p,g,c),v&&s.calAttractive(v,g,d)},x.prototype.calRepulsive=function(p,v,g){p.forEach(function(d,c){v[c]={x:0,y:0},p.forEach(function(s,m){if(c!==m&&!(!(0,L.isNumber)(d.x)||!(0,L.isNumber)(s.x)||!(0,L.isNumber)(d.y)||!(0,L.isNumber)(s.y))){var M=d.x-s.x,P=d.y-s.y,R=M*M+P*P;if(R===0){R=1;var j=c>m?1:-1;M=.01*j,P=.01*j}var Q=g/R;v[c].x+=M*Q,v[c].y+=P*Q}})})},x.prototype.calAttractive=function(p,v,g){var d=this;p.forEach(function(c){var s=(0,L.getEdgeTerminal)(c,"source"),m=(0,L.getEdgeTerminal)(c,"target");if(!(!s||!m)){var M=d.nodeIdxMap[s],P=d.nodeIdxMap[m];if(M!==P){var R=d.nodeMap[s],j=d.nodeMap[m];if(!(!(0,L.isNumber)(j.x)||!(0,L.isNumber)(R.x)||!(0,L.isNumber)(j.y)||!(0,L.isNumber)(R.y))){var Q=j.x-R.x,G=j.y-R.y,W=Math.sqrt(Q*Q+G*G),H=W*W/g;v[P].x-=Q/W*H,v[P].y-=G/W*H,v[M].x+=Q/W*H,v[M].y+=G/W*H}}}})},x.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},x.prototype.destroy=function(){var p=this;p.stop(),p.tick=null,p.nodes=null,p.edges=null,p.destroyed=!0},x.prototype.getType=function(){return"fruchterman"},x}(U.Base);N.FruchtermanLayout=I},83254:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var T=function(x,p){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},T(x,p)};return function(x,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");T(x,p);function v(){this.constructor=x}x.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.GForceLayout=void 0;var U=F(46833),L=F(44941),_=function(T,x){var p;return T?(0,L.isNumber)(T)?p=function(v){return T}:p=T:p=function(v){return x||1},p},I=function(T){k(x,T);function x(p){var v=T.call(this)||this;return v.maxIteration=500,v.workerEnabled=!1,v.edgeStrength=200,v.nodeStrength=1e3,v.coulombDisScale=.005,v.damping=.9,v.maxSpeed=1e3,v.minMovement=.5,v.interval=.02,v.factor=1,v.linkDistance=1,v.gravity=10,v.preventOverlap=!0,v.collideStrength=1,v.tick=function(){},v.nodes=[],v.edges=[],v.width=300,v.height=300,v.nodeMap={},v.nodeIdxMap={},v.animate=!0,v.updateCfg(p),v}return x.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},x.prototype.execute=function(){var p,v,g=this,d=g.nodes;if(g.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(g.timeInterval),!d||d.length===0){(p=g.onLayoutEnd)===null||p===void 0||p.call(g);return}!g.width&&typeof window!="undefined"&&(g.width=window.innerWidth),!g.height&&typeof window!="undefined"&&(g.height=window.innerHeight),g.center||(g.center=[g.width/2,g.height/2]);var c=g.center;if(d.length===1){d[0].x=c[0],d[0].y=c[1],(v=g.onLayoutEnd)===null||v===void 0||v.call(g);return}var s={},m={};d.forEach(function(G,W){(0,L.isNumber)(G.x)||(G.x=Math.random()*g.width),(0,L.isNumber)(G.y)||(G.y=Math.random()*g.height),s[G.id]=G,m[G.id]=W}),g.nodeMap=s,g.nodeIdxMap=m,g.linkDistance=_(g.linkDistance,1),g.nodeStrength=_(g.nodeStrength,1),g.edgeStrength=_(g.edgeStrength,1);var M=g.nodeSize,P;if(g.preventOverlap){var R=g.nodeSpacing,j;(0,L.isNumber)(R)?j=function(){return R}:(0,L.isFunction)(R)?j=R:j=function(){return 0},M?(0,L.isArray)(M)?P=function(G){return Math.max(M[0],M[1])+j(G)}:P=function(G){return M+j(G)}:P=function(G){return G.size?(0,L.isArray)(G.size)?Math.max(G.size[0],G.size[1])+j(G):(0,L.isObject)(G.size)?Math.max(G.size.width,G.size.height)+j(G):G.size+j(G):10+j(G)}}g.nodeSize=P;var Q=g.edges;g.degrees=(0,L.getDegree)(d.length,g.nodeIdxMap,Q),g.getMass||(g.getMass=function(G){var W=G.mass||g.degrees[g.nodeIdxMap[G.id]].all||1;return W}),g.run()},x.prototype.run=function(){var p,v=this,g=v.maxIteration,d=v.nodes,c=v.workerEnabled,s=v.minMovement,m=v.animate;if(d)if(c||!m){for(var M=0;M<g;M++){var P=v.runOneStep(M);if(v.reachMoveThreshold(d,P,s))break}(p=v.onLayoutEnd)===null||p===void 0||p.call(v)}else{if(typeof window=="undefined")return;var R=0;this.timeInterval=window.setInterval(function(){var j,Q;if(d){var G=v.runOneStep(R)||[];v.reachMoveThreshold(d,G,s)&&((j=v.onLayoutEnd)===null||j===void 0||j.call(v),window.clearInterval(v.timeInterval)),R++,R>=g&&((Q=v.onLayoutEnd)===null||Q===void 0||Q.call(v),window.clearInterval(v.timeInterval))}},0)}},x.prototype.reachMoveThreshold=function(p,v,g){var d=0;return p.forEach(function(c,s){var m=c.x-v[s].x,M=c.y-v[s].y;d+=Math.sqrt(m*m+M*M)}),d/=p.length,d<g},x.prototype.runOneStep=function(p){var v,g=this,d=g.nodes,c=g.edges,s=[],m=[];if(d){d.forEach(function(R,j){s[2*j]=0,s[2*j+1]=0,m[2*j]=0,m[2*j+1]=0}),g.calRepulsive(s,d),c&&g.calAttractive(s,c),g.calGravity(s,d);var M=Math.max(.02,g.interval-p*.002);g.updateVelocity(s,m,M,d);var P=[];return d.forEach(function(R){P.push({x:R.x,y:R.y})}),g.updatePosition(m,M,d),(v=g.tick)===null||v===void 0||v.call(g),P}},x.prototype.calRepulsive=function(p,v){var g=this,d=g.getMass,c=g.factor,s=g.coulombDisScale,m=g.preventOverlap,M=g.collideStrength,P=M===void 0?1:M,R=g.nodeStrength,j=g.nodeSize;v.forEach(function(Q,G){var W=d?d(Q):1;v.forEach(function(H,Z){if(!(G>=Z)){var J=Q.x-H.x,K=Q.y-H.y;J===0&&K===0&&(J=Math.random()*.01,K=Math.random()*.01);var ne=J*J+K*K,se=Math.sqrt(ne),fe=(se+.1)*s,Ie=J/se,ye=K/se,Ae=(R(Q)+R(H))*.5*c/(fe*fe),Se=d?d(H):1;if(p[2*G]+=Ie*Ae,p[2*G+1]+=ye*Ae,p[2*Z]-=Ie*Ae,p[2*Z+1]-=ye*Ae,m&&(j(Q)+j(H))/2>se){var we=P*(R(Q)+R(H))*.5/ne;p[2*G]+=Ie*we/W,p[2*G+1]+=ye*we/W,p[2*Z]-=Ie*we/Se,p[2*Z+1]-=ye*we/Se}}})})},x.prototype.calAttractive=function(p,v){var g=this,d=g.nodeMap,c=g.nodeIdxMap,s=g.linkDistance,m=g.edgeStrength,M=g.nodeSize,P=g.getMass;v.forEach(function(R,j){var Q=(0,L.getEdgeTerminal)(R,"source"),G=(0,L.getEdgeTerminal)(R,"target"),W=d[Q],H=d[G],Z=H.x-W.x,J=H.y-W.y;Z===0&&J===0&&(Z=Math.random()*.01,J=Math.random()*.01);var K=Math.sqrt(Z*Z+J*J),ne=Z/K,se=J/K,fe=s(R,W,H)||1+(M(W)+M(H)||0)/2,Ie=fe-K,ye=Ie*m(R),Ae=c[Q],Se=c[G],we=P?P(W):1,Te=P?P(H):1;p[2*Ae]-=ne*ye/we,p[2*Ae+1]-=se*ye/we,p[2*Se]+=ne*ye/Te,p[2*Se+1]+=se*ye/Te})},x.prototype.calGravity=function(p,v){for(var g=this,d=g.center,c=g.gravity,s=g.degrees,m=v.length,M=0;M<m;M++){var P=v[M],R=P.x-d[0],j=P.y-d[1],Q=c;if(g.getCenter){var G=g.getCenter(P,s[M].all);G&&(0,L.isNumber)(G[0])&&(0,L.isNumber)(G[1])&&(0,L.isNumber)(G[2])&&(R=P.x-G[0],j=P.y-G[1],Q=G[2])}Q&&(p[2*M]-=Q*R,p[2*M+1]-=Q*j)}},x.prototype.updateVelocity=function(p,v,g,d){var c=this,s=g*c.damping;d.forEach(function(m,M){var P=p[2*M]*s||.01,R=p[2*M+1]*s||.01,j=Math.sqrt(P*P+R*R);if(j>c.maxSpeed){var Q=c.maxSpeed/j;P=Q*P,R=Q*R}v[2*M]=P,v[2*M+1]=R})},x.prototype.updatePosition=function(p,v,g){g.forEach(function(d,c){if((0,L.isNumber)(d.fx)&&(0,L.isNumber)(d.fy)){d.x=d.fx,d.y=d.fy;return}var s=p[2*c]*v,m=p[2*c+1]*v;d.x+=s,d.y+=m})},x.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},x.prototype.destroy=function(){var p=this;p.stop(),p.tick=null,p.nodes=null,p.edges=null,p.destroyed=!0},x.prototype.getType=function(){return"gForce"},x}(U.Base);N.GForceLayout=I},6851:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var d=function(c,s){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,M){m.__proto__=M}||function(m,M){for(var P in M)Object.prototype.hasOwnProperty.call(M,P)&&(m[P]=M[P])},d(c,s)};return function(c,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");d(c,s);function m(){this.constructor=c}c.prototype=s===null?Object.create(s):(m.prototype=s.prototype,new m)}}(),U=this&&this.__awaiter||function(d,c,s,m){function M(P){return P instanceof s?P:new s(function(R){R(P)})}return new(s||(s=Promise))(function(P,R){function j(W){try{G(m.next(W))}catch(H){R(H)}}function Q(W){try{G(m.throw(W))}catch(H){R(H)}}function G(W){W.done?P(W.value):M(W.value).then(j,Q)}G((m=m.apply(d,c||[])).next())})},L=this&&this.__generator||function(d,c){var s={label:0,sent:function(){if(P[0]&1)throw P[1];return P[1]},trys:[],ops:[]},m,M,P,R;return R={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function j(G){return function(W){return Q([G,W])}}function Q(G){if(m)throw new TypeError("Generator is already executing.");for(;R&&(R=0,G[0]&&(s=0)),s;)try{if(m=1,M&&(P=G[0]&2?M.return:G[0]?M.throw||((P=M.return)&&P.call(M),0):M.next)&&!(P=P.call(M,G[1])).done)return P;switch(M=0,P&&(G=[G[0]&2,P.value]),G[0]){case 0:case 1:P=G;break;case 4:return s.label++,{value:G[1],done:!1};case 5:s.label++,M=G[1],G=[0];continue;case 7:G=s.ops.pop(),s.trys.pop();continue;default:if(P=s.trys,!(P=P.length>0&&P[P.length-1])&&(G[0]===6||G[0]===2)){s=0;continue}if(G[0]===3&&(!P||G[1]>P[0]&&G[1]<P[3])){s.label=G[1];break}if(G[0]===6&&s.label<P[1]){s.label=P[1],P=G;break}if(P&&s.label<P[2]){s.label=P[2],s.ops.push(G);break}P[2]&&s.ops.pop(),s.trys.pop();continue}G=c.call(d,s)}catch(W){G=[6,W],M=0}finally{m=P=0}if(G[0]&5)throw G[1];return{value:G[0]?G[1]:void 0,done:!0}}};Object.defineProperty(N,"__esModule",{value:!0}),N.FruchtermanGPULayout=void 0;var _=F(46833),I=F(44941),T=F(20199),x=F(50793),p=F(92464),v=F(72939),g=function(d){k(c,d);function c(s){var m=d.call(this)||this;return m.maxIteration=1e3,m.gravity=10,m.speed=1,m.clustering=!1,m.clusterField="cluster",m.clusterGravity=10,m.workerEnabled=!1,m.nodes=[],m.edges=[],m.width=300,m.height=300,m.nodeMap={},m.nodeIdxMap={},m.updateCfg(s),m}return c.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},c.prototype.execute=function(){return U(this,void 0,void 0,function(){var s,m,M,P,R,j=this;return L(this,function(Q){switch(Q.label){case 0:return s=this,m=s.nodes,!m||m.length===0?(s.onLayoutEnd&&s.onLayoutEnd(),[2]):(!s.width&&typeof window!="undefined"&&(s.width=window.innerWidth),!s.height&&typeof window!="undefined"&&(s.height=window.innerHeight),s.center||(s.center=[s.width/2,s.height/2]),M=s.center,m.length===1?(m[0].x=M[0],m[0].y=M[1],s.onLayoutEnd&&s.onLayoutEnd(),[2]):(P={},R={},m.forEach(function(G,W){(0,I.isNumber)(G.x)||(G.x=Math.random()*j.width),(0,I.isNumber)(G.y)||(G.y=Math.random()*j.height),P[G.id]=G,R[G.id]=W}),s.nodeMap=P,s.nodeIdxMap=R,[4,s.run()]));case 1:return Q.sent(),[2]}})})},c.prototype.executeWithWorker=function(s,m){return U(this,void 0,void 0,function(){var M,P,R,j,Q,G=this;return L(this,function(W){switch(W.label){case 0:return M=this,P=M.nodes,R=M.center,!P||P.length===0?[2]:P.length===1?(P[0].x=R[0],P[0].y=R[1],[2]):(j={},Q={},P.forEach(function(H,Z){(0,I.isNumber)(H.x)||(H.x=Math.random()*G.width),(0,I.isNumber)(H.y)||(H.y=Math.random()*G.height),j[H.id]=H,Q[H.id]=Z}),M.nodeMap=j,M.nodeIdxMap=Q,[4,M.run(s,m)]);case 1:return W.sent(),[2]}})})},c.prototype.run=function(s,m){return U(this,void 0,void 0,function(){var M,P,R,j,Q,G,W,H,Z,J,K,ne,se,fe,Ie,ye,Ae,Se,we,Te,ke,Ge,tt,He,ft,Lt,Jt=this;return L(this,function(Qe){switch(Qe.label){case 0:for(M=this,P=M.nodes,R=M.edges,j=M.maxIteration,Q=M.center,G=M.height*M.width,W=Math.sqrt(G)/10,H=G/(P.length+1),Z=Math.sqrt(H),J=M.speed,K=M.clustering,ne=(0,x.attributesToTextureData)([M.clusterField],P),se=ne.array,fe=ne.count,P.forEach(function(ut,xt){var dt=0,pt=0;(0,I.isNumber)(ut.fx)&&(0,I.isNumber)(ut.fy)&&(dt=ut.fx||.001,pt=ut.fy||.001),se[4*xt+1]=dt,se[4*xt+2]=pt}),Ie=P.length,ye=(0,x.buildTextureData)(P,R),Ae=ye.maxEdgePerVetex,Se=ye.array,we=M.workerEnabled,we?Te=T.World.create({canvas:s,engineOptions:{supportCompute:!0}}):Te=T.World.create({engineOptions:{supportCompute:!0}}),ke=M.onLayoutEnd,Ge=[],tt=0;tt<fe;tt++)Ge.push(0,0,0,0);return He=Te.createKernel(p.fruchtermanBundle).setDispatch([Ie,1,1]).setBinding({u_Data:Se,u_K:Z,u_K2:H,u_Gravity:M.gravity,u_ClusterGravity:M.clusterGravity||M.gravity||1,u_Speed:J,u_MaxDisplace:W,u_Clustering:K?1:0,u_Center:Q,u_AttributeArray:se,u_ClusterCenters:Ge,MAX_EDGE_PER_VERTEX:Ae,VERTEX_COUNT:Ie}),K&&(ft=Te.createKernel(p.clusterBundle).setDispatch([fe,1,1]).setBinding({u_Data:Se,u_NodeAttributes:se,u_ClusterCenters:Ge,VERTEX_COUNT:Ie,CLUSTER_COUNT:fe})),Lt=function(){return U(Jt,void 0,void 0,function(){var ut,xt;return L(this,function(dt){switch(dt.label){case 0:ut=0,dt.label=1;case 1:return ut<j?[4,He.execute()]:[3,6];case 2:return dt.sent(),K?(ft.setBinding({u_Data:He}),[4,ft.execute()]):[3,4];case 3:dt.sent(),He.setBinding({u_ClusterCenters:ft}),dt.label=4;case 4:He.setBinding({u_MaxDisplace:W*=.99}),dt.label=5;case 5:return ut++,[3,1];case 6:return[4,He.getOutput()];case 7:return xt=dt.sent(),s?m.postMessage({type:v.LAYOUT_MESSAGE.GPUEND,vertexEdgeData:xt}):P.forEach(function(pt,wt){var mt=xt[4*wt],ur=xt[4*wt+1];pt.x=mt,pt.y=ur}),ke&&ke(),[2]}})})},[4,Lt()];case 1:return Qe.sent(),[2]}})})},c.prototype.getType=function(){return"fruchterman-gpu"},c}(_.Base);N.FruchtermanGPULayout=g},92464:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.clusterBundle=N.clusterCode=N.fruchtermanBundle=N.fruchtermanCode=void 0,N.fruchtermanCode=`
import { globalInvocationID } from 'g-webgpu';
const MAX_EDGE_PER_VERTEX;
const VERTEX_COUNT;
@numthreads(1, 1, 1)
class Fruchterman {
@in @out
u_Data: vec4[];
@in
u_K: float;
@in
u_K2: float;
@in
u_Center: vec2;
@in
u_Gravity: float;
@in
u_ClusterGravity: float;
@in
u_Speed: float;
@in
u_MaxDisplace: float;
@in
u_Clustering: float;
@in
u_AttributeArray: vec4[];
@in
u_ClusterCenters: vec4[];
calcRepulsive(i: int, currentNode: vec4): vec2 {
let dx = 0, dy = 0;
for (let j = 0; j < VERTEX_COUNT; j++) {
if (i != j) {
const nextNode = this.u_Data[j];
const xDist = currentNode[0] - nextNode[0];
const yDist = currentNode[1] - nextNode[1];
const dist = (xDist * xDist + yDist * yDist) + 0.01;
let param = this.u_K2 / dist;
if (dist > 0.0) {
dx += param * xDist;
dy += param * yDist;
if (xDist == 0 && yDist == 0) {
const sign = i < j ? 1 : -1;
dx += param * sign;
dy += param * sign;
}
}
}
}
return [dx, dy];
}
calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { //
let dx = 0, dy = 0;
const vx = currentNode[0] - this.u_Center[0];
const vy = currentNode[1] - this.u_Center[1];
const gf = 0.01 * this.u_K * this.u_Gravity;
dx = gf * vx;
dy = gf * vy;
if (this.u_Clustering == 1) {
const clusterIdx = int(nodeAttributes[0]);
const center = this.u_ClusterCenters[clusterIdx];
const cvx = currentNode[0] - center[0];
const cvy = currentNode[1] - center[1];
const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;
const parma = this.u_K * this.u_ClusterGravity / dist;
dx += parma * cvx;
dy += parma * cvy;
}
return [dx, dy];
}
calcAttractive(i: int, currentNode: vec4): vec2 {
let dx = 0, dy = 0;
const arr_offset = int(floor(currentNode[2] + 0.5));
const length = int(floor(currentNode[3] + 0.5));
const node_buffer: vec4;
for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {
if (p >= length) break;
const arr_idx = arr_offset + p;
// when arr_idx % 4 == 0 update currentNodedx_buffer
const buf_offset = arr_idx - arr_idx / 4 * 4;
if (p == 0 || buf_offset == 0) {
node_buffer = this.u_Data[int(arr_idx / 4)];
}
const float_j = buf_offset == 0 ? node_buffer[0] :
buf_offset == 1 ? node_buffer[1] :
buf_offset == 2 ? node_buffer[2] :
node_buffer[3];
const nextNode = this.u_Data[int(float_j)];
const xDist = currentNode[0] - nextNode[0];
const yDist = currentNode[1] - nextNode[1];
const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;
let attractiveF = dist / this.u_K;
if (dist > 0.0) {
dx -= xDist * attractiveF;
dy -= yDist * attractiveF;
if (xDist == 0 && yDist == 0) {
const sign = i < int(float_j) ? 1 : -1;
dx -= sign * attractiveF;
dy -= sign * attractiveF;
}
}
}
return [dx, dy];
}
@main
compute() {
const i = globalInvocationID.x;
const currentNode = this.u_Data[i];
let dx = 0, dy = 0;
if (i >= VERTEX_COUNT) {
this.u_Data[i] = currentNode;
return;
}
// [gravity, fx, fy, 0]
const nodeAttributes = this.u_AttributeArray[i];
if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {
// the node is fixed
this.u_Data[i] = [
nodeAttributes[1],
nodeAttributes[2],
currentNode[2],
currentNode[3]
];
return;
}
// repulsive
const repulsive = this.calcRepulsive(i, currentNode);
dx += repulsive[0];
dy += repulsive[1];
// attractive
const attractive = this.calcAttractive(i, currentNode);
dx += attractive[0];
dy += attractive[1];
// gravity
const gravity = this.calcGravity(currentNode, nodeAttributes);
dx -= gravity[0];
dy -= gravity[1];
// speed
dx *= this.u_Speed;
dy *= this.u_Speed;
// move
const distLength = sqrt(dx * dx + dy * dy);
if (distLength > 0.0) {
const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);
this.u_Data[i] = [
currentNode[0] + dx / distLength * limitedDist,
currentNode[1] + dy / distLength * limitedDist,
currentNode[2],
currentNode[3]
];
}
}
}
`,N.fruchtermanBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',N.clusterCode=`
import { globalInvocationID } from 'g-webgpu';
const VERTEX_COUNT;
const CLUSTER_COUNT;
@numthreads(1, 1, 1)
class CalcCenter {
@in
u_Data: vec4[];
@in
u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]
@in @out
u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]
@main
compute() {
const i = globalInvocationID.x;
const center = this.u_ClusterCenters[i];
let sumx = 0;
let sumy = 0;
let count = 0;
for (let j = 0; j < VERTEX_COUNT; j++) {
const attributes = this.u_NodeAttributes[j];
const clusterIdx = int(attributes[0]);
const vertex = this.u_Data[j];
if (clusterIdx == i) {
sumx += vertex.x;
sumy += vertex.y;
count += 1;
}
}
this.u_ClusterCenters[i] = [
sumx / count,
sumy / count,
count,
i
];
}
}
`,N.clusterBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}'},77820:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var c=function(s,m){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,P){M.__proto__=P}||function(M,P){for(var R in P)Object.prototype.hasOwnProperty.call(P,R)&&(M[R]=P[R])},c(s,m)};return function(s,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");c(s,m);function M(){this.constructor=s}s.prototype=m===null?Object.create(m):(M.prototype=m.prototype,new M)}}(),U=this&&this.__awaiter||function(c,s,m,M){function P(R){return R instanceof m?R:new m(function(j){j(R)})}return new(m||(m=Promise))(function(R,j){function Q(H){try{W(M.next(H))}catch(Z){j(Z)}}function G(H){try{W(M.throw(H))}catch(Z){j(Z)}}function W(H){H.done?R(H.value):P(H.value).then(Q,G)}W((M=M.apply(c,s||[])).next())})},L=this&&this.__generator||function(c,s){var m={label:0,sent:function(){if(R[0]&1)throw R[1];return R[1]},trys:[],ops:[]},M,P,R,j;return j={next:Q(0),throw:Q(1),return:Q(2)},typeof Symbol=="function"&&(j[Symbol.iterator]=function(){return this}),j;function Q(W){return function(H){return G([W,H])}}function G(W){if(M)throw new TypeError("Generator is already executing.");for(;j&&(j=0,W[0]&&(m=0)),m;)try{if(M=1,P&&(R=W[0]&2?P.return:W[0]?P.throw||((R=P.return)&&R.call(P),0):P.next)&&!(R=R.call(P,W[1])).done)return R;switch(P=0,R&&(W=[W[0]&2,R.value]),W[0]){case 0:case 1:R=W;break;case 4:return m.label++,{value:W[1],done:!1};case 5:m.label++,P=W[1],W=[0];continue;case 7:W=m.ops.pop(),m.trys.pop();continue;default:if(R=m.trys,!(R=R.length>0&&R[R.length-1])&&(W[0]===6||W[0]===2)){m=0;continue}if(W[0]===3&&(!R||W[1]>R[0]&&W[1]<R[3])){m.label=W[1];break}if(W[0]===6&&m.label<R[1]){m.label=R[1],R=W;break}if(R&&m.label<R[2]){m.label=R[2],m.ops.push(W);break}R[2]&&m.ops.pop(),m.trys.pop();continue}W=s.call(c,m)}catch(H){W=[6,H],P=0}finally{M=R=0}if(W[0]&5)throw W[1];return{value:W[0]?W[1]:void 0,done:!0}}};Object.defineProperty(N,"__esModule",{value:!0}),N.GForceGPULayout=void 0;var _=F(46833),I=F(44941),T=F(20199),x=F(50793),p=F(13892),v=F(93685),g=F(72939),d=function(c){k(s,c);function s(m){var M=c.call(this)||this;return M.maxIteration=1e3,M.edgeStrength=200,M.nodeStrength=1e3,M.coulombDisScale=.005,M.damping=.9,M.maxSpeed=1e3,M.minMovement=.5,M.interval=.02,M.factor=1,M.linkDistance=1,M.gravity=10,M.workerEnabled=!1,M.nodes=[],M.edges=[],M.width=300,M.height=300,M.nodeMap={},M.nodeIdxMap={},M.updateCfg(m),M}return s.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},s.prototype.execute=function(){return U(this,void 0,void 0,function(){var m,M,P,R,j;return L(this,function(Q){switch(Q.label){case 0:return m=this,M=m.nodes,!M||M.length===0?(m.onLayoutEnd&&m.onLayoutEnd(),[2]):(!m.width&&typeof window!="undefined"&&(m.width=window.innerWidth),!m.height&&typeof window!="undefined"&&(m.height=window.innerHeight),m.center||(m.center=[m.width/2,m.height/2]),P=m.center,M.length===1?(M[0].x=P[0],M[0].y=P[1],m.onLayoutEnd&&m.onLayoutEnd(),[2]):(R={},j={},M.forEach(function(G,W){(0,I.isNumber)(G.x)||(G.x=Math.random()*m.width),(0,I.isNumber)(G.y)||(G.y=Math.random()*m.height),R[G.id]=G,j[G.id]=W}),m.nodeMap=R,m.nodeIdxMap=j,m.nodeStrength=(0,x.proccessToFunc)(m.nodeStrength,1),m.edgeStrength=(0,x.proccessToFunc)(m.edgeStrength,1),[4,m.run()]));case 1:return Q.sent(),[2]}})})},s.prototype.executeWithWorker=function(m,M){var P=this,R=P.nodes,j=P.center;if(!(!R||R.length===0)){if(R.length===1){R[0].x=j[0],R[0].y=j[1];return}var Q={},G={};R.forEach(function(W,H){(0,I.isNumber)(W.x)||(W.x=Math.random()*P.width),(0,I.isNumber)(W.y)||(W.y=Math.random()*P.height),Q[W.id]=W,G[W.id]=H}),P.nodeMap=Q,P.nodeIdxMap=G,P.nodeStrength=(0,x.proccessToFunc)(P.nodeStrength,1),P.edgeStrength=(0,x.proccessToFunc)(P.edgeStrength,1),P.run(m,M)}},s.prototype.run=function(m,M){return U(this,void 0,void 0,function(){var P,R,j,Q,G,W,H,Z,J,K,ne,se,fe,Ie,ye,Ae,Se,we,Te,ke,Ge,tt,He,ft,Lt,Jt,Qe,ut=this;return L(this,function(xt){switch(xt.label){case 0:for(P=this,R=P.nodes,j=P.edges,Q=P.maxIteration,!P.width&&typeof window!="undefined"&&(P.width=window.innerWidth),!P.height&&typeof window!="undefined"&&(P.height=window.innerHeight),G=R.length,P.linkDistance=(0,x.proccessToFunc)(P.linkDistance),P.edgeStrength=(0,x.proccessToFunc)(P.edgeStrength),W=(0,x.buildTextureDataWithTwoEdgeAttr)(R,j,P.linkDistance,P.edgeStrength),H=W.maxEdgePerVetex,Z=W.array,P.degrees=(0,p.getDegree)(R.length,P.nodeIdxMap,j).map(function(dt){return dt.all}),J=[],K=[],ne=[],se=[],fe=[],Ie=[],ye=[],P.getMass||(P.getMass=function(dt){return P.degrees[P.nodeIdxMap[dt.id]]||1}),Ae=P.gravity,Se=P.center,R.forEach(function(dt,pt){J.push(P.getMass(dt)),K.push(P.nodeStrength(dt)),P.degrees[pt]||(P.degrees[pt]=0);var wt=[Se[0],Se[1],Ae];if(P.getCenter){var mt=P.getCenter(dt,P.degrees[pt]);mt&&(0,I.isNumber)(mt[0])&&(0,I.isNumber)(mt[1])&&(0,I.isNumber)(mt[2])&&(wt=mt)}ne.push(wt[0]),se.push(wt[1]),fe.push(wt[2]),(0,I.isNumber)(dt.fx)&&(0,I.isNumber)(dt.fy)?(Ie.push(dt.fx||.001),ye.push(dt.fy||.001)):(Ie.push(0),ye.push(0))}),we=(0,x.arrayToTextureData)([J,P.degrees,K,Ie]),Te=(0,x.arrayToTextureData)([ne,se,fe,ye]),ke=P.workerEnabled,ke?Ge=T.World.create({canvas:m,engineOptions:{supportCompute:!0}}):Ge=T.World.create({engineOptions:{supportCompute:!0}}),tt=P.onLayoutEnd,He=[],Z.forEach(function(dt){He.push(dt)}),ft=0;ft<4;ft++)He.push(0);return Lt=Ge.createKernel(v.gForceBundle).setDispatch([G,1,1]).setBinding({u_Data:Z,u_damping:P.damping,u_maxSpeed:P.maxSpeed,u_minMovement:P.minMovement,u_coulombDisScale:P.coulombDisScale,u_factor:P.factor,u_NodeAttributeArray1:we,u_NodeAttributeArray2:Te,MAX_EDGE_PER_VERTEX:H,VERTEX_COUNT:G,u_AveMovement:He,u_interval:P.interval}),Jt=Ge.createKernel(v.aveMovementBundle).setDispatch([1,1,1]).setBinding({u_Data:Z,VERTEX_COUNT:G,u_AveMovement:[0,0,0,0]}),Qe=function(){return U(ut,void 0,void 0,function(){var dt,pt,wt;return L(this,function(mt){switch(mt.label){case 0:dt=0,mt.label=1;case 1:return dt<Q?[4,Lt.execute()]:[3,5];case 2:return mt.sent(),Jt.setBinding({u_Data:Lt}),[4,Jt.execute()];case 3:mt.sent(),pt=Math.max(.02,P.interval-dt*.002),Lt.setBinding({u_interval:pt,u_AveMovement:Jt}),mt.label=4;case 4:return dt++,[3,1];case 5:return[4,Lt.getOutput()];case 6:return wt=mt.sent(),m?M.postMessage({type:g.LAYOUT_MESSAGE.GPUEND,vertexEdgeData:wt}):R.forEach(function(ur,Ir){var Nr=wt[4*Ir],Hr=wt[4*Ir+1];ur.x=Nr,ur.y=Hr}),tt&&tt(),[2]}})})},[4,Qe()];case 1:return xt.sent(),[2]}})})},s.prototype.getType=function(){return"gForce-gpu"},s}(_.Base);N.GForceGPULayout=d},93685:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.aveMovementBundle=N.aveMovementCode=N.gForceBundle=N.gForceCode=void 0,N.gForceCode=`
import { globalInvocationID } from 'g-webgpu';
const MAX_EDGE_PER_VERTEX;
const VERTEX_COUNT;
const SHIFT_20 = 1048576;
@numthreads(1, 1, 1)
class GGForce {
@in @out
u_Data: vec4[];
@in
u_damping: float;
@in
u_maxSpeed: float;
@in
u_minMovement: float;
@in
u_AveMovement: vec4[];
@in
u_coulombDisScale: float;
@in
u_factor: float;
@in
u_NodeAttributeArray1: vec4[];
@in
u_NodeAttributeArray2: vec4[];
@in
u_interval: float;
unpack_float(packedValue: float): ivec2 {
const packedIntValue = int(packedValue);
const v0 = packedIntValue / SHIFT_20;
return [v0, packedIntValue - v0 * SHIFT_20];
}
calcRepulsive(i: int, currentNode: vec4): vec2 {
let ax = 0, ay = 0;
for (let j: int = 0; j < VERTEX_COUNT; j++) {
if (i != j) {
const nextNode = this.u_Data[j];
const vx = currentNode[0] - nextNode[0];
const vy = currentNode[1] - nextNode[1];
const dist = sqrt(vx * vx + vy * vy) + 0.01;
const n_dist = (dist + 0.1) * this.u_coulombDisScale;
const direx = vx / dist;
const direy = vy / dist;
const attributesi = this.u_NodeAttributeArray1[i];
const attributesj = this.u_NodeAttributeArray1[j];
const massi = attributesi[0];
const nodeStrengthi = attributesi[2];
const nodeStrengthj = attributesj[2];
const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;
// const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);
const param = nodeStrength * this.u_factor / (n_dist * n_dist);
ax += direx * param;
ay += direy * param;
}
}
return [ax, ay];
}
calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {
// note: attributes2 = [centerX, centerY, gravity, 0]
const vx = currentNode[0] - attributes2[0];
const vy = currentNode[1] - attributes2[1];
const ax = vx * attributes2[2];
const ay = vy * attributes2[2];
return [ax, ay];
}
calcAttractive(i: int, currentNode: vec4, attributes1: vec4): vec2 {
// note: attributes1 = [mass, degree, nodeSterngth, 0]
const mass = attributes1[0];
let ax = 0, ay = 0;
// const arr_offset = int(floor(currentNode[2] + 0.5));
// const length = int(floor(currentNode[3] + 0.5));
const compressed = this.unpack_float(currentNode[2]);
const length = compressed[0];
const arr_offset = compressed[1];
const node_buffer: vec4;
for (let p: int = 0; p < MAX_EDGE_PER_VERTEX; p++) {
if (p >= length) break;
const arr_idx = arr_offset + 4 * p; // i \u8282\u70B9\u7684\u7B2C p \u6761\u8FB9\u5F00\u59CB\u7684\u5C0F\u683C\u5B50\u4F4D\u7F6E
const buf_offset = arr_idx - arr_idx / 4 * 4;
if (p == 0 || buf_offset == 0) {
node_buffer = this.u_Data[int(arr_idx / 4)]; // \u5927\u683C\u5B50\uFF0C\u5927\u683C\u5B50\u4F4D\u7F6E=\u5C0F\u4E2A\u5B50\u4F4D\u7F6E / 4\uFF0C
}
let float_j: float = node_buffer[0];
const nextNode = this.u_Data[int(float_j)];
const vx = nextNode[0] - currentNode[0];
const vy = nextNode[1] - currentNode[1];
const dist = sqrt(vx * vx + vy * vy) + 0.01;
const direx = vx / dist;
const direy = vy / dist;
const edgeLength = node_buffer[1];
const edgeStrength = node_buffer[2];
const diff: float = edgeLength - dist;//edgeLength
// const param = diff * this.u_stiffness / mass; //
const param = diff * edgeStrength / mass; //
ax -= direx * param;
ay -= direy * param;
}
return [ax, ay];
}
@main
compute() {
const i = globalInvocationID.x;
const currentNode = this.u_Data[i];
const movement = u_AveMovement[0];
let ax = 0, ay = 0;
if (i >= VERTEX_COUNT || movement.x < u_minMovement) {
this.u_Data[i] = currentNode;
return;
}
// \u6BCF\u4E2A\u8282\u70B9\u5C5E\u6027\u5360\u4E24\u4E2A\u6570\u7EC4\u4E2D\u5404\u4E00\u683C
// [mass, degree, nodeStrength, fx]
const nodeAttributes1 = this.u_NodeAttributeArray1[i];
// [centerX, centerY, centerGravity, fy]
const nodeAttributes2 = this.u_NodeAttributeArray2[i];
// repulsive
const repulsive = this.calcRepulsive(i, currentNode);
ax += repulsive[0];
ay += repulsive[1];
// attractive
const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);
ax += attractive[0];
ay += attractive[1];
// gravity
const gravity = this.calcGravity(i, currentNode, nodeAttributes2);
ax -= gravity[0];
ay -= gravity[1];
// speed
const param = this.u_interval * this.u_damping;
let vx = ax * param;
let vy = ay * param;
const vlength = sqrt(vx * vx + vy * vy) + 0.0001;
if (vlength > this.u_maxSpeed) {
const param2 = this.u_maxSpeed / vlength;
vx = param2 * vx;
vy = param2 * vy;
}
// move
if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {
this.u_Data[i] = [
nodeAttributes1[3],
nodeAttributes2[3],
currentNode[2],
0
];
} else {
const distx = vx * this.u_interval;
const disty = vy * this.u_interval;
const distLength = sqrt(distx * distx + disty * disty);
this.u_Data[i] = [
currentNode[0] + distx,
currentNode[1] + disty,
currentNode[2],
distLength
];
}
// the avarage move distance
// need to share memory
}
}
`,N.gForceBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',N.aveMovementCode=`
const VERTEX_COUNT;
@numthreads(1, 1, 1)
class CalcAveMovement {
@in
u_Data: vec4[];
@in
u_iter: float;
@in @out
u_AveMovement: vec4[];
@main
compute() {
let movement = 0;
for (let j: int = 0; j < VERTEX_COUNT; j++) {
const vertex = this.u_Data[j];
movement += vertex[3];
}
movement = movement / float(VERTEX_COUNT);
this.u_AveMovement[0] = [movement, 0, 0, 0];
}
}
`,N.aveMovementBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}'},59462:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var I=function(T,x){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(p[g]=v[g])},I(T,x)};return function(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");I(T,x);function p(){this.constructor=T}T.prototype=x===null?Object.create(x):(p.prototype=x.prototype,new p)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.GridLayout=void 0;var U=F(44941),L=F(46833),_=function(I){k(T,I);function T(x){var p=I.call(this)||this;return p.begin=[0,0],p.preventOverlap=!0,p.preventOverlapPadding=10,p.condense=!1,p.sortBy="degree",p.nodes=[],p.edges=[],p.width=300,p.height=300,p.row=0,p.col=0,p.cellWidth=0,p.cellHeight=0,p.cellUsed={},p.id2manPos={},p.onLayoutEnd=function(){},p.updateCfg(x),p}return T.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},T.prototype.execute=function(){var x=this,p=x.nodes,v=x.edges,g=x.begin,d=p.length;if(d===0)return x.onLayoutEnd&&x.onLayoutEnd(),{nodes:p,edges:v};if(d===1)return p[0].x=g[0],p[0].y=g[1],x.onLayoutEnd&&x.onLayoutEnd(),{nodes:p,edges:v};var c=x.sortBy,s=x.width,m=x.height,M=x.condense,P=x.preventOverlapPadding,R=x.preventOverlap,j=x.nodeSpacing,Q=x.nodeSize,G=[];p.forEach(function(we){G.push(we)});var W={};if(G.forEach(function(we,Te){W[we.id]=Te}),(c==="degree"||!(0,U.isString)(c)||G[0][c]===void 0)&&(c="degree",(0,U.isNaN)(p[0].degree))){var H=(0,U.getDegree)(G.length,W,v);G.forEach(function(we,Te){we.degree=H[Te].all})}G.sort(function(we,Te){return Te[c]-we[c]}),!s&&typeof window!="undefined"&&(s=window.innerWidth),!m&&typeof window!="undefined"&&(m=window.innerHeight);var Z=x.rows,J=x.cols!=null?x.cols:x.columns;if(x.cells=d,Z!=null&&J!=null?(x.rows=Z,x.cols=J):Z!=null&&J==null?(x.rows=Z,x.cols=Math.ceil(x.cells/x.rows)):Z==null&&J!=null?(x.cols=J,x.rows=Math.ceil(x.cells/x.cols)):(x.splits=Math.sqrt(x.cells*x.height/x.width),x.rows=Math.round(x.splits),x.cols=Math.round(x.width/x.height*x.splits)),x.rows=Math.max(x.rows,1),x.cols=Math.max(x.cols,1),x.cols*x.rows>x.cells){var K=x.small(),ne=x.large();(K-1)*ne>=x.cells?x.small(K-1):(ne-1)*K>=x.cells&&x.large(ne-1)}else for(;x.cols*x.rows<x.cells;){var K=x.small(),ne=x.large();(ne+1)*K>=x.cells?x.large(ne+1):x.small(K+1)}if(x.cellWidth=s/x.cols,x.cellHeight=m/x.rows,M&&(x.cellWidth=0,x.cellHeight=0),R||j){var se=(0,U.getFuncByUnknownType)(10,j),fe=(0,U.getFuncByUnknownType)(30,Q,!1);G.forEach(function(we){(!we.x||!we.y)&&(we.x=0,we.y=0);var Te=fe(we)||30,ke,Ge;(0,U.isArray)(Te)?(ke=Te[0],Ge=Te[1]):(ke=Te,Ge=Te);var tt=se!==void 0?se(we):P,He=ke+tt,ft=Ge+tt;x.cellWidth=Math.max(x.cellWidth,He),x.cellHeight=Math.max(x.cellHeight,ft)})}x.cellUsed={},x.row=0,x.col=0,x.id2manPos={};for(var Ie=0;Ie<G.length;Ie++){var ye=G[Ie],Ae=void 0;if(x.position&&(Ae=x.position(ye)),Ae&&(Ae.row!==void 0||Ae.col!==void 0)){var Se={row:Ae.row,col:Ae.col};if(Se.col===void 0)for(Se.col=0;x.used(Se.row,Se.col);)Se.col++;else if(Se.row===void 0)for(Se.row=0;x.used(Se.row,Se.col);)Se.row++;x.id2manPos[ye.id]=Se,x.use(Se.row,Se.col)}x.getPos(ye)}return x.onLayoutEnd&&x.onLayoutEnd(),{edges:v,nodes:G}},T.prototype.small=function(x){var p=this,v,g=p.rows||5,d=p.cols||5;if(x==null)v=Math.min(g,d);else{var c=Math.min(g,d);c===p.rows?p.rows=x:p.cols=x}return v},T.prototype.large=function(x){var p=this,v,g=p.rows||5,d=p.cols||5;if(x==null)v=Math.max(g,d);else{var c=Math.max(g,d);c===p.rows?p.rows=x:p.cols=x}return v},T.prototype.used=function(x,p){var v=this;return v.cellUsed["c-".concat(x,"-").concat(p)]||!1},T.prototype.use=function(x,p){var v=this;v.cellUsed["c-".concat(x,"-").concat(p)]=!0},T.prototype.moveToNextCell=function(){var x=this,p=x.cols||5;x.col++,x.col>=p&&(x.col=0,x.row++)},T.prototype.getPos=function(x){var p=this,v=p.begin,g=p.cellWidth,d=p.cellHeight,c,s,m=p.id2manPos[x.id];if(m)c=m.col*g+g/2+v[0],s=m.row*d+d/2+v[1];else{for(;p.used(p.row,p.col);)p.moveToNextCell();c=p.col*g+g/2+v[0],s=p.row*d+d/2+v[1],p.use(p.row,p.col),p.moveToNextCell()}x.x=c,x.y=s},T.prototype.getType=function(){return"grid"},T}(L.Base);N.GridLayout=_},68609:function(Mt,N,F){"use strict";var k=this&&this.__createBinding||(Object.create?function(H,Z,J,K){K===void 0&&(K=J);var ne=Object.getOwnPropertyDescriptor(Z,J);(!ne||("get"in ne?!Z.__esModule:ne.writable||ne.configurable))&&(ne={enumerable:!0,get:function(){return Z[J]}}),Object.defineProperty(H,K,ne)}:function(H,Z,J,K){K===void 0&&(K=J),H[K]=Z[J]}),U=this&&this.__exportStar||function(H,Z){for(var J in H)J!=="default"&&!Object.prototype.hasOwnProperty.call(Z,J)&&k(Z,H,J)};Object.defineProperty(N,"__esModule",{value:!0}),N.ERLayout=N.ForceAtlas2Layout=N.ComboCombinedLayout=N.ComboForceLayout=N.GForceGPULayout=N.FruchtermanGPULayout=N.FruchtermanLayout=N.MDSLayout=N.ConcentricLayout=N.RadialLayout=N.DagreCompoundLayout=N.DagreLayout=N.CircularLayout=N.ForceLayout=N.Force2Layout=N.GForceLayout=N.RandomLayout=N.GridLayout=N.Layouts=N.Layout=void 0;var L=F(59462);Object.defineProperty(N,"GridLayout",{enumerable:!0,get:function(){return L.GridLayout}});var _=F(12026);Object.defineProperty(N,"RandomLayout",{enumerable:!0,get:function(){return _.RandomLayout}});var I=F(83254);Object.defineProperty(N,"GForceLayout",{enumerable:!0,get:function(){return I.GForceLayout}});var T=F(41142);Object.defineProperty(N,"Force2Layout",{enumerable:!0,get:function(){return T.Force2Layout}});var x=F(22457);Object.defineProperty(N,"ForceLayout",{enumerable:!0,get:function(){return x.ForceLayout}});var p=F(30716);Object.defineProperty(N,"CircularLayout",{enumerable:!0,get:function(){return p.CircularLayout}});var v=F(95511);Object.defineProperty(N,"DagreLayout",{enumerable:!0,get:function(){return v.DagreLayout}});var g=F(19268);Object.defineProperty(N,"DagreCompoundLayout",{enumerable:!0,get:function(){return g.DagreCompoundLayout}});var d=F(50140);Object.defineProperty(N,"RadialLayout",{enumerable:!0,get:function(){return d.RadialLayout}});var c=F(370);Object.defineProperty(N,"ConcentricLayout",{enumerable:!0,get:function(){return c.ConcentricLayout}});var s=F(67842);Object.defineProperty(N,"MDSLayout",{enumerable:!0,get:function(){return s.MDSLayout}});var m=F(92627);Object.defineProperty(N,"FruchtermanLayout",{enumerable:!0,get:function(){return m.FruchtermanLayout}});var M=F(6851);Object.defineProperty(N,"FruchtermanGPULayout",{enumerable:!0,get:function(){return M.FruchtermanGPULayout}});var P=F(77820);Object.defineProperty(N,"GForceGPULayout",{enumerable:!0,get:function(){return P.GForceGPULayout}});var R=F(80808);Object.defineProperty(N,"ComboForceLayout",{enumerable:!0,get:function(){return R.ComboForceLayout}});var j=F(59506);Object.defineProperty(N,"ComboCombinedLayout",{enumerable:!0,get:function(){return j.ComboCombinedLayout}});var Q=F(54255);Object.defineProperty(N,"ForceAtlas2Layout",{enumerable:!0,get:function(){return Q.ForceAtlas2Layout}});var G=F(71443);Object.defineProperty(N,"ERLayout",{enumerable:!0,get:function(){return G.ERLayout}});var W=F(29382);Object.defineProperty(N,"Layout",{enumerable:!0,get:function(){return W.Layout}}),Object.defineProperty(N,"Layouts",{enumerable:!0,get:function(){return W.Layouts}}),U(F(74007),N)},29382:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.Layouts=N.Layout=void 0;var k=F(56559),U=F(59462),L=F(12026),_=F(41142),I=F(83254),T=F(22457),x=F(30716),p=F(95511),v=F(50140),g=F(370),d=F(67842),c=F(92627),s=F(6851),m=F(77820),M=F(80808),P=F(59506),R=F(54255),j=F(71443),Q=F(19268),G=F(44941),W=function(){function H(Z){var J=(0,k.getLayoutByName)(Z.type);this.layoutInstance=new J(Z)}return H.prototype.layout=function(Z){return this.layoutInstance.layout(Z)},H.prototype.updateCfg=function(Z){this.layoutInstance.updateCfg(Z)},H.prototype.init=function(Z){this.correctLayers(Z.nodes),this.layoutInstance.init(Z)},H.prototype.correctLayers=function(Z){if(Z!=null&&Z.length){var J=1/0,K=[];if(Z.forEach(function(se){(0,G.isString)(se.layer)&&(se.layer=parseInt(se.layer,10)),!(se.layer===void 0||isNaN(se.layer))&&(K.push(se),se.layer<J&&(J=se.layer))}),J<=0){var ne=Math.abs(J)+1;K.forEach(function(se){return se.layer+=ne})}}},H.prototype.execute=function(){this.layoutInstance.execute()},H.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},H.prototype.destroy=function(){return this.layoutInstance.destroy()},H}();N.Layout=W,N.Layouts={force:T.ForceLayout,fruchterman:c.FruchtermanLayout,forceAtlas2:R.ForceAtlas2Layout,gForce:I.GForceLayout,force2:_.Force2Layout,dagre:p.DagreLayout,dagreCompound:Q.DagreCompoundLayout,circular:x.CircularLayout,radial:v.RadialLayout,concentric:g.ConcentricLayout,grid:U.GridLayout,mds:d.MDSLayout,comboForce:M.ComboForceLayout,comboCombined:P.ComboCombinedLayout,random:L.RandomLayout,"gForce-gpu":m.GForceGPULayout,"fruchterman-gpu":s.FruchtermanGPULayout,er:j.ERLayout}},67842:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var T=function(x,p){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},T(x,p)};return function(x,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");T(x,p);function v(){this.constructor=x}x.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.MDSLayout=void 0;var U=F(8082),L=F(44941),_=F(46833),I=function(T){k(x,T);function x(p){var v=T.call(this)||this;return v.center=[0,0],v.linkDistance=50,v.nodes=[],v.edges=[],v.onLayoutEnd=function(){},v.updateCfg(p),v}return x.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},x.prototype.execute=function(){var p=this,v=p.nodes,g=p.edges,d=g===void 0?[]:g,c=p.center;if(!v||v.length===0){p.onLayoutEnd&&p.onLayoutEnd();return}if(v.length===1){v[0].x=c[0],v[0].y=c[1],p.onLayoutEnd&&p.onLayoutEnd();return}var s=p.linkDistance,m=(0,L.getAdjMatrix)({nodes:v,edges:d},!1),M=(0,L.floydWarshall)(m);p.handleInfinity(M);var P=(0,L.scaleMatrix)(M,s);p.scaledDistances=P;var R=p.runMDS();return p.positions=R,R.forEach(function(j,Q){v[Q].x=j[0]+c[0],v[Q].y=j[1]+c[1]}),p.onLayoutEnd&&p.onLayoutEnd(),{nodes:v,edges:d}},x.prototype.runMDS=function(){var p=this,v=2,g=p.scaledDistances,d=U.Matrix.mul(U.Matrix.pow(g,2),-.5),c=d.mean("row"),s=d.mean("column"),m=d.mean();d.add(m).subRowVector(c).subColumnVector(s);var M=new U.SingularValueDecomposition(d),P=U.Matrix.sqrt(M.diagonalMatrix).diagonal();return M.leftSingularVectors.toJSON().map(function(R){return U.Matrix.mul([R],[P]).toJSON()[0].splice(0,v)})},x.prototype.handleInfinity=function(p){var v=-999999;p.forEach(function(g){g.forEach(function(d){d!==1/0&&v<d&&(v=d)})}),p.forEach(function(g,d){g.forEach(function(c,s){c===1/0&&(p[d][s]=v)})})},x.prototype.getType=function(){return"mds"},x}(_.Base);N.MDSLayout=I},50140:function(Mt,N,F){"use strict";var k=this&&this.__createBinding||(Object.create?function(L,_,I,T){T===void 0&&(T=I);var x=Object.getOwnPropertyDescriptor(_,I);(!x||("get"in x?!_.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return _[I]}}),Object.defineProperty(L,T,x)}:function(L,_,I,T){T===void 0&&(T=I),L[T]=_[I]}),U=this&&this.__exportStar||function(L,_){for(var I in L)I!=="default"&&!Object.prototype.hasOwnProperty.call(_,I)&&k(_,L,I)};Object.defineProperty(N,"__esModule",{value:!0}),U(F(30933),N)},61179:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var k=F(8082),U=function(){function L(_){this.distances=_.distances,this.dimension=_.dimension||2,this.linkDistance=_.linkDistance}return L.prototype.layout=function(){var _=this,I=_.dimension,T=_.distances,x=_.linkDistance;try{var p=k.Matrix.mul(k.Matrix.pow(T,2),-.5),v=p.mean("row"),g=p.mean("column"),d=p.mean();p.add(d).subRowVector(v).subColumnVector(g);var c=new k.SingularValueDecomposition(p),s=k.Matrix.sqrt(c.diagonalMatrix).diagonal();return c.leftSingularVectors.toJSON().map(function(j){return k.Matrix.mul([j],[s]).toJSON()[0].splice(0,I)})}catch(j){for(var m=[],M=0;M<T.length;M++){var P=Math.random()*x,R=Math.random()*x;m.push([P,R])}return m}},L}();N.default=U},30933:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var d=function(c,s){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,M){m.__proto__=M}||function(m,M){for(var P in M)Object.prototype.hasOwnProperty.call(M,P)&&(m[P]=M[P])},d(c,s)};return function(c,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");d(c,s);function m(){this.constructor=c}c.prototype=s===null?Object.create(s):(m.prototype=s.prototype,new m)}}(),U=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(N,"__esModule",{value:!0}),N.RadialLayout=void 0;var L=F(44941),_=F(46833),I=U(F(61179)),T=U(F(96716));function x(d){for(var c=d.length,s=d[0].length,m=[],M=0;M<c;M++){for(var P=[],R=0;R<s;R++)d[M][R]!==0?P.push(1/(d[M][R]*d[M][R])):P.push(0);m.push(P)}return m}function p(d,c){var s=-1;return d.forEach(function(m,M){m.id===c&&(s=M)}),s}function v(d,c){return Math.sqrt((d[0]-c[0])*(d[0]-c[0])+(d[1]-c[1])*(d[1]-c[1]))}var g=function(d){k(c,d);function c(s){var m=d.call(this)||this;return m.maxIteration=1e3,m.focusNode=null,m.unitRadius=null,m.linkDistance=50,m.preventOverlap=!1,m.strictRadial=!0,m.maxPreventOverlapIteration=200,m.sortStrength=10,m.nodes=[],m.edges=[],m.updateCfg(s),m}return c.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10,initWithMDS:!0}},c.prototype.execute=function(){var s=this,m=s.nodes,M=s.edges||[];if(!m||m.length===0){s.onLayoutEnd&&s.onLayoutEnd();return}!s.width&&typeof window!="undefined"&&(s.width=window.innerWidth),!s.height&&typeof window!="undefined"&&(s.height=window.innerHeight),s.center||(s.center=[s.width/2,s.height/2]);var P=s.center;if(m.length===1){m[0].x=P[0],m[0].y=P[1],s.onLayoutEnd&&s.onLayoutEnd();return}var R=s.linkDistance,j=null;if((0,L.isString)(s.focusNode)){for(var Q=!1,G=0;G<m.length;G++)m[G].id===s.focusNode&&(j=m[G],s.focusNode=j,Q=!0,G=m.length);Q||(j=null)}else j=s.focusNode;j||(j=m[0],s.focusNode=j);var W=p(m,j.id);W<0&&(W=0),s.focusIndex=W;var H=(0,L.getAdjMatrix)({nodes:m,edges:M},!1),Z=(0,L.floydWarshall)(H),J=s.maxToFocus(Z,W);s.handleInfinity(Z,W,J+1),s.distances=Z;var K=Z[W],ne=s.width||500,se=s.height||500,fe=ne-P[0]>P[0]?P[0]:ne-P[0],Ie=se-P[1]>P[1]?P[1]:se-P[1];fe===0&&(fe=ne/2),Ie===0&&(Ie=se/2);var ye=Ie>fe?fe:Ie,Ae=Math.max.apply(Math,K),Se=[];K.forEach(function(dt,pt){s.unitRadius||(s.unitRadius=ye/Ae),Se[pt]=dt*s.unitRadius}),s.radii=Se;var we=s.eIdealDisMatrix();s.eIdealDistances=we;var Te=x(we);if(s.weights=Te,s.initWithMDS){var ke=new I.default({linkDistance:R,distances:we}),Ge=ke.layout();Ge.forEach(function(dt){(0,L.isNaN)(dt[0])&&(dt[0]=Math.random()*R),(0,L.isNaN)(dt[1])&&(dt[1]=Math.random()*R)}),s.positions=Ge}else s.positions=m.map(function(dt,pt){return[(Math.random()-.5)*we[pt][W],(Math.random()-.5)*we[pt][W]]});s.positions.forEach(function(dt,pt){m[pt].x=dt[0]+P[0],m[pt].y=dt[1]+P[1]}),s.positions.forEach(function(dt){dt[0]-=s.positions[W][0],dt[1]-=s.positions[W][1]}),s.run();var tt=s.preventOverlap,He=s.nodeSize,ft,Lt=s.strictRadial;if(tt){var Jt=s.nodeSpacing,Qe;(0,L.isNumber)(Jt)?Qe=function(){return Jt}:(0,L.isFunction)(Jt)?Qe=Jt:Qe=function(){return 0},He?(0,L.isArray)(He)?ft=function(dt){var pt=He[0]>He[1]?He[0]:He[1];return pt+Qe(dt)}:ft=function(dt){return He+Qe(dt)}:ft=function(dt){if(dt.size){if((0,L.isArray)(dt.size)){var pt=dt.size[0]>dt.size[1]?dt.size[0]:dt.size[1];return pt+Qe(dt)}if((0,L.isObject)(dt.size)){var pt=dt.size.width>dt.size.height?dt.size.width:dt.size.height;return pt+Qe(dt)}return dt.size+Qe(dt)}return 10+Qe(dt)};var ut={nodes:m,nodeSizeFunc:ft,adjMatrix:H,positions:s.positions,radii:Se,height:se,width:ne,strictRadial:Lt,focusID:W,iterations:s.maxPreventOverlapIteration||200,k:s.positions.length/4.5},xt=new T.default(ut);s.positions=xt.layout()}return s.positions.forEach(function(dt,pt){m[pt].x=dt[0]+P[0],m[pt].y=dt[1]+P[1]}),s.onLayoutEnd&&s.onLayoutEnd(),{nodes:m,edges:M}},c.prototype.run=function(){for(var s=this,m=s.maxIteration,M=s.positions||[],P=s.weights||[],R=s.eIdealDistances||[],j=s.radii||[],Q=0;Q<=m;Q++){var G=Q/m;s.oneIteration(G,M,j,R,P)}},c.prototype.oneIteration=function(s,m,M,P,R){var j=this,Q=1-s,G=j.focusIndex;m.forEach(function(W,H){var Z=v(W,[0,0]),J=Z===0?0:1/Z;if(H!==G){var K=0,ne=0,se=0;m.forEach(function(Ie,ye){if(H!==ye){var Ae=v(W,Ie),Se=Ae===0?0:1/Ae,we=P[ye][H];se+=R[H][ye],K+=R[H][ye]*(Ie[0]+we*(W[0]-Ie[0])*Se),ne+=R[H][ye]*(Ie[1]+we*(W[1]-Ie[1])*Se)}});var fe=M[H]===0?0:1/M[H];se*=Q,se+=s*fe*fe,K*=Q,K+=s*fe*W[0]*J,W[0]=K/se,ne*=Q,ne+=s*fe*W[1]*J,W[1]=ne/se}})},c.prototype.eIdealDisMatrix=function(){var s=this,m=s.nodes;if(!m)return[];var M=s.distances,P=s.linkDistance,R=s.radii||[],j=s.unitRadius||50,Q=[];return M&&M.forEach(function(G,W){var H=[];G.forEach(function(Z,J){if(W===J)H.push(0);else if(R[W]===R[J])if(s.sortBy==="data")H.push(Z*(Math.abs(W-J)*s.sortStrength)/(R[W]/j));else if(s.sortBy){var K=m[W][s.sortBy]||0,ne=m[J][s.sortBy]||0;(0,L.isString)(K)&&(K=K.charCodeAt(0)),(0,L.isString)(ne)&&(ne=ne.charCodeAt(0)),H.push(Z*(Math.abs(K-ne)*s.sortStrength)/(R[W]/j))}else H.push(Z*P/(R[W]/j));else{var se=(P+j)/2;H.push(Z*se)}}),Q.push(H)}),Q},c.prototype.handleInfinity=function(s,m,M){for(var P=s.length,R=0;R<P;R++)if(s[m][R]===1/0){s[m][R]=M,s[R][m]=M;for(var j=0;j<P;j++)s[R][j]!==1/0&&s[m][j]===1/0&&(s[m][j]=M+s[R][j],s[j][m]=M+s[R][j])}for(var R=0;R<P;R++)if(R!==m){for(var j=0;j<P;j++)if(s[R][j]===1/0){var Q=Math.abs(s[m][R]-s[m][j]);Q=Q===0?1:Q,s[R][j]=Q}}},c.prototype.maxToFocus=function(s,m){for(var M=0,P=0;P<s[m].length;P++)s[m][P]!==1/0&&(M=s[m][P]>M?s[m][P]:M);return M},c.prototype.getType=function(){return"radial"},c}(_.Base);N.RadialLayout=g},96716:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0});var F=800,k=function(){function U(L){this.disp=[],this.positions=L.positions,this.adjMatrix=L.adjMatrix,this.focusID=L.focusID,this.radii=L.radii,this.iterations=L.iterations||10,this.height=L.height||10,this.width=L.width||10,this.speed=L.speed||100,this.gravity=L.gravity||10,this.nodeSizeFunc=L.nodeSizeFunc,this.k=L.k||5,this.strictRadial=L.strictRadial,this.nodes=L.nodes}return U.prototype.layout=function(){var L=this,_=L.positions,I=[],T=L.iterations,x=L.width/10;L.maxDisplace=x,L.disp=I;for(var p=0;p<T;p++)_.forEach(function(v,g){I[g]={x:0,y:0}}),L.getRepulsion(),L.updatePositions();return _},U.prototype.getRepulsion=function(){var L=this,_=L.positions,I=L.nodes,T=L.disp,x=L.k,p=L.radii||[];_.forEach(function(v,g){T[g]={x:0,y:0},_.forEach(function(d,c){if(g!==c&&p[g]===p[c]){var s=v[0]-d[0],m=v[1]-d[1],M=Math.sqrt(s*s+m*m);if(M===0){M=1;var P=g>c?1:-1;s=.01*P,m=.01*P}if(M<L.nodeSizeFunc(I[g])/2+L.nodeSizeFunc(I[c])/2){var R=x*x/M;T[g].x+=s/M*R,T[g].y+=m/M*R}}})})},U.prototype.updatePositions=function(){var L=this,_=L.positions,I=L.disp,T=L.speed,x=L.strictRadial,p=L.focusID,v=L.maxDisplace||L.width/10;x&&I.forEach(function(d,c){var s=_[c][0]-_[p][0],m=_[c][1]-_[p][1],M=Math.sqrt(s*s+m*m),P=m/M,R=-s/M,j=Math.sqrt(d.x*d.x+d.y*d.y),Q=Math.acos((P*d.x+R*d.y)/j);Q>Math.PI/2&&(Q-=Math.PI/2,P*=-1,R*=-1);var G=Math.cos(Q)*j;d.x=P*G,d.y=R*G});var g=L.radii;_.forEach(function(d,c){if(c!==p){var s=Math.sqrt(I[c].x*I[c].x+I[c].y*I[c].y);if(s>0&&c!==p){var m=Math.min(v*(T/F),s);if(d[0]+=I[c].x/s*m,d[1]+=I[c].y/s*m,x){var M=d[0]-_[p][0],P=d[1]-_[p][1],R=Math.sqrt(M*M+P*P);M=M/R*g[c],P=P/R*g[c],d[0]=_[p][0]+M,d[1]=_[p][1]+P}}}})},U}();N.default=k},12026:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var _=function(I,T){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,p){x.__proto__=p}||function(x,p){for(var v in p)Object.prototype.hasOwnProperty.call(p,v)&&(x[v]=p[v])},_(I,T)};return function(I,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");_(I,T);function x(){this.constructor=I}I.prototype=T===null?Object.create(T):(x.prototype=T.prototype,new x)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.RandomLayout=void 0;var U=F(46833),L=function(_){k(I,_);function I(T){var x=_.call(this)||this;return x.center=[0,0],x.width=300,x.height=300,x.nodes=[],x.edges=[],x.onLayoutEnd=function(){},x.updateCfg(T),x}return I.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},I.prototype.execute=function(){var T=this,x=T.nodes,p=.9,v=T.center;return!T.width&&typeof window!="undefined"&&(T.width=window.innerWidth),!T.height&&typeof window!="undefined"&&(T.height=window.innerHeight),x&&x.forEach(function(g){g.x=(Math.random()-.5)*p*T.width+v[0],g.y=(Math.random()-.5)*p*T.height+v[1]}),T.onLayoutEnd&&T.onLayoutEnd(),{nodes:x,edges:this.edges}},I.prototype.getType=function(){return"random"},I}(U.Base);N.RandomLayout=L},74007:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0})},56559:function(Mt,N,F){"use strict";var k=this&&this.__extends||function(){var p=function(v,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,c){d.__proto__=c}||function(d,c){for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(d[s]=c[s])},p(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");p(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}();Object.defineProperty(N,"__esModule",{value:!0}),N.getLayoutByName=N.unRegisterLayout=N.registerLayout=void 0;var U=F(46833),L=F(44941),_=new Map,I=function(p,v){if(_.get(p)&&console.warn("The layout with the name ".concat(p," exists already, it will be overridden")),(0,L.isObject)(v)){var g=function(d){k(c,d);function c(s){var m=this,M;m=d.call(this)||this;var P=m,R={},j=Object.assign({},P.getDefaultCfg(),((M=v.getDefaultCfg)===null||M===void 0?void 0:M.call(v))||{});return Object.assign(R,j,v,s),Object.keys(R).forEach(function(Q){var G=R[Q];P[Q]=G}),m}return c}(U.Base);_.set(p,g)}else _.set(p,v);return _.get(p)};N.registerLayout=I;var T=function(p){_.has(p)&&_.delete(p)};N.unRegisterLayout=T;var x=function(p){return _.has(p)?_.get(p):null};N.getLayoutByName=x},26422:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.isArray=void 0,N.isArray=Array.isArray},62400:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.getFuncByUnknownType=N.getFunc=N.isFunction=void 0;var k=F(44941),U=F(17679),L=function(T){return typeof T=="function"};N.isFunction=L;var _=function(T,x,p){var v;return p?v=p:(0,U.isNumber)(T)?v=function(){return T}:v=function(){return x},v};N.getFunc=_;var I=function(T,x,p){return p===void 0&&(p=!0),!x&&x!==0?function(v){return v.size?(0,k.isArray)(v.size)?v.size[0]>v.size[1]?v.size[0]:v.size[1]:(0,k.isObject)(v.size)?v.size.width>v.size.height?v.size.width:v.size.height:v.size:T}:(0,N.isFunction)(x)?x:(0,U.isNumber)(x)?function(){return x}:(0,k.isArray)(x)?function(){if(p){var v=Math.max.apply(Math,x);return isNaN(v)?T:v}return x}:(0,k.isObject)(x)?function(){if(p){var v=Math.max(x.width,x.height);return isNaN(v)?T:v}return[x.width,x.height]}:function(){return T}};N.getFuncByUnknownType=I},50793:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.arrayToTextureData=N.attributesToTextureData=N.buildTextureDataWithTwoEdgeAttr=N.buildTextureData=N.proccessToFunc=void 0;var k=F(44941),U=F(13892),L=function(p,v){var g;return p?(0,k.isNumber)(p)?g=function(){return p}:g=p:g=function(){return v||1},g};N.proccessToFunc=L;var _=function(p,v){var g=[],d=[],c={},s=0;for(s=0;s<p.length;s++){var m=p[s];c[m.id]=s,g.push(m.x),g.push(m.y),g.push(0),g.push(0),d.push([])}for(s=0;s<v.length;s++){var M=v[s],P=(0,U.getEdgeTerminal)(M,"source"),R=(0,U.getEdgeTerminal)(M,"target");!isNaN(c[P])&&!isNaN(c[R])&&(d[c[P]].push(c[R]),d[c[R]].push(c[P]))}var j=0;for(s=0;s<p.length;s++){var Q=g.length,G=d[s],W=G.length;g[s*4+2]=Q,g[s*4+3]=W,j=Math.max(j,W);for(var H=0;H<W;++H){var Z=G[H];g.push(+Z)}}for(;g.length%4!==0;)g.push(0);return{maxEdgePerVetex:j,array:new Float32Array(g)}};N.buildTextureData=_;var I=function(p,v,g,d){var c=[],s=[],m={},M=0;for(M=0;M<p.length;M++){var P=p[M];m[P.id]=M,c.push(P.x),c.push(P.y),c.push(0),c.push(0),s.push([])}for(M=0;M<v.length;M++){var R=v[M],j=(0,U.getEdgeTerminal)(R,"source"),Q=(0,U.getEdgeTerminal)(R,"target");s[m[j]].push(m[Q]),s[m[j]].push(g(R)),s[m[j]].push(d(R)),s[m[j]].push(0),s[m[Q]].push(m[j]),s[m[Q]].push(g(R)),s[m[Q]].push(d(R)),s[m[Q]].push(0)}var G=0;for(M=0;M<p.length;M++){var W=c.length,H=s[M],Z=H.length;c[M*4+2]=W+1048576*Z/4,c[M*4+3]=0,G=Math.max(G,Z/4);for(var J=0;J<Z;++J){var K=H[J];c.push(+K)}}for(;c.length%4!==0;)c.push(0);return{maxEdgePerVetex:G,array:new Float32Array(c)}};N.buildTextureDataWithTwoEdgeAttr=I;var T=function(p,v){var g=[],d=p.length,c={};return v.forEach(function(s){p.forEach(function(m,M){if(c[s[m]]===void 0&&(c[s[m]]=Object.keys(c).length),g.push(c[s[m]]),M===d-1)for(;g.length%4!==0;)g.push(0)})}),{array:new Float32Array(g),count:Object.keys(c).length}};N.attributesToTextureData=T;var x=function(p){for(var v=[],g=p.length,d=p[0].length,c=function(m){p.forEach(function(M,P){if(v.push(M[m]),P===g-1)for(;v.length%4!==0;)v.push(0)})},s=0;s<d;s++)c(s);return new Float32Array(v)};N.arrayToTextureData=x},44941:function(Mt,N,F){"use strict";var k=this&&this.__createBinding||(Object.create?function(L,_,I,T){T===void 0&&(T=I);var x=Object.getOwnPropertyDescriptor(_,I);(!x||("get"in x?!_.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return _[I]}}),Object.defineProperty(L,T,x)}:function(L,_,I,T){T===void 0&&(T=I),L[T]=_[I]}),U=this&&this.__exportStar||function(L,_){for(var I in L)I!=="default"&&!Object.prototype.hasOwnProperty.call(_,I)&&k(_,L,I)};Object.defineProperty(N,"__esModule",{value:!0}),U(F(31300),N),U(F(26422),N),U(F(17679),N),U(F(13892),N),U(F(78356),N),U(F(62400),N)},13892:function(Mt,N,F){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.getCoreNodeAndRelativeLeafNodes=N.getAvgNodePosition=N.getLayoutBBox=N.traverseTreeUp=N.scaleMatrix=N.getAdjMatrix=N.floydWarshall=N.getDegreeMap=N.getDegree=N.getEdgeTerminal=void 0;var k=F(26422),U=F(17679),L=F(78356),_=function(j,Q){var G=j[Q];return(0,L.isObject)(G)?G.cell:G};N.getEdgeTerminal=_;var I=function(j,Q,G){for(var W=[],H=0;H<j;H++)W[H]={in:0,out:0,all:0};return G&&G.forEach(function(Z){var J=(0,N.getEdgeTerminal)(Z,"source"),K=(0,N.getEdgeTerminal)(Z,"target");J&&W[Q[J]]&&(W[Q[J]].out+=1,W[Q[J]].all+=1),K&&W[Q[K]]&&(W[Q[K]].in+=1,W[Q[K]].all+=1)}),W};N.getDegree=I;var T=function(j,Q){var G={};return j.forEach(function(W){G[W.id]={in:0,out:0,all:0}}),Q&&Q.forEach(function(W){var H=(0,N.getEdgeTerminal)(W,"source"),Z=(0,N.getEdgeTerminal)(W,"target");H&&(G[H].out+=1,G[H].all+=1),Z&&(G[Z].in+=1,G[Z].all+=1)}),G};N.getDegreeMap=T;var x=function(j){for(var Q=[],G=j.length,W=0;W<G;W+=1){Q[W]=[];for(var H=0;H<G;H+=1)W===H?Q[W][H]=0:j[W][H]===0||!j[W][H]?Q[W][H]=1/0:Q[W][H]=j[W][H]}for(var Z=0;Z<G;Z+=1)for(var W=0;W<G;W+=1)for(var H=0;H<G;H+=1)Q[W][H]>Q[W][Z]+Q[Z][H]&&(Q[W][H]=Q[W][Z]+Q[Z][H]);return Q};N.floydWarshall=x;var p=function(j,Q){var G=j.nodes,W=j.edges,H=[],Z={};if(!G)throw new Error("invalid nodes data!");return G&&G.forEach(function(J,K){Z[J.id]=K;var ne=[];H.push(ne)}),W==null||W.forEach(function(J){var K=(0,N.getEdgeTerminal)(J,"source"),ne=(0,N.getEdgeTerminal)(J,"target"),se=Z[K],fe=Z[ne];se===void 0||fe===void 0||(H[se][fe]=1,Q||(H[fe][se]=1))}),H};N.getAdjMatrix=p;var v=function(j,Q){var G=[];return j.forEach(function(W){var H=[];W.forEach(function(Z){H.push(Z*Q)}),G.push(H)}),G};N.scaleMatrix=v;var g=function(j,Q){if(j&&j.children){for(var G=j.children.length-1;G>=0;G--)if(!g(j.children[G],Q))return}return!!Q(j)},d=function(j,Q){typeof Q=="function"&&g(j,Q)};N.traverseTreeUp=d;var c=function(j){var Q=1/0,G=1/0,W=-1/0,H=-1/0;return j.forEach(function(Z){var J=Z.size;(0,k.isArray)(J)?J.length===1&&(J=[J[0],J[0]]):(0,U.isNumber)(J)?J=[J,J]:(J===void 0||isNaN(J))&&(J=[30,30]);var K=[J[0]/2,J[1]/2],ne=Z.x-K[0],se=Z.x+K[0],fe=Z.y-K[1],Ie=Z.y+K[1];Q>ne&&(Q=ne),G>fe&&(G=fe),W<se&&(W=se),H<Ie&&(H=Ie)}),{minX:Q,minY:G,maxX:W,maxY:H}};N.getLayoutBBox=c;var s=function(j){var Q={x:0,y:0};j.forEach(function(W){Q.x+=W.x||0,Q.y+=W.y||0});var G=j.length||1;return{x:Q.x/G,y:Q.y/G}};N.getAvgNodePosition=s;var m=function(j,Q,G){var W,H;return j==="source"?((W=G==null?void 0:G.find(function(Z){return Z.target===Q.id}))===null||W===void 0?void 0:W.source)||{}:((H=G==null?void 0:G.find(function(Z){return Z.source===Q.id}))===null||H===void 0?void 0:H.target)||{}},M=function(j,Q,G){var W=[];switch(j){case"source":W=G==null?void 0:G.filter(function(Z){return Z.source===Q.id}).map(function(Z){return Z.target});break;case"target":W=G==null?void 0:G.filter(function(Z){return Z.target===Q.id}).map(function(Z){return Z.source});break;case"both":W=G==null?void 0:G.filter(function(Z){return Z.source===Q.id}).map(function(Z){return Z.target}).concat(G==null?void 0:G.filter(function(Z){return Z.target===Q.id}).map(function(Z){return Z.source}));break;default:break}var H=new Set(W);return Array.from(H)},P=function(j,Q,G,W,H){var Z=G[Q]||"",J=(W==null?void 0:W.filter(function(K){return K[Q]===Z}))||[];return j==="leaf"&&(J=J.filter(function(K){var ne,se;return((ne=H[K.id])===null||ne===void 0?void 0:ne.in)===0||((se=H[K.id])===null||se===void 0?void 0:se.out)===0})),J},R=function(j,Q,G,W,H,Z){var J=H[Q.id],K=J.in,ne=J.out,se=Q,fe=[];K===0?(se=m("source",Q,G),fe=M("both",se,G).map(function(ye){return Z[ye]})):ne===0&&(se=m("target",Q,G),fe=M("both",se,G).map(function(ye){return Z[ye]})),fe=fe.filter(function(ye){return H[ye.id]&&(H[ye.id].in===0||H[ye.id].out===0)});var Ie=P(j,W,Q,fe,H);return{coreNode:se,relativeLeafNodes:fe,sameTypeLeafNodes:Ie}};N.getCoreNodeAndRelativeLeafNodes=R},17679:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.toNumber=N.isNaN=N.isNumber=void 0;var F=function(L){return typeof L=="number"};N.isNumber=F;var k=function(L){return Number.isNaN(Number(L))};N.isNaN=k;var U=function(L){var _=parseFloat(L);return(0,N.isNaN)(_)?L:_};N.toNumber=U},78356:function(Mt,N){"use strict";var F=this&&this.__assign||function(){return F=Object.assign||function(L){for(var _,I=1,T=arguments.length;I<T;I++){_=arguments[I];for(var x in _)Object.prototype.hasOwnProperty.call(_,x)&&(L[x]=_[x])}return L},F.apply(this,arguments)};Object.defineProperty(N,"__esModule",{value:!0}),N.clone=N.isObject=void 0;var k=function(L){return L!==null&&typeof L=="object"};N.isObject=k;var U=function(L){if(L===null)return L;if(L instanceof Date)return new Date(L.getTime());if(L instanceof Array){var _=[];return L.forEach(function(T){_.push(T)}),_.map(function(T){return(0,N.clone)(T)})}if(typeof L=="object"&&Object.keys(L).length){var I=F({},L);return Object.keys(I).forEach(function(T){I[T]=(0,N.clone)(I[T])}),I}return L};N.clone=U},31300:function(Mt,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.camelize=N.isString=void 0;var F=function(L){return typeof L=="string"};N.isString=F;var k=function(L){var _=Object.create(null);return function(I){var T=_[I];return T||(_[I]=L(I))}},U=/-(\w)/g;N.camelize=k(function(L){return L.replace(U,function(_,I){return I?I.toUpperCase():""})})},60728:function(Mt,N,F){"use strict";var k;k={value:!0};var U=F(47385);function L(d,c,s){var m=[0,0,0,0,0,0,0,0,0];return U.mat3.fromTranslation(m,s),U.mat3.multiply(d,m,c)}k=L;function _(d,c,s){var m=[0,0,0,0,0,0,0,0,0];return U.mat3.fromRotation(m,s),U.mat3.multiply(d,m,c)}k=_;function I(d,c,s){var m=[0,0,0,0,0,0,0,0,0];return U.mat3.fromScaling(m,s),U.mat3.multiply(d,m,c)}k=I;function T(d,c,s){return U.mat3.multiply(d,s,c)}function x(d,c){for(var s=d?[].concat(d):[1,0,0,0,1,0,0,0,1],m=0,M=c.length;m<M;m++){var P=c[m];switch(P[0]){case"t":L(s,s,[P[1],P[2]]);break;case"s":I(s,s,[P[1],P[2]]);break;case"r":_(s,s,P[1]);break;case"m":T(s,s,P[1]);break;default:break}}return s}N.vs=x;function p(d,c){return d[0]*c[1]-c[0]*d[1]}k=p;function v(d,c,s){var m=U.vec2.angle(d,c),M=p(d,c)>=0;return s?M?Math.PI*2-m:m:M?m:Math.PI*2-m}k=v;function g(d,c,s){return s?(d[0]=c[1],d[1]=-1*c[0]):(d[0]=-1*c[1],d[1]=c[0]),d}k=g},50037:function(Mt,N,F){"use strict";F.r(N),F.d(N,{Cache:function(){return as},angleTo:function(){return fe},arcToCubic:function(){return Oe},assign:function(){return Bo},augment:function(){return vi},clamp:function(){return So.Z},clearAnimationFrame:function(){return yu},clone:function(){return Xs},clonePath:function(){return Sr},contains:function(){return Le},createDOM:function(){return Af},debounce:function(){return xf},deepMix:function(){return ac},difference:function(){return nr},direction:function(){return se},distanceSquareRoot:function(){return Rn},each:function(){return lr},endsWith:function(){return to},equalizeSegments:function(){return X},every:function(){return Ru},extend:function(){return Vi},filter:function(){return qe},find:function(){return In},findIndex:function(){return D},firstValue:function(){return xe},fixedBase:function(){return di},flatten:function(){return De},flattenDeep:function(){return Je},forIn:function(){return Jo},get:function(){return io},getDrawDirection:function(){return Wn},getPathArea:function(){return un},getPathBBox:function(){return Cn},getPathBBoxTotalLength:function(){return oa},getPointAtLength:function(){return Y},getRange:function(){return ir},getRotatedCurve:function(){return xn},getTotalLength:function(){return Sn},getType:function(){return qo},getWrapBehavior:function(){return ro},gradient:function(){return m},group:function(){return $i},groupBy:function(){return Ho},groupToMap:function(){return zi},has:function(){return vs},hasKey:function(){return Bu},hasValue:function(){return yo},head:function(){return Ki},identity:function(){return Ku},includes:function(){return Le},indexOf:function(){return wf},isArguments:function(){return du},isArray:function(){return Ur},isArrayLike:function(){return Me},isBoolean:function(){return Uu},isDate:function(){return ao},isDecimal:function(){return hi},isElement:function(){return gu},isEmpty:function(){return Hu},isEqual:function(){return ms},isEqualWith:function(){return Zu},isError:function(){return Xu},isEven:function(){return Vn},isFinite:function(){return vu},isFunction:function(){return I},isInteger:function(){return qa},isMatch:function(){return ea},isNegative:function(){return bi},isNil:function(){return Ft.Z},isNull:function(){return pf},isNumber:function(){return mi.Z},isNumberEqual:function(){return go},isObject:function(){return Ct},isObjectLike:function(){return Tn},isOdd:function(){return Mo},isPlainObject:function(){return Zn},isPointInPolygon:function(){return na},isPointInStroke:function(){return C},isPolygonsIntersect:function(){return If},isPositive:function(){return su},isPrototype:function(){return Gs},isRegExp:function(){return mf},isString:function(){return Kn},isType:function(){return er.Z},isUndefined:function(){return zs},keys:function(){return br},last:function(){return Si},lowerCase:function(){return cu},lowerFirst:function(){return ps},map:function(){return ii},mapValues:function(){return bs},max:function(){return lt},maxBy:function(){return gf},memoize:function(){return T},min:function(){return Tt},minBy:function(){return uu},mix:function(){return Bo},mod:function(){return dn},modifyCSS:function(){return oo},noop:function(){return mu},normalizePath:function(){return It},number2color:function(){return vo},omit:function(){return Co},parseRadius:function(){return Ca},path2Absolute:function(){return Nr},path2Curve:function(){return rn},path2String:function(){return Ae},pick:function(){return Mf},pull:function(){return jn},pullAt:function(){return ya},reduce:function(){return bo},remove:function(){return Fi},requestAnimationFrame:function(){return pu},reverseCurve:function(){return qr},rgb2arr:function(){return k},set:function(){return ns},size:function(){return $u},some:function(){return ri},sortBy:function(){return Ei},startsWith:function(){return On},substitute:function(){return Gu},throttle:function(){return ic},toArray:function(){return oc},toCSSGradient:function(){return Q},toDegree:function(){return Ps},toInteger:function(){return $o},toRGB:function(){return d},toRadian:function(){return Qo},toString:function(){return gs},transform:function(){return K},union:function(){return Yo},uniq:function(){return eo},uniqueId:function(){return Cf},upperCase:function(){return ko},upperFirst:function(){return zu},values:function(){return Fa},valuesOfKey:function(){return Po},vertical:function(){return Ie},wrapBehavior:function(){return Ui}});function k(q){return[parseInt(q.substr(1,2),16),parseInt(q.substr(3,2),16),parseInt(q.substr(5,2),16)]}function U(q){var de=Math.round(q).toString(16);return de.length===1?"0"+de:de}function L(q){return"#"+U(q[0])+U(q[1])+U(q[2])}function _(q){var de,Ee,Pe,je=q||1;function bt(jt,vr){++de>je&&(Pe=Ee,St(1),++de),Ee[jt]=vr}function St(jt){de=0,Ee=Object.create(null),jt||(Pe=Object.create(null))}return St(),{clear:St,has:function(jt){return Ee[jt]!==void 0||Pe[jt]!==void 0},get:function(jt){var vr=Ee[jt];if(vr!==void 0)return vr;if((vr=Pe[jt])!==void 0)return bt(jt,vr),vr},set:function(jt,vr){Ee[jt]!==void 0?Ee[jt]=vr:bt(jt,vr)}}}var I=function(q){return typeof q=="function"},T=function(q,de,Ee){if(Ee===void 0&&(Ee=128),!I(q))throw new TypeError("Expected a function");var Pe=function(){for(var je=[],bt=0;bt<arguments.length;bt++)je[bt]=arguments[bt];var St=de?de.apply(this,je):je[0],jt=Pe.cache;if(jt.has(St))return jt.get(St);var vr=q.apply(this,je);return jt.set(St,vr),vr};return Pe.cache=_(Ee),Pe},x=/rgba?\(([\s.,0-9]+)\)/;function p(){var q=document.createElement("i");return q.title="Web Colour Picker",q.style.display="none",document.body.appendChild(q),q}var v;function g(q){if(q[0]==="#"&&q.length===7)return q;v||(v=p()),v.style.color=q;var de=document.defaultView.getComputedStyle(v,"").getPropertyValue("color"),Ee=x.exec(de),Pe=Ee[1].split(/\s*,\s*/).map(function(je){return Number(je)});return de=L(Pe),de}var d=T(g,function(q){return q},256);function c(q,de,Ee,Pe){return q[Pe]+(de[Pe]-q[Pe])*Ee}function s(q,de){var Ee=isNaN(Number(de))||de<0?0:de>1?1:Number(de),Pe=q.length-1,je=Math.floor(Pe*Ee),bt=Pe*Ee-je,St=q[je],jt=je===Pe?St:q[je+1];return L([c(St,jt,bt,0),c(St,jt,bt,1),c(St,jt,bt,2)])}function m(q){var de=typeof q=="string"?q.split("-"):q,Ee=de.map(function(Pe){return k(Pe.indexOf("#")===-1?d(Pe):Pe)});return function(Pe){return s(Ee,Pe)}}var M=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,P=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,R=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function j(q){return/^[r,R,L,l]{1}[\s]*\(/.test(q)}function Q(q){if(j(q)){var de,Ee=void 0;if(q[0]==="l"){var Pe=M.exec(q),je=+Pe[1]+90;Ee=Pe[2],de="linear-gradient("+je+"deg, "}else if(q[0]==="r"){de="radial-gradient(";var Pe=P.exec(q);Ee=Pe[4]}var bt=Ee.match(R);return bt.forEach(function(St,jt){var vr=St.split(":");de+=vr[1]+" "+Number(vr[0])*100+"%",jt!==bt.length-1&&(de+=", ")}),de+=")",de}return q}var G=F(73485);function W(q,de,Ee){var Pe=[0,0,0,0,0,0,0,0,0];return G.fromTranslation(Pe,Ee),G.multiply(q,Pe,de)}function H(q,de,Ee){var Pe=[0,0,0,0,0,0,0,0,0];return G.fromRotation(Pe,Ee),G.multiply(q,Pe,de)}function Z(q,de,Ee){var Pe=[0,0,0,0,0,0,0,0,0];return G.fromScaling(Pe,Ee),G.multiply(q,Pe,de)}function J(q,de,Ee){return G.multiply(q,Ee,de)}function K(q,de){for(var Ee=q?[].concat(q):[1,0,0,0,1,0,0,0,1],Pe=0,je=de.length;Pe<je;Pe++){var bt=de[Pe];switch(bt[0]){case"t":W(Ee,Ee,[bt[1],bt[2]]);break;case"s":Z(Ee,Ee,[bt[1],bt[2]]);break;case"r":H(Ee,Ee,bt[1]);break;case"m":J(Ee,Ee,bt[1]);break;default:break}}return Ee}var ne=F(38015);function se(q,de){return q[0]*de[1]-de[0]*q[1]}function fe(q,de,Ee){var Pe=ne.angle(q,de),je=se(q,de)>=0;return Ee?je?Math.PI*2-Pe:Pe:je?Pe:Math.PI*2-Pe}function Ie(q,de,Ee){return Ee?(q[0]=de[1],q[1]=-1*de[0]):(q[0]=-1*de[1],q[1]=de[0]),q}function ye(q,de){if(de==="off")return[].concat(q);var Ee=typeof de=="number"&&de>=1?Math.pow(10,de):1;return q.map(function(Pe){var je=Pe.slice(1).map(Number).map(function(bt){return de?Math.round(bt*Ee)/Ee:Math.round(bt)});return[Pe[0]].concat(je)})}function Ae(q,de){return de===void 0&&(de="off"),ye(q,de).map(function(Ee){return Ee[0]+Ee.slice(1).join(" ")}).join("")}var Se=F(99938),we={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Te(q,de,Ee){if(q[Ee].length>7){q[Ee].shift();for(var Pe=q[Ee],je=Ee;Pe.length;)de[Ee]="A",q.splice(je+=1,0,["C"].concat(Pe.splice(0,6)));q.splice(Ee,1)}}var ke={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ge(q){return Array.isArray(q)&&q.every(function(de){var Ee=de[0].toLowerCase();return ke[Ee]===de.length-1&&"achlmqstvz".includes(Ee)})}function tt(q){return Ge(q)&&q.every(function(de){var Ee=de[0];return Ee===Ee.toUpperCase()})}function He(q){return tt(q)&&q.every(function(de){var Ee=de[0];return"ACLMQZ".includes(Ee)})}function ft(q){for(var de=q.pathValue[q.segmentStart],Ee=de.toLowerCase(),Pe=q.data;Pe.length>=ke[Ee]&&(Ee==="m"&&Pe.length>2?(q.segments.push([de].concat(Pe.splice(0,2))),Ee="l",de=de==="m"?"l":"L"):q.segments.push([de].concat(Pe.splice(0,ke[Ee]))),!!ke[Ee]););}function Lt(q){var de=q.index,Ee=q.pathValue,Pe=Ee.charCodeAt(de);if(Pe===48){q.param=0,q.index+=1;return}if(Pe===49){q.param=1,q.index+=1;return}q.err='[path-util]: invalid Arc flag "'+Ee[de]+'", expecting 0 or 1 at index '+de}function Jt(q){return q>=48&&q<=57||q===43||q===45||q===46}function Qe(q){return q>=48&&q<=57}function ut(q){var de=q.max,Ee=q.pathValue,Pe=q.index,je=Pe,bt=!1,St=!1,jt=!1,vr=!1,xr;if(je>=de){q.err="[path-util]: Invalid path value at index "+je+', "pathValue" is missing param';return}if(xr=Ee.charCodeAt(je),(xr===43||xr===45)&&(je+=1,xr=Ee.charCodeAt(je)),!Qe(xr)&&xr!==46){q.err="[path-util]: Invalid path value at index "+je+', "'+Ee[je]+'" is not a number';return}if(xr!==46){if(bt=xr===48,je+=1,xr=Ee.charCodeAt(je),bt&&je<de&&xr&&Qe(xr)){q.err="[path-util]: Invalid path value at index "+Pe+', "'+Ee[Pe]+'" illegal number';return}for(;je<de&&Qe(Ee.charCodeAt(je));)je+=1,St=!0;xr=Ee.charCodeAt(je)}if(xr===46){for(vr=!0,je+=1;Qe(Ee.charCodeAt(je));)je+=1,jt=!0;xr=Ee.charCodeAt(je)}if(xr===101||xr===69){if(vr&&!St&&!jt){q.err="[path-util]: Invalid path value at index "+je+', "'+Ee[je]+'" invalid float exponent';return}if(je+=1,xr=Ee.charCodeAt(je),(xr===43||xr===45)&&(je+=1),je<de&&Qe(Ee.charCodeAt(je)))for(;je<de&&Qe(Ee.charCodeAt(je));)je+=1;else{q.err="[path-util]: Invalid path value at index "+je+', "'+Ee[je]+'" invalid integer exponent';return}}q.index=je,q.param=+q.pathValue.slice(Pe,je)}function xt(q){var de=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return q===10||q===13||q===8232||q===8233||q===32||q===9||q===11||q===12||q===160||q>=5760&&de.includes(q)}function dt(q){for(var de=q.pathValue,Ee=q.max;q.index<Ee&&xt(de.charCodeAt(q.index));)q.index+=1}function pt(q){switch(q|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function wt(q){return(q|32)===97}function mt(q){var de=q.max,Ee=q.pathValue,Pe=q.index,je=Ee.charCodeAt(Pe),bt=ke[Ee[Pe].toLowerCase()];if(q.segmentStart=Pe,!pt(je)){q.err='[path-util]: Invalid path value "'+Ee[Pe]+'" is not a path command';return}if(q.index+=1,dt(q),q.data=[],!bt){ft(q);return}for(;;){for(var St=bt;St>0;St-=1){if(wt(je)&&(St===3||St===4)?Lt(q):ut(q),q.err.length)return;q.data.push(q.param),dt(q),q.index<de&&Ee.charCodeAt(q.index)===44&&(q.index+=1,dt(q))}if(q.index>=q.max||!Jt(Ee.charCodeAt(q.index)))break}ft(q)}var ur=function(){function q(de){this.pathValue=de,this.segments=[],this.max=de.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return q}();function Ir(q){if(Ge(q))return[].concat(q);var de=new ur(q);for(dt(de);de.index<de.max&&!de.err.length;)mt(de);return de.err?de.err:de.segments}function Nr(q){if(tt(q))return[].concat(q);var de=Ir(q),Ee=0,Pe=0,je=0,bt=0;return de.map(function(St){var jt=St.slice(1).map(Number),vr=St[0],xr=vr.toUpperCase();if(vr==="M")return Ee=jt[0],Pe=jt[1],je=Ee,bt=Pe,["M",Ee,Pe];var $r;if(vr!==xr)switch(xr){case"A":$r=[xr,jt[0],jt[1],jt[2],jt[3],jt[4],jt[5]+Ee,jt[6]+Pe];break;case"V":$r=[xr,jt[0]+Pe];break;case"H":$r=[xr,jt[0]+Ee];break;default:{var an=jt.map(function(Gn,$n){return Gn+($n%2?Pe:Ee)});$r=[xr].concat(an)}}else $r=[xr].concat(jt);var tn=$r.length;switch(xr){case"Z":Ee=je,Pe=bt;break;case"H":Ee=$r[1];break;case"V":Pe=$r[1];break;default:Ee=$r[tn-2],Pe=$r[tn-1],xr==="M"&&(je=Ee,bt=Pe)}return $r})}function Hr(q,de){var Ee=q[0],Pe=de.x1,je=de.y1,bt=de.x2,St=de.y2,jt=q.slice(1).map(Number),vr=q;if("TQ".includes(Ee)||(de.qx=null,de.qy=null),Ee==="H")vr=["L",q[1],je];else if(Ee==="V")vr=["L",Pe,q[1]];else if(Ee==="S"){var xr=Pe*2-bt,$r=je*2-St;de.x1=xr,de.y1=$r,vr=["C",xr,$r].concat(jt)}else if(Ee==="T"){var an=Pe*2-de.qx,tn=je*2-de.qy;de.qx=an,de.qy=tn,vr=["Q",an,tn].concat(jt)}else if(Ee==="Q"){var Gn=jt[0],$n=jt[1];de.qx=Gn,de.qy=$n}return vr}function It(q){if(He(q))return[].concat(q);for(var de=Nr(q),Ee=(0,Se.__assign)({},we),Pe=0;Pe<de.length;Pe+=1){de[Pe]=Hr(de[Pe],Ee);var je=de[Pe],bt=je.length;Ee.x1=+je[bt-2],Ee.y1=+je[bt-1],Ee.x2=+je[bt-4]||Ee.x1,Ee.y2=+je[bt-3]||Ee.y1}return de}function qt(q){return He(q)&&q.every(function(de){var Ee=de[0];return"MC".includes(Ee)})}function ar(q,de,Ee){var Pe=q*Math.cos(Ee)-de*Math.sin(Ee),je=q*Math.sin(Ee)+de*Math.cos(Ee);return{x:Pe,y:je}}function Oe(q,de,Ee,Pe,je,bt,St,jt,vr,xr){var $r=q,an=de,tn=Ee,Gn=Pe,$n=jt,Dn=vr,Nn=Math.PI*120/180,zn=Math.PI/180*(+je||0),pn=[],Yn,Xn,bn,Qn,ga;if(xr)Xn=xr[0],bn=xr[1],Qn=xr[2],ga=xr[3];else{Yn=ar($r,an,-zn),$r=Yn.x,an=Yn.y,Yn=ar($n,Dn,-zn),$n=Yn.x,Dn=Yn.y;var Da=($r-$n)/2,Ma=(an-Dn)/2,ha=Da*Da/(tn*tn)+Ma*Ma/(Gn*Gn);ha>1&&(ha=Math.sqrt(ha),tn*=ha,Gn*=ha);var Pa=tn*tn,Qa=Gn*Gn,Ya=(bt===St?-1:1)*Math.sqrt(Math.abs((Pa*Qa-Pa*Ma*Ma-Qa*Da*Da)/(Pa*Ma*Ma+Qa*Da*Da)));Qn=Ya*tn*Ma/Gn+($r+$n)/2,ga=Ya*-Gn*Da/tn+(an+Dn)/2,Xn=Math.asin(((an-ga)/Gn*Math.pow(10,9)>>0)/Math.pow(10,9)),bn=Math.asin(((Dn-ga)/Gn*Math.pow(10,9)>>0)/Math.pow(10,9)),Xn=$r<Qn?Math.PI-Xn:Xn,bn=$n<Qn?Math.PI-bn:bn,Xn<0&&(Xn=Math.PI*2+Xn),bn<0&&(bn=Math.PI*2+bn),St&&Xn>bn&&(Xn-=Math.PI*2),!St&&bn>Xn&&(bn-=Math.PI*2)}var zo=bn-Xn;if(Math.abs(zo)>Nn){var Qu=bn,To=$n,$s=Dn;bn=Xn+Nn*(St&&bn>Xn?1:-1),$n=Qn+tn*Math.cos(bn),Dn=ga+Gn*Math.sin(bn),pn=Oe($n,Dn,tn,Gn,je,0,St,To,$s,[bn,Qu,Qn,ga])}zo=bn-Xn;var Qi=Math.cos(Xn),Io=Math.sin(Xn),wu=Math.cos(bn),sc=Math.sin(bn),Qs=Math.tan(zo/4),ei=4/3*tn*Qs,Of=4/3*Gn*Qs,ws=[$r,an],Ss=[$r+ei*Io,an-Of*Qi],Ju=[$n+ei*sc,Dn-Of*wu],so=[$n,Dn];if(Ss[0]=2*ws[0]-Ss[0],Ss[1]=2*ws[1]-Ss[1],xr)return Ss.concat(Ju,so,pn);pn=Ss.concat(Ju,so,pn);for(var qu=[],Uo=0,_s=pn.length;Uo<_s;Uo+=1)qu[Uo]=Uo%2?ar(pn[Uo-1],pn[Uo],zn).y:ar(pn[Uo],pn[Uo+1],zn).x;return qu}function Pr(q,de,Ee,Pe,je,bt){var St=.3333333333333333,jt=2/3;return[St*q+jt*Ee,St*de+jt*Pe,St*je+jt*Ee,St*bt+jt*Pe,je,bt]}function Cr(q,de,Ee){var Pe=q[0],je=q[1],bt=de[0],St=de[1];return[Pe+(bt-Pe)*Ee,je+(St-je)*Ee]}var Gr=function(q,de,Ee,Pe){var je=.5,bt=Cr([q,de],[Ee,Pe],je);return(0,Se.__spreadArray)((0,Se.__spreadArray)([],bt,!0),[Ee,Pe,Ee,Pe],!1)};function mr(q,de){var Ee=q[0],Pe=q.slice(1).map(Number),je=Pe[0],bt=Pe[1],St,jt=de.x1,vr=de.y1,xr=de.x,$r=de.y;switch("TQ".includes(Ee)||(de.qx=null,de.qy=null),Ee){case"M":return de.x=je,de.y=bt,q;case"A":return St=[jt,vr].concat(Pe),["C"].concat(Oe(St[0],St[1],St[2],St[3],St[4],St[5],St[6],St[7],St[8],St[9]));case"Q":return de.qx=je,de.qy=bt,St=[jt,vr].concat(Pe),["C"].concat(Pr(St[0],St[1],St[2],St[3],St[4],St[5]));case"L":return["C"].concat(Gr(jt,vr,je,bt));case"Z":return jt===xr&&vr===$r?["C",jt,vr,xr,$r,xr,$r]:["C"].concat(Gr(jt,vr,xr,$r));default:}return q}function rn(q,de){if(de===void 0&&(de=!1),qt(q)){var Ee=[].concat(q);return de?[Ee,[]]:Ee}for(var Pe=It(q),je=(0,Se.__assign)({},we),bt=[],St="",jt=Pe.length,vr,xr,$r=[],an=0;an<jt;an+=1){Pe[an]&&(St=Pe[an][0]),bt[an]=St;var tn=mr(Pe[an],je);Pe[an]=tn,Te(Pe,bt,an),jt=Pe.length,St==="Z"&&$r.push(an),vr=Pe[an],xr=vr.length,je.x1=+vr[xr-2],je.y1=+vr[xr-1],je.x2=+vr[xr-4]||je.x1,je.y2=+vr[xr-3]||je.y1}return de?[Pe,$r]:Pe}function Sr(q){return q.map(function(de){return Array.isArray(de)?[].concat(de):de})}function qr(q){var de=q.slice(1).map(function(Ee,Pe,je){return Pe?je[Pe-1].slice(-2).concat(Ee.slice(1)):q[0].slice(1).concat(Ee.slice(1))}).map(function(Ee){return Ee.map(function(Pe,je){return Ee[Ee.length-je-2*(1-je%2)]})}).reverse();return[["M"].concat(de[0].slice(0,2))].concat(de.map(function(Ee){return["C"].concat(Ee.slice(2))}))}function Rn(q,de){return Math.sqrt((q[0]-de[0])*(q[0]-de[0])+(q[1]-de[1])*(q[1]-de[1]))}function yn(q,de,Ee,Pe,je){var bt=Rn([q,de],[Ee,Pe]),St={x:0,y:0};if(typeof je=="number")if(je<=0)St={x:q,y:de};else if(je>=bt)St={x:Ee,y:Pe};else{var jt=Cr([q,de],[Ee,Pe],je/bt),vr=jt[0],xr=jt[1];St={x:vr,y:xr}}return{length:bt,point:St,min:{x:Math.min(q,Ee),y:Math.min(de,Pe)},max:{x:Math.max(q,Ee),y:Math.max(de,Pe)}}}function zr(q,de){var Ee=q.x,Pe=q.y,je=de.x,bt=de.y,St=Ee*je+Pe*bt,jt=Math.sqrt((Math.pow(Ee,2)+Math.pow(Pe,2))*(Math.pow(je,2)+Math.pow(bt,2))),vr=Ee*bt-Pe*je<0?-1:1,xr=vr*Math.acos(St/jt);return xr}function Rt(q,de,Ee,Pe,je,bt,St,jt,vr,xr){var $r=Math.abs,an=Math.sin,tn=Math.cos,Gn=Math.sqrt,$n=Math.PI,Dn=$r(Ee),Nn=$r(Pe),zn=(je%360+360)%360,pn=zn*($n/180);if(q===jt&&de===vr)return{x:q,y:de};if(Dn===0||Nn===0)return yn(q,de,jt,vr,xr).point;var Yn=(q-jt)/2,Xn=(de-vr)/2,bn={x:tn(pn)*Yn+an(pn)*Xn,y:-an(pn)*Yn+tn(pn)*Xn},Qn=Math.pow(bn.x,2)/Math.pow(Dn,2)+Math.pow(bn.y,2)/Math.pow(Nn,2);Qn>1&&(Dn*=Gn(Qn),Nn*=Gn(Qn));var ga=Math.pow(Dn,2)*Math.pow(Nn,2)-Math.pow(Dn,2)*Math.pow(bn.y,2)-Math.pow(Nn,2)*Math.pow(bn.x,2),Da=Math.pow(Dn,2)*Math.pow(bn.y,2)+Math.pow(Nn,2)*Math.pow(bn.x,2),Ma=ga/Da;Ma=Ma<0?0:Ma;var ha=(bt!==St?1:-1)*Gn(Ma),Pa={x:ha*(Dn*bn.y/Nn),y:ha*(-(Nn*bn.x)/Dn)},Qa={x:tn(pn)*Pa.x-an(pn)*Pa.y+(q+jt)/2,y:an(pn)*Pa.x+tn(pn)*Pa.y+(de+vr)/2},Ya={x:(bn.x-Pa.x)/Dn,y:(bn.y-Pa.y)/Nn},zo=zr({x:1,y:0},Ya),Qu={x:(-bn.x-Pa.x)/Dn,y:(-bn.y-Pa.y)/Nn},To=zr(Ya,Qu);!St&&To>0?To-=2*$n:St&&To<0&&(To+=2*$n),To%=2*$n;var $s=zo+To*xr,Qi=Dn*tn($s),Io=Nn*an($s),wu={x:tn(pn)*Qi-an(pn)*Io+Qa.x,y:an(pn)*Qi+tn(pn)*Io+Qa.y};return wu}function zt(q,de,Ee,Pe,je,bt,St,jt,vr,xr,$r){var an,tn=$r.bbox,Gn=tn===void 0?!0:tn,$n=$r.length,Dn=$n===void 0?!0:$n,Nn=$r.sampleSize,zn=Nn===void 0?30:Nn,pn=typeof xr=="number",Yn=q,Xn=de,bn=0,Qn=[Yn,Xn,bn],ga=[Yn,Xn],Da=0,Ma={x:0,y:0},ha=[{x:Yn,y:Xn}];pn&&xr<=0&&(Ma={x:Yn,y:Xn});for(var Pa=0;Pa<=zn;Pa+=1){if(Da=Pa/zn,an=Rt(q,de,Ee,Pe,je,bt,St,jt,vr,Da),Yn=an.x,Xn=an.y,Gn&&ha.push({x:Yn,y:Xn}),Dn&&(bn+=Rn(ga,[Yn,Xn])),ga=[Yn,Xn],pn&&bn>=xr&&xr>Qn[2]){var Qa=(bn-xr)/(bn-Qn[2]);Ma={x:ga[0]*(1-Qa)+Qn[0]*Qa,y:ga[1]*(1-Qa)+Qn[1]*Qa}}Qn=[Yn,Xn,bn]}return pn&&xr>=bn&&(Ma={x:jt,y:vr}),{length:bn,point:Ma,min:{x:Math.min.apply(null,ha.map(function(Ya){return Ya.x})),y:Math.min.apply(null,ha.map(function(Ya){return Ya.y}))},max:{x:Math.max.apply(null,ha.map(function(Ya){return Ya.x})),y:Math.max.apply(null,ha.map(function(Ya){return Ya.y}))}}}function Vt(q,de,Ee,Pe,je,bt,St,jt,vr){var xr=1-vr;return{x:Math.pow(xr,3)*q+3*Math.pow(xr,2)*vr*Ee+3*xr*Math.pow(vr,2)*je+Math.pow(vr,3)*St,y:Math.pow(xr,3)*de+3*Math.pow(xr,2)*vr*Pe+3*xr*Math.pow(vr,2)*bt+Math.pow(vr,3)*jt}}function hr(q,de,Ee,Pe,je,bt,St,jt,vr,xr){var $r,an=xr.bbox,tn=an===void 0?!0:an,Gn=xr.length,$n=Gn===void 0?!0:Gn,Dn=xr.sampleSize,Nn=Dn===void 0?10:Dn,zn=typeof vr=="number",pn=q,Yn=de,Xn=0,bn=[pn,Yn,Xn],Qn=[pn,Yn],ga=0,Da={x:0,y:0},Ma=[{x:pn,y:Yn}];zn&&vr<=0&&(Da={x:pn,y:Yn});for(var ha=0;ha<=Nn;ha+=1){if(ga=ha/Nn,$r=Vt(q,de,Ee,Pe,je,bt,St,jt,ga),pn=$r.x,Yn=$r.y,tn&&Ma.push({x:pn,y:Yn}),$n&&(Xn+=Rn(Qn,[pn,Yn])),Qn=[pn,Yn],zn&&Xn>=vr&&vr>bn[2]){var Pa=(Xn-vr)/(Xn-bn[2]);Da={x:Qn[0]*(1-Pa)+bn[0]*Pa,y:Qn[1]*(1-Pa)+bn[1]*Pa}}bn=[pn,Yn,Xn]}return zn&&vr>=Xn&&(Da={x:St,y:jt}),{length:Xn,point:Da,min:{x:Math.min.apply(null,Ma.map(function(Qa){return Qa.x})),y:Math.min.apply(null,Ma.map(function(Qa){return Qa.y}))},max:{x:Math.max.apply(null,Ma.map(function(Qa){return Qa.x})),y:Math.max.apply(null,Ma.map(function(Qa){return Qa.y}))}}}function Ar(q,de,Ee,Pe,je,bt,St){var jt=1-St;return{x:Math.pow(jt,2)*q+2*jt*St*Ee+Math.pow(St,2)*je,y:Math.pow(jt,2)*de+2*jt*St*Pe+Math.pow(St,2)*bt}}function en(q,de,Ee,Pe,je,bt,St,jt){var vr,xr=jt.bbox,$r=xr===void 0?!0:xr,an=jt.length,tn=an===void 0?!0:an,Gn=jt.sampleSize,$n=Gn===void 0?10:Gn,Dn=typeof St=="number",Nn=q,zn=de,pn=0,Yn=[Nn,zn,pn],Xn=[Nn,zn],bn=0,Qn={x:0,y:0},ga=[{x:Nn,y:zn}];Dn&&St<=0&&(Qn={x:Nn,y:zn});for(var Da=0;Da<=$n;Da+=1){if(bn=Da/$n,vr=Ar(q,de,Ee,Pe,je,bt,bn),Nn=vr.x,zn=vr.y,$r&&ga.push({x:Nn,y:zn}),tn&&(pn+=Rn(Xn,[Nn,zn])),Xn=[Nn,zn],Dn&&pn>=St&&St>Yn[2]){var Ma=(pn-St)/(pn-Yn[2]);Qn={x:Xn[0]*(1-Ma)+Yn[0]*Ma,y:Xn[1]*(1-Ma)+Yn[1]*Ma}}Yn=[Nn,zn,pn]}return Dn&&St>=pn&&(Qn={x:je,y:bt}),{length:pn,point:Qn,min:{x:Math.min.apply(null,ga.map(function(ha){return ha.x})),y:Math.min.apply(null,ga.map(function(ha){return ha.y}))},max:{x:Math.max.apply(null,ga.map(function(ha){return ha.x})),y:Math.max.apply(null,ga.map(function(ha){return ha.y}))}}}function Fr(q,de,Ee){for(var Pe,je,bt,St,jt,vr,xr=It(q),$r=typeof de=="number",an,tn=[],Gn,$n=0,Dn=0,Nn=0,zn=0,pn,Yn=[],Xn=[],bn=0,Qn={x:0,y:0},ga=Qn,Da=Qn,Ma=Qn,ha=0,Pa=0,Qa=xr.length;Pa<Qa;Pa+=1)pn=xr[Pa],Gn=pn[0],an=Gn==="M",tn=an?tn:[$n,Dn].concat(pn.slice(1)),an?(Nn=pn[1],zn=pn[2],Qn={x:Nn,y:zn},ga=Qn,bn=0,$r&&de<.001&&(Ma=Qn)):Gn==="L"?(Pe=yn(tn[0],tn[1],tn[2],tn[3],(de||0)-ha),bn=Pe.length,Qn=Pe.min,ga=Pe.max,Da=Pe.point):Gn==="A"?(je=zt(tn[0],tn[1],tn[2],tn[3],tn[4],tn[5],tn[6],tn[7],tn[8],(de||0)-ha,Ee||{}),bn=je.length,Qn=je.min,ga=je.max,Da=je.point):Gn==="C"?(bt=hr(tn[0],tn[1],tn[2],tn[3],tn[4],tn[5],tn[6],tn[7],(de||0)-ha,Ee||{}),bn=bt.length,Qn=bt.min,ga=bt.max,Da=bt.point):Gn==="Q"?(St=en(tn[0],tn[1],tn[2],tn[3],tn[4],tn[5],(de||0)-ha,Ee||{}),bn=St.length,Qn=St.min,ga=St.max,Da=St.point):Gn==="Z"&&(tn=[$n,Dn,Nn,zn],jt=yn(tn[0],tn[1],tn[2],tn[3],(de||0)-ha),bn=jt.length,Qn=jt.min,ga=jt.max,Da=jt.point),$r&&ha<de&&ha+bn>=de&&(Ma=Da),Xn.push(ga),Yn.push(Qn),ha+=bn,vr=Gn!=="Z"?pn.slice(-2):[Nn,zn],$n=vr[0],Dn=vr[1];return $r&&de>=ha&&(Ma={x:$n,y:Dn}),{length:ha,point:Ma,min:{x:Math.min.apply(null,Yn.map(function(Ya){return Ya.x})),y:Math.min.apply(null,Yn.map(function(Ya){return Ya.y}))},max:{x:Math.max.apply(null,Xn.map(function(Ya){return Ya.x})),y:Math.max.apply(null,Xn.map(function(Ya){return Ya.y}))}}}function Cn(q,de){if(!q)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var Ee=Fr(q,void 0,(0,Se.__assign)((0,Se.__assign)({},de),{length:!1})),Pe=Ee.min,je=Pe.x,bt=Pe.y,St=Ee.max,jt=St.x,vr=St.y,xr=jt-je,$r=vr-bt;return{width:xr,height:$r,x:je,y:bt,x2:jt,y2:vr,cx:je+xr/2,cy:bt+$r/2,cz:Math.max(xr,$r)+Math.min(xr,$r)/2}}function Sn(q,de){return Fr(q,void 0,(0,Se.__assign)((0,Se.__assign)({},de),{bbox:!1,length:!0})).length}function oa(q,de){if(!q)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var Ee=Fr(q,void 0,(0,Se.__assign)((0,Se.__assign)({},de),{bbox:!0,length:!0})),Pe=Ee.length,je=Ee.min,bt=je.x,St=je.y,jt=Ee.max,vr=jt.x,xr=jt.y,$r=vr-bt,an=xr-St;return{length:Pe,width:$r,height:an,x:bt,y:St,x2:vr,y2:xr,cx:bt+$r/2,cy:St+an/2,cz:Math.max($r,an)+Math.min($r,an)/2}}function jr(q){var de=q.length,Ee=de-1;return q.map(function(Pe,je){return q.map(function(bt,St){var jt=je+St,vr;return St===0||q[jt]&&q[jt][0]==="M"?(vr=q[jt],["M"].concat(vr.slice(-2))):(jt>=de&&(jt-=Ee),q[jt])})})}function xn(q,de){var Ee=q.length-1,Pe=[],je=0,bt=0,St=jr(q);return St.forEach(function(jt,vr){q.slice(1).forEach(function(xr,$r){bt+=Rn(q[(vr+$r)%Ee].slice(-2),de[$r%Ee].slice(-2))}),Pe[vr]=bt,bt=0}),je=Pe.indexOf(Math.min.apply(null,Pe)),St[je]}function vn(q,de,Ee,Pe,je,bt,St,jt){return 3*((jt-de)*(Ee+je)-(St-q)*(Pe+bt)+Pe*(q-je)-Ee*(de-bt)+jt*(je+q/3)-St*(bt+de/3))/20}function un(q){var de=0,Ee=0,Pe=0;return rn(q).map(function(je){var bt;switch(je[0]){case"M":return de=je[1],Ee=je[2],0;default:var St=je.slice(1),jt=St[0],vr=St[1],xr=St[2],$r=St[3],an=St[4],tn=St[5];return Pe=vn(de,Ee,jt,vr,xr,$r,an,tn),bt=je.slice(-2),de=bt[0],Ee=bt[1],Pe}}).reduce(function(je,bt){return je+bt},0)}function Wn(q){return un(q)>=0}function Y(q,de,Ee){return Fr(q,de,(0,Se.__assign)((0,Se.__assign)({},Ee),{bbox:!1,length:!0})).point}function ie(q,de){var Ee=Ir(q);if(typeof Ee=="string")throw TypeError(Ee);var Pe=Ee.slice(),je=Sn(Pe),bt=Pe.length-1,St=0,jt=0,vr=Ee[0],xr=vr.slice(-2),$r=xr[0],an=xr[1],tn={x:$r,y:an};if(bt<=0||!de||!Number.isFinite(de))return{segment:vr,index:0,length:jt,point:tn,lengthAtSegment:St};if(de>=je)return Pe=Ee.slice(0,-1),St=Sn(Pe),jt=je-St,{segment:Ee[bt],index:bt,length:jt,lengthAtSegment:St};for(var Gn=[];bt>0;)vr=Pe[bt],Pe=Pe.slice(0,-1),St=Sn(Pe),jt=je-St,je=St,Gn.push({segment:vr,index:bt,length:jt,lengthAtSegment:St}),bt-=1;return Gn.find(function($n){var Dn=$n.lengthAtSegment;return Dn<=de})}function ee(q,de){for(var Ee=Ir(q),Pe=It(Ee),je=Sn(Ee),bt=function(bn){var Qn=bn.x-de.x,ga=bn.y-de.y;return Qn*Qn+ga*ga},St=8,jt,vr=0,xr,$r=0,an=1/0,tn=0;tn<=je;tn+=St)jt=Y(Pe,tn),vr=bt(jt),vr<an&&(xr=jt,$r=tn,an=vr);St/=2;for(var Gn,$n,Dn=0,Nn=0,zn=0,pn=0;St>.5;)Dn=$r-St,Gn=Y(Pe,Dn),zn=bt(Gn),Nn=$r+St,$n=Y(Pe,Nn),pn=bt($n),Dn>=0&&zn<an?(xr=Gn,$r=Dn,an=zn):Nn<=je&&pn<an?(xr=$n,$r=Nn,an=pn):St/=2;var Yn=ie(Ee,$r),Xn=Math.sqrt(an);return{closest:xr,distance:Xn,segment:Yn}}function C(q,de){var Ee=ee(q,de).distance;return Math.abs(Ee)<.001}function b(q,de){de===void 0&&(de=.5);var Ee=q.slice(0,2),Pe=q.slice(2,4),je=q.slice(4,6),bt=q.slice(6,8),St=Cr(Ee,Pe,de),jt=Cr(Pe,je,de),vr=Cr(je,bt,de),xr=Cr(St,jt,de),$r=Cr(jt,vr,de),an=Cr(xr,$r,de);return[["C"].concat(St,xr,an),["C"].concat($r,vr,bt)]}function S(q){return q.map(function(de,Ee,Pe){var je=Ee&&Pe[Ee-1].slice(-2).concat(de.slice(1)),bt=Ee?hr(je[0],je[1],je[2],je[3],je[4],je[5],je[6],je[7],je[8],{bbox:!1}).length:0,St;return Ee?St=bt?b(je):[de,de]:St=[de],{s:de,ss:St,l:bt}})}function X(q,de,Ee){var Pe=S(q),je=S(de),bt=Pe.length,St=je.length,jt=Pe.filter(function(Nn){return Nn.l}).length,vr=je.filter(function(Nn){return Nn.l}).length,xr=Pe.filter(function(Nn){return Nn.l}).reduce(function(Nn,zn){var pn=zn.l;return Nn+pn},0)/jt||0,$r=je.filter(function(Nn){return Nn.l}).reduce(function(Nn,zn){var pn=zn.l;return Nn+pn},0)/vr||0,an=Ee||Math.max(bt,St),tn=[xr,$r],Gn=[an-bt,an-St],$n=0,Dn=[Pe,je].map(function(Nn,zn){return Nn.l===an?Nn.map(function(pn){return pn.s}):Nn.map(function(pn,Yn){return $n=Yn&&Gn[zn]&&pn.l>=tn[zn],Gn[zn]-=$n?1:0,$n?pn.ss:[pn.s]}).flat()});return Dn[0].length===Dn[1].length?Dn:X(Dn[0],Dn[1],an)}var pe=function(q){return q!==null&&typeof q!="function"&&isFinite(q.length)},Me=pe,me=function(q,de){return Me(q)?q.indexOf(de)>-1:!1},Le=me,st=function(q,de){if(!Me(q))return q;for(var Ee=[],Pe=0;Pe<q.length;Pe++){var je=q[Pe];de(je,Pe)&&Ee.push(je)}return Ee},qe=st,Nt=function(q,de){return de===void 0&&(de=[]),qe(q,function(Ee){return!Le(de,Ee)})},nr=Nt,Ft=F(58622),er=F(98104),Ur=function(q){return Array.isArray?Array.isArray(q):(0,er.Z)(q,"Array")},Ct=function(q){var de=typeof q;return q!==null&&de==="object"||de==="function"};function Kt(q,de){if(q){var Ee;if(Ur(q))for(var Pe=0,je=q.length;Pe<je&&(Ee=de(q[Pe],Pe),Ee!==!1);Pe++);else if(Ct(q)){for(var bt in q)if(q.hasOwnProperty(bt)&&(Ee=de(q[bt],bt),Ee===!1))break}}}var lr=Kt,Dr=Object.keys?function(q){return Object.keys(q)}:function(q){var de=[];return lr(q,function(Ee,Pe){I(q)&&Pe==="prototype"||de.push(Pe)}),de},br=Dr;function sa(q,de){var Ee=br(de),Pe=Ee.length;if((0,Ft.Z)(q))return!Pe;for(var je=0;je<Pe;je+=1){var bt=Ee[je];if(de[bt]!==q[bt]||!(bt in q))return!1}return!0}var ea=sa,gn=function(q){return typeof q=="object"&&q!==null},Tn=gn,ra=function(q){if(!Tn(q)||!(0,er.Z)(q,"Object"))return!1;if(Object.getPrototypeOf(q)===null)return!0;for(var de=q;Object.getPrototypeOf(de)!==null;)de=Object.getPrototypeOf(de);return Object.getPrototypeOf(q)===de},Zn=ra;function Vr(q,de){if(!Ur(q))return null;var Ee;if(I(de)&&(Ee=de),Zn(de)&&(Ee=function(je){return ea(je,de)}),Ee){for(var Pe=0;Pe<q.length;Pe+=1)if(Ee(q[Pe]))return q[Pe]}return null}var In=Vr;function at(q,de,Ee){Ee===void 0&&(Ee=0);for(var Pe=Ee;Pe<q.length;Pe++)if(de(q[Pe],Pe))return Pe;return-1}var D=at,te=function(q,de){for(var Ee=null,Pe=0;Pe<q.length;Pe++){var je=q[Pe],bt=je[de];if(!(0,Ft.Z)(bt)){Ur(bt)?Ee=bt[0]:Ee=bt;break}}return Ee},xe=te,be=function(q){if(!Ur(q))return[];for(var de=[],Ee=0;Ee<q.length;Ee++)de=de.concat(q[Ee]);return de},De=be,Xe=function(q,de){if(de===void 0&&(de=[]),!Ur(q))de.push(q);else for(var Ee=0;Ee<q.length;Ee+=1)Xe(q[Ee],de);return de},Je=Xe,lt=function(q){if(Ur(q))return q.reduce(function(de,Ee){return Math.max(de,Ee)},q[0])},Tt=function(q){if(Ur(q))return q.reduce(function(de,Ee){return Math.min(de,Ee)},q[0])},Ht=function(q){var de=q.filter(function(St){return!isNaN(St)});if(!de.length)return{min:0,max:0};if(Ur(q[0])){for(var Ee=[],Pe=0;Pe<q.length;Pe++)Ee=Ee.concat(q[Pe]);de=Ee}var je=lt(de),bt=Tt(de);return{min:bt,max:je}},ir=Ht,Kr=Array.prototype,nn=Kr.splice,mn=Kr.indexOf,Jr=function(q){for(var de=[],Ee=1;Ee<arguments.length;Ee++)de[Ee-1]=arguments[Ee];for(var Pe=0;Pe<de.length;Pe++)for(var je=de[Pe],bt=-1;(bt=mn.call(q,je))>-1;)nn.call(q,bt,1);return q},jn=Jr,_a=Array.prototype.splice,Fn=function(de,Ee){if(!Me(de))return[];for(var Pe=de?Ee.length:0,je=Pe-1;Pe--;){var bt=void 0,St=Ee[Pe];(Pe===je||St!==bt)&&(bt=St,_a.call(de,St,1))}return de},ya=Fn,Ai=function(q,de,Ee){if(!Ur(q)&&!Zn(q))return q;var Pe=Ee;return lr(q,function(je,bt){Pe=de(Pe,je,bt)}),Pe},bo=Ai,Zi=function(q,de){var Ee=[];if(!Me(q))return Ee;for(var Pe=-1,je=[],bt=q.length;++Pe<bt;){var St=q[Pe];de(St,Pe,q)&&(Ee.push(St),je.push(Pe))}return ya(q,je),Ee},Fi=Zi,Kn=function(q){return(0,er.Z)(q,"String")};function ho(q,de){var Ee;if(I(de))Ee=function(je,bt){return de(je)-de(bt)};else{var Pe=[];Kn(de)?Pe.push(de):Ur(de)&&(Pe=de),Ee=function(je,bt){for(var St=0;St<Pe.length;St+=1){var jt=Pe[St];if(je[jt]>bt[jt])return 1;if(je[jt]<bt[jt])return-1}return 0}}return q.sort(Ee),q}var Ei=ho;function eo(q,de){de===void 0&&(de=new Map);var Ee=[];if(Array.isArray(q))for(var Pe=0,je=q.length;Pe<je;Pe++){var bt=q[Pe];de.has(bt)||(Ee.push(bt),de.set(bt,!0))}return Ee}var Eo=function(){for(var q=[],de=0;de<arguments.length;de++)q[de]=arguments[de];return eo([].concat.apply([],q))},Yo=Eo,Po=function(q,de){for(var Ee=[],Pe={},je=0;je<q.length;je++){var bt=q[je],St=bt[de];if(!(0,Ft.Z)(St)){Ur(St)||(St=[St]);for(var jt=0;jt<St.length;jt++){var vr=St[jt];Pe[vr]||(Ee.push(vr),Pe[vr]=!0)}}}return Ee};function Ki(q){if(Me(q))return q[0]}function Si(q){if(Me(q)){var de=q;return de[de.length-1]}}function Ns(q,de){return Ur(q)||Kn(q)?q[0]===de:!1}var On=Ns;function Gi(q,de){return Ur(q)||Kn(q)?q[q.length-1]===de:!1}var to=Gi,_i=function(q,de){for(var Ee=0;Ee<q.length;Ee++)if(!de(q[Ee],Ee))return!1;return!0},Ru=_i,xo=function(q,de){for(var Ee=0;Ee<q.length;Ee++)if(de(q[Ee],Ee))return!0;return!1},ri=xo,wo=Object.prototype.hasOwnProperty;function ds(q,de){if(!de||!Ur(q))return{};for(var Ee={},Pe=I(de)?de:function(jt){return jt[de]},je,bt=0;bt<q.length;bt++){var St=q[bt];je=Pe(St),wo.call(Ee,je)?Ee[je].push(St):Ee[je]=[St]}return Ee}var Ho=ds;function zi(q,de){if(!de)return{0:q};if(!I(de)){var Ee=Ur(de)?de:de.replace(/\s+/g,"").split("*");de=function(Pe){for(var je="_",bt=0,St=Ee.length;bt<St;bt++)je+=Pe[Ee[bt]]&&Pe[Ee[bt]].toString();return je}}return Ho(q,de)}var $i=function(q,de){if(!de)return[q];var Ee=zi(q,de),Pe=[];for(var je in Ee)Pe.push(Ee[je]);return Pe};function Va(q,de){return q["_wrap_"+de]}var ro=Va;function Zo(q,de){if(q["_wrap_"+de])return q["_wrap_"+de];var Ee=function(Pe){q[de](Pe)};return q["_wrap_"+de]=Ee,Ee}var Ui=Zo,Wi={};function Ko(q){var de=Wi[q];if(!de){for(var Ee=q.toString(16),Pe=Ee.length;Pe<6;Pe++)Ee="0"+Ee;de="#"+Ee,Wi[q]=de}return de}var vo=Ko;function hs(q){var de=0,Ee=0,Pe=0,je=0;return Ur(q)?q.length===1?de=Ee=Pe=je=q[0]:q.length===2?(de=Pe=q[0],Ee=je=q[1]):q.length===3?(de=q[0],Ee=je=q[1],Pe=q[2]):(de=q[0],Ee=q[1],Pe=q[2],je=q[3]):de=Ee=Pe=je=q,{r1:de,r2:Ee,r3:Pe,r4:je}}var Ca=hs,So=F(39083),ou=function(q,de){var Ee=de.toString(),Pe=Ee.indexOf(".");if(Pe===-1)return Math.round(q);var je=Ee.substr(Pe+1).length;return je>20&&(je=20),parseFloat(q.toFixed(je))},di=ou,mi=F(39696),_o=function(q){return(0,mi.Z)(q)&&q%1!==0},hi=_o,xi=function(q){return(0,mi.Z)(q)&&q%2===0},Vn=xi,ni=Number.isInteger?Number.isInteger:function(q){return(0,mi.Z)(q)&&q%1===0},qa=ni,wi=function(q){return(0,mi.Z)(q)&&q<0},bi=wi,Mi=1e-5;function go(q,de,Ee){return Ee===void 0&&(Ee=Mi),Math.abs(q-de)<Ee}var no=function(q){return(0,mi.Z)(q)&&q%2!==0},Mo=no,po=function(q){return(0,mi.Z)(q)&&q>0},su=po,gf=function(q,de){if(Ur(q)){for(var Ee,Pe=-1/0,je=0;je<q.length;je++){var bt=q[je],St=I(de)?de(bt):bt[de];St>Pe&&(Ee=bt,Pe=St)}return Ee}},uu=function(q,de){if(Ur(q)){for(var Ee,Pe=1/0,je=0;je<q.length;je++){var bt=q[je],St=I(de)?de(bt):bt[de];St<Pe&&(Ee=bt,Pe=St)}return Ee}},_n=function(q,de){return(q%de+de)%de},dn=_n,rc=180/Math.PI,ai=function(q){return rc*q},Ps=ai,$o=parseInt,Ba=Math.PI/180,$a=function(q){return Ba*q},Qo=$a,Jo=lr,vs=function(q,de){return q.hasOwnProperty(de)},Bu=vs,Fu=Object.values?function(q){return Object.values(q)}:function(q){var de=[];return lr(q,function(Ee,Pe){I(q)&&Pe==="prototype"||de.push(Ee)}),de},Fa=Fu,yo=function(q,de){return Le(Fa(q),de)},gs=function(q){return(0,Ft.Z)(q)?"":q.toString()},fu=function(q){return gs(q).toLowerCase()},cu=fu,ks=function(q){var de=gs(q);return de.charAt(0).toLowerCase()+de.substring(1)},ps=ks;function ys(q,de){return!q||!de?q:q.replace(/\\?\{([^{}]+)\}/g,function(Ee,Pe){return Ee.charAt(0)==="\\"?Ee.slice(1):de[Pe]===void 0?"":de[Pe]})}var Gu=ys,Oi=function(q){return gs(q).toUpperCase()},ko=Oi,Rs=function(q){var de=gs(q);return de.charAt(0).toUpperCase()+de.substring(1)},zu=Rs,lu={}.toString,Bs=function(q){return lu.call(q).replace(/^\[object /,"").replace(/]$/,"")},qo=Bs,Fs=function(q){return(0,er.Z)(q,"Arguments")},du=Fs,hu=function(q){return(0,er.Z)(q,"Boolean")},Uu=hu,Wu=function(q){return(0,er.Z)(q,"Date")},ao=Wu,Ro=function(q){return(0,er.Z)(q,"Error")},Xu=Ro;function vu(q){return(0,mi.Z)(q)&&isFinite(q)}var Xi=function(q){return q===null},pf=Xi,ju=Object.prototype,yf=function(q){var de=q&&q.constructor,Ee=typeof de=="function"&&de.prototype||ju;return q===Ee},Gs=yf,nc=function(q){return(0,er.Z)(q,"RegExp")},mf=nc,bf=function(q){return q===void 0},zs=bf,Vu=function(q){return q instanceof Element||q instanceof Document},gu=Vu;function pu(q){var de=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(Ee){return setTimeout(Ee,16)};return de(q)}function yu(q){var de=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;de(q)}function Us(q,de){for(var Ee in de)de.hasOwnProperty(Ee)&&Ee!=="constructor"&&de[Ee]!==void 0&&(q[Ee]=de[Ee])}function Bo(q,de,Ee,Pe){return de&&Us(q,de),Ee&&Us(q,Ee),Pe&&Us(q,Pe),q}var es=function(){for(var q=[],de=0;de<arguments.length;de++)q[de]=arguments[de];for(var Ee=q[0],Pe=1;Pe<q.length;Pe++){var je=q[Pe];I(je)&&(je=je.prototype),Bo(Ee.prototype,je)}},vi=es,Ws=function(q){if(typeof q!="object"||q===null)return q;var de;if(Ur(q)){de=[];for(var Ee=0,Pe=q.length;Ee<Pe;Ee++)typeof q[Ee]=="object"&&q[Ee]!=null?de[Ee]=Ws(q[Ee]):de[Ee]=q[Ee]}else{de={};for(var je in q)typeof q[je]=="object"&&q[je]!=null?de[je]=Ws(q[je]):de[je]=q[je]}return de},Xs=Ws;function Ef(q,de,Ee){var Pe;return function(){var je=this,bt=arguments,St=function(){Pe=null,Ee||q.apply(je,bt)},jt=Ee&&!Pe;clearTimeout(Pe),Pe=setTimeout(St,de),jt&&q.apply(je,bt)}}var xf=Ef,Yu=5;function js(q,de){if(Object.hasOwn)return Object.hasOwn(q,de);if(q==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(q),de)}function ji(q,de,Ee,Pe){Ee=Ee||0,Pe=Pe||Yu;for(var je in de)if(js(de,je)){var bt=de[je];bt!==null&&Zn(bt)?(Zn(q[je])||(q[je]={}),Ee<Pe?ji(q[je],bt,Ee+1,Pe):q[je]=de[je]):Ur(bt)?(q[je]=[],q[je]=q[je].concat(bt)):bt!==void 0&&(q[je]=bt)}}var mo=function(q){for(var de=[],Ee=1;Ee<arguments.length;Ee++)de[Ee-1]=arguments[Ee];for(var Pe=0;Pe<de.length;Pe+=1)ji(q,de[Pe]);return q},ac=mo,Vs=function(q,de,Ee,Pe){I(de)||(Ee=de,de=q,q=function(){});var je=Object.create?function(St,jt){return Object.create(St,{constructor:{value:jt}})}:function(St,jt){function vr(){}vr.prototype=St;var xr=new vr;return xr.constructor=jt,xr},bt=je(de.prototype,q);return q.prototype=Bo(bt,q.prototype),q.superclass=je(de.prototype,de),Bo(bt,Ee),Bo(q,Pe),q},Vi=Vs,Fo=function(q,de){if(!Me(q))return-1;var Ee=Array.prototype.indexOf;if(Ee)return Ee.call(q,de);for(var Pe=-1,je=0;je<q.length;je++)if(q[je]===de){Pe=je;break}return Pe},wf=Fo,Sf=Object.prototype.hasOwnProperty;function Ys(q){if((0,Ft.Z)(q))return!0;if(Me(q))return!q.length;var de=qo(q);if(de==="Map"||de==="Set")return!q.size;if(Gs(q))return!Object.keys(q).length;for(var Ee in q)if(Sf.call(q,Ee))return!1;return!0}var Hu=Ys,ts=function(q,de){if(q===de)return!0;if(!q||!de||Kn(q)||Kn(de))return!1;if(Me(q)||Me(de)){if(q.length!==de.length)return!1;for(var Ee=!0,Pe=0;Pe<q.length&&(Ee=ts(q[Pe],de[Pe]),!!Ee);Pe++);return Ee}if(Tn(q)||Tn(de)){var je=Object.keys(q),bt=Object.keys(de);if(je.length!==bt.length)return!1;for(var Ee=!0,Pe=0;Pe<je.length&&(Ee=ts(q[je[Pe]],de[je[Pe]]),!!Ee);Pe++);return Ee}return!1},ms=ts,Zu=function(q,de,Ee){return I(Ee)?!!Ee(q,de):ms(q,de)},rs=function(q,de){if(!Me(q))return q;for(var Ee=[],Pe=0;Pe<q.length;Pe++){var je=q[Pe];Ee.push(de(je,Pe))}return Ee},ii=rs,Hs=function(q){return q},bs=function(q,de){de===void 0&&(de=Hs);var Ee={};return Ct(q)&&!(0,Ft.Z)(q)&&Object.keys(q).forEach(function(Pe){Ee[Pe]=de(q[Pe],Pe)}),Ee},io=function(q,de,Ee){for(var Pe=0,je=Kn(de)?de.split("."):de;q&&Pe<je.length;)q=q[je[Pe++]];return q===void 0||Pe<je.length?Ee:q},ns=function(q,de,Ee){var Pe=q,je=Kn(de)?de.split("."):de;return je.forEach(function(bt,St){St<je.length-1?(Ct(Pe[bt])||(Pe[bt]=(0,mi.Z)(je[St+1])?[]:{}),Pe=Pe[bt]):Pe[bt]=Ee}),q},_f=Object.prototype.hasOwnProperty,Mf=function(q,de){if(q===null||!Zn(q))return{};var Ee={};return lr(de,function(Pe){_f.call(q,Pe)&&(Ee[Pe]=q[Pe])}),Ee},Co=function(q,de){return bo(q,function(Ee,Pe,je){return de.includes(je)||(Ee[je]=Pe),Ee},{})},ic=function(q,de,Ee){var Pe,je,bt,St,jt=0;Ee||(Ee={});var vr=function(){jt=Ee.leading===!1?0:Date.now(),Pe=null,St=q.apply(je,bt),Pe||(je=bt=null)},xr=function(){var $r=Date.now();!jt&&Ee.leading===!1&&(jt=$r);var an=de-($r-jt);return je=this,bt=arguments,an<=0||an>de?(Pe&&(clearTimeout(Pe),Pe=null),jt=$r,St=q.apply(je,bt),Pe||(je=bt=null)):!Pe&&Ee.trailing!==!1&&(Pe=setTimeout(vr,an)),St};return xr.cancel=function(){clearTimeout(Pe),jt=0,Pe=je=bt=null},xr},oc=function(q){return Me(q)?Array.prototype.slice.call(q):[]},Es={},Cf=function(q){return q=q||"g",Es[q]?Es[q]+=1:Es[q]=1,q+Es[q]},mu=function(){},Ku=function(q){return q};function $u(q){return(0,Ft.Z)(q)?0:Me(q)?q.length:Object.keys(q).length}var bu=function(){function q(){this.map={}}return q.prototype.has=function(de){return this.map[de]!==void 0},q.prototype.get=function(de,Ee){var Pe=this.map[de];return Pe===void 0?Ee:Pe},q.prototype.set=function(de,Ee){this.map[de]=Ee},q.prototype.clear=function(){this.map={}},q.prototype.delete=function(de){delete this.map[de]},q.prototype.size=function(){return Object.keys(this.map).length},q}(),as=bu,Eu=1e-6;function Qr(q){return Math.abs(q)<Eu?0:q<0?-1:1}function is(q,de,Ee){return(Ee[0]-q[0])*(de[1]-q[1])===(de[0]-q[0])*(Ee[1]-q[1])&&Math.min(q[0],de[0])<=Ee[0]&&Ee[0]<=Math.max(q[0],de[0])&&Math.min(q[1],de[1])<=Ee[1]&&Ee[1]<=Math.max(q[1],de[1])}function na(q,de,Ee){var Pe=!1,je=q.length;if(je<=2)return!1;for(var bt=0;bt<je;bt++){var St=q[bt],jt=q[(bt+1)%je];if(is(St,jt,[de,Ee]))return!0;Qr(St[1]-Ee)>0!=Qr(jt[1]-Ee)>0&&Qr(de-(Ee-St[1])*(St[0]-jt[0])/(St[1]-jt[1])-St[0])<0&&(Pe=!Pe)}return Pe}var Zs=function(q,de,Ee){return q>=de&&q<=Ee};function Ks(q,de,Ee,Pe){var je=.001,bt={x:Ee.x-q.x,y:Ee.y-q.y},St={x:de.x-q.x,y:de.y-q.y},jt={x:Pe.x-Ee.x,y:Pe.y-Ee.y},vr=St.x*jt.y-St.y*jt.x,xr=vr*vr,$r=St.x*St.x+St.y*St.y,an=jt.x*jt.x+jt.y*jt.y,tn=null;if(xr>je*$r*an){var Gn=(bt.x*jt.y-bt.y*jt.x)/vr,$n=(bt.x*St.y-bt.y*St.x)/vr;Zs(Gn,0,1)&&Zs($n,0,1)&&(tn={x:q.x+Gn*St.x,y:q.y+Gn*St.y})}return tn}function Go(q){for(var de=[],Ee=q.length,Pe=0;Pe<Ee-1;Pe++){var je=q[Pe],bt=q[Pe+1];de.push({from:{x:je[0],y:je[1]},to:{x:bt[0],y:bt[1]}})}if(de.length>1){var St=q[0],jt=q[Ee-1];de.push({from:{x:jt[0],y:jt[1]},to:{x:St[0],y:St[1]}})}return de}function Tf(q,de){var Ee=!1;return q.forEach(function(Pe){if(Ks(Pe.from,Pe.to,de.from,de.to))return Ee=!0,!1}),Ee}function xs(q){var de=q.map(function(Pe){return Pe[0]}),Ee=q.map(function(Pe){return Pe[1]});return{minX:Math.min.apply(null,de),maxX:Math.max.apply(null,de),minY:Math.min.apply(null,Ee),maxY:Math.max.apply(null,Ee)}}function xu(q,de){return!(de.minX>q.maxX||de.maxX<q.minX||de.minY>q.maxY||de.maxY<q.minY)}function If(q,de){if(q.length<2||de.length<2)return!1;var Ee=xs(q),Pe=xs(de);if(!xu(Ee,Pe))return!1;var je=!1;if(de.forEach(function(vr){if(na(q,vr[0],vr[1]))return je=!0,!1}),je||(q.forEach(function(vr){if(na(de,vr[0],vr[1]))return je=!0,!1}),je))return!0;var bt=Go(q),St=Go(de),jt=!1;return St.forEach(function(vr){if(Tf(bt,vr))return jt=!0,!1}),jt}function Af(q){var de=document.createElement("div");de.innerHTML=q;var Ee=de.childNodes[0];return Ee&&de.contains(Ee)&&de.removeChild(Ee),Ee}function oo(q,de){if(q)return Object.keys(de).forEach(function(Ee){q.style[Ee]=de[Ee]}),q}},36074:function(Mt,N,F){"use strict";F.r(N),F.d(N,{forceCenter:function(){return k},forceCollide:function(){return x},forceLink:function(){return c},forceManyBody:function(){return ur},forceRadial:function(){return Ir},forceSimulation:function(){return mt},forceX:function(){return Nr},forceY:function(){return Hr}});function k(It,qt){var ar,Oe=1;It==null&&(It=0),qt==null&&(qt=0);function Pr(){var Cr,Gr=ar.length,mr,rn=0,Sr=0;for(Cr=0;Cr<Gr;++Cr)mr=ar[Cr],rn+=mr.x,Sr+=mr.y;for(rn=(rn/Gr-It)*Oe,Sr=(Sr/Gr-qt)*Oe,Cr=0;Cr<Gr;++Cr)mr=ar[Cr],mr.x-=rn,mr.y-=Sr}return Pr.initialize=function(Cr){ar=Cr},Pr.x=function(Cr){return arguments.length?(It=+Cr,Pr):It},Pr.y=function(Cr){return arguments.length?(qt=+Cr,Pr):qt},Pr.strength=function(Cr){return arguments.length?(Oe=+Cr,Pr):Oe},Pr}var U=F(93883);function L(It){return function(){return It}}function _(It){return(It()-.5)*1e-6}function I(It){return It.x+It.vx}function T(It){return It.y+It.vy}function x(It){var qt,ar,Oe,Pr=1,Cr=1;typeof It!="function"&&(It=L(It==null?1:+It));function Gr(){for(var Sr,qr=qt.length,Rn,yn,zr,Rt,zt,Vt,hr=0;hr<Cr;++hr)for(Rn=(0,U.Z)(qt,I,T).visitAfter(mr),Sr=0;Sr<qr;++Sr)yn=qt[Sr],zt=ar[yn.index],Vt=zt*zt,zr=yn.x+yn.vx,Rt=yn.y+yn.vy,Rn.visit(Ar);function Ar(en,Fr,Cn,Sn,oa){var jr=en.data,xn=en.r,vn=zt+xn;if(jr){if(jr.index>yn.index){var un=zr-jr.x-jr.vx,Wn=Rt-jr.y-jr.vy,Y=un*un+Wn*Wn;Y<vn*vn&&(un===0&&(un=_(Oe),Y+=un*un),Wn===0&&(Wn=_(Oe),Y+=Wn*Wn),Y=(vn-(Y=Math.sqrt(Y)))/Y*Pr,yn.vx+=(un*=Y)*(vn=(xn*=xn)/(Vt+xn)),yn.vy+=(Wn*=Y)*vn,jr.vx-=un*(vn=1-vn),jr.vy-=Wn*vn)}return}return Fr>zr+vn||Sn<zr-vn||Cn>Rt+vn||oa<Rt-vn}}function mr(Sr){if(Sr.data)return Sr.r=ar[Sr.data.index];for(var qr=Sr.r=0;qr<4;++qr)Sr[qr]&&Sr[qr].r>Sr.r&&(Sr.r=Sr[qr].r)}function rn(){if(qt){var Sr,qr=qt.length,Rn;for(ar=new Array(qr),Sr=0;Sr<qr;++Sr)Rn=qt[Sr],ar[Rn.index]=+It(Rn,Sr,qt)}}return Gr.initialize=function(Sr,qr){qt=Sr,Oe=qr,rn()},Gr.iterations=function(Sr){return arguments.length?(Cr=+Sr,Gr):Cr},Gr.strength=function(Sr){return arguments.length?(Pr=+Sr,Gr):Pr},Gr.radius=function(Sr){return arguments.length?(It=typeof Sr=="function"?Sr:L(+Sr),rn(),Gr):It},Gr}var p=F(37635),v=F.n(p);function g(It){return It.index}function d(It,qt){var ar=It.get(qt);if(!ar)throw new Error("node not found: "+qt);return ar}function c(It){var qt=g,ar=Rn,Oe,Pr=L(30),Cr,Gr,mr,rn,Sr,qr=1;It==null&&(It=[]);function Rn(Vt){return 1/Math.min(mr[Vt.source.index],mr[Vt.target.index])}function yn(Vt){for(var hr=0,Ar=It.length;hr<qr;++hr)for(var en=0,Fr,Cn,Sn,oa,jr,xn,vn;en<Ar;++en)Fr=It[en],Cn=Fr.source,Sn=Fr.target,oa=Sn.x+Sn.vx-Cn.x-Cn.vx||_(Sr),jr=Sn.y+Sn.vy-Cn.y-Cn.vy||_(Sr),xn=Math.sqrt(oa*oa+jr*jr),xn=(xn-Cr[en])/xn*Vt*Oe[en],oa*=xn,jr*=xn,Sn.vx-=oa*(vn=rn[en]),Sn.vy-=jr*vn,Cn.vx+=oa*(vn=1-vn),Cn.vy+=jr*vn}function zr(){if(Gr){var Vt,hr=Gr.length,Ar=It.length,en=new Map(Gr.map(function(Cn,Sn){return[qt(Cn,Sn,Gr),Cn]})),Fr;for(Vt=0,mr=new Array(hr);Vt<Ar;++Vt)Fr=It[Vt],Fr.index=Vt,v()(Fr.source)!=="object"&&(Fr.source=d(en,Fr.source)),v()(Fr.target)!=="object"&&(Fr.target=d(en,Fr.target)),mr[Fr.source.index]=(mr[Fr.source.index]||0)+1,mr[Fr.target.index]=(mr[Fr.target.index]||0)+1;for(Vt=0,rn=new Array(Ar);Vt<Ar;++Vt)Fr=It[Vt],rn[Vt]=mr[Fr.source.index]/(mr[Fr.source.index]+mr[Fr.target.index]);Oe=new Array(Ar),Rt(),Cr=new Array(Ar),zt()}}function Rt(){if(Gr)for(var Vt=0,hr=It.length;Vt<hr;++Vt)Oe[Vt]=+ar(It[Vt],Vt,It)}function zt(){if(Gr)for(var Vt=0,hr=It.length;Vt<hr;++Vt)Cr[Vt]=+Pr(It[Vt],Vt,It)}return yn.initialize=function(Vt,hr){Gr=Vt,Sr=hr,zr()},yn.links=function(Vt){return arguments.length?(It=Vt,zr(),yn):It},yn.id=function(Vt){return arguments.length?(qt=Vt,yn):qt},yn.iterations=function(Vt){return arguments.length?(qr=+Vt,yn):qr},yn.strength=function(Vt){return arguments.length?(ar=typeof Vt=="function"?Vt:L(+Vt),Rt(),yn):ar},yn.distance=function(Vt){return arguments.length?(Pr=typeof Vt=="function"?Vt:L(+Vt),zt(),yn):Pr},yn}var s={value:function(){}};function m(){for(var It=0,qt=arguments.length,ar={},Oe;It<qt;++It){if(!(Oe=arguments[It]+"")||Oe in ar||/[\s.]/.test(Oe))throw new Error("illegal type: "+Oe);ar[Oe]=[]}return new M(ar)}function M(It){this._=It}function P(It,qt){return It.trim().split(/^|\s+/).map(function(ar){var Oe="",Pr=ar.indexOf(".");if(Pr>=0&&(Oe=ar.slice(Pr+1),ar=ar.slice(0,Pr)),ar&&!qt.hasOwnProperty(ar))throw new Error("unknown type: "+ar);return{type:ar,name:Oe}})}M.prototype=m.prototype={constructor:M,on:function(qt,ar){var Oe=this._,Pr=P(qt+"",Oe),Cr,Gr=-1,mr=Pr.length;if(arguments.length<2){for(;++Gr<mr;)if((Cr=(qt=Pr[Gr]).type)&&(Cr=R(Oe[Cr],qt.name)))return Cr;return}if(ar!=null&&typeof ar!="function")throw new Error("invalid callback: "+ar);for(;++Gr<mr;)if(Cr=(qt=Pr[Gr]).type)Oe[Cr]=j(Oe[Cr],qt.name,ar);else if(ar==null)for(Cr in Oe)Oe[Cr]=j(Oe[Cr],qt.name,null);return this},copy:function(){var qt={},ar=this._;for(var Oe in ar)qt[Oe]=ar[Oe].slice();return new M(qt)},call:function(qt,ar){if((Cr=arguments.length-2)>0)for(var Oe=new Array(Cr),Pr=0,Cr,Gr;Pr<Cr;++Pr)Oe[Pr]=arguments[Pr+2];if(!this._.hasOwnProperty(qt))throw new Error("unknown type: "+qt);for(Gr=this._[qt],Pr=0,Cr=Gr.length;Pr<Cr;++Pr)Gr[Pr].value.apply(ar,Oe)},apply:function(qt,ar,Oe){if(!this._.hasOwnProperty(qt))throw new Error("unknown type: "+qt);for(var Pr=this._[qt],Cr=0,Gr=Pr.length;Cr<Gr;++Cr)Pr[Cr].value.apply(ar,Oe)}};function R(It,qt){for(var ar=0,Oe=It.length,Pr;ar<Oe;++ar)if((Pr=It[ar]).name===qt)return Pr.value}function j(It,qt,ar){for(var Oe=0,Pr=It.length;Oe<Pr;++Oe)if(It[Oe].name===qt){It[Oe]=s,It=It.slice(0,Oe).concat(It.slice(Oe+1));break}return ar!=null&&It.push({name:qt,value:ar}),It}var Q=m,G=0,W=0,H=0,Z=1e3,J,K,ne=0,se=0,fe=0,Ie=typeof performance=="object"&&performance.now?performance:Date,ye=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(It){setTimeout(It,17)};function Ae(){return se||(ye(Se),se=Ie.now()+fe)}function Se(){se=0}function we(){this._call=this._time=this._next=null}we.prototype=Te.prototype={constructor:we,restart:function(It,qt,ar){if(typeof It!="function")throw new TypeError("callback is not a function");ar=(ar==null?Ae():+ar)+(qt==null?0:+qt),!this._next&&K!==this&&(K?K._next=this:J=this,K=this),this._call=It,this._time=ar,ft()},stop:function(){this._call&&(this._call=null,this._time=1/0,ft())}};function Te(It,qt,ar){var Oe=new we;return Oe.restart(It,qt,ar),Oe}function ke(){Ae(),++G;for(var It=J,qt;It;)(qt=se-It._time)>=0&&It._call.call(null,qt),It=It._next;--G}function Ge(){se=(ne=Ie.now())+fe,G=W=0;try{ke()}finally{G=0,He(),se=0}}function tt(){var It=Ie.now(),qt=It-ne;qt>Z&&(fe-=qt,ne=It)}function He(){for(var It,qt=J,ar,Oe=1/0;qt;)qt._call?(Oe>qt._time&&(Oe=qt._time),It=qt,qt=qt._next):(ar=qt._next,qt._next=null,qt=It?It._next=ar:J=ar);K=It,ft(Oe)}function ft(It){if(!G){W&&(W=clearTimeout(W));var qt=It-se;qt>24?(It<1/0&&(W=setTimeout(Ge,It-Ie.now()-fe)),H&&(H=clearInterval(H))):(H||(ne=Ie.now(),H=setInterval(tt,Z)),G=1,ye(Ge))}}var Lt=1664525,Jt=1013904223,Qe=4294967296;function ut(){var It=1;return function(){return(It=(Lt*It+Jt)%Qe)/Qe}}function xt(It){return It.x}function dt(It){return It.y}var pt=10,wt=Math.PI*(3-Math.sqrt(5));function mt(It){var qt,ar=1,Oe=.001,Pr=1-Math.pow(Oe,1/300),Cr=0,Gr=.6,mr=new Map,rn=Te(Rn),Sr=Q("tick","end"),qr=ut();It==null&&(It=[]);function Rn(){yn(),Sr.call("tick",qt),ar<Oe&&(rn.stop(),Sr.call("end",qt))}function yn(zt){var Vt,hr=It.length,Ar;zt===void 0&&(zt=1);for(var en=0;en<zt;++en)for(ar+=(Cr-ar)*Pr,mr.forEach(function(Fr){Fr(ar)}),Vt=0;Vt<hr;++Vt)Ar=It[Vt],Ar.fx==null?Ar.x+=Ar.vx*=Gr:(Ar.x=Ar.fx,Ar.vx=0),Ar.fy==null?Ar.y+=Ar.vy*=Gr:(Ar.y=Ar.fy,Ar.vy=0);return qt}function zr(){for(var zt=0,Vt=It.length,hr;zt<Vt;++zt){if(hr=It[zt],hr.index=zt,hr.fx!=null&&(hr.x=hr.fx),hr.fy!=null&&(hr.y=hr.fy),isNaN(hr.x)||isNaN(hr.y)){var Ar=pt*Math.sqrt(.5+zt),en=zt*wt;hr.x=Ar*Math.cos(en),hr.y=Ar*Math.sin(en)}(isNaN(hr.vx)||isNaN(hr.vy))&&(hr.vx=hr.vy=0)}}function Rt(zt){return zt.initialize&&zt.initialize(It,qr),zt}return zr(),qt={tick:yn,restart:function(){return rn.restart(Rn),qt},stop:function(){return rn.stop(),qt},nodes:function(Vt){return arguments.length?(It=Vt,zr(),mr.forEach(Rt),qt):It},alpha:function(Vt){return arguments.length?(ar=+Vt,qt):ar},alphaMin:function(Vt){return arguments.length?(Oe=+Vt,qt):Oe},alphaDecay:function(Vt){return arguments.length?(Pr=+Vt,qt):+Pr},alphaTarget:function(Vt){return arguments.length?(Cr=+Vt,qt):Cr},velocityDecay:function(Vt){return arguments.length?(Gr=1-Vt,qt):1-Gr},randomSource:function(Vt){return arguments.length?(qr=Vt,mr.forEach(Rt),qt):qr},force:function(Vt,hr){return arguments.length>1?(hr==null?mr.delete(Vt):mr.set(Vt,Rt(hr)),qt):mr.get(Vt)},find:function(Vt,hr,Ar){var en=0,Fr=It.length,Cn,Sn,oa,jr,xn;for(Ar==null?Ar=1/0:Ar*=Ar,en=0;en<Fr;++en)jr=It[en],Cn=Vt-jr.x,Sn=hr-jr.y,oa=Cn*Cn+Sn*Sn,oa<Ar&&(xn=jr,Ar=oa);return xn},on:function(Vt,hr){return arguments.length>1?(Sr.on(Vt,hr),qt):Sr.on(Vt)}}}function ur(){var It,qt,ar,Oe,Pr=L(-30),Cr,Gr=1,mr=1/0,rn=.81;function Sr(zr){var Rt,zt=It.length,Vt=(0,U.Z)(It,xt,dt).visitAfter(Rn);for(Oe=zr,Rt=0;Rt<zt;++Rt)qt=It[Rt],Vt.visit(yn)}function qr(){if(It){var zr,Rt=It.length,zt;for(Cr=new Array(Rt),zr=0;zr<Rt;++zr)zt=It[zr],Cr[zt.index]=+Pr(zt,zr,It)}}function Rn(zr){var Rt=0,zt,Vt,hr=0,Ar,en,Fr;if(zr.length){for(Ar=en=Fr=0;Fr<4;++Fr)(zt=zr[Fr])&&(Vt=Math.abs(zt.value))&&(Rt+=zt.value,hr+=Vt,Ar+=Vt*zt.x,en+=Vt*zt.y);zr.x=Ar/hr,zr.y=en/hr}else{zt=zr,zt.x=zt.data.x,zt.y=zt.data.y;do Rt+=Cr[zt.data.index];while(zt=zt.next)}zr.value=Rt}function yn(zr,Rt,zt,Vt){if(!zr.value)return!0;var hr=zr.x-qt.x,Ar=zr.y-qt.y,en=Vt-Rt,Fr=hr*hr+Ar*Ar;if(en*en/rn<Fr)return Fr<mr&&(hr===0&&(hr=_(ar),Fr+=hr*hr),Ar===0&&(Ar=_(ar),Fr+=Ar*Ar),Fr<Gr&&(Fr=Math.sqrt(Gr*Fr)),qt.vx+=hr*zr.value*Oe/Fr,qt.vy+=Ar*zr.value*Oe/Fr),!0;if(zr.length||Fr>=mr)return;(zr.data!==qt||zr.next)&&(hr===0&&(hr=_(ar),Fr+=hr*hr),Ar===0&&(Ar=_(ar),Fr+=Ar*Ar),Fr<Gr&&(Fr=Math.sqrt(Gr*Fr)));do zr.data!==qt&&(en=Cr[zr.data.index]*Oe/Fr,qt.vx+=hr*en,qt.vy+=Ar*en);while(zr=zr.next)}return Sr.initialize=function(zr,Rt){It=zr,ar=Rt,qr()},Sr.strength=function(zr){return arguments.length?(Pr=typeof zr=="function"?zr:L(+zr),qr(),Sr):Pr},Sr.distanceMin=function(zr){return arguments.length?(Gr=zr*zr,Sr):Math.sqrt(Gr)},Sr.distanceMax=function(zr){return arguments.length?(mr=zr*zr,Sr):Math.sqrt(mr)},Sr.theta=function(zr){return arguments.length?(rn=zr*zr,Sr):Math.sqrt(rn)},Sr}function Ir(It,qt,ar){var Oe,Pr=L(.1),Cr,Gr;typeof It!="function"&&(It=L(+It)),qt==null&&(qt=0),ar==null&&(ar=0);function mr(Sr){for(var qr=0,Rn=Oe.length;qr<Rn;++qr){var yn=Oe[qr],zr=yn.x-qt||1e-6,Rt=yn.y-ar||1e-6,zt=Math.sqrt(zr*zr+Rt*Rt),Vt=(Gr[qr]-zt)*Cr[qr]*Sr/zt;yn.vx+=zr*Vt,yn.vy+=Rt*Vt}}function rn(){if(Oe){var Sr,qr=Oe.length;for(Cr=new Array(qr),Gr=new Array(qr),Sr=0;Sr<qr;++Sr)Gr[Sr]=+It(Oe[Sr],Sr,Oe),Cr[Sr]=isNaN(Gr[Sr])?0:+Pr(Oe[Sr],Sr,Oe)}}return mr.initialize=function(Sr){Oe=Sr,rn()},mr.strength=function(Sr){return arguments.length?(Pr=typeof Sr=="function"?Sr:L(+Sr),rn(),mr):Pr},mr.radius=function(Sr){return arguments.length?(It=typeof Sr=="function"?Sr:L(+Sr),rn(),mr):It},mr.x=function(Sr){return arguments.length?(qt=+Sr,mr):qt},mr.y=function(Sr){return arguments.length?(ar=+Sr,mr):ar},mr}function Nr(It){var qt=L(.1),ar,Oe,Pr;typeof It!="function"&&(It=L(It==null?0:+It));function Cr(mr){for(var rn=0,Sr=ar.length,qr;rn<Sr;++rn)qr=ar[rn],qr.vx+=(Pr[rn]-qr.x)*Oe[rn]*mr}function Gr(){if(ar){var mr,rn=ar.length;for(Oe=new Array(rn),Pr=new Array(rn),mr=0;mr<rn;++mr)Oe[mr]=isNaN(Pr[mr]=+It(ar[mr],mr,ar))?0:+qt(ar[mr],mr,ar)}}return Cr.initialize=function(mr){ar=mr,Gr()},Cr.strength=function(mr){return arguments.length?(qt=typeof mr=="function"?mr:L(+mr),Gr(),Cr):qt},Cr.x=function(mr){return arguments.length?(It=typeof mr=="function"?mr:L(+mr),Gr(),Cr):It},Cr}function Hr(It){var qt=L(.1),ar,Oe,Pr;typeof It!="function"&&(It=L(It==null?0:+It));function Cr(mr){for(var rn=0,Sr=ar.length,qr;rn<Sr;++rn)qr=ar[rn],qr.vy+=(Pr[rn]-qr.y)*Oe[rn]*mr}function Gr(){if(ar){var mr,rn=ar.length;for(Oe=new Array(rn),Pr=new Array(rn),mr=0;mr<rn;++mr)Oe[mr]=isNaN(Pr[mr]=+It(ar[mr],mr,ar))?0:+qt(ar[mr],mr,ar)}}return Cr.initialize=function(mr){ar=mr,Gr()},Cr.strength=function(mr){return arguments.length?(qt=typeof mr=="function"?mr:L(+mr),Gr(),Cr):qt},Cr.y=function(mr){return arguments.length?(It=typeof mr=="function"?mr:L(+mr),Gr(),Cr):It},Cr}},8082:function(Mt,N,F){"use strict";var k=F(91621).default,U=F(58853).default,L=F(38888).default,_=F(37635).default,I=F(21140).default,T=F(63466).default;Object.defineProperty(N,"__esModule",{value:!0});var x=F(60804),p=F(85650),v=" ".repeat(2),g=" ".repeat(4);function d(){return c(this)}function c(ie){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=ee.maxRows,b=C===void 0?15:C,S=ee.maxColumns,X=S===void 0?10:S,pe=ee.maxNumSize,Me=pe===void 0?8:pe,me=ee.padMinus,Le=me===void 0?"auto":me;return"".concat(ie.constructor.name,` {
`).concat(v,`[
`).concat(g).concat(s(ie,b,X,Me,Le),`
`).concat(v,`]
`).concat(v,"rows: ").concat(ie.rows,`
`).concat(v,"columns: ").concat(ie.columns,`
}`)}function s(ie,ee,C,b,S){var X=ie.rows,pe=ie.columns,Me=Math.min(X,ee),me=Math.min(pe,C),Le=[];if(S==="auto"){S=!1;e:for(var st=0;st<Me;st++)for(var qe=0;qe<me;qe++)if(ie.get(st,qe)<0){S=!0;break e}}for(var Nt=0;Nt<Me;Nt++){for(var nr=[],Ft=0;Ft<me;Ft++)nr.push(m(ie.get(Nt,Ft),b,S));Le.push("".concat(nr.join(" ")))}return me!==pe&&(Le[Le.length-1]+=" ... ".concat(pe-C," more columns")),Me!==X&&Le.push("... ".concat(X-ee," more rows")),Le.join(`
`.concat(g))}function m(ie,ee,C){return(ie>=0&&C?" ".concat(M(ie,ee-1)):M(ie,ee)).padEnd(ee)}function M(ie,ee){var C=ie.toString();if(C.length<=ee)return C;var b=ie.toFixed(ee);if(b.length>ee&&(b=ie.toFixed(Math.max(0,ee-(b.length-ee)))),b.length<=ee&&!b.startsWith("0.000")&&!b.startsWith("-0.000"))return b;var S=ie.toExponential(ee);return S.length>ee&&(S=ie.toExponential(Math.max(0,ee-(S.length-ee)))),S.slice(0)}function P(ie,ee){ie.prototype.add=function(b){return typeof b=="number"?this.addS(b):this.addM(b)},ie.prototype.addS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)+b);return this},ie.prototype.addM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)+b.get(S,X));return this},ie.add=function(b,S){var X=new ee(b);return X.add(S)},ie.prototype.sub=function(b){return typeof b=="number"?this.subS(b):this.subM(b)},ie.prototype.subS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)-b);return this},ie.prototype.subM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)-b.get(S,X));return this},ie.sub=function(b,S){var X=new ee(b);return X.sub(S)},ie.prototype.subtract=ie.prototype.sub,ie.prototype.subtractS=ie.prototype.subS,ie.prototype.subtractM=ie.prototype.subM,ie.subtract=ie.sub,ie.prototype.mul=function(b){return typeof b=="number"?this.mulS(b):this.mulM(b)},ie.prototype.mulS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)*b);return this},ie.prototype.mulM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)*b.get(S,X));return this},ie.mul=function(b,S){var X=new ee(b);return X.mul(S)},ie.prototype.multiply=ie.prototype.mul,ie.prototype.multiplyS=ie.prototype.mulS,ie.prototype.multiplyM=ie.prototype.mulM,ie.multiply=ie.mul,ie.prototype.div=function(b){return typeof b=="number"?this.divS(b):this.divM(b)},ie.prototype.divS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)/b);return this},ie.prototype.divM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)/b.get(S,X));return this},ie.div=function(b,S){var X=new ee(b);return X.div(S)},ie.prototype.divide=ie.prototype.div,ie.prototype.divideS=ie.prototype.divS,ie.prototype.divideM=ie.prototype.divM,ie.divide=ie.div,ie.prototype.mod=function(b){return typeof b=="number"?this.modS(b):this.modM(b)},ie.prototype.modS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)%b);return this},ie.prototype.modM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)%b.get(S,X));return this},ie.mod=function(b,S){var X=new ee(b);return X.mod(S)},ie.prototype.modulus=ie.prototype.mod,ie.prototype.modulusS=ie.prototype.modS,ie.prototype.modulusM=ie.prototype.modM,ie.modulus=ie.mod,ie.prototype.and=function(b){return typeof b=="number"?this.andS(b):this.andM(b)},ie.prototype.andS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)&b);return this},ie.prototype.andM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)&b.get(S,X));return this},ie.and=function(b,S){var X=new ee(b);return X.and(S)},ie.prototype.or=function(b){return typeof b=="number"?this.orS(b):this.orM(b)},ie.prototype.orS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)|b);return this},ie.prototype.orM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)|b.get(S,X));return this},ie.or=function(b,S){var X=new ee(b);return X.or(S)},ie.prototype.xor=function(b){return typeof b=="number"?this.xorS(b):this.xorM(b)},ie.prototype.xorS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)^b);return this},ie.prototype.xorM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)^b.get(S,X));return this},ie.xor=function(b,S){var X=new ee(b);return X.xor(S)},ie.prototype.leftShift=function(b){return typeof b=="number"?this.leftShiftS(b):this.leftShiftM(b)},ie.prototype.leftShiftS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)<<b);return this},ie.prototype.leftShiftM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)<<b.get(S,X));return this},ie.leftShift=function(b,S){var X=new ee(b);return X.leftShift(S)},ie.prototype.signPropagatingRightShift=function(b){return typeof b=="number"?this.signPropagatingRightShiftS(b):this.signPropagatingRightShiftM(b)},ie.prototype.signPropagatingRightShiftS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)>>b);return this},ie.prototype.signPropagatingRightShiftM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)>>b.get(S,X));return this},ie.signPropagatingRightShift=function(b,S){var X=new ee(b);return X.signPropagatingRightShift(S)},ie.prototype.rightShift=function(b){return typeof b=="number"?this.rightShiftS(b):this.rightShiftM(b)},ie.prototype.rightShiftS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)>>>b);return this},ie.prototype.rightShiftM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,this.get(S,X)>>>b.get(S,X));return this},ie.rightShift=function(b,S){var X=new ee(b);return X.rightShift(S)},ie.prototype.zeroFillRightShift=ie.prototype.rightShift,ie.prototype.zeroFillRightShiftS=ie.prototype.rightShiftS,ie.prototype.zeroFillRightShiftM=ie.prototype.rightShiftM,ie.zeroFillRightShift=ie.rightShift,ie.prototype.not=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,~this.get(b,S));return this},ie.not=function(b){var S=new ee(b);return S.not()},ie.prototype.abs=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.abs(this.get(b,S)));return this},ie.abs=function(b){var S=new ee(b);return S.abs()},ie.prototype.acos=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.acos(this.get(b,S)));return this},ie.acos=function(b){var S=new ee(b);return S.acos()},ie.prototype.acosh=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.acosh(this.get(b,S)));return this},ie.acosh=function(b){var S=new ee(b);return S.acosh()},ie.prototype.asin=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.asin(this.get(b,S)));return this},ie.asin=function(b){var S=new ee(b);return S.asin()},ie.prototype.asinh=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.asinh(this.get(b,S)));return this},ie.asinh=function(b){var S=new ee(b);return S.asinh()},ie.prototype.atan=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.atan(this.get(b,S)));return this},ie.atan=function(b){var S=new ee(b);return S.atan()},ie.prototype.atanh=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.atanh(this.get(b,S)));return this},ie.atanh=function(b){var S=new ee(b);return S.atanh()},ie.prototype.cbrt=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.cbrt(this.get(b,S)));return this},ie.cbrt=function(b){var S=new ee(b);return S.cbrt()},ie.prototype.ceil=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.ceil(this.get(b,S)));return this},ie.ceil=function(b){var S=new ee(b);return S.ceil()},ie.prototype.clz32=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.clz32(this.get(b,S)));return this},ie.clz32=function(b){var S=new ee(b);return S.clz32()},ie.prototype.cos=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.cos(this.get(b,S)));return this},ie.cos=function(b){var S=new ee(b);return S.cos()},ie.prototype.cosh=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.cosh(this.get(b,S)));return this},ie.cosh=function(b){var S=new ee(b);return S.cosh()},ie.prototype.exp=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.exp(this.get(b,S)));return this},ie.exp=function(b){var S=new ee(b);return S.exp()},ie.prototype.expm1=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.expm1(this.get(b,S)));return this},ie.expm1=function(b){var S=new ee(b);return S.expm1()},ie.prototype.floor=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.floor(this.get(b,S)));return this},ie.floor=function(b){var S=new ee(b);return S.floor()},ie.prototype.fround=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.fround(this.get(b,S)));return this},ie.fround=function(b){var S=new ee(b);return S.fround()},ie.prototype.log=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.log(this.get(b,S)));return this},ie.log=function(b){var S=new ee(b);return S.log()},ie.prototype.log1p=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.log1p(this.get(b,S)));return this},ie.log1p=function(b){var S=new ee(b);return S.log1p()},ie.prototype.log10=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.log10(this.get(b,S)));return this},ie.log10=function(b){var S=new ee(b);return S.log10()},ie.prototype.log2=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.log2(this.get(b,S)));return this},ie.log2=function(b){var S=new ee(b);return S.log2()},ie.prototype.round=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.round(this.get(b,S)));return this},ie.round=function(b){var S=new ee(b);return S.round()},ie.prototype.sign=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.sign(this.get(b,S)));return this},ie.sign=function(b){var S=new ee(b);return S.sign()},ie.prototype.sin=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.sin(this.get(b,S)));return this},ie.sin=function(b){var S=new ee(b);return S.sin()},ie.prototype.sinh=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.sinh(this.get(b,S)));return this},ie.sinh=function(b){var S=new ee(b);return S.sinh()},ie.prototype.sqrt=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.sqrt(this.get(b,S)));return this},ie.sqrt=function(b){var S=new ee(b);return S.sqrt()},ie.prototype.tan=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.tan(this.get(b,S)));return this},ie.tan=function(b){var S=new ee(b);return S.tan()},ie.prototype.tanh=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.tanh(this.get(b,S)));return this},ie.tanh=function(b){var S=new ee(b);return S.tanh()},ie.prototype.trunc=function(){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,Math.trunc(this.get(b,S)));return this},ie.trunc=function(b){var S=new ee(b);return S.trunc()},ie.pow=function(b,S){var X=new ee(b);return X.pow(S)},ie.prototype.pow=function(b){return typeof b=="number"?this.powS(b):this.powM(b)},ie.prototype.powS=function(b){for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,Math.pow(this.get(S,X),b));return this},ie.prototype.powM=function(b){if(b=ee.checkMatrix(b),this.rows!==b.rows||this.columns!==b.columns)throw new RangeError("Matrices dimensions must be equal");for(var S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.set(S,X,Math.pow(this.get(S,X),b.get(S,X)));return this}}function R(ie,ee,C){var b=C?ie.rows:ie.rows-1;if(ee<0||ee>b)throw new RangeError("Row index out of range")}function j(ie,ee,C){var b=C?ie.columns:ie.columns-1;if(ee<0||ee>b)throw new RangeError("Column index out of range")}function Q(ie,ee){if(ee.to1DArray&&(ee=ee.to1DArray()),ee.length!==ie.columns)throw new RangeError("vector size must be the same as the number of columns");return ee}function G(ie,ee){if(ee.to1DArray&&(ee=ee.to1DArray()),ee.length!==ie.rows)throw new RangeError("vector size must be the same as the number of rows");return ee}function W(ie,ee){if(!x.isAnyArray(ee))throw new TypeError("row indices must be an array");for(var C=0;C<ee.length;C++)if(ee[C]<0||ee[C]>=ie.rows)throw new RangeError("row indices are out of range")}function H(ie,ee){if(!x.isAnyArray(ee))throw new TypeError("column indices must be an array");for(var C=0;C<ee.length;C++)if(ee[C]<0||ee[C]>=ie.columns)throw new RangeError("column indices are out of range")}function Z(ie,ee,C,b,S){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(K("startRow",ee),K("endRow",C),K("startColumn",b),K("endColumn",S),ee>C||b>S||ee<0||ee>=ie.rows||C<0||C>=ie.rows||b<0||b>=ie.columns||S<0||S>=ie.columns)throw new RangeError("Submatrix indices are out of range")}function J(ie){for(var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=[],b=0;b<ie;b++)C.push(ee);return C}function K(ie,ee){if(typeof ee!="number")throw new TypeError("".concat(ie," must be a number"))}function ne(ie){if(ie.isEmpty())throw new Error("Empty matrix has no elements to index")}function se(ie){for(var ee=J(ie.rows),C=0;C<ie.rows;++C)for(var b=0;b<ie.columns;++b)ee[C]+=ie.get(C,b);return ee}function fe(ie){for(var ee=J(ie.columns),C=0;C<ie.rows;++C)for(var b=0;b<ie.columns;++b)ee[b]+=ie.get(C,b);return ee}function Ie(ie){for(var ee=0,C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ee+=ie.get(C,b);return ee}function ye(ie){for(var ee=J(ie.rows,1),C=0;C<ie.rows;++C)for(var b=0;b<ie.columns;++b)ee[C]*=ie.get(C,b);return ee}function Ae(ie){for(var ee=J(ie.columns,1),C=0;C<ie.rows;++C)for(var b=0;b<ie.columns;++b)ee[b]*=ie.get(C,b);return ee}function Se(ie){for(var ee=1,C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ee*=ie.get(C,b);return ee}function we(ie,ee,C){for(var b=ie.rows,S=ie.columns,X=[],pe=0;pe<b;pe++){for(var Me=0,me=0,Le=0,st=0;st<S;st++)Le=ie.get(pe,st)-C[pe],Me+=Le,me+=Le*Le;ee?X.push((me-Me*Me/S)/(S-1)):X.push((me-Me*Me/S)/S)}return X}function Te(ie,ee,C){for(var b=ie.rows,S=ie.columns,X=[],pe=0;pe<S;pe++){for(var Me=0,me=0,Le=0,st=0;st<b;st++)Le=ie.get(st,pe)-C[pe],Me+=Le,me+=Le*Le;ee?X.push((me-Me*Me/b)/(b-1)):X.push((me-Me*Me/b)/b)}return X}function ke(ie,ee,C){for(var b=ie.rows,S=ie.columns,X=b*S,pe=0,Me=0,me=0,Le=0;Le<b;Le++)for(var st=0;st<S;st++)me=ie.get(Le,st)-C,pe+=me,Me+=me*me;return ee?(Me-pe*pe/X)/(X-1):(Me-pe*pe/X)/X}function Ge(ie,ee){for(var C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ie.set(C,b,ie.get(C,b)-ee[C])}function tt(ie,ee){for(var C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ie.set(C,b,ie.get(C,b)-ee[b])}function He(ie,ee){for(var C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ie.set(C,b,ie.get(C,b)-ee)}function ft(ie){for(var ee=[],C=0;C<ie.rows;C++){for(var b=0,S=0;S<ie.columns;S++)b+=Math.pow(ie.get(C,S),2)/(ie.columns-1);ee.push(Math.sqrt(b))}return ee}function Lt(ie,ee){for(var C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ie.set(C,b,ie.get(C,b)/ee[C])}function Jt(ie){for(var ee=[],C=0;C<ie.columns;C++){for(var b=0,S=0;S<ie.rows;S++)b+=Math.pow(ie.get(S,C),2)/(ie.rows-1);ee.push(Math.sqrt(b))}return ee}function Qe(ie,ee){for(var C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ie.set(C,b,ie.get(C,b)/ee[b])}function ut(ie){for(var ee=ie.size-1,C=0,b=0;b<ie.columns;b++)for(var S=0;S<ie.rows;S++)C+=Math.pow(ie.get(S,b),2)/ee;return Math.sqrt(C)}function xt(ie,ee){for(var C=0;C<ie.rows;C++)for(var b=0;b<ie.columns;b++)ie.set(C,b,ie.get(C,b)/ee)}var dt=function(){function ie(){I(this,ie)}return T(ie,[{key:"size",get:function(){return this.rows*this.columns}},{key:"apply",value:function(C){if(typeof C!="function")throw new TypeError("callback must be a function");for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)C.call(this,b,S);return this}},{key:"to1DArray",value:function(){for(var C=[],b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)C.push(this.get(b,S));return C}},{key:"to2DArray",value:function(){for(var C=[],b=0;b<this.rows;b++){C.push([]);for(var S=0;S<this.columns;S++)C[b].push(this.get(b,S))}return C}},{key:"toJSON",value:function(){return this.to2DArray()}},{key:"isRowVector",value:function(){return this.rows===1}},{key:"isColumnVector",value:function(){return this.columns===1}},{key:"isVector",value:function(){return this.rows===1||this.columns===1}},{key:"isSquare",value:function(){return this.rows===this.columns}},{key:"isEmpty",value:function(){return this.rows===0||this.columns===0}},{key:"isSymmetric",value:function(){if(this.isSquare()){for(var C=0;C<this.rows;C++)for(var b=0;b<=C;b++)if(this.get(C,b)!==this.get(b,C))return!1;return!0}return!1}},{key:"isEchelonForm",value:function(){for(var C=0,b=0,S=-1,X=!0,pe=!1;C<this.rows&&X;){for(b=0,pe=!1;b<this.columns&&pe===!1;)this.get(C,b)===0?b++:this.get(C,b)===1&&b>S?(pe=!0,S=b):(X=!1,pe=!0);C++}return X}},{key:"isReducedEchelonForm",value:function(){for(var C=0,b=0,S=-1,X=!0,pe=!1;C<this.rows&&X;){for(b=0,pe=!1;b<this.columns&&pe===!1;)this.get(C,b)===0?b++:this.get(C,b)===1&&b>S?(pe=!0,S=b):(X=!1,pe=!0);for(var Me=b+1;Me<this.rows;Me++)this.get(C,Me)!==0&&(X=!1);C++}return X}},{key:"echelonForm",value:function(){for(var C=this.clone(),b=0,S=0;b<C.rows&&S<C.columns;){for(var X=b,pe=b;pe<C.rows;pe++)C.get(pe,S)>C.get(X,S)&&(X=pe);if(C.get(X,S)===0)S++;else{C.swapRows(b,X);for(var Me=C.get(b,S),me=S;me<C.columns;me++)C.set(b,me,C.get(b,me)/Me);for(var Le=b+1;Le<C.rows;Le++){var st=C.get(Le,S)/C.get(b,S);C.set(Le,S,0);for(var qe=S+1;qe<C.columns;qe++)C.set(Le,qe,C.get(Le,qe)-C.get(b,qe)*st)}b++,S++}}return C}},{key:"reducedEchelonForm",value:function(){for(var C=this.echelonForm(),b=C.columns,S=C.rows,X=S-1;X>=0;)if(C.maxRow(X)===0)X--;else{for(var pe=0,Me=!1;pe<S&&Me===!1;)C.get(X,pe)===1?Me=!0:pe++;for(var me=0;me<X;me++)for(var Le=C.get(me,pe),st=pe;st<b;st++){var qe=C.get(me,st)-Le*C.get(X,st);C.set(me,st,qe)}X--}return C}},{key:"set",value:function(){throw new Error("set method is unimplemented")}},{key:"get",value:function(){throw new Error("get method is unimplemented")}},{key:"repeat",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_(C)!=="object")throw new TypeError("options must be an object");var b=C.rows,S=b===void 0?1:b,X=C.columns,pe=X===void 0?1:X;if(!Number.isInteger(S)||S<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(pe)||pe<=0)throw new TypeError("columns must be a positive integer");for(var Me=new mt(this.rows*S,this.columns*pe),me=0;me<S;me++)for(var Le=0;Le<pe;Le++)Me.setSubMatrix(this,this.rows*me,this.columns*Le);return Me}},{key:"fill",value:function(C){for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,C);return this}},{key:"neg",value:function(){return this.mulS(-1)}},{key:"getRow",value:function(C){R(this,C);for(var b=[],S=0;S<this.columns;S++)b.push(this.get(C,S));return b}},{key:"getRowVector",value:function(C){return mt.rowVector(this.getRow(C))}},{key:"setRow",value:function(C,b){R(this,C),b=Q(this,b);for(var S=0;S<this.columns;S++)this.set(C,S,b[S]);return this}},{key:"swapRows",value:function(C,b){R(this,C),R(this,b);for(var S=0;S<this.columns;S++){var X=this.get(C,S);this.set(C,S,this.get(b,S)),this.set(b,S,X)}return this}},{key:"getColumn",value:function(C){j(this,C);for(var b=[],S=0;S<this.rows;S++)b.push(this.get(S,C));return b}},{key:"getColumnVector",value:function(C){return mt.columnVector(this.getColumn(C))}},{key:"setColumn",value:function(C,b){j(this,C),b=G(this,b);for(var S=0;S<this.rows;S++)this.set(S,C,b[S]);return this}},{key:"swapColumns",value:function(C,b){j(this,C),j(this,b);for(var S=0;S<this.rows;S++){var X=this.get(S,C);this.set(S,C,this.get(S,b)),this.set(S,b,X)}return this}},{key:"addRowVector",value:function(C){C=Q(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)+C[S]);return this}},{key:"subRowVector",value:function(C){C=Q(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)-C[S]);return this}},{key:"mulRowVector",value:function(C){C=Q(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)*C[S]);return this}},{key:"divRowVector",value:function(C){C=Q(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)/C[S]);return this}},{key:"addColumnVector",value:function(C){C=G(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)+C[b]);return this}},{key:"subColumnVector",value:function(C){C=G(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)-C[b]);return this}},{key:"mulColumnVector",value:function(C){C=G(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)*C[b]);return this}},{key:"divColumnVector",value:function(C){C=G(this,C);for(var b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)this.set(b,S,this.get(b,S)/C[b]);return this}},{key:"mulRow",value:function(C,b){R(this,C);for(var S=0;S<this.columns;S++)this.set(C,S,this.get(C,S)*b);return this}},{key:"mulColumn",value:function(C,b){j(this,C);for(var S=0;S<this.rows;S++)this.set(S,C,this.get(S,C)*b);return this}},{key:"max",value:function(C){if(this.isEmpty())return NaN;switch(C){case"row":{for(var b=new Array(this.rows).fill(Number.NEGATIVE_INFINITY),S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.get(S,X)>b[S]&&(b[S]=this.get(S,X));return b}case"column":{for(var pe=new Array(this.columns).fill(Number.NEGATIVE_INFINITY),Me=0;Me<this.rows;Me++)for(var me=0;me<this.columns;me++)this.get(Me,me)>pe[me]&&(pe[me]=this.get(Me,me));return pe}case void 0:{for(var Le=this.get(0,0),st=0;st<this.rows;st++)for(var qe=0;qe<this.columns;qe++)this.get(st,qe)>Le&&(Le=this.get(st,qe));return Le}default:throw new Error("invalid option: ".concat(C))}}},{key:"maxIndex",value:function(){ne(this);for(var C=this.get(0,0),b=[0,0],S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.get(S,X)>C&&(C=this.get(S,X),b[0]=S,b[1]=X);return b}},{key:"min",value:function(C){if(this.isEmpty())return NaN;switch(C){case"row":{for(var b=new Array(this.rows).fill(Number.POSITIVE_INFINITY),S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.get(S,X)<b[S]&&(b[S]=this.get(S,X));return b}case"column":{for(var pe=new Array(this.columns).fill(Number.POSITIVE_INFINITY),Me=0;Me<this.rows;Me++)for(var me=0;me<this.columns;me++)this.get(Me,me)<pe[me]&&(pe[me]=this.get(Me,me));return pe}case void 0:{for(var Le=this.get(0,0),st=0;st<this.rows;st++)for(var qe=0;qe<this.columns;qe++)this.get(st,qe)<Le&&(Le=this.get(st,qe));return Le}default:throw new Error("invalid option: ".concat(C))}}},{key:"minIndex",value:function(){ne(this);for(var C=this.get(0,0),b=[0,0],S=0;S<this.rows;S++)for(var X=0;X<this.columns;X++)this.get(S,X)<C&&(C=this.get(S,X),b[0]=S,b[1]=X);return b}},{key:"maxRow",value:function(C){if(R(this,C),this.isEmpty())return NaN;for(var b=this.get(C,0),S=1;S<this.columns;S++)this.get(C,S)>b&&(b=this.get(C,S));return b}},{key:"maxRowIndex",value:function(C){R(this,C),ne(this);for(var b=this.get(C,0),S=[C,0],X=1;X<this.columns;X++)this.get(C,X)>b&&(b=this.get(C,X),S[1]=X);return S}},{key:"minRow",value:function(C){if(R(this,C),this.isEmpty())return NaN;for(var b=this.get(C,0),S=1;S<this.columns;S++)this.get(C,S)<b&&(b=this.get(C,S));return b}},{key:"minRowIndex",value:function(C){R(this,C),ne(this);for(var b=this.get(C,0),S=[C,0],X=1;X<this.columns;X++)this.get(C,X)<b&&(b=this.get(C,X),S[1]=X);return S}},{key:"maxColumn",value:function(C){if(j(this,C),this.isEmpty())return NaN;for(var b=this.get(0,C),S=1;S<this.rows;S++)this.get(S,C)>b&&(b=this.get(S,C));return b}},{key:"maxColumnIndex",value:function(C){j(this,C),ne(this);for(var b=this.get(0,C),S=[0,C],X=1;X<this.rows;X++)this.get(X,C)>b&&(b=this.get(X,C),S[0]=X);return S}},{key:"minColumn",value:function(C){if(j(this,C),this.isEmpty())return NaN;for(var b=this.get(0,C),S=1;S<this.rows;S++)this.get(S,C)<b&&(b=this.get(S,C));return b}},{key:"minColumnIndex",value:function(C){j(this,C),ne(this);for(var b=this.get(0,C),S=[0,C],X=1;X<this.rows;X++)this.get(X,C)<b&&(b=this.get(X,C),S[0]=X);return S}},{key:"diag",value:function(){for(var C=Math.min(this.rows,this.columns),b=[],S=0;S<C;S++)b.push(this.get(S,S));return b}},{key:"norm",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"frobenius";switch(C){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError("unknown norm type: ".concat(C))}}},{key:"cumulativeSum",value:function(){for(var C=0,b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)C+=this.get(b,S),this.set(b,S,C);return this}},{key:"dot",value:function(C){ie.isMatrix(C)&&(C=C.to1DArray());var b=this.to1DArray();if(b.length!==C.length)throw new RangeError("vectors do not have the same size");for(var S=0,X=0;X<b.length;X++)S+=b[X]*C[X];return S}},{key:"mmul",value:function(C){C=mt.checkMatrix(C);for(var b=this.rows,S=this.columns,X=C.columns,pe=new mt(b,X),Me=new Float64Array(S),me=0;me<X;me++){for(var Le=0;Le<S;Le++)Me[Le]=C.get(Le,me);for(var st=0;st<b;st++){for(var qe=0,Nt=0;Nt<S;Nt++)qe+=this.get(st,Nt)*Me[Nt];pe.set(st,me,qe)}}return pe}},{key:"strassen2x2",value:function(C){C=mt.checkMatrix(C);var b=new mt(2,2),S=this.get(0,0),X=C.get(0,0),pe=this.get(0,1),Me=C.get(0,1),me=this.get(1,0),Le=C.get(1,0),st=this.get(1,1),qe=C.get(1,1),Nt=(S+st)*(X+qe),nr=(me+st)*X,Ft=S*(Me-qe),er=st*(Le-X),Ur=(S+pe)*qe,Ct=(me-S)*(X+Me),Kt=(pe-st)*(Le+qe),lr=Nt+er-Ur+Kt,Dr=Ft+Ur,br=nr+er,sa=Nt-nr+Ft+Ct;return b.set(0,0,lr),b.set(0,1,Dr),b.set(1,0,br),b.set(1,1,sa),b}},{key:"strassen3x3",value:function(C){C=mt.checkMatrix(C);var b=new mt(3,3),S=this.get(0,0),X=this.get(0,1),pe=this.get(0,2),Me=this.get(1,0),me=this.get(1,1),Le=this.get(1,2),st=this.get(2,0),qe=this.get(2,1),Nt=this.get(2,2),nr=C.get(0,0),Ft=C.get(0,1),er=C.get(0,2),Ur=C.get(1,0),Ct=C.get(1,1),Kt=C.get(1,2),lr=C.get(2,0),Dr=C.get(2,1),br=C.get(2,2),sa=(S+X+pe-Me-me-qe-Nt)*Ct,ea=(S-Me)*(-Ft+Ct),gn=me*(-nr+Ft+Ur-Ct-Kt-lr+br),Tn=(-S+Me+me)*(nr-Ft+Ct),ra=(Me+me)*(-nr+Ft),Zn=S*nr,Vr=(-S+st+qe)*(nr-er+Kt),In=(-S+st)*(er-Kt),at=(st+qe)*(-nr+er),D=(S+X+pe-me-Le-st-qe)*Kt,te=qe*(-nr+er+Ur-Ct-Kt-lr+Dr),xe=(-pe+qe+Nt)*(Ct+lr-Dr),be=(pe-Nt)*(Ct-Dr),De=pe*lr,Xe=(qe+Nt)*(-lr+Dr),Je=(-pe+me+Le)*(Kt+lr-br),lt=(pe-Le)*(Kt-br),Tt=(me+Le)*(-lr+br),Ht=X*Ur,ir=Le*Dr,Kr=Me*er,nn=st*Ft,mn=Nt*br,Jr=Zn+De+Ht,jn=sa+Tn+ra+Zn+xe+De+Xe,_a=Zn+Vr+at+D+De+Je+Tt,Fn=ea+gn+Tn+Zn+De+Je+lt,ya=ea+Tn+ra+Zn+ir,Ai=De+Je+lt+Tt+Kr,bo=Zn+Vr+In+te+xe+be+De,Zi=xe+be+De+Xe+nn,Fi=Zn+Vr+In+at+mn;return b.set(0,0,Jr),b.set(0,1,jn),b.set(0,2,_a),b.set(1,0,Fn),b.set(1,1,ya),b.set(1,2,Ai),b.set(2,0,bo),b.set(2,1,Zi),b.set(2,2,Fi),b}},{key:"mmulStrassen",value:function(C){C=mt.checkMatrix(C);var b=this.clone(),S=b.rows,X=b.columns,pe=C.rows,Me=C.columns;X!==pe&&console.warn("Multiplying ".concat(S," x ").concat(X," and ").concat(pe," x ").concat(Me," matrix: dimensions do not match."));function me(Nt,nr,Ft){var er=Nt.rows,Ur=Nt.columns;if(er===nr&&Ur===Ft)return Nt;var Ct=ie.zeros(nr,Ft);return Ct=Ct.setSubMatrix(Nt,0,0),Ct}var Le=Math.max(S,pe),st=Math.max(X,Me);b=me(b,Le,st),C=me(C,Le,st);function qe(Nt,nr,Ft,er){if(Ft<=512||er<=512)return Nt.mmul(nr);Ft%2===1&&er%2===1?(Nt=me(Nt,Ft+1,er+1),nr=me(nr,Ft+1,er+1)):Ft%2===1?(Nt=me(Nt,Ft+1,er),nr=me(nr,Ft+1,er)):er%2===1&&(Nt=me(Nt,Ft,er+1),nr=me(nr,Ft,er+1));var Ur=parseInt(Nt.rows/2,10),Ct=parseInt(Nt.columns/2,10),Kt=Nt.subMatrix(0,Ur-1,0,Ct-1),lr=nr.subMatrix(0,Ur-1,0,Ct-1),Dr=Nt.subMatrix(0,Ur-1,Ct,Nt.columns-1),br=nr.subMatrix(0,Ur-1,Ct,nr.columns-1),sa=Nt.subMatrix(Ur,Nt.rows-1,0,Ct-1),ea=nr.subMatrix(Ur,nr.rows-1,0,Ct-1),gn=Nt.subMatrix(Ur,Nt.rows-1,Ct,Nt.columns-1),Tn=nr.subMatrix(Ur,nr.rows-1,Ct,nr.columns-1),ra=qe(ie.add(Kt,gn),ie.add(lr,Tn),Ur,Ct),Zn=qe(ie.add(sa,gn),lr,Ur,Ct),Vr=qe(Kt,ie.sub(br,Tn),Ur,Ct),In=qe(gn,ie.sub(ea,lr),Ur,Ct),at=qe(ie.add(Kt,Dr),Tn,Ur,Ct),D=qe(ie.sub(sa,Kt),ie.add(lr,br),Ur,Ct),te=qe(ie.sub(Dr,gn),ie.add(ea,Tn),Ur,Ct),xe=ie.add(ra,In);xe.sub(at),xe.add(te);var be=ie.add(Vr,at),De=ie.add(Zn,In),Xe=ie.sub(ra,Zn);Xe.add(Vr),Xe.add(D);var Je=ie.zeros(2*xe.rows,2*xe.columns);return Je=Je.setSubMatrix(xe,0,0),Je=Je.setSubMatrix(be,xe.rows,0),Je=Je.setSubMatrix(De,0,xe.columns),Je=Je.setSubMatrix(Xe,xe.rows,xe.columns),Je.subMatrix(0,Ft-1,0,er-1)}return qe(b,C,Le,st)}},{key:"scaleRows",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_(C)!=="object")throw new TypeError("options must be an object");var b=C.min,S=b===void 0?0:b,X=C.max,pe=X===void 0?1:X;if(!Number.isFinite(S))throw new TypeError("min must be a number");if(!Number.isFinite(pe))throw new TypeError("max must be a number");if(S>=pe)throw new RangeError("min must be smaller than max");for(var Me=new mt(this.rows,this.columns),me=0;me<this.rows;me++){var Le=this.getRow(me);Le.length>0&&p(Le,{min:S,max:pe,output:Le}),Me.setRow(me,Le)}return Me}},{key:"scaleColumns",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_(C)!=="object")throw new TypeError("options must be an object");var b=C.min,S=b===void 0?0:b,X=C.max,pe=X===void 0?1:X;if(!Number.isFinite(S))throw new TypeError("min must be a number");if(!Number.isFinite(pe))throw new TypeError("max must be a number");if(S>=pe)throw new RangeError("min must be smaller than max");for(var Me=new mt(this.rows,this.columns),me=0;me<this.columns;me++){var Le=this.getColumn(me);Le.length&&p(Le,{min:S,max:pe,output:Le}),Me.setColumn(me,Le)}return Me}},{key:"flipRows",value:function(){for(var C=Math.ceil(this.columns/2),b=0;b<this.rows;b++)for(var S=0;S<C;S++){var X=this.get(b,S),pe=this.get(b,this.columns-1-S);this.set(b,S,pe),this.set(b,this.columns-1-S,X)}return this}},{key:"flipColumns",value:function(){for(var C=Math.ceil(this.rows/2),b=0;b<this.columns;b++)for(var S=0;S<C;S++){var X=this.get(S,b),pe=this.get(this.rows-1-S,b);this.set(S,b,pe),this.set(this.rows-1-S,b,X)}return this}},{key:"kroneckerProduct",value:function(C){C=mt.checkMatrix(C);for(var b=this.rows,S=this.columns,X=C.rows,pe=C.columns,Me=new mt(b*X,S*pe),me=0;me<b;me++)for(var Le=0;Le<S;Le++)for(var st=0;st<X;st++)for(var qe=0;qe<pe;qe++)Me.set(X*me+st,pe*Le+qe,this.get(me,Le)*C.get(st,qe));return Me}},{key:"kroneckerSum",value:function(C){if(C=mt.checkMatrix(C),!this.isSquare()||!C.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");var b=this.rows,S=C.rows,X=this.kroneckerProduct(mt.eye(S,S)),pe=mt.eye(b,b).kroneckerProduct(C);return X.add(pe)}},{key:"transpose",value:function(){for(var C=new mt(this.columns,this.rows),b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)C.set(S,b,this.get(b,S));return C}},{key:"sortRows",value:function(){for(var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pt,b=0;b<this.rows;b++)this.setRow(b,this.getRow(b).sort(C));return this}},{key:"sortColumns",value:function(){for(var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pt,b=0;b<this.columns;b++)this.setColumn(b,this.getColumn(b).sort(C));return this}},{key:"subMatrix",value:function(C,b,S,X){Z(this,C,b,S,X);for(var pe=new mt(b-C+1,X-S+1),Me=C;Me<=b;Me++)for(var me=S;me<=X;me++)pe.set(Me-C,me-S,this.get(Me,me));return pe}},{key:"subMatrixRow",value:function(C,b,S){if(b===void 0&&(b=0),S===void 0&&(S=this.columns-1),b>S||b<0||b>=this.columns||S<0||S>=this.columns)throw new RangeError("Argument out of range");for(var X=new mt(C.length,S-b+1),pe=0;pe<C.length;pe++)for(var Me=b;Me<=S;Me++){if(C[pe]<0||C[pe]>=this.rows)throw new RangeError("Row index out of range: ".concat(C[pe]));X.set(pe,Me-b,this.get(C[pe],Me))}return X}},{key:"subMatrixColumn",value:function(C,b,S){if(b===void 0&&(b=0),S===void 0&&(S=this.rows-1),b>S||b<0||b>=this.rows||S<0||S>=this.rows)throw new RangeError("Argument out of range");for(var X=new mt(S-b+1,C.length),pe=0;pe<C.length;pe++)for(var Me=b;Me<=S;Me++){if(C[pe]<0||C[pe]>=this.columns)throw new RangeError("Column index out of range: ".concat(C[pe]));X.set(Me-b,pe,this.get(Me,C[pe]))}return X}},{key:"setSubMatrix",value:function(C,b,S){if(C=mt.checkMatrix(C),C.isEmpty())return this;var X=b+C.rows-1,pe=S+C.columns-1;Z(this,b,X,S,pe);for(var Me=0;Me<C.rows;Me++)for(var me=0;me<C.columns;me++)this.set(b+Me,S+me,C.get(Me,me));return this}},{key:"selection",value:function(C,b){W(this,C),H(this,b);for(var S=new mt(C.length,b.length),X=0;X<C.length;X++)for(var pe=C[X],Me=0;Me<b.length;Me++){var me=b[Me];S.set(X,Me,this.get(pe,me))}return S}},{key:"trace",value:function(){for(var C=Math.min(this.rows,this.columns),b=0,S=0;S<C;S++)b+=this.get(S,S);return b}},{key:"clone",value:function(){for(var C=new mt(this.rows,this.columns),b=0;b<this.rows;b++)for(var S=0;S<this.columns;S++)C.set(b,S,this.get(b,S));return C}},{key:"sum",value:function(C){switch(C){case"row":return se(this);case"column":return fe(this);case void 0:return Ie(this);default:throw new Error("invalid option: ".concat(C))}}},{key:"product",value:function(C){switch(C){case"row":return ye(this);case"column":return Ae(this);case void 0:return Se(this);default:throw new Error("invalid option: ".concat(C))}}},{key:"mean",value:function(C){var b=this.sum(C);switch(C){case"row":{for(var S=0;S<this.rows;S++)b[S]/=this.columns;return b}case"column":{for(var X=0;X<this.columns;X++)b[X]/=this.rows;return b}case void 0:return b/this.size;default:throw new Error("invalid option: ".concat(C))}}},{key:"variance",value:function(C){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_(C)==="object"&&(b=C,C=void 0),_(b)!=="object")throw new TypeError("options must be an object");var S=b,X=S.unbiased,pe=X===void 0?!0:X,Me=S.mean,me=Me===void 0?this.mean(C):Me;if(typeof pe!="boolean")throw new TypeError("unbiased must be a boolean");switch(C){case"row":{if(!x.isAnyArray(me))throw new TypeError("mean must be an array");return we(this,pe,me)}case"column":{if(!x.isAnyArray(me))throw new TypeError("mean must be an array");return Te(this,pe,me)}case void 0:{if(typeof me!="number")throw new TypeError("mean must be a number");return ke(this,pe,me)}default:throw new Error("invalid option: ".concat(C))}}},{key:"standardDeviation",value:function(C,b){_(C)==="object"&&(b=C,C=void 0);var S=this.variance(C,b);if(C===void 0)return Math.sqrt(S);for(var X=0;X<S.length;X++)S[X]=Math.sqrt(S[X]);return S}},{key:"center",value:function(C){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_(C)==="object"&&(b=C,C=void 0),_(b)!=="object")throw new TypeError("options must be an object");var S=b,X=S.center,pe=X===void 0?this.mean(C):X;switch(C){case"row":{if(!x.isAnyArray(pe))throw new TypeError("center must be an array");return Ge(this,pe),this}case"column":{if(!x.isAnyArray(pe))throw new TypeError("center must be an array");return tt(this,pe),this}case void 0:{if(typeof pe!="number")throw new TypeError("center must be a number");return He(this,pe),this}default:throw new Error("invalid option: ".concat(C))}}},{key:"scale",value:function(C){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_(C)==="object"&&(b=C,C=void 0),_(b)!=="object")throw new TypeError("options must be an object");var S=b.scale;switch(C){case"row":{if(S===void 0)S=ft(this);else if(!x.isAnyArray(S))throw new TypeError("scale must be an array");return Lt(this,S),this}case"column":{if(S===void 0)S=Jt(this);else if(!x.isAnyArray(S))throw new TypeError("scale must be an array");return Qe(this,S),this}case void 0:{if(S===void 0)S=ut(this);else if(typeof S!="number")throw new TypeError("scale must be a number");return xt(this,S),this}default:throw new Error("invalid option: ".concat(C))}}},{key:"toString",value:function(C){return c(this,C)}}],[{key:"from1DArray",value:function(C,b,S){var X=C*b;if(X!==S.length)throw new RangeError("data length does not match given dimensions");for(var pe=new mt(C,b),Me=0;Me<C;Me++)for(var me=0;me<b;me++)pe.set(Me,me,S[Me*b+me]);return pe}},{key:"rowVector",value:function(C){for(var b=new mt(1,C.length),S=0;S<C.length;S++)b.set(0,S,C[S]);return b}},{key:"columnVector",value:function(C){for(var b=new mt(C.length,1),S=0;S<C.length;S++)b.set(S,0,C[S]);return b}},{key:"zeros",value:function(C,b){return new mt(C,b)}},{key:"ones",value:function(C,b){return new mt(C,b).fill(1)}},{key:"rand",value:function(C,b){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(_(S)!=="object")throw new TypeError("options must be an object");for(var X=S.random,pe=X===void 0?Math.random:X,Me=new mt(C,b),me=0;me<C;me++)for(var Le=0;Le<b;Le++)Me.set(me,Le,pe());return Me}},{key:"randInt",value:function(C,b){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(_(S)!=="object")throw new TypeError("options must be an object");var X=S.min,pe=X===void 0?0:X,Me=S.max,me=Me===void 0?1e3:Me,Le=S.random,st=Le===void 0?Math.random:Le;if(!Number.isInteger(pe))throw new TypeError("min must be an integer");if(!Number.isInteger(me))throw new TypeError("max must be an integer");if(pe>=me)throw new RangeError("min must be smaller than max");for(var qe=me-pe,Nt=new mt(C,b),nr=0;nr<C;nr++)for(var Ft=0;Ft<b;Ft++){var er=pe+Math.round(st()*qe);Nt.set(nr,Ft,er)}return Nt}},{key:"eye",value:function(C,b,S){b===void 0&&(b=C),S===void 0&&(S=1);for(var X=Math.min(C,b),pe=this.zeros(C,b),Me=0;Me<X;Me++)pe.set(Me,Me,S);return pe}},{key:"diag",value:function(C,b,S){var X=C.length;b===void 0&&(b=X),S===void 0&&(S=b);for(var pe=Math.min(X,b,S),Me=this.zeros(b,S),me=0;me<pe;me++)Me.set(me,me,C[me]);return Me}},{key:"min",value:function(C,b){C=this.checkMatrix(C),b=this.checkMatrix(b);for(var S=C.rows,X=C.columns,pe=new mt(S,X),Me=0;Me<S;Me++)for(var me=0;me<X;me++)pe.set(Me,me,Math.min(C.get(Me,me),b.get(Me,me)));return pe}},{key:"max",value:function(C,b){C=this.checkMatrix(C),b=this.checkMatrix(b);for(var S=C.rows,X=C.columns,pe=new this(S,X),Me=0;Me<S;Me++)for(var me=0;me<X;me++)pe.set(Me,me,Math.max(C.get(Me,me),b.get(Me,me)));return pe}},{key:"checkMatrix",value:function(C){return ie.isMatrix(C)?C:new mt(C)}},{key:"isMatrix",value:function(C){return C!=null&&C.klass==="Matrix"}}]),ie}();dt.prototype.klass="Matrix",typeof Symbol!="undefined"&&(dt.prototype[Symbol.for("nodejs.util.inspect.custom")]=d);function pt(ie,ee){return ie-ee}function wt(ie){return ie.every(function(ee){return typeof ee=="number"})}dt.random=dt.rand,dt.randomInt=dt.randInt,dt.diagonal=dt.diag,dt.prototype.diagonal=dt.prototype.diag,dt.identity=dt.eye,dt.prototype.negate=dt.prototype.neg,dt.prototype.tensorProduct=dt.prototype.kroneckerProduct;var mt=function(ie){U(C,ie);var ee=L(C);function C(b,S){var X;if(I(this,C),X=ee.call(this),C.isMatrix(b))return k(X,b.clone());if(Number.isInteger(b)&&b>=0)if(X.data=[],Number.isInteger(S)&&S>=0)for(var pe=0;pe<b;pe++)X.data.push(new Float64Array(S));else throw new TypeError("nColumns must be a positive integer");else if(x.isAnyArray(b)){var Me=b;if(b=Me.length,S=b?Me[0].length:0,typeof S!="number")throw new TypeError("Data must be a 2D array with at least one element");X.data=[];for(var me=0;me<b;me++){if(Me[me].length!==S)throw new RangeError("Inconsistent array dimensions");if(!wt(Me[me]))throw new TypeError("Input data contains non-numeric values");X.data.push(Float64Array.from(Me[me]))}}else throw new TypeError("First argument must be a positive number or an array");return X.rows=b,X.columns=S,X}return T(C,[{key:"set",value:function(S,X,pe){return this.data[S][X]=pe,this}},{key:"get",value:function(S,X){return this.data[S][X]}},{key:"removeRow",value:function(S){return R(this,S),this.data.splice(S,1),this.rows-=1,this}},{key:"addRow",value:function(S,X){return X===void 0&&(X=S,S=this.rows),R(this,S,!0),X=Float64Array.from(Q(this,X)),this.data.splice(S,0,X),this.rows+=1,this}},{key:"removeColumn",value:function(S){j(this,S);for(var X=0;X<this.rows;X++){for(var pe=new Float64Array(this.columns-1),Me=0;Me<S;Me++)pe[Me]=this.data[X][Me];for(var me=S+1;me<this.columns;me++)pe[me-1]=this.data[X][me];this.data[X]=pe}return this.columns-=1,this}},{key:"addColumn",value:function(S,X){typeof X=="undefined"&&(X=S,S=this.columns),j(this,S,!0),X=G(this,X);for(var pe=0;pe<this.rows;pe++){for(var Me=new Float64Array(this.columns+1),me=0;me<S;me++)Me[me]=this.data[pe][me];for(Me[me++]=X[pe];me<this.columns+1;me++)Me[me]=this.data[pe][me-1];this.data[pe]=Me}return this.columns+=1,this}}]),C}(dt);P(dt,mt);var ur=function(ie){U(C,ie);var ee=L(C);function C(b,S,X){var pe;return I(this,C),pe=ee.call(this),pe.matrix=b,pe.rows=S,pe.columns=X,pe}return T(C)}(dt),Ir=function(ie){U(C,ie);var ee=L(C);function C(b,S){var X;return I(this,C),j(b,S),X=ee.call(this,b,b.rows,1),X.column=S,X}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(S,this.column,pe),this}},{key:"get",value:function(S){return this.matrix.get(S,this.column)}}]),C}(ur),Nr=function(ie){U(C,ie);var ee=L(C);function C(b,S){var X;return I(this,C),H(b,S),X=ee.call(this,b,b.rows,S.length),X.columnIndices=S,X}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(S,this.columnIndices[X],pe),this}},{key:"get",value:function(S,X){return this.matrix.get(S,this.columnIndices[X])}}]),C}(ur),Hr=function(ie){U(C,ie);var ee=L(C);function C(b){return I(this,C),ee.call(this,b,b.rows,b.columns)}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(S,this.columns-X-1,pe),this}},{key:"get",value:function(S,X){return this.matrix.get(S,this.columns-X-1)}}]),C}(ur),It=function(ie){U(C,ie);var ee=L(C);function C(b){return I(this,C),ee.call(this,b,b.rows,b.columns)}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(this.rows-S-1,X,pe),this}},{key:"get",value:function(S,X){return this.matrix.get(this.rows-S-1,X)}}]),C}(ur),qt=function(ie){U(C,ie);var ee=L(C);function C(b,S){var X;return I(this,C),R(b,S),X=ee.call(this,b,1,b.columns),X.row=S,X}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(this.row,X,pe),this}},{key:"get",value:function(S,X){return this.matrix.get(this.row,X)}}]),C}(ur),ar=function(ie){U(C,ie);var ee=L(C);function C(b,S){var X;return I(this,C),W(b,S),X=ee.call(this,b,S.length,b.columns),X.rowIndices=S,X}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(this.rowIndices[S],X,pe),this}},{key:"get",value:function(S,X){return this.matrix.get(this.rowIndices[S],X)}}]),C}(ur),Oe=function(ie){U(C,ie);var ee=L(C);function C(b,S,X){var pe;return I(this,C),W(b,S),H(b,X),pe=ee.call(this,b,S.length,X.length),pe.rowIndices=S,pe.columnIndices=X,pe}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(this.rowIndices[S],this.columnIndices[X],pe),this}},{key:"get",value:function(S,X){return this.matrix.get(this.rowIndices[S],this.columnIndices[X])}}]),C}(ur),Pr=function(ie){U(C,ie);var ee=L(C);function C(b,S,X,pe,Me){var me;return I(this,C),Z(b,S,X,pe,Me),me=ee.call(this,b,X-S+1,Me-pe+1),me.startRow=S,me.startColumn=pe,me}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(this.startRow+S,this.startColumn+X,pe),this}},{key:"get",value:function(S,X){return this.matrix.get(this.startRow+S,this.startColumn+X)}}]),C}(ur),Cr=function(ie){U(C,ie);var ee=L(C);function C(b){return I(this,C),ee.call(this,b,b.columns,b.rows)}return T(C,[{key:"set",value:function(S,X,pe){return this.matrix.set(X,S,pe),this}},{key:"get",value:function(S,X){return this.matrix.get(X,S)}}]),C}(ur),Gr=function(ie){U(C,ie);var ee=L(C);function C(b){var S,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};I(this,C);var pe=X.rows,Me=pe===void 0?1:pe;if(b.length%Me!==0)throw new Error("the data length is not divisible by the number of rows");return S=ee.call(this),S.rows=Me,S.columns=b.length/Me,S.data=b,S}return T(C,[{key:"set",value:function(S,X,pe){var Me=this._calculateIndex(S,X);return this.data[Me]=pe,this}},{key:"get",value:function(S,X){var pe=this._calculateIndex(S,X);return this.data[pe]}},{key:"_calculateIndex",value:function(S,X){return S*this.columns+X}}]),C}(dt),mr=function(ie){U(C,ie);var ee=L(C);function C(b){var S;return I(this,C),S=ee.call(this),S.data=b,S.rows=b.length,S.columns=b[0].length,S}return T(C,[{key:"set",value:function(S,X,pe){return this.data[S][X]=pe,this}},{key:"get",value:function(S,X){return this.data[S][X]}}]),C}(dt);function rn(ie,ee){if(x.isAnyArray(ie))return ie[0]&&x.isAnyArray(ie[0])?new mr(ie):new Gr(ie,ee);throw new Error("the argument is not an array")}var Sr=function(){function ie(ee){I(this,ie),ee=mr.checkMatrix(ee);var C=ee.clone(),b=C.rows,S=C.columns,X=new Float64Array(b),pe=1,Me,me,Le,st,qe,Nt,nr,Ft,er;for(Me=0;Me<b;Me++)X[Me]=Me;for(Ft=new Float64Array(b),me=0;me<S;me++){for(Me=0;Me<b;Me++)Ft[Me]=C.get(Me,me);for(Me=0;Me<b;Me++){for(er=Math.min(Me,me),qe=0,Le=0;Le<er;Le++)qe+=C.get(Me,Le)*Ft[Le];Ft[Me]-=qe,C.set(Me,me,Ft[Me])}for(st=me,Me=me+1;Me<b;Me++)Math.abs(Ft[Me])>Math.abs(Ft[st])&&(st=Me);if(st!==me){for(Le=0;Le<S;Le++)Nt=C.get(st,Le),C.set(st,Le,C.get(me,Le)),C.set(me,Le,Nt);nr=X[st],X[st]=X[me],X[me]=nr,pe=-pe}if(me<b&&C.get(me,me)!==0)for(Me=me+1;Me<b;Me++)C.set(Me,me,C.get(Me,me)/C.get(me,me))}this.LU=C,this.pivotVector=X,this.pivotSign=pe}return T(ie,[{key:"isSingular",value:function(){for(var C=this.LU,b=C.columns,S=0;S<b;S++)if(C.get(S,S)===0)return!0;return!1}},{key:"solve",value:function(C){C=mt.checkMatrix(C);var b=this.LU,S=b.rows;if(S!==C.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");var X=C.columns,pe=C.subMatrixRow(this.pivotVector,0,X-1),Me=b.columns,me,Le,st;for(st=0;st<Me;st++)for(me=st+1;me<Me;me++)for(Le=0;Le<X;Le++)pe.set(me,Le,pe.get(me,Le)-pe.get(st,Le)*b.get(me,st));for(st=Me-1;st>=0;st--){for(Le=0;Le<X;Le++)pe.set(st,Le,pe.get(st,Le)/b.get(st,st));for(me=0;me<st;me++)for(Le=0;Le<X;Le++)pe.set(me,Le,pe.get(me,Le)-pe.get(st,Le)*b.get(me,st))}return pe}},{key:"determinant",get:function(){var C=this.LU;if(!C.isSquare())throw new Error("Matrix must be square");for(var b=this.pivotSign,S=C.columns,X=0;X<S;X++)b*=C.get(X,X);return b}},{key:"lowerTriangularMatrix",get:function(){for(var C=this.LU,b=C.rows,S=C.columns,X=new mt(b,S),pe=0;pe<b;pe++)for(var Me=0;Me<S;Me++)pe>Me?X.set(pe,Me,C.get(pe,Me)):pe===Me?X.set(pe,Me,1):X.set(pe,Me,0);return X}},{key:"upperTriangularMatrix",get:function(){for(var C=this.LU,b=C.rows,S=C.columns,X=new mt(b,S),pe=0;pe<b;pe++)for(var Me=0;Me<S;Me++)pe<=Me?X.set(pe,Me,C.get(pe,Me)):X.set(pe,Me,0);return X}},{key:"pivotPermutationVector",get:function(){return Array.from(this.pivotVector)}}]),ie}();function qr(ie,ee){var C=0;return Math.abs(ie)>Math.abs(ee)?(C=ee/ie,Math.abs(ie)*Math.sqrt(1+C*C)):ee!==0?(C=ie/ee,Math.abs(ee)*Math.sqrt(1+C*C)):0}var Rn=function(){function ie(ee){I(this,ie),ee=mr.checkMatrix(ee);var C=ee.clone(),b=ee.rows,S=ee.columns,X=new Float64Array(S),pe,Me,me,Le;for(me=0;me<S;me++){var st=0;for(pe=me;pe<b;pe++)st=qr(st,C.get(pe,me));if(st!==0){for(C.get(me,me)<0&&(st=-st),pe=me;pe<b;pe++)C.set(pe,me,C.get(pe,me)/st);for(C.set(me,me,C.get(me,me)+1),Me=me+1;Me<S;Me++){for(Le=0,pe=me;pe<b;pe++)Le+=C.get(pe,me)*C.get(pe,Me);for(Le=-Le/C.get(me,me),pe=me;pe<b;pe++)C.set(pe,Me,C.get(pe,Me)+Le*C.get(pe,me))}}X[me]=-st}this.QR=C,this.Rdiag=X}return T(ie,[{key:"solve",value:function(C){C=mt.checkMatrix(C);var b=this.QR,S=b.rows;if(C.rows!==S)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");var X=C.columns,pe=C.clone(),Me=b.columns,me,Le,st,qe;for(st=0;st<Me;st++)for(Le=0;Le<X;Le++){for(qe=0,me=st;me<S;me++)qe+=b.get(me,st)*pe.get(me,Le);for(qe=-qe/b.get(st,st),me=st;me<S;me++)pe.set(me,Le,pe.get(me,Le)+qe*b.get(me,st))}for(st=Me-1;st>=0;st--){for(Le=0;Le<X;Le++)pe.set(st,Le,pe.get(st,Le)/this.Rdiag[st]);for(me=0;me<st;me++)for(Le=0;Le<X;Le++)pe.set(me,Le,pe.get(me,Le)-pe.get(st,Le)*b.get(me,st))}return pe.subMatrix(0,Me-1,0,X-1)}},{key:"isFullRank",value:function(){for(var C=this.QR.columns,b=0;b<C;b++)if(this.Rdiag[b]===0)return!1;return!0}},{key:"upperTriangularMatrix",get:function(){var C=this.QR,b=C.columns,S=new mt(b,b),X,pe;for(X=0;X<b;X++)for(pe=0;pe<b;pe++)X<pe?S.set(X,pe,C.get(X,pe)):X===pe?S.set(X,pe,this.Rdiag[X]):S.set(X,pe,0);return S}},{key:"orthogonalMatrix",get:function(){var C=this.QR,b=C.rows,S=C.columns,X=new mt(b,S),pe,Me,me,Le;for(me=S-1;me>=0;me--){for(pe=0;pe<b;pe++)X.set(pe,me,0);for(X.set(me,me,1),Me=me;Me<S;Me++)if(C.get(me,me)!==0){for(Le=0,pe=me;pe<b;pe++)Le+=C.get(pe,me)*X.get(pe,Me);for(Le=-Le/C.get(me,me),pe=me;pe<b;pe++)X.set(pe,Me,X.get(pe,Me)+Le*C.get(pe,me))}}return X}}]),ie}(),yn=function(){function ie(ee){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(I(this,ie),ee=mr.checkMatrix(ee),ee.isEmpty())throw new Error("Matrix must be non-empty");var b=ee.rows,S=ee.columns,X=C.computeLeftSingularVectors,pe=X===void 0?!0:X,Me=C.computeRightSingularVectors,me=Me===void 0?!0:Me,Le=C.autoTranspose,st=Le===void 0?!1:Le,qe=!!pe,Nt=!!me,nr=!1,Ft;if(b<S)if(!st)Ft=ee.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{Ft=ee.transpose(),b=Ft.rows,S=Ft.columns,nr=!0;var er=qe;qe=Nt,Nt=er}else Ft=ee.clone();for(var Ur=Math.min(b,S),Ct=Math.min(b+1,S),Kt=new Float64Array(Ct),lr=new mt(b,Ur),Dr=new mt(S,S),br=new Float64Array(S),sa=new Float64Array(b),ea=new Float64Array(Ct),gn=0;gn<Ct;gn++)ea[gn]=gn;for(var Tn=Math.min(b-1,S),ra=Math.max(0,Math.min(S-2,b)),Zn=Math.max(Tn,ra),Vr=0;Vr<Zn;Vr++){if(Vr<Tn){Kt[Vr]=0;for(var In=Vr;In<b;In++)Kt[Vr]=qr(Kt[Vr],Ft.get(In,Vr));if(Kt[Vr]!==0){Ft.get(Vr,Vr)<0&&(Kt[Vr]=-Kt[Vr]);for(var at=Vr;at<b;at++)Ft.set(at,Vr,Ft.get(at,Vr)/Kt[Vr]);Ft.set(Vr,Vr,Ft.get(Vr,Vr)+1)}Kt[Vr]=-Kt[Vr]}for(var D=Vr+1;D<S;D++){if(Vr<Tn&&Kt[Vr]!==0){for(var te=0,xe=Vr;xe<b;xe++)te+=Ft.get(xe,Vr)*Ft.get(xe,D);te=-te/Ft.get(Vr,Vr);for(var be=Vr;be<b;be++)Ft.set(be,D,Ft.get(be,D)+te*Ft.get(be,Vr))}br[D]=Ft.get(Vr,D)}if(qe&&Vr<Tn)for(var De=Vr;De<b;De++)lr.set(De,Vr,Ft.get(De,Vr));if(Vr<ra){br[Vr]=0;for(var Xe=Vr+1;Xe<S;Xe++)br[Vr]=qr(br[Vr],br[Xe]);if(br[Vr]!==0){br[Vr+1]<0&&(br[Vr]=0-br[Vr]);for(var Je=Vr+1;Je<S;Je++)br[Je]/=br[Vr];br[Vr+1]+=1}if(br[Vr]=-br[Vr],Vr+1<b&&br[Vr]!==0){for(var lt=Vr+1;lt<b;lt++)sa[lt]=0;for(var Tt=Vr+1;Tt<b;Tt++)for(var Ht=Vr+1;Ht<S;Ht++)sa[Tt]+=br[Ht]*Ft.get(Tt,Ht);for(var ir=Vr+1;ir<S;ir++)for(var Kr=-br[ir]/br[Vr+1],nn=Vr+1;nn<b;nn++)Ft.set(nn,ir,Ft.get(nn,ir)+Kr*sa[nn])}if(Nt)for(var mn=Vr+1;mn<S;mn++)Dr.set(mn,Vr,br[mn])}}var Jr=Math.min(S,b+1);if(Tn<S&&(Kt[Tn]=Ft.get(Tn,Tn)),b<Jr&&(Kt[Jr-1]=0),ra+1<Jr&&(br[ra]=Ft.get(ra,Jr-1)),br[Jr-1]=0,qe){for(var jn=Tn;jn<Ur;jn++){for(var _a=0;_a<b;_a++)lr.set(_a,jn,0);lr.set(jn,jn,1)}for(var Fn=Tn-1;Fn>=0;Fn--)if(Kt[Fn]!==0){for(var ya=Fn+1;ya<Ur;ya++){for(var Ai=0,bo=Fn;bo<b;bo++)Ai+=lr.get(bo,Fn)*lr.get(bo,ya);Ai=-Ai/lr.get(Fn,Fn);for(var Zi=Fn;Zi<b;Zi++)lr.set(Zi,ya,lr.get(Zi,ya)+Ai*lr.get(Zi,Fn))}for(var Fi=Fn;Fi<b;Fi++)lr.set(Fi,Fn,-lr.get(Fi,Fn));lr.set(Fn,Fn,1+lr.get(Fn,Fn));for(var Kn=0;Kn<Fn-1;Kn++)lr.set(Kn,Fn,0)}else{for(var ho=0;ho<b;ho++)lr.set(ho,Fn,0);lr.set(Fn,Fn,1)}}if(Nt)for(var Ei=S-1;Ei>=0;Ei--){if(Ei<ra&&br[Ei]!==0)for(var eo=Ei+1;eo<S;eo++){for(var Eo=0,Yo=Ei+1;Yo<S;Yo++)Eo+=Dr.get(Yo,Ei)*Dr.get(Yo,eo);Eo=-Eo/Dr.get(Ei+1,Ei);for(var Po=Ei+1;Po<S;Po++)Dr.set(Po,eo,Dr.get(Po,eo)+Eo*Dr.get(Po,Ei))}for(var Ki=0;Ki<S;Ki++)Dr.set(Ki,Ei,0);Dr.set(Ei,Ei,1)}for(var Si=Jr-1,Ns=Number.EPSILON;Jr>0;){var On=void 0,Gi=void 0;for(On=Jr-2;On>=-1&&On!==-1;On--){var to=Number.MIN_VALUE+Ns*Math.abs(Kt[On]+Math.abs(Kt[On+1]));if(Math.abs(br[On])<=to||Number.isNaN(br[On])){br[On]=0;break}}if(On===Jr-2)Gi=4;else{var _i=void 0;for(_i=Jr-1;_i>=On&&_i!==On;_i--){var Ru=(_i!==Jr?Math.abs(br[_i]):0)+(_i!==On+1?Math.abs(br[_i-1]):0);if(Math.abs(Kt[_i])<=Ns*Ru){Kt[_i]=0;break}}_i===On?Gi=3:_i===Jr-1?Gi=1:(Gi=2,On=_i)}switch(On++,Gi){case 1:{var xo=br[Jr-2];br[Jr-2]=0;for(var ri=Jr-2;ri>=On;ri--){var wo=qr(Kt[ri],xo),ds=Kt[ri]/wo,Ho=xo/wo;if(Kt[ri]=wo,ri!==On&&(xo=-Ho*br[ri-1],br[ri-1]=ds*br[ri-1]),Nt)for(var zi=0;zi<S;zi++)wo=ds*Dr.get(zi,ri)+Ho*Dr.get(zi,Jr-1),Dr.set(zi,Jr-1,-Ho*Dr.get(zi,ri)+ds*Dr.get(zi,Jr-1)),Dr.set(zi,ri,wo)}break}case 2:{var $i=br[On-1];br[On-1]=0;for(var Va=On;Va<Jr;Va++){var ro=qr(Kt[Va],$i),Zo=Kt[Va]/ro,Ui=$i/ro;if(Kt[Va]=ro,$i=-Ui*br[Va],br[Va]=Zo*br[Va],qe)for(var Wi=0;Wi<b;Wi++)ro=Zo*lr.get(Wi,Va)+Ui*lr.get(Wi,On-1),lr.set(Wi,On-1,-Ui*lr.get(Wi,Va)+Zo*lr.get(Wi,On-1)),lr.set(Wi,Va,ro)}break}case 3:{var Ko=Math.max(Math.abs(Kt[Jr-1]),Math.abs(Kt[Jr-2]),Math.abs(br[Jr-2]),Math.abs(Kt[On]),Math.abs(br[On])),vo=Kt[Jr-1]/Ko,hs=Kt[Jr-2]/Ko,Ca=br[Jr-2]/Ko,So=Kt[On]/Ko,ou=br[On]/Ko,di=((hs+vo)*(hs-vo)+Ca*Ca)/2,mi=vo*Ca*(vo*Ca),_o=0;(di!==0||mi!==0)&&(di<0?_o=0-Math.sqrt(di*di+mi):_o=Math.sqrt(di*di+mi),_o=mi/(di+_o));for(var hi=(So+vo)*(So-vo)+_o,xi=So*ou,Vn=On;Vn<Jr-1;Vn++){var ni=qr(hi,xi);ni===0&&(ni=Number.MIN_VALUE);var qa=hi/ni,wi=xi/ni;if(Vn!==On&&(br[Vn-1]=ni),hi=qa*Kt[Vn]+wi*br[Vn],br[Vn]=qa*br[Vn]-wi*Kt[Vn],xi=wi*Kt[Vn+1],Kt[Vn+1]=qa*Kt[Vn+1],Nt)for(var bi=0;bi<S;bi++)ni=qa*Dr.get(bi,Vn)+wi*Dr.get(bi,Vn+1),Dr.set(bi,Vn+1,-wi*Dr.get(bi,Vn)+qa*Dr.get(bi,Vn+1)),Dr.set(bi,Vn,ni);if(ni=qr(hi,xi),ni===0&&(ni=Number.MIN_VALUE),qa=hi/ni,wi=xi/ni,Kt[Vn]=ni,hi=qa*br[Vn]+wi*Kt[Vn+1],Kt[Vn+1]=-wi*br[Vn]+qa*Kt[Vn+1],xi=wi*br[Vn+1],br[Vn+1]=qa*br[Vn+1],qe&&Vn<b-1)for(var Mi=0;Mi<b;Mi++)ni=qa*lr.get(Mi,Vn)+wi*lr.get(Mi,Vn+1),lr.set(Mi,Vn+1,-wi*lr.get(Mi,Vn)+qa*lr.get(Mi,Vn+1)),lr.set(Mi,Vn,ni)}br[Jr-2]=hi;break}case 4:{if(Kt[On]<=0&&(Kt[On]=Kt[On]<0?-Kt[On]:0,Nt))for(var go=0;go<=Si;go++)Dr.set(go,On,-Dr.get(go,On));for(;On<Si&&!(Kt[On]>=Kt[On+1]);){var no=Kt[On];if(Kt[On]=Kt[On+1],Kt[On+1]=no,Nt&&On<S-1)for(var Mo=0;Mo<S;Mo++)no=Dr.get(Mo,On+1),Dr.set(Mo,On+1,Dr.get(Mo,On)),Dr.set(Mo,On,no);if(qe&&On<b-1)for(var po=0;po<b;po++)no=lr.get(po,On+1),lr.set(po,On+1,lr.get(po,On)),lr.set(po,On,no);On++}Jr--;break}}}if(nr){var su=Dr;Dr=lr,lr=su}this.m=b,this.n=S,this.s=Kt,this.U=lr,this.V=Dr}return T(ie,[{key:"solve",value:function(C){for(var b=C,S=this.threshold,X=this.s.length,pe=mt.zeros(X,X),Me=0;Me<X;Me++)Math.abs(this.s[Me])<=S?pe.set(Me,Me,0):pe.set(Me,Me,1/this.s[Me]);for(var me=this.U,Le=this.rightSingularVectors,st=Le.mmul(pe),qe=Le.rows,Nt=me.rows,nr=mt.zeros(qe,Nt),Ft=0;Ft<qe;Ft++)for(var er=0;er<Nt;er++){for(var Ur=0,Ct=0;Ct<X;Ct++)Ur+=st.get(Ft,Ct)*me.get(er,Ct);nr.set(Ft,er,Ur)}return nr.mmul(b)}},{key:"solveForDiagonal",value:function(C){return this.solve(mt.diag(C))}},{key:"inverse",value:function(){for(var C=this.V,b=this.threshold,S=C.rows,X=C.columns,pe=new mt(S,this.s.length),Me=0;Me<S;Me++)for(var me=0;me<X;me++)Math.abs(this.s[me])>b&&pe.set(Me,me,C.get(Me,me)/this.s[me]);for(var Le=this.U,st=Le.rows,qe=Le.columns,Nt=new mt(S,st),nr=0;nr<S;nr++)for(var Ft=0;Ft<st;Ft++){for(var er=0,Ur=0;Ur<qe;Ur++)er+=pe.get(nr,Ur)*Le.get(Ft,Ur);Nt.set(nr,Ft,er)}return Nt}},{key:"condition",get:function(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}},{key:"norm2",get:function(){return this.s[0]}},{key:"rank",get:function(){for(var C=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,b=0,S=this.s,X=0,pe=S.length;X<pe;X++)S[X]>C&&b++;return b}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return mt.diag(this.s)}}]),ie}();function zr(ie){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ie=mr.checkMatrix(ie),ee?new yn(ie).inverse():Rt(ie,mt.eye(ie.rows))}function Rt(ie,ee){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return ie=mr.checkMatrix(ie),ee=mr.checkMatrix(ee),C?new yn(ie).solve(ee):ie.isSquare()?new Sr(ie).solve(ee):new Rn(ie).solve(ee)}function zt(ie){if(ie=mt.checkMatrix(ie),ie.isSquare()){if(ie.columns===0)return 1;var ee,C,b,S;if(ie.columns===2)return ee=ie.get(0,0),C=ie.get(0,1),b=ie.get(1,0),S=ie.get(1,1),ee*S-C*b;if(ie.columns===3){var X,pe,Me;return X=new Oe(ie,[1,2],[1,2]),pe=new Oe(ie,[1,2],[0,2]),Me=new Oe(ie,[1,2],[0,1]),ee=ie.get(0,0),C=ie.get(0,1),b=ie.get(0,2),ee*zt(X)-C*zt(pe)+b*zt(Me)}else return new Sr(ie).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Vt(ie,ee){for(var C=[],b=0;b<ie;b++)b!==ee&&C.push(b);return C}function hr(ie,ee,C){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e-9,S=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1e-9;if(ie>S)return new Array(ee.rows+1).fill(0);for(var X=ee.addRow(C,[0]),pe=0;pe<X.rows;pe++)Math.abs(X.get(pe,0))<b&&X.set(pe,0,0);return X.to1DArray()}function Ar(ie){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=ee.thresholdValue,b=C===void 0?1e-9:C,S=ee.thresholdError,X=S===void 0?1e-9:S;ie=mt.checkMatrix(ie);for(var pe=ie.rows,Me=new mt(pe,pe),me=0;me<pe;me++){var Le=mt.columnVector(ie.getRow(me)),st=ie.subMatrixRow(Vt(pe,me)).transpose(),qe=new yn(st),Nt=qe.solve(Le),nr=mt.sub(Le,st.mmul(Nt)).abs().max();Me.setRow(me,hr(nr,Nt,me,b,X))}return Me}function en(ie){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.EPSILON;if(ie=mt.checkMatrix(ie),ie.isEmpty())return ie.transpose();for(var C=new yn(ie,{autoTranspose:!0}),b=C.leftSingularVectors,S=C.rightSingularVectors,X=C.diagonal,pe=0;pe<X.length;pe++)Math.abs(X[pe])>ee?X[pe]=1/X[pe]:X[pe]=0;return S.mmul(mt.diag(X).mmul(b.transpose()))}function Fr(ie){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ie=new mt(ie);var b=!1;if(_(ee)==="object"&&!mt.isMatrix(ee)&&!x.isAnyArray(ee)?(C=ee,ee=ie,b=!0):ee=new mt(ee),ie.rows!==ee.rows)throw new TypeError("Both matrices must have the same number of rows");var S=C,X=S.center,pe=X===void 0?!0:X;pe&&(ie=ie.center("column"),b||(ee=ee.center("column")));for(var Me=ie.transpose().mmul(ee),me=0;me<Me.rows;me++)for(var Le=0;Le<Me.columns;Le++)Me.set(me,Le,Me.get(me,Le)*(1/(ie.rows-1)));return Me}function Cn(ie){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ie=new mt(ie);var b=!1;if(_(ee)==="object"&&!mt.isMatrix(ee)&&!x.isAnyArray(ee)?(C=ee,ee=ie,b=!0):ee=new mt(ee),ie.rows!==ee.rows)throw new TypeError("Both matrices must have the same number of rows");var S=C,X=S.center,pe=X===void 0?!0:X,Me=S.scale,me=Me===void 0?!0:Me;pe&&(ie.center("column"),b||ee.center("column")),me&&(ie.scale("column"),b||ee.scale("column"));for(var Le=ie.standardDeviation("column",{unbiased:!0}),st=b?Le:ee.standardDeviation("column",{unbiased:!0}),qe=ie.transpose().mmul(ee),Nt=0;Nt<qe.rows;Nt++)for(var nr=0;nr<qe.columns;nr++)qe.set(Nt,nr,qe.get(Nt,nr)*(1/(Le[Nt]*st[nr]))*(1/(ie.rows-1)));return qe}var Sn=function(){function ie(ee){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};I(this,ie);var b=C.assumeSymmetric,S=b===void 0?!1:b;if(ee=mr.checkMatrix(ee),!ee.isSquare())throw new Error("Matrix is not a square matrix");if(ee.isEmpty())throw new Error("Matrix must be non-empty");var X=ee.columns,pe=new mt(X,X),Me=new Float64Array(X),me=new Float64Array(X),Le=ee,st,qe,Nt=!1;if(S?Nt=!0:Nt=ee.isSymmetric(),Nt){for(st=0;st<X;st++)for(qe=0;qe<X;qe++)pe.set(st,qe,Le.get(st,qe));oa(X,me,Me,pe),jr(X,me,Me,pe)}else{var nr=new mt(X,X),Ft=new Float64Array(X);for(qe=0;qe<X;qe++)for(st=0;st<X;st++)nr.set(st,qe,Le.get(st,qe));xn(X,nr,Ft,pe),vn(X,me,Me,pe,nr)}this.n=X,this.e=me,this.d=Me,this.V=pe}return T(ie,[{key:"realEigenvalues",get:function(){return Array.from(this.d)}},{key:"imaginaryEigenvalues",get:function(){return Array.from(this.e)}},{key:"eigenvectorMatrix",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){var C=this.n,b=this.e,S=this.d,X=new mt(C,C),pe,Me;for(pe=0;pe<C;pe++){for(Me=0;Me<C;Me++)X.set(pe,Me,0);X.set(pe,pe,S[pe]),b[pe]>0?X.set(pe,pe+1,b[pe]):b[pe]<0&&X.set(pe,pe-1,b[pe])}return X}}]),ie}();function oa(ie,ee,C,b){var S,X,pe,Me,me,Le,st,qe;for(me=0;me<ie;me++)C[me]=b.get(ie-1,me);for(Me=ie-1;Me>0;Me--){for(qe=0,pe=0,Le=0;Le<Me;Le++)qe=qe+Math.abs(C[Le]);if(qe===0)for(ee[Me]=C[Me-1],me=0;me<Me;me++)C[me]=b.get(Me-1,me),b.set(Me,me,0),b.set(me,Me,0);else{for(Le=0;Le<Me;Le++)C[Le]/=qe,pe+=C[Le]*C[Le];for(S=C[Me-1],X=Math.sqrt(pe),S>0&&(X=-X),ee[Me]=qe*X,pe=pe-S*X,C[Me-1]=S-X,me=0;me<Me;me++)ee[me]=0;for(me=0;me<Me;me++){for(S=C[me],b.set(me,Me,S),X=ee[me]+b.get(me,me)*S,Le=me+1;Le<=Me-1;Le++)X+=b.get(Le,me)*C[Le],ee[Le]+=b.get(Le,me)*S;ee[me]=X}for(S=0,me=0;me<Me;me++)ee[me]/=pe,S+=ee[me]*C[me];for(st=S/(pe+pe),me=0;me<Me;me++)ee[me]-=st*C[me];for(me=0;me<Me;me++){for(S=C[me],X=ee[me],Le=me;Le<=Me-1;Le++)b.set(Le,me,b.get(Le,me)-(S*ee[Le]+X*C[Le]));C[me]=b.get(Me-1,me),b.set(Me,me,0)}}C[Me]=pe}for(Me=0;Me<ie-1;Me++){if(b.set(ie-1,Me,b.get(Me,Me)),b.set(Me,Me,1),pe=C[Me+1],pe!==0){for(Le=0;Le<=Me;Le++)C[Le]=b.get(Le,Me+1)/pe;for(me=0;me<=Me;me++){for(X=0,Le=0;Le<=Me;Le++)X+=b.get(Le,Me+1)*b.get(Le,me);for(Le=0;Le<=Me;Le++)b.set(Le,me,b.get(Le,me)-X*C[Le])}}for(Le=0;Le<=Me;Le++)b.set(Le,Me+1,0)}for(me=0;me<ie;me++)C[me]=b.get(ie-1,me),b.set(ie-1,me,0);b.set(ie-1,ie-1,1),ee[0]=0}function jr(ie,ee,C,b){var S,X,pe,Me,me,Le,st,qe,Nt,nr,Ft,er,Ur,Ct,Kt,lr;for(pe=1;pe<ie;pe++)ee[pe-1]=ee[pe];ee[ie-1]=0;var Dr=0,br=0,sa=Number.EPSILON;for(Le=0;Le<ie;Le++){for(br=Math.max(br,Math.abs(C[Le])+Math.abs(ee[Le])),st=Le;st<ie&&!(Math.abs(ee[st])<=sa*br);)st++;if(st>Le)do{for(S=C[Le],qe=(C[Le+1]-S)/(2*ee[Le]),Nt=qr(qe,1),qe<0&&(Nt=-Nt),C[Le]=ee[Le]/(qe+Nt),C[Le+1]=ee[Le]*(qe+Nt),nr=C[Le+1],X=S-C[Le],pe=Le+2;pe<ie;pe++)C[pe]-=X;for(Dr=Dr+X,qe=C[st],Ft=1,er=Ft,Ur=Ft,Ct=ee[Le+1],Kt=0,lr=0,pe=st-1;pe>=Le;pe--)for(Ur=er,er=Ft,lr=Kt,S=Ft*ee[pe],X=Ft*qe,Nt=qr(qe,ee[pe]),ee[pe+1]=Kt*Nt,Kt=ee[pe]/Nt,Ft=qe/Nt,qe=Ft*C[pe]-Kt*S,C[pe+1]=X+Kt*(Ft*S+Kt*C[pe]),me=0;me<ie;me++)X=b.get(me,pe+1),b.set(me,pe+1,Kt*b.get(me,pe)+Ft*X),b.set(me,pe,Ft*b.get(me,pe)-Kt*X);qe=-Kt*lr*Ur*Ct*ee[Le]/nr,ee[Le]=Kt*qe,C[Le]=Ft*qe}while(Math.abs(ee[Le])>sa*br);C[Le]=C[Le]+Dr,ee[Le]=0}for(pe=0;pe<ie-1;pe++){for(me=pe,qe=C[pe],Me=pe+1;Me<ie;Me++)C[Me]<qe&&(me=Me,qe=C[Me]);if(me!==pe)for(C[me]=C[pe],C[pe]=qe,Me=0;Me<ie;Me++)qe=b.get(Me,pe),b.set(Me,pe,b.get(Me,me)),b.set(Me,me,qe)}}function xn(ie,ee,C,b){var S=0,X=ie-1,pe,Me,me,Le,st,qe,Nt;for(qe=S+1;qe<=X-1;qe++){for(Nt=0,Le=qe;Le<=X;Le++)Nt=Nt+Math.abs(ee.get(Le,qe-1));if(Nt!==0){for(me=0,Le=X;Le>=qe;Le--)C[Le]=ee.get(Le,qe-1)/Nt,me+=C[Le]*C[Le];for(Me=Math.sqrt(me),C[qe]>0&&(Me=-Me),me=me-C[qe]*Me,C[qe]=C[qe]-Me,st=qe;st<ie;st++){for(pe=0,Le=X;Le>=qe;Le--)pe+=C[Le]*ee.get(Le,st);for(pe=pe/me,Le=qe;Le<=X;Le++)ee.set(Le,st,ee.get(Le,st)-pe*C[Le])}for(Le=0;Le<=X;Le++){for(pe=0,st=X;st>=qe;st--)pe+=C[st]*ee.get(Le,st);for(pe=pe/me,st=qe;st<=X;st++)ee.set(Le,st,ee.get(Le,st)-pe*C[st])}C[qe]=Nt*C[qe],ee.set(qe,qe-1,Nt*Me)}}for(Le=0;Le<ie;Le++)for(st=0;st<ie;st++)b.set(Le,st,Le===st?1:0);for(qe=X-1;qe>=S+1;qe--)if(ee.get(qe,qe-1)!==0){for(Le=qe+1;Le<=X;Le++)C[Le]=ee.get(Le,qe-1);for(st=qe;st<=X;st++){for(Me=0,Le=qe;Le<=X;Le++)Me+=C[Le]*b.get(Le,st);for(Me=Me/C[qe]/ee.get(qe,qe-1),Le=qe;Le<=X;Le++)b.set(Le,st,b.get(Le,st)+Me*C[Le])}}}function vn(ie,ee,C,b,S){var X=ie-1,pe=0,Me=ie-1,me=Number.EPSILON,Le=0,st=0,qe=0,Nt=0,nr=0,Ft=0,er=0,Ur=0,Ct,Kt,lr,Dr,br,sa,ea,gn,Tn,ra,Zn,Vr,In,at,D;for(Ct=0;Ct<ie;Ct++)for((Ct<pe||Ct>Me)&&(C[Ct]=S.get(Ct,Ct),ee[Ct]=0),Kt=Math.max(Ct-1,0);Kt<ie;Kt++)st=st+Math.abs(S.get(Ct,Kt));for(;X>=pe;){for(Dr=X;Dr>pe&&(Ft=Math.abs(S.get(Dr-1,Dr-1))+Math.abs(S.get(Dr,Dr)),Ft===0&&(Ft=st),!(Math.abs(S.get(Dr,Dr-1))<me*Ft));)Dr--;if(Dr===X)S.set(X,X,S.get(X,X)+Le),C[X]=S.get(X,X),ee[X]=0,X--,Ur=0;else if(Dr===X-1){if(ea=S.get(X,X-1)*S.get(X-1,X),qe=(S.get(X-1,X-1)-S.get(X,X))/2,Nt=qe*qe+ea,er=Math.sqrt(Math.abs(Nt)),S.set(X,X,S.get(X,X)+Le),S.set(X-1,X-1,S.get(X-1,X-1)+Le),gn=S.get(X,X),Nt>=0){for(er=qe>=0?qe+er:qe-er,C[X-1]=gn+er,C[X]=C[X-1],er!==0&&(C[X]=gn-ea/er),ee[X-1]=0,ee[X]=0,gn=S.get(X,X-1),Ft=Math.abs(gn)+Math.abs(er),qe=gn/Ft,Nt=er/Ft,nr=Math.sqrt(qe*qe+Nt*Nt),qe=qe/nr,Nt=Nt/nr,Kt=X-1;Kt<ie;Kt++)er=S.get(X-1,Kt),S.set(X-1,Kt,Nt*er+qe*S.get(X,Kt)),S.set(X,Kt,Nt*S.get(X,Kt)-qe*er);for(Ct=0;Ct<=X;Ct++)er=S.get(Ct,X-1),S.set(Ct,X-1,Nt*er+qe*S.get(Ct,X)),S.set(Ct,X,Nt*S.get(Ct,X)-qe*er);for(Ct=pe;Ct<=Me;Ct++)er=b.get(Ct,X-1),b.set(Ct,X-1,Nt*er+qe*b.get(Ct,X)),b.set(Ct,X,Nt*b.get(Ct,X)-qe*er)}else C[X-1]=gn+qe,C[X]=gn+qe,ee[X-1]=er,ee[X]=-er;X=X-2,Ur=0}else{if(gn=S.get(X,X),Tn=0,ea=0,Dr<X&&(Tn=S.get(X-1,X-1),ea=S.get(X,X-1)*S.get(X-1,X)),Ur===10){for(Le+=gn,Ct=pe;Ct<=X;Ct++)S.set(Ct,Ct,S.get(Ct,Ct)-gn);Ft=Math.abs(S.get(X,X-1))+Math.abs(S.get(X-1,X-2)),gn=Tn=.75*Ft,ea=-.4375*Ft*Ft}if(Ur===30&&(Ft=(Tn-gn)/2,Ft=Ft*Ft+ea,Ft>0)){for(Ft=Math.sqrt(Ft),Tn<gn&&(Ft=-Ft),Ft=gn-ea/((Tn-gn)/2+Ft),Ct=pe;Ct<=X;Ct++)S.set(Ct,Ct,S.get(Ct,Ct)-Ft);Le+=Ft,gn=Tn=ea=.964}for(Ur=Ur+1,br=X-2;br>=Dr&&(er=S.get(br,br),nr=gn-er,Ft=Tn-er,qe=(nr*Ft-ea)/S.get(br+1,br)+S.get(br,br+1),Nt=S.get(br+1,br+1)-er-nr-Ft,nr=S.get(br+2,br+1),Ft=Math.abs(qe)+Math.abs(Nt)+Math.abs(nr),qe=qe/Ft,Nt=Nt/Ft,nr=nr/Ft,!(br===Dr||Math.abs(S.get(br,br-1))*(Math.abs(Nt)+Math.abs(nr))<me*(Math.abs(qe)*(Math.abs(S.get(br-1,br-1))+Math.abs(er)+Math.abs(S.get(br+1,br+1))))));)br--;for(Ct=br+2;Ct<=X;Ct++)S.set(Ct,Ct-2,0),Ct>br+2&&S.set(Ct,Ct-3,0);for(lr=br;lr<=X-1&&(at=lr!==X-1,lr!==br&&(qe=S.get(lr,lr-1),Nt=S.get(lr+1,lr-1),nr=at?S.get(lr+2,lr-1):0,gn=Math.abs(qe)+Math.abs(Nt)+Math.abs(nr),gn!==0&&(qe=qe/gn,Nt=Nt/gn,nr=nr/gn)),gn!==0);lr++)if(Ft=Math.sqrt(qe*qe+Nt*Nt+nr*nr),qe<0&&(Ft=-Ft),Ft!==0){for(lr!==br?S.set(lr,lr-1,-Ft*gn):Dr!==br&&S.set(lr,lr-1,-S.get(lr,lr-1)),qe=qe+Ft,gn=qe/Ft,Tn=Nt/Ft,er=nr/Ft,Nt=Nt/qe,nr=nr/qe,Kt=lr;Kt<ie;Kt++)qe=S.get(lr,Kt)+Nt*S.get(lr+1,Kt),at&&(qe=qe+nr*S.get(lr+2,Kt),S.set(lr+2,Kt,S.get(lr+2,Kt)-qe*er)),S.set(lr,Kt,S.get(lr,Kt)-qe*gn),S.set(lr+1,Kt,S.get(lr+1,Kt)-qe*Tn);for(Ct=0;Ct<=Math.min(X,lr+3);Ct++)qe=gn*S.get(Ct,lr)+Tn*S.get(Ct,lr+1),at&&(qe=qe+er*S.get(Ct,lr+2),S.set(Ct,lr+2,S.get(Ct,lr+2)-qe*nr)),S.set(Ct,lr,S.get(Ct,lr)-qe),S.set(Ct,lr+1,S.get(Ct,lr+1)-qe*Nt);for(Ct=pe;Ct<=Me;Ct++)qe=gn*b.get(Ct,lr)+Tn*b.get(Ct,lr+1),at&&(qe=qe+er*b.get(Ct,lr+2),b.set(Ct,lr+2,b.get(Ct,lr+2)-qe*nr)),b.set(Ct,lr,b.get(Ct,lr)-qe),b.set(Ct,lr+1,b.get(Ct,lr+1)-qe*Nt)}}}if(st!==0){for(X=ie-1;X>=0;X--)if(qe=C[X],Nt=ee[X],Nt===0)for(Dr=X,S.set(X,X,1),Ct=X-1;Ct>=0;Ct--){for(ea=S.get(Ct,Ct)-qe,nr=0,Kt=Dr;Kt<=X;Kt++)nr=nr+S.get(Ct,Kt)*S.get(Kt,X);if(ee[Ct]<0)er=ea,Ft=nr;else if(Dr=Ct,ee[Ct]===0?S.set(Ct,X,ea!==0?-nr/ea:-nr/(me*st)):(gn=S.get(Ct,Ct+1),Tn=S.get(Ct+1,Ct),Nt=(C[Ct]-qe)*(C[Ct]-qe)+ee[Ct]*ee[Ct],sa=(gn*Ft-er*nr)/Nt,S.set(Ct,X,sa),S.set(Ct+1,X,Math.abs(gn)>Math.abs(er)?(-nr-ea*sa)/gn:(-Ft-Tn*sa)/er)),sa=Math.abs(S.get(Ct,X)),me*sa*sa>1)for(Kt=Ct;Kt<=X;Kt++)S.set(Kt,X,S.get(Kt,X)/sa)}else if(Nt<0)for(Dr=X-1,Math.abs(S.get(X,X-1))>Math.abs(S.get(X-1,X))?(S.set(X-1,X-1,Nt/S.get(X,X-1)),S.set(X-1,X,-(S.get(X,X)-qe)/S.get(X,X-1))):(D=un(0,-S.get(X-1,X),S.get(X-1,X-1)-qe,Nt),S.set(X-1,X-1,D[0]),S.set(X-1,X,D[1])),S.set(X,X-1,0),S.set(X,X,1),Ct=X-2;Ct>=0;Ct--){for(ra=0,Zn=0,Kt=Dr;Kt<=X;Kt++)ra=ra+S.get(Ct,Kt)*S.get(Kt,X-1),Zn=Zn+S.get(Ct,Kt)*S.get(Kt,X);if(ea=S.get(Ct,Ct)-qe,ee[Ct]<0)er=ea,nr=ra,Ft=Zn;else if(Dr=Ct,ee[Ct]===0?(D=un(-ra,-Zn,ea,Nt),S.set(Ct,X-1,D[0]),S.set(Ct,X,D[1])):(gn=S.get(Ct,Ct+1),Tn=S.get(Ct+1,Ct),Vr=(C[Ct]-qe)*(C[Ct]-qe)+ee[Ct]*ee[Ct]-Nt*Nt,In=(C[Ct]-qe)*2*Nt,Vr===0&&In===0&&(Vr=me*st*(Math.abs(ea)+Math.abs(Nt)+Math.abs(gn)+Math.abs(Tn)+Math.abs(er))),D=un(gn*nr-er*ra+Nt*Zn,gn*Ft-er*Zn-Nt*ra,Vr,In),S.set(Ct,X-1,D[0]),S.set(Ct,X,D[1]),Math.abs(gn)>Math.abs(er)+Math.abs(Nt)?(S.set(Ct+1,X-1,(-ra-ea*S.get(Ct,X-1)+Nt*S.get(Ct,X))/gn),S.set(Ct+1,X,(-Zn-ea*S.get(Ct,X)-Nt*S.get(Ct,X-1))/gn)):(D=un(-nr-Tn*S.get(Ct,X-1),-Ft-Tn*S.get(Ct,X),er,Nt),S.set(Ct+1,X-1,D[0]),S.set(Ct+1,X,D[1]))),sa=Math.max(Math.abs(S.get(Ct,X-1)),Math.abs(S.get(Ct,X))),me*sa*sa>1)for(Kt=Ct;Kt<=X;Kt++)S.set(Kt,X-1,S.get(Kt,X-1)/sa),S.set(Kt,X,S.get(Kt,X)/sa)}for(Ct=0;Ct<ie;Ct++)if(Ct<pe||Ct>Me)for(Kt=Ct;Kt<ie;Kt++)b.set(Ct,Kt,S.get(Ct,Kt));for(Kt=ie-1;Kt>=pe;Kt--)for(Ct=pe;Ct<=Me;Ct++){for(er=0,lr=pe;lr<=Math.min(Kt,Me);lr++)er=er+b.get(Ct,lr)*S.get(lr,Kt);b.set(Ct,Kt,er)}}}function un(ie,ee,C,b){var S,X;return Math.abs(C)>Math.abs(b)?(S=b/C,X=C+S*b,[(ie+S*ee)/X,(ee-S*ie)/X]):(S=C/b,X=b+S*C,[(S*ie+ee)/X,(S*ee-ie)/X])}var Wn=function(){function ie(ee){if(I(this,ie),ee=mr.checkMatrix(ee),!ee.isSymmetric())throw new Error("Matrix is not symmetric");var C=ee,b=C.rows,S=new mt(b,b),X=!0,pe,Me,me;for(Me=0;Me<b;Me++){var Le=0;for(me=0;me<Me;me++){var st=0;for(pe=0;pe<me;pe++)st+=S.get(me,pe)*S.get(Me,pe);st=(C.get(Me,me)-st)/S.get(me,me),S.set(Me,me,st),Le=Le+st*st}for(Le=C.get(Me,Me)-Le,X&=Le>0,S.set(Me,Me,Math.sqrt(Math.max(Le,0))),me=Me+1;me<b;me++)S.set(Me,me,0)}this.L=S,this.positiveDefinite=!!X}return T(ie,[{key:"isPositiveDefinite",value:function(){return this.positiveDefinite}},{key:"solve",value:function(C){C=mr.checkMatrix(C);var b=this.L,S=b.rows;if(C.rows!==S)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");var X=C.columns,pe=C.clone(),Me,me,Le;for(Le=0;Le<S;Le++)for(me=0;me<X;me++){for(Me=0;Me<Le;Me++)pe.set(Le,me,pe.get(Le,me)-pe.get(Me,me)*b.get(Le,Me));pe.set(Le,me,pe.get(Le,me)/b.get(Le,Le))}for(Le=S-1;Le>=0;Le--)for(me=0;me<X;me++){for(Me=Le+1;Me<S;Me++)pe.set(Le,me,pe.get(Le,me)-pe.get(Me,me)*b.get(Me,Le));pe.set(Le,me,pe.get(Le,me)/b.get(Le,Le))}return pe}},{key:"lowerTriangularMatrix",get:function(){return this.L}}]),ie}(),Y=T(function ie(ee){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};I(this,ie),ee=mr.checkMatrix(ee);var b=C.Y,S=C.scaleScores,X=S===void 0?!1:S,pe=C.maxIterations,Me=pe===void 0?1e3:pe,me=C.terminationCriteria,Le=me===void 0?1e-10:me,st;if(b){if(x.isAnyArray(b)&&typeof b[0]=="number"?b=mt.columnVector(b):b=mr.checkMatrix(b),b.rows!==ee.rows)throw new Error("Y should have the same number of rows as X");st=b.getColumnVector(0)}else st=ee.getColumnVector(0);for(var qe=1,Nt,nr,Ft,er,Ur=0;Ur<Me&&qe>Le;Ur++)Ft=ee.transpose().mmul(st).div(st.transpose().mmul(st).get(0,0)),Ft=Ft.div(Ft.norm()),Nt=ee.mmul(Ft).div(Ft.transpose().mmul(Ft).get(0,0)),Ur>0&&(qe=Nt.clone().sub(er).pow(2).sum()),er=Nt.clone(),b?(nr=b.transpose().mmul(Nt).div(Nt.transpose().mmul(Nt).get(0,0)),nr=nr.div(nr.norm()),st=b.mmul(nr).div(nr.transpose().mmul(nr).get(0,0))):st=Nt;if(b){var Ct=ee.transpose().mmul(Nt).div(Nt.transpose().mmul(Nt).get(0,0));Ct=Ct.div(Ct.norm());var Kt=ee.clone().sub(Nt.clone().mmul(Ct.transpose())),lr=st.transpose().mmul(Nt).div(Nt.transpose().mmul(Nt).get(0,0)),Dr=b.clone().sub(Nt.clone().mulS(lr.get(0,0)).mmul(nr.transpose()));this.t=Nt,this.p=Ct.transpose(),this.w=Ft.transpose(),this.q=nr,this.u=st,this.s=Nt.transpose().mmul(Nt),this.xResidual=Kt,this.yResidual=Dr,this.betas=lr}else this.w=Ft.transpose(),this.s=Nt.transpose().mmul(Nt).sqrt(),X?this.t=Nt.clone().div(this.s.get(0,0)):this.t=Nt,this.xResidual=ee.sub(Nt.mmul(Ft.transpose()))});N.AbstractMatrix=dt,N.CHO=Wn,N.CholeskyDecomposition=Wn,N.EVD=Sn,N.EigenvalueDecomposition=Sn,N.LU=Sr,N.LuDecomposition=Sr,N.Matrix=mt,N.MatrixColumnSelectionView=Nr,N.MatrixColumnView=Ir,N.MatrixFlipColumnView=Hr,N.MatrixFlipRowView=It,N.MatrixRowSelectionView=ar,N.MatrixRowView=qt,N.MatrixSelectionView=Oe,N.MatrixSubView=Pr,N.MatrixTransposeView=Cr,N.NIPALS=Y,N.Nipals=Y,N.QR=Rn,N.QrDecomposition=Rn,N.SVD=yn,N.SingularValueDecomposition=yn,N.WrapperMatrix1D=Gr,N.WrapperMatrix2D=mr,N.correlation=Cn,N.covariance=Fr,N.default=mt,N.determinant=zt,N.inverse=zr,N.linearDependencies=Ar,N.pseudoInverse=en,N.solve=Rt,N.wrap=rn},44589:function(Mt,N,F){var k=F(13337),U={};for(var L in k)k.hasOwnProperty(L)&&(U[k[L]]=L);var _=Mt.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 I in _)if(_.hasOwnProperty(I)){if(!("channels"in _[I]))throw new Error("missing channels property: "+I);if(!("labels"in _[I]))throw new Error("missing channel labels property: "+I);if(_[I].labels.length!==_[I].channels)throw new Error("channel and label counts mismatch: "+I);var T=_[I].channels,x=_[I].labels;delete _[I].channels,delete _[I].labels,Object.defineProperty(_[I],"channels",{value:T}),Object.defineProperty(_[I],"labels",{value:x})}_.rgb.hsl=function(v){var g=v[0]/255,d=v[1]/255,c=v[2]/255,s=Math.min(g,d,c),m=Math.max(g,d,c),M=m-s,P,R,j;return m===s?P=0:g===m?P=(d-c)/M:d===m?P=2+(c-g)/M:c===m&&(P=4+(g-d)/M),P=Math.min(P*60,360),P<0&&(P+=360),j=(s+m)/2,m===s?R=0:j<=.5?R=M/(m+s):R=M/(2-m-s),[P,R*100,j*100]},_.rgb.hsv=function(v){var g,d,c,s,m,M=v[0]/255,P=v[1]/255,R=v[2]/255,j=Math.max(M,P,R),Q=j-Math.min(M,P,R),G=function(W){return(j-W)/6/Q+1/2};return Q===0?s=m=0:(m=Q/j,g=G(M),d=G(P),c=G(R),M===j?s=c-d:P===j?s=1/3+g-c:R===j&&(s=2/3+d-g),s<0?s+=1:s>1&&(s-=1)),[s*360,m*100,j*100]},_.rgb.hwb=function(v){var g=v[0],d=v[1],c=v[2],s=_.rgb.hsl(v)[0],m=1/255*Math.min(g,Math.min(d,c));return c=1-1/255*Math.max(g,Math.max(d,c)),[s,m*100,c*100]},_.rgb.cmyk=function(v){var g=v[0]/255,d=v[1]/255,c=v[2]/255,s,m,M,P;return P=Math.min(1-g,1-d,1-c),s=(1-g-P)/(1-P)||0,m=(1-d-P)/(1-P)||0,M=(1-c-P)/(1-P)||0,[s*100,m*100,M*100,P*100]};function p(v,g){return Math.pow(v[0]-g[0],2)+Math.pow(v[1]-g[1],2)+Math.pow(v[2]-g[2],2)}_.rgb.keyword=function(v){var g=U[v];if(g)return g;var d=1/0,c;for(var s in k)if(k.hasOwnProperty(s)){var m=k[s],M=p(v,m);M<d&&(d=M,c=s)}return c},_.keyword.rgb=function(v){return k[v]},_.rgb.xyz=function(v){var g=v[0]/255,d=v[1]/255,c=v[2]/255;g=g>.04045?Math.pow((g+.055)/1.055,2.4):g/12.92,d=d>.04045?Math.pow((d+.055)/1.055,2.4):d/12.92,c=c>.04045?Math.pow((c+.055)/1.055,2.4):c/12.92;var s=g*.4124+d*.3576+c*.1805,m=g*.2126+d*.7152+c*.0722,M=g*.0193+d*.1192+c*.9505;return[s*100,m*100,M*100]},_.rgb.lab=function(v){var g=_.rgb.xyz(v),d=g[0],c=g[1],s=g[2],m,M,P;return d/=95.047,c/=100,s/=108.883,d=d>.008856?Math.pow(d,1/3):7.787*d+16/116,c=c>.008856?Math.pow(c,1/3):7.787*c+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,m=116*c-16,M=500*(d-c),P=200*(c-s),[m,M,P]},_.hsl.rgb=function(v){var g=v[0]/360,d=v[1]/100,c=v[2]/100,s,m,M,P,R;if(d===0)return R=c*255,[R,R,R];c<.5?m=c*(1+d):m=c+d-c*d,s=2*c-m,P=[0,0,0];for(var j=0;j<3;j++)M=g+1/3*-(j-1),M<0&&M++,M>1&&M--,6*M<1?R=s+(m-s)*6*M:2*M<1?R=m:3*M<2?R=s+(m-s)*(2/3-M)*6:R=s,P[j]=R*255;return P},_.hsl.hsv=function(v){var g=v[0],d=v[1]/100,c=v[2]/100,s=d,m=Math.max(c,.01),M,P;return c*=2,d*=c<=1?c:2-c,s*=m<=1?m:2-m,P=(c+d)/2,M=c===0?2*s/(m+s):2*d/(c+d),[g,M*100,P*100]},_.hsv.rgb=function(v){var g=v[0]/60,d=v[1]/100,c=v[2]/100,s=Math.floor(g)%6,m=g-Math.floor(g),M=255*c*(1-d),P=255*c*(1-d*m),R=255*c*(1-d*(1-m));switch(c*=255,s){case 0:return[c,R,M];case 1:return[P,c,M];case 2:return[M,c,R];case 3:return[M,P,c];case 4:return[R,M,c];case 5:return[c,M,P]}},_.hsv.hsl=function(v){var g=v[0],d=v[1]/100,c=v[2]/100,s=Math.max(c,.01),m,M,P;return P=(2-d)*c,m=(2-d)*s,M=d*s,M/=m<=1?m:2-m,M=M||0,P/=2,[g,M*100,P*100]},_.hwb.rgb=function(v){var g=v[0]/360,d=v[1]/100,c=v[2]/100,s=d+c,m,M,P,R;s>1&&(d/=s,c/=s),m=Math.floor(6*g),M=1-c,P=6*g-m,m&1&&(P=1-P),R=d+P*(M-d);var j,Q,G;switch(m){default:case 6:case 0:j=M,Q=R,G=d;break;case 1:j=R,Q=M,G=d;break;case 2:j=d,Q=M,G=R;break;case 3:j=d,Q=R,G=M;break;case 4:j=R,Q=d,G=M;break;case 5:j=M,Q=d,G=R;break}return[j*255,Q*255,G*255]},_.cmyk.rgb=function(v){var g=v[0]/100,d=v[1]/100,c=v[2]/100,s=v[3]/100,m,M,P;return m=1-Math.min(1,g*(1-s)+s),M=1-Math.min(1,d*(1-s)+s),P=1-Math.min(1,c*(1-s)+s),[m*255,M*255,P*255]},_.xyz.rgb=function(v){var g=v[0]/100,d=v[1]/100,c=v[2]/100,s,m,M;return s=g*3.2406+d*-1.5372+c*-.4986,m=g*-.9689+d*1.8758+c*.0415,M=g*.0557+d*-.204+c*1.057,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,m=m>.0031308?1.055*Math.pow(m,1/2.4)-.055:m*12.92,M=M>.0031308?1.055*Math.pow(M,1/2.4)-.055:M*12.92,s=Math.min(Math.max(0,s),1),m=Math.min(Math.max(0,m),1),M=Math.min(Math.max(0,M),1),[s*255,m*255,M*255]},_.xyz.lab=function(v){var g=v[0],d=v[1],c=v[2],s,m,M;return g/=95.047,d/=100,c/=108.883,g=g>.008856?Math.pow(g,1/3):7.787*g+16/116,d=d>.008856?Math.pow(d,1/3):7.787*d+16/116,c=c>.008856?Math.pow(c,1/3):7.787*c+16/116,s=116*d-16,m=500*(g-d),M=200*(d-c),[s,m,M]},_.lab.xyz=function(v){var g=v[0],d=v[1],c=v[2],s,m,M;m=(g+16)/116,s=d/500+m,M=m-c/200;var P=Math.pow(m,3),R=Math.pow(s,3),j=Math.pow(M,3);return m=P>.008856?P:(m-16/116)/7.787,s=R>.008856?R:(s-16/116)/7.787,M=j>.008856?j:(M-16/116)/7.787,s*=95.047,m*=100,M*=108.883,[s,m,M]},_.lab.lch=function(v){var g=v[0],d=v[1],c=v[2],s,m,M;return s=Math.atan2(c,d),m=s*360/2/Math.PI,m<0&&(m+=360),M=Math.sqrt(d*d+c*c),[g,M,m]},_.lch.lab=function(v){var g=v[0],d=v[1],c=v[2],s,m,M;return M=c/360*2*Math.PI,s=d*Math.cos(M),m=d*Math.sin(M),[g,s,m]},_.rgb.ansi16=function(v){var g=v[0],d=v[1],c=v[2],s=1 in arguments?arguments[1]:_.rgb.hsv(v)[2];if(s=Math.round(s/50),s===0)return 30;var m=30+(Math.round(c/255)<<2|Math.round(d/255)<<1|Math.round(g/255));return s===2&&(m+=60),m},_.hsv.ansi16=function(v){return _.rgb.ansi16(_.hsv.rgb(v),v[2])},_.rgb.ansi256=function(v){var g=v[0],d=v[1],c=v[2];if(g===d&&d===c)return g<8?16:g>248?231:Math.round((g-8)/247*24)+232;var s=16+36*Math.round(g/255*5)+6*Math.round(d/255*5)+Math.round(c/255*5);return s},_.ansi16.rgb=function(v){var g=v%10;if(g===0||g===7)return v>50&&(g+=3.5),g=g/10.5*255,[g,g,g];var d=(~~(v>50)+1)*.5,c=(g&1)*d*255,s=(g>>1&1)*d*255,m=(g>>2&1)*d*255;return[c,s,m]},_.ansi256.rgb=function(v){if(v>=232){var g=(v-232)*10+8;return[g,g,g]}v-=16;var d,c=Math.floor(v/36)/5*255,s=Math.floor((d=v%36)/6)/5*255,m=d%6/5*255;return[c,s,m]},_.rgb.hex=function(v){var g=((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255),d=g.toString(16).toUpperCase();return"000000".substring(d.length)+d},_.hex.rgb=function(v){var g=v.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!g)return[0,0,0];var d=g[0];g[0].length===3&&(d=d.split("").map(function(P){return P+P}).join(""));var c=parseInt(d,16),s=c>>16&255,m=c>>8&255,M=c&255;return[s,m,M]},_.rgb.hcg=function(v){var g=v[0]/255,d=v[1]/255,c=v[2]/255,s=Math.max(Math.max(g,d),c),m=Math.min(Math.min(g,d),c),M=s-m,P,R;return M<1?P=m/(1-M):P=0,M<=0?R=0:s===g?R=(d-c)/M%6:s===d?R=2+(c-g)/M:R=4+(g-d)/M+4,R/=6,R%=1,[R*360,M*100,P*100]},_.hsl.hcg=function(v){var g=v[1]/100,d=v[2]/100,c=1,s=0;return d<.5?c=2*g*d:c=2*g*(1-d),c<1&&(s=(d-.5*c)/(1-c)),[v[0],c*100,s*100]},_.hsv.hcg=function(v){var g=v[1]/100,d=v[2]/100,c=g*d,s=0;return c<1&&(s=(d-c)/(1-c)),[v[0],c*100,s*100]},_.hcg.rgb=function(v){var g=v[0]/360,d=v[1]/100,c=v[2]/100;if(d===0)return[c*255,c*255,c*255];var s=[0,0,0],m=g%1*6,M=m%1,P=1-M,R=0;switch(Math.floor(m)){case 0:s[0]=1,s[1]=M,s[2]=0;break;case 1:s[0]=P,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=M;break;case 3:s[0]=0,s[1]=P,s[2]=1;break;case 4:s[0]=M,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=P}return R=(1-d)*c,[(d*s[0]+R)*255,(d*s[1]+R)*255,(d*s[2]+R)*255]},_.hcg.hsv=function(v){var g=v[1]/100,d=v[2]/100,c=g+d*(1-g),s=0;return c>0&&(s=g/c),[v[0],s*100,c*100]},_.hcg.hsl=function(v){var g=v[1]/100,d=v[2]/100,c=d*(1-g)+.5*g,s=0;return c>0&&c<.5?s=g/(2*c):c>=.5&&c<1&&(s=g/(2*(1-c))),[v[0],s*100,c*100]},_.hcg.hwb=function(v){var g=v[1]/100,d=v[2]/100,c=g+d*(1-g);return[v[0],(c-g)*100,(1-c)*100]},_.hwb.hcg=function(v){var g=v[1]/100,d=v[2]/100,c=1-d,s=c-g,m=0;return s<1&&(m=(c-s)/(1-s)),[v[0],s*100,m*100]},_.apple.rgb=function(v){return[v[0]/65535*255,v[1]/65535*255,v[2]/65535*255]},_.rgb.apple=function(v){return[v[0]/255*65535,v[1]/255*65535,v[2]/255*65535]},_.gray.rgb=function(v){return[v[0]/100*255,v[0]/100*255,v[0]/100*255]},_.gray.hsl=_.gray.hsv=function(v){return[0,0,v[0]]},_.gray.hwb=function(v){return[0,100,v[0]]},_.gray.cmyk=function(v){return[0,0,0,v[0]]},_.gray.lab=function(v){return[v[0],0,0]},_.gray.hex=function(v){var g=Math.round(v[0]/100*255)&255,d=(g<<16)+(g<<8)+g,c=d.toString(16).toUpperCase();return"000000".substring(c.length)+c},_.rgb.gray=function(v){var g=(v[0]+v[1]+v[2])/3;return[g/255*100]}},18358:function(Mt,N,F){var k=F(44589),U=F(3314),L={},_=Object.keys(k);function I(x){var p=function(v){return v==null?v:(arguments.length>1&&(v=Array.prototype.slice.call(arguments)),x(v))};return"conversion"in x&&(p.conversion=x.conversion),p}function T(x){var p=function(v){if(v==null)return v;arguments.length>1&&(v=Array.prototype.slice.call(arguments));var g=x(v);if(typeof g=="object")for(var d=g.length,c=0;c<d;c++)g[c]=Math.round(g[c]);return g};return"conversion"in x&&(p.conversion=x.conversion),p}_.forEach(function(x){L[x]={},Object.defineProperty(L[x],"channels",{value:k[x].channels}),Object.defineProperty(L[x],"labels",{value:k[x].labels});var p=U(x),v=Object.keys(p);v.forEach(function(g){var d=p[g];L[x][g]=T(d),L[x][g].raw=I(d)})}),Mt.exports=L},3314:function(Mt,N,F){var k=F(44589);function U(){for(var T={},x=Object.keys(k),p=x.length,v=0;v<p;v++)T[x[v]]={distance:-1,parent:null};return T}function L(T){var x=U(),p=[T];for(x[T].distance=0;p.length;)for(var v=p.pop(),g=Object.keys(k[v]),d=g.length,c=0;c<d;c++){var s=g[c],m=x[s];m.distance===-1&&(m.distance=x[v].distance+1,m.parent=v,p.unshift(s))}return x}function _(T,x){return function(p){return x(T(p))}}function I(T,x){for(var p=[x[T].parent,T],v=k[x[T].parent][T],g=x[T].parent;x[g].parent;)p.unshift(x[g].parent),v=_(k[x[g].parent][g],v),g=x[g].parent;return v.conversion=p,v}Mt.exports=function(T){for(var x=L(T),p={},v=Object.keys(x),g=v.length,d=0;d<g;d++){var c=v[d],s=x[c];s.parent!==null&&(p[c]=I(c,x))}return p}},13337:function(Mt){"use strict";Mt.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]}},74654:function(Mt,N,F){"use strict";var k=F(2489),U=F(18358),L=[].slice,_=["keyword","gray","hex"],I={};Object.keys(U).forEach(function(m){I[L.call(U[m].labels).sort().join("")]=m});var T={};function x(m,M){if(!(this instanceof x))return new x(m,M);if(M&&M in _&&(M=null),M&&!(M in U))throw new Error("Unknown model: "+M);var P,R;if(m==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(m instanceof x)this.model=m.model,this.color=m.color.slice(),this.valpha=m.valpha;else if(typeof m=="string"){var j=k.get(m);if(j===null)throw new Error("Unable to parse color from string: "+m);this.model=j.model,R=U[this.model].channels,this.color=j.value.slice(0,R),this.valpha=typeof j.value[R]=="number"?j.value[R]:1}else if(m.length){this.model=M||"rgb",R=U[this.model].channels;var Q=L.call(m,0,R);this.color=s(Q,R),this.valpha=typeof m[R]=="number"?m[R]:1}else if(typeof m=="number")m&=16777215,this.model="rgb",this.color=[m>>16&255,m>>8&255,m&255],this.valpha=1;else{this.valpha=1;var G=Object.keys(m);"alpha"in m&&(G.splice(G.indexOf("alpha"),1),this.valpha=typeof m.alpha=="number"?m.alpha:0);var W=G.sort().join("");if(!(W in I))throw new Error("Unable to parse color from object: "+JSON.stringify(m));this.model=I[W];var H=U[this.model].labels,Z=[];for(P=0;P<H.length;P++)Z.push(m[H[P]]);this.color=s(Z)}if(T[this.model])for(R=U[this.model].channels,P=0;P<R;P++){var J=T[this.model][P];J&&(this.color[P]=J(this.color[P]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}x.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(m){var M=this.model in k.to?this:this.rgb();M=M.round(typeof m=="number"?m:1);var P=M.valpha===1?M.color:M.color.concat(this.valpha);return k.to[M.model](P)},percentString:function(m){var M=this.rgb().round(typeof m=="number"?m:1),P=M.valpha===1?M.color:M.color.concat(this.valpha);return k.to.rgb.percent(P)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var m={},M=U[this.model].channels,P=U[this.model].labels,R=0;R<M;R++)m[P[R]]=this.color[R];return this.valpha!==1&&(m.alpha=this.valpha),m},unitArray:function(){var m=this.rgb().color;return m[0]/=255,m[1]/=255,m[2]/=255,this.valpha!==1&&m.push(this.valpha),m},unitObject:function(){var m=this.rgb().object();return m.r/=255,m.g/=255,m.b/=255,this.valpha!==1&&(m.alpha=this.valpha),m},round:function(m){return m=Math.max(m||0,0),new x(this.color.map(v(m)).concat(this.valpha),this.model)},alpha:function(m){return arguments.length?new x(this.color.concat(Math.max(0,Math.min(1,m))),this.model):this.valpha},red:g("rgb",0,d(255)),green:g("rgb",1,d(255)),blue:g("rgb",2,d(255)),hue:g(["hsl","hsv","hsl","hwb","hcg"],0,function(m){return(m%360+360)%360}),saturationl:g("hsl",1,d(100)),lightness:g("hsl",2,d(100)),saturationv:g("hsv",1,d(100)),value:g("hsv",2,d(100)),chroma:g("hcg",1,d(100)),gray:g("hcg",2,d(100)),white:g("hwb",1,d(100)),wblack:g("hwb",2,d(100)),cyan:g("cmyk",0,d(100)),magenta:g("cmyk",1,d(100)),yellow:g("cmyk",2,d(100)),black:g("cmyk",3,d(100)),x:g("xyz",0,d(100)),y:g("xyz",1,d(100)),z:g("xyz",2,d(100)),l:g("lab",0,d(100)),a:g("lab",1),b:g("lab",2),keyword:function(m){return arguments.length?new x(m):U[this.model].keyword(this.color)},hex:function(m){return arguments.length?new x(m):k.to.hex(this.rgb().round().color)},rgbNumber:function(){var m=this.rgb().color;return(m[0]&255)<<16|(m[1]&255)<<8|m[2]&255},luminosity:function(){for(var m=this.rgb().color,M=[],P=0;P<m.length;P++){var R=m[P]/255;M[P]=R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4)}return .2126*M[0]+.7152*M[1]+.0722*M[2]},contrast:function(m){var M=this.luminosity(),P=m.luminosity();return M>P?(M+.05)/(P+.05):(P+.05)/(M+.05)},level:function(m){var M=this.contrast(m);return M>=7.1?"AAA":M>=4.5?"AA":""},isDark:function(){var m=this.rgb().color,M=(m[0]*299+m[1]*587+m[2]*114)/1e3;return M<128},isLight:function(){return!this.isDark()},negate:function(){for(var m=this.rgb(),M=0;M<3;M++)m.color[M]=255-m.color[M];return m},lighten:function(m){var M=this.hsl();return M.color[2]+=M.color[2]*m,M},darken:function(m){var M=this.hsl();return M.color[2]-=M.color[2]*m,M},saturate:function(m){var M=this.hsl();return M.color[1]+=M.color[1]*m,M},desaturate:function(m){var M=this.hsl();return M.color[1]-=M.color[1]*m,M},whiten:function(m){var M=this.hwb();return M.color[1]+=M.color[1]*m,M},blacken:function(m){var M=this.hwb();return M.color[2]+=M.color[2]*m,M},grayscale:function(){var m=this.rgb().color,M=m[0]*.3+m[1]*.59+m[2]*.11;return x.rgb(M,M,M)},fade:function(m){return this.alpha(this.valpha-this.valpha*m)},opaquer:function(m){return this.alpha(this.valpha+this.valpha*m)},rotate:function(m){var M=this.hsl(),P=M.color[0];return P=(P+m)%360,P=P<0?360+P:P,M.color[0]=P,M},mix:function(m,M){if(!m||!m.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof m);var P=m.rgb(),R=this.rgb(),j=M===void 0?.5:M,Q=2*j-1,G=P.alpha()-R.alpha(),W=((Q*G===-1?Q:(Q+G)/(1+Q*G))+1)/2,H=1-W;return x.rgb(W*P.red()+H*R.red(),W*P.green()+H*R.green(),W*P.blue()+H*R.blue(),P.alpha()*j+R.alpha()*(1-j))}},Object.keys(U).forEach(function(m){if(_.indexOf(m)===-1){var M=U[m].channels;x.prototype[m]=function(){if(this.model===m)return new x(this);if(arguments.length)return new x(arguments,m);var P=typeof arguments[M]=="number"?M:this.valpha;return new x(c(U[this.model][m].raw(this.color)).concat(P),m)},x[m]=function(P){return typeof P=="number"&&(P=s(L.call(arguments),M)),new x(P,m)}}});function p(m,M){return Number(m.toFixed(M))}function v(m){return function(M){return p(M,m)}}function g(m,M,P){return m=Array.isArray(m)?m:[m],m.forEach(function(R){(T[R]||(T[R]=[]))[M]=P}),m=m[0],function(R){var j;return arguments.length?(P&&(R=P(R)),j=this[m](),j.color[M]=R,j):(j=this[m]().color[M],P&&(j=P(j)),j)}}function d(m){return function(M){return Math.max(0,Math.min(m,M))}}function c(m){return Array.isArray(m)?m:[m]}function s(m,M){for(var P=0;P<M;P++)typeof m[P]!="number"&&(m[P]=0);return m}Mt.exports=x},80789:function(Mt,N,F){"use strict";F.r(N),F.d(N,{quadtree:function(){return k.Z}});var k=F(93883)},93883:function(Mt,N,F){"use strict";F.d(N,{Z:function(){return Q}});function k(Z){const J=+this._x.call(null,Z),K=+this._y.call(null,Z);return U(this.cover(J,K),J,K,Z)}function U(Z,J,K,ne){if(isNaN(J)||isNaN(K))return Z;var se,fe=Z._root,Ie={data:ne},ye=Z._x0,Ae=Z._y0,Se=Z._x1,we=Z._y1,Te,ke,Ge,tt,He,ft,Lt,Jt;if(!fe)return Z._root=Ie,Z;for(;fe.length;)if((He=J>=(Te=(ye+Se)/2))?ye=Te:Se=Te,(ft=K>=(ke=(Ae+we)/2))?Ae=ke:we=ke,se=fe,!(fe=fe[Lt=ft<<1|He]))return se[Lt]=Ie,Z;if(Ge=+Z._x.call(null,fe.data),tt=+Z._y.call(null,fe.data),J===Ge&&K===tt)return Ie.next=fe,se?se[Lt]=Ie:Z._root=Ie,Z;do se=se?se[Lt]=new Array(4):Z._root=new Array(4),(He=J>=(Te=(ye+Se)/2))?ye=Te:Se=Te,(ft=K>=(ke=(Ae+we)/2))?Ae=ke:we=ke;while((Lt=ft<<1|He)===(Jt=(tt>=ke)<<1|Ge>=Te));return se[Jt]=fe,se[Lt]=Ie,Z}function L(Z){var J,K,ne=Z.length,se,fe,Ie=new Array(ne),ye=new Array(ne),Ae=1/0,Se=1/0,we=-1/0,Te=-1/0;for(K=0;K<ne;++K)isNaN(se=+this._x.call(null,J=Z[K]))||isNaN(fe=+this._y.call(null,J))||(Ie[K]=se,ye[K]=fe,se<Ae&&(Ae=se),se>we&&(we=se),fe<Se&&(Se=fe),fe>Te&&(Te=fe));if(Ae>we||Se>Te)return this;for(this.cover(Ae,Se).cover(we,Te),K=0;K<ne;++K)U(this,Ie[K],ye[K],Z[K]);return this}function _(Z,J){if(isNaN(Z=+Z)||isNaN(J=+J))return this;var K=this._x0,ne=this._y0,se=this._x1,fe=this._y1;if(isNaN(K))se=(K=Math.floor(Z))+1,fe=(ne=Math.floor(J))+1;else{for(var Ie=se-K||1,ye=this._root,Ae,Se;K>Z||Z>=se||ne>J||J>=fe;)switch(Se=(J<ne)<<1|Z<K,Ae=new Array(4),Ae[Se]=ye,ye=Ae,Ie*=2,Se){case 0:se=K+Ie,fe=ne+Ie;break;case 1:K=se-Ie,fe=ne+Ie;break;case 2:se=K+Ie,ne=fe-Ie;break;case 3:K=se-Ie,ne=fe-Ie;break}this._root&&this._root.length&&(this._root=ye)}return this._x0=K,this._y0=ne,this._x1=se,this._y1=fe,this}function I(){var Z=[];return this.visit(function(J){if(!J.length)do Z.push(J.data);while(J=J.next)}),Z}function T(Z){return arguments.length?this.cover(+Z[0][0],+Z[0][1]).cover(+Z[1][0],+Z[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function x(Z,J,K,ne,se){this.node=Z,this.x0=J,this.y0=K,this.x1=ne,this.y1=se}function p(Z,J,K){var ne,se=this._x0,fe=this._y0,Ie,ye,Ae,Se,we=this._x1,Te=this._y1,ke=[],Ge=this._root,tt,He;for(Ge&&ke.push(new x(Ge,se,fe,we,Te)),K==null?K=1/0:(se=Z-K,fe=J-K,we=Z+K,Te=J+K,K*=K);tt=ke.pop();)if(!(!(Ge=tt.node)||(Ie=tt.x0)>we||(ye=tt.y0)>Te||(Ae=tt.x1)<se||(Se=tt.y1)<fe))if(Ge.length){var ft=(Ie+Ae)/2,Lt=(ye+Se)/2;ke.push(new x(Ge[3],ft,Lt,Ae,Se),new x(Ge[2],Ie,Lt,ft,Se),new x(Ge[1],ft,ye,Ae,Lt),new x(Ge[0],Ie,ye,ft,Lt)),(He=(J>=Lt)<<1|Z>=ft)&&(tt=ke[ke.length-1],ke[ke.length-1]=ke[ke.length-1-He],ke[ke.length-1-He]=tt)}else{var Jt=Z-+this._x.call(null,Ge.data),Qe=J-+this._y.call(null,Ge.data),ut=Jt*Jt+Qe*Qe;if(ut<K){var xt=Math.sqrt(K=ut);se=Z-xt,fe=J-xt,we=Z+xt,Te=J+xt,ne=Ge.data}}return ne}function v(Z){if(isNaN(we=+this._x.call(null,Z))||isNaN(Te=+this._y.call(null,Z)))return this;var J,K=this._root,ne,se,fe,Ie=this._x0,ye=this._y0,Ae=this._x1,Se=this._y1,we,Te,ke,Ge,tt,He,ft,Lt;if(!K)return this;if(K.length)for(;;){if((tt=we>=(ke=(Ie+Ae)/2))?Ie=ke:Ae=ke,(He=Te>=(Ge=(ye+Se)/2))?ye=Ge:Se=Ge,J=K,!(K=K[ft=He<<1|tt]))return this;if(!K.length)break;(J[ft+1&3]||J[ft+2&3]||J[ft+3&3])&&(ne=J,Lt=ft)}for(;K.data!==Z;)if(se=K,!(K=K.next))return this;return(fe=K.next)&&delete K.next,se?(fe?se.next=fe:delete se.next,this):J?(fe?J[ft]=fe:delete J[ft],(K=J[0]||J[1]||J[2]||J[3])&&K===(J[3]||J[2]||J[1]||J[0])&&!K.length&&(ne?ne[Lt]=K:this._root=K),this):(this._root=fe,this)}function g(Z){for(var J=0,K=Z.length;J<K;++J)this.remove(Z[J]);return this}function d(){return this._root}function c(){var Z=0;return this.visit(function(J){if(!J.length)do++Z;while(J=J.next)}),Z}function s(Z){var J=[],K,ne=this._root,se,fe,Ie,ye,Ae;for(ne&&J.push(new x(ne,this._x0,this._y0,this._x1,this._y1));K=J.pop();)if(!Z(ne=K.node,fe=K.x0,Ie=K.y0,ye=K.x1,Ae=K.y1)&&ne.length){var Se=(fe+ye)/2,we=(Ie+Ae)/2;(se=ne[3])&&J.push(new x(se,Se,we,ye,Ae)),(se=ne[2])&&J.push(new x(se,fe,we,Se,Ae)),(se=ne[1])&&J.push(new x(se,Se,Ie,ye,we)),(se=ne[0])&&J.push(new x(se,fe,Ie,Se,we))}return this}function m(Z){var J=[],K=[],ne;for(this._root&&J.push(new x(this._root,this._x0,this._y0,this._x1,this._y1));ne=J.pop();){var se=ne.node;if(se.length){var fe,Ie=ne.x0,ye=ne.y0,Ae=ne.x1,Se=ne.y1,we=(Ie+Ae)/2,Te=(ye+Se)/2;(fe=se[0])&&J.push(new x(fe,Ie,ye,we,Te)),(fe=se[1])&&J.push(new x(fe,we,ye,Ae,Te)),(fe=se[2])&&J.push(new x(fe,Ie,Te,we,Se)),(fe=se[3])&&J.push(new x(fe,we,Te,Ae,Se))}K.push(ne)}for(;ne=K.pop();)Z(ne.node,ne.x0,ne.y0,ne.x1,ne.y1);return this}function M(Z){return Z[0]}function P(Z){return arguments.length?(this._x=Z,this):this._x}function R(Z){return Z[1]}function j(Z){return arguments.length?(this._y=Z,this):this._y}function Q(Z,J,K){var ne=new G(J==null?M:J,K==null?R:K,NaN,NaN,NaN,NaN);return Z==null?ne:ne.addAll(Z)}function G(Z,J,K,ne,se,fe){this._x=Z,this._y=J,this._x0=K,this._y0=ne,this._x1=se,this._y1=fe,this._root=void 0}function W(Z){for(var J={data:Z.data},K=J;Z=Z.next;)K=K.next={data:Z.data};return J}var H=Q.prototype=G.prototype;H.copy=function(){var Z=new G(this._x,this._y,this._x0,this._y0,this._x1,this._y1),J=this._root,K,ne;if(!J)return Z;if(!J.length)return Z._root=W(J),Z;for(K=[{source:J,target:Z._root=new Array(4)}];J=K.pop();)for(var se=0;se<4;++se)(ne=J.source[se])&&(ne.length?K.push({source:ne,target:J.target[se]=new Array(4)}):J.target[se]=W(ne));return Z},H.add=k,H.addAll=L,H.cover=_,H.data=I,H.extent=T,H.find=p,H.remove=v,H.removeAll=g,H.root=d,H.size=c,H.visit=s,H.visitAfter=m,H.x=P,H.y=j},42891:function(Mt,N,F){"use strict";F.r(N),F.d(N,{BRIDGE_GRAPH_NAME:function(){return I},GraphType:function(){return p},HierarchyNodeType:function(){return v},InclusionType:function(){return x},LAYOUT_CONFIG:function(){return k},NodeType:function(){return T},ROOT_NAME:function(){return _},buildGraph:function(){return Qt},flatGraph:function(){return gr},getEdges:function(){return Er},mergeConfig:function(){return U}});const k={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function U(f={},w=k){var B,V,re,oe;const le=JSON.parse(JSON.stringify(w)),ge=((B=f==null?void 0:f.graph)===null||B===void 0?void 0:B.meta)||{},_e=((V=f==null?void 0:f.subScene)===null||V===void 0?void 0:V.meta)||{},Ne=((re=f==null?void 0:f.nodeSize)===null||re===void 0?void 0:re.meta)||{},ze=((oe=f==null?void 0:f.nodeSize)===null||oe===void 0?void 0:oe.node)||{},Be=le.nodeSize.bridge;return{graph:{meta:Object.assign(le.graph.meta,ge)},subScene:{meta:Object.assign(le.subScene.meta,_e)},nodeSize:{meta:Object.assign(le.nodeSize.meta,Ne),node:Object.assign(le.nodeSize.node,ze),bridge:Be}}}function L(f){return`\u25EC${f}\u25EC`}const _=L("ROOT"),I=L("BRIDGE_GRAPH");var T,x,p,v;(function(f){f[f.META=0]="META",f[f.NODE=1]="NODE",f[f.BRIDGE=2]="BRIDGE"})(T||(T={})),function(f){f[f.INCLUDE=0]="INCLUDE",f[f.EXCLUDE=1]="EXCLUDE",f[f.UNSPECIFIED=2]="UNSPECIFIED"}(x||(x={})),function(f){f[f.META=0]="META",f[f.CORE=1]="CORE",f[f.BRIDGE=2]="BRIDGE"}(p||(p={})),function(f){f[f.META=0]="META",f[f.OP=1]="OP",f[f.SERIES=2]="SERIES"}(v||(v={}));var g=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof F.g!="undefined"?F.g:typeof self!="undefined"?self:{};function d(f,w){return f(w={exports:{}},w.exports),w.exports}var c=function(){this.__data__=[],this.size=0},s=function(f,w){return f===w||f!=f&&w!=w},m=function(f,w){for(var B=f.length;B--;)if(s(f[B][0],w))return B;return-1},M=Array.prototype.splice,P=function(f){var w=this.__data__,B=m(w,f);return!(B<0)&&(B==w.length-1?w.pop():M.call(w,B,1),--this.size,!0)},R=function(f){var w=this.__data__,B=m(w,f);return B<0?void 0:w[B][1]},j=function(f){return m(this.__data__,f)>-1},Q=function(f,w){var B=this.__data__,V=m(B,f);return V<0?(++this.size,B.push([f,w])):B[V][1]=w,this};function G(f){var w=-1,B=f==null?0:f.length;for(this.clear();++w<B;){var V=f[w];this.set(V[0],V[1])}}G.prototype.clear=c,G.prototype.delete=P,G.prototype.get=R,G.prototype.has=j,G.prototype.set=Q;var W=G,H=function(){this.__data__=new W,this.size=0},Z=function(f){var w=this.__data__,B=w.delete(f);return this.size=w.size,B},J=function(f){return this.__data__.get(f)},K=function(f){return this.__data__.has(f)},ne=typeof g=="object"&&g&&g.Object===Object&&g,se=typeof self=="object"&&self&&self.Object===Object&&self,fe=ne||se||Function("return this")(),Ie=fe.Symbol,ye=Object.prototype,Ae=ye.hasOwnProperty,Se=ye.toString,we=Ie?Ie.toStringTag:void 0,Te=function(f){var w=Ae.call(f,we),B=f[we];try{f[we]=void 0;var V=!0}catch(oe){}var re=Se.call(f);return V&&(w?f[we]=B:delete f[we]),re},ke=Object.prototype.toString,Ge=function(f){return ke.call(f)},tt=Ie?Ie.toStringTag:void 0,He=function(f){return f==null?f===void 0?"[object Undefined]":"[object Null]":tt&&tt in Object(f)?Te(f):Ge(f)},ft=function(f){var w=typeof f;return f!=null&&(w=="object"||w=="function")},Lt,Jt=function(f){if(!ft(f))return!1;var w=He(f);return w=="[object Function]"||w=="[object GeneratorFunction]"||w=="[object AsyncFunction]"||w=="[object Proxy]"},Qe=fe["__core-js_shared__"],ut=(Lt=/[^.]+$/.exec(Qe&&Qe.keys&&Qe.keys.IE_PROTO||""))?"Symbol(src)_1."+Lt:"",xt=function(f){return!!ut&&ut in f},dt=Function.prototype.toString,pt=function(f){if(f!=null){try{return dt.call(f)}catch(w){}try{return f+""}catch(w){}}return""},wt=/^\[object .+?Constructor\]$/,mt=Function.prototype,ur=Object.prototype,Ir=mt.toString,Nr=ur.hasOwnProperty,Hr=RegExp("^"+Ir.call(Nr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),It=function(f){return!(!ft(f)||xt(f))&&(Jt(f)?Hr:wt).test(pt(f))},qt=function(f,w){return f==null?void 0:f[w]},ar=function(f,w){var B=qt(f,w);return It(B)?B:void 0},Oe=ar(fe,"Map"),Pr=ar(Object,"create"),Cr=function(){this.__data__=Pr?Pr(null):{},this.size=0},Gr=function(f){var w=this.has(f)&&delete this.__data__[f];return this.size-=w?1:0,w},mr=Object.prototype.hasOwnProperty,rn=function(f){var w=this.__data__;if(Pr){var B=w[f];return B==="__lodash_hash_undefined__"?void 0:B}return mr.call(w,f)?w[f]:void 0},Sr=Object.prototype.hasOwnProperty,qr=function(f){var w=this.__data__;return Pr?w[f]!==void 0:Sr.call(w,f)},Rn=function(f,w){var B=this.__data__;return this.size+=this.has(f)?0:1,B[f]=Pr&&w===void 0?"__lodash_hash_undefined__":w,this};function yn(f){var w=-1,B=f==null?0:f.length;for(this.clear();++w<B;){var V=f[w];this.set(V[0],V[1])}}yn.prototype.clear=Cr,yn.prototype.delete=Gr,yn.prototype.get=rn,yn.prototype.has=qr,yn.prototype.set=Rn;var zr=yn,Rt=function(){this.size=0,this.__data__={hash:new zr,map:new(Oe||W),string:new zr}},zt=function(f){var w=typeof f;return w=="string"||w=="number"||w=="symbol"||w=="boolean"?f!=="__proto__":f===null},Vt=function(f,w){var B=f.__data__;return zt(w)?B[typeof w=="string"?"string":"hash"]:B.map},hr=function(f){var w=Vt(this,f).delete(f);return this.size-=w?1:0,w},Ar=function(f){return Vt(this,f).get(f)},en=function(f){return Vt(this,f).has(f)},Fr=function(f,w){var B=Vt(this,f),V=B.size;return B.set(f,w),this.size+=B.size==V?0:1,this};function Cn(f){var w=-1,B=f==null?0:f.length;for(this.clear();++w<B;){var V=f[w];this.set(V[0],V[1])}}Cn.prototype.clear=Rt,Cn.prototype.delete=hr,Cn.prototype.get=Ar,Cn.prototype.has=en,Cn.prototype.set=Fr;var Sn=Cn,oa=function(f,w){var B=this.__data__;if(B instanceof W){var V=B.__data__;if(!Oe||V.length<199)return V.push([f,w]),this.size=++B.size,this;B=this.__data__=new Sn(V)}return B.set(f,w),this.size=B.size,this};function jr(f){var w=this.__data__=new W(f);this.size=w.size}jr.prototype.clear=H,jr.prototype.delete=Z,jr.prototype.get=J,jr.prototype.has=K,jr.prototype.set=oa;var xn=jr,vn=function(f,w){for(var B=-1,V=f==null?0:f.length;++B<V&&w(f[B],B,f)!==!1;);return f},un=function(){try{var f=ar(Object,"defineProperty");return f({},"",{}),f}catch(w){}}(),Wn=function(f,w,B){w=="__proto__"&&un?un(f,w,{configurable:!0,enumerable:!0,value:B,writable:!0}):f[w]=B},Y=Object.prototype.hasOwnProperty,ie=function(f,w,B){var V=f[w];Y.call(f,w)&&s(V,B)&&(B!==void 0||w in f)||Wn(f,w,B)},ee=function(f,w,B,V){var re=!B;B||(B={});for(var oe=-1,le=w.length;++oe<le;){var ge=w[oe],_e=V?V(B[ge],f[ge],ge,B,f):void 0;_e===void 0&&(_e=f[ge]),re?Wn(B,ge,_e):ie(B,ge,_e)}return B},C=function(f,w){for(var B=-1,V=Array(f);++B<f;)V[B]=w(B);return V},b=function(f){return f!=null&&typeof f=="object"},S=function(f){return b(f)&&He(f)=="[object Arguments]"},X=Object.prototype,pe=X.hasOwnProperty,Me=X.propertyIsEnumerable,me=S(function(){return arguments}())?S:function(f){return b(f)&&pe.call(f,"callee")&&!Me.call(f,"callee")},Le=Array.isArray,st=function(){return!1},qe=d(function(f,w){var B=w&&!w.nodeType&&w,V=B&&f&&!f.nodeType&&f,re=V&&V.exports===B?fe.Buffer:void 0,oe=(re?re.isBuffer:void 0)||st;f.exports=oe}),Nt=/^(?:0|[1-9]\d*)$/,nr=function(f,w){var B=typeof f;return!!(w=w==null?9007199254740991:w)&&(B=="number"||B!="symbol"&&Nt.test(f))&&f>-1&&f%1==0&&f<w},Ft=function(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=9007199254740991},er={};er["[object Float32Array]"]=er["[object Float64Array]"]=er["[object Int8Array]"]=er["[object Int16Array]"]=er["[object Int32Array]"]=er["[object Uint8Array]"]=er["[object Uint8ClampedArray]"]=er["[object Uint16Array]"]=er["[object Uint32Array]"]=!0,er["[object Arguments]"]=er["[object Array]"]=er["[object ArrayBuffer]"]=er["[object Boolean]"]=er["[object DataView]"]=er["[object Date]"]=er["[object Error]"]=er["[object Function]"]=er["[object Map]"]=er["[object Number]"]=er["[object Object]"]=er["[object RegExp]"]=er["[object Set]"]=er["[object String]"]=er["[object WeakMap]"]=!1;var Ur=function(f){return b(f)&&Ft(f.length)&&!!er[He(f)]},Ct=function(f){return function(w){return f(w)}},Kt=d(function(f,w){var B=w&&!w.nodeType&&w,V=B&&f&&!f.nodeType&&f,re=V&&V.exports===B&&ne.process,oe=function(){try{var le=V&&V.require&&V.require("util").types;return le||re&&re.binding&&re.binding("util")}catch(ge){}}();f.exports=oe}),lr=Kt&&Kt.isTypedArray,Dr=lr?Ct(lr):Ur,br=Object.prototype.hasOwnProperty,sa=function(f,w){var B=Le(f),V=!B&&me(f),re=!B&&!V&&qe(f),oe=!B&&!V&&!re&&Dr(f),le=B||V||re||oe,ge=le?C(f.length,String):[],_e=ge.length;for(var Ne in f)!w&&!br.call(f,Ne)||le&&(Ne=="length"||re&&(Ne=="offset"||Ne=="parent")||oe&&(Ne=="buffer"||Ne=="byteLength"||Ne=="byteOffset")||nr(Ne,_e))||ge.push(Ne);return ge},ea=Object.prototype,gn=function(f){var w=f&&f.constructor;return f===(typeof w=="function"&&w.prototype||ea)},Tn=function(f,w){return function(B){return f(w(B))}},ra=Tn(Object.keys,Object),Zn=Object.prototype.hasOwnProperty,Vr=function(f){if(!gn(f))return ra(f);var w=[];for(var B in Object(f))Zn.call(f,B)&&B!="constructor"&&w.push(B);return w},In=function(f){return f!=null&&Ft(f.length)&&!Jt(f)},at=function(f){return In(f)?sa(f):Vr(f)},D=function(f,w){return f&&ee(w,at(w),f)},te=function(f){var w=[];if(f!=null)for(var B in Object(f))w.push(B);return w},xe=Object.prototype.hasOwnProperty,be=function(f){if(!ft(f))return te(f);var w=gn(f),B=[];for(var V in f)(V!="constructor"||!w&&xe.call(f,V))&&B.push(V);return B},De=function(f){return In(f)?sa(f,!0):be(f)},Xe=function(f,w){return f&&ee(w,De(w),f)},Je=d(function(f,w){var B=w&&!w.nodeType&&w,V=B&&f&&!f.nodeType&&f,re=V&&V.exports===B?fe.Buffer:void 0,oe=re?re.allocUnsafe:void 0;f.exports=function(le,ge){if(ge)return le.slice();var _e=le.length,Ne=oe?oe(_e):new le.constructor(_e);return le.copy(Ne),Ne}}),lt=function(f,w){var B=-1,V=f.length;for(w||(w=Array(V));++B<V;)w[B]=f[B];return w},Tt=function(f,w){for(var B=-1,V=f==null?0:f.length,re=0,oe=[];++B<V;){var le=f[B];w(le,B,f)&&(oe[re++]=le)}return oe},Ht=function(){return[]},ir=Object.prototype.propertyIsEnumerable,Kr=Object.getOwnPropertySymbols,nn=Kr?function(f){return f==null?[]:(f=Object(f),Tt(Kr(f),function(w){return ir.call(f,w)}))}:Ht,mn=function(f,w){return ee(f,nn(f),w)},Jr=function(f,w){for(var B=-1,V=w.length,re=f.length;++B<V;)f[re+B]=w[B];return f},jn=Tn(Object.getPrototypeOf,Object),_a=Object.getOwnPropertySymbols?function(f){for(var w=[];f;)Jr(w,nn(f)),f=jn(f);return w}:Ht,Fn=function(f,w){return ee(f,_a(f),w)},ya=function(f,w,B){var V=w(f);return Le(f)?V:Jr(V,B(f))},Ai=function(f){return ya(f,at,nn)},bo=function(f){return ya(f,De,_a)},Zi=ar(fe,"DataView"),Fi=ar(fe,"Promise"),Kn=ar(fe,"Set"),ho=ar(fe,"WeakMap"),Ei=pt(Zi),eo=pt(Oe),Eo=pt(Fi),Yo=pt(Kn),Po=pt(ho),Ki=He;(Zi&&Ki(new Zi(new ArrayBuffer(1)))!="[object DataView]"||Oe&&Ki(new Oe)!="[object Map]"||Fi&&Ki(Fi.resolve())!="[object Promise]"||Kn&&Ki(new Kn)!="[object Set]"||ho&&Ki(new ho)!="[object WeakMap]")&&(Ki=function(f){var w=He(f),B=w=="[object Object]"?f.constructor:void 0,V=B?pt(B):"";if(V)switch(V){case Ei:return"[object DataView]";case eo:return"[object Map]";case Eo:return"[object Promise]";case Yo:return"[object Set]";case Po:return"[object WeakMap]"}return w});var Si=Ki,Ns=Object.prototype.hasOwnProperty,On=function(f){var w=f.length,B=new f.constructor(w);return w&&typeof f[0]=="string"&&Ns.call(f,"index")&&(B.index=f.index,B.input=f.input),B},Gi=fe.Uint8Array,to=function(f){var w=new f.constructor(f.byteLength);return new Gi(w).set(new Gi(f)),w},_i=function(f,w){var B=w?to(f.buffer):f.buffer;return new f.constructor(B,f.byteOffset,f.byteLength)},Ru=/\w*$/,xo=function(f){var w=new f.constructor(f.source,Ru.exec(f));return w.lastIndex=f.lastIndex,w},ri=Ie?Ie.prototype:void 0,wo=ri?ri.valueOf:void 0,ds=function(f){return wo?Object(wo.call(f)):{}},Ho=function(f,w){var B=w?to(f.buffer):f.buffer;return new f.constructor(B,f.byteOffset,f.length)},zi=function(f,w,B){var V=f.constructor;switch(w){case"[object ArrayBuffer]":return to(f);case"[object Boolean]":case"[object Date]":return new V(+f);case"[object DataView]":return _i(f,B);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ho(f,B);case"[object Map]":return new V;case"[object Number]":case"[object String]":return new V(f);case"[object RegExp]":return xo(f);case"[object Set]":return new V;case"[object Symbol]":return ds(f)}},$i=Object.create,Va=function(){function f(){}return function(w){if(!ft(w))return{};if($i)return $i(w);f.prototype=w;var B=new f;return f.prototype=void 0,B}}(),ro=function(f){return typeof f.constructor!="function"||gn(f)?{}:Va(jn(f))},Zo=function(f){return b(f)&&Si(f)=="[object Map]"},Ui=Kt&&Kt.isMap,Wi=Ui?Ct(Ui):Zo,Ko=function(f){return b(f)&&Si(f)=="[object Set]"},vo=Kt&&Kt.isSet,hs=vo?Ct(vo):Ko,Ca={};Ca["[object Arguments]"]=Ca["[object Array]"]=Ca["[object ArrayBuffer]"]=Ca["[object DataView]"]=Ca["[object Boolean]"]=Ca["[object Date]"]=Ca["[object Float32Array]"]=Ca["[object Float64Array]"]=Ca["[object Int8Array]"]=Ca["[object Int16Array]"]=Ca["[object Int32Array]"]=Ca["[object Map]"]=Ca["[object Number]"]=Ca["[object Object]"]=Ca["[object RegExp]"]=Ca["[object Set]"]=Ca["[object String]"]=Ca["[object Symbol]"]=Ca["[object Uint8Array]"]=Ca["[object Uint8ClampedArray]"]=Ca["[object Uint16Array]"]=Ca["[object Uint32Array]"]=!0,Ca["[object Error]"]=Ca["[object Function]"]=Ca["[object WeakMap]"]=!1;var So=function f(w,B,V,re,oe,le){var ge,_e=1&B,Ne=2&B,ze=4&B;if(V&&(ge=oe?V(w,re,oe,le):V(w)),ge!==void 0)return ge;if(!ft(w))return w;var Be=Le(w);if(Be){if(ge=On(w),!_e)return lt(w,ge)}else{var nt=Si(w),_t=nt=="[object Function]"||nt=="[object GeneratorFunction]";if(qe(w))return Je(w,_e);if(nt=="[object Object]"||nt=="[object Arguments]"||_t&&!oe){if(ge=Ne||_t?{}:ro(w),!_e)return Ne?Fn(w,Xe(ge,w)):mn(w,D(ge,w))}else{if(!Ca[nt])return oe?w:{};ge=zi(w,nt,_e)}}le||(le=new xn);var tr=le.get(w);if(tr)return tr;le.set(w,ge),hs(w)?w.forEach(function(kt){ge.add(f(kt,B,V,kt,w,le))}):Wi(w)&&w.forEach(function(kt,Dt){ge.set(Dt,f(kt,B,V,Dt,w,le))});var Pt=Be?void 0:(ze?Ne?bo:Ai:Ne?De:at)(w);return vn(Pt||w,function(kt,Dt){Pt&&(kt=w[Dt=kt]),ie(ge,Dt,f(kt,B,V,Dt,w,le))}),ge},ou=function(f){return So(f,4)},di=function(f){return function(){return f}},mi=function(f){return function(w,B,V){for(var re=-1,oe=Object(w),le=V(w),ge=le.length;ge--;){var _e=le[f?ge:++re];if(B(oe[_e],_e,oe)===!1)break}return w}}(),_o=function(f,w){return f&&mi(f,w,at)},hi=function(f,w){return function(B,V){if(B==null)return B;if(!In(B))return f(B,V);for(var re=B.length,oe=w?re:-1,le=Object(B);(w?oe--:++oe<re)&&V(le[oe],oe,le)!==!1;);return B}}(_o),xi=function(f){return f},Vn=function(f){return typeof f=="function"?f:xi},ni=function(f,w){return(Le(f)?vn:hi)(f,Vn(w))},qa=ni,wi=function(f,w){var B=[];return hi(f,function(V,re,oe){w(V,re,oe)&&B.push(V)}),B},bi=function(f){return this.__data__.set(f,"__lodash_hash_undefined__"),this},Mi=function(f){return this.__data__.has(f)};function go(f){var w=-1,B=f==null?0:f.length;for(this.__data__=new Sn;++w<B;)this.add(f[w])}go.prototype.add=go.prototype.push=bi,go.prototype.has=Mi;var no=go,Mo=function(f,w){for(var B=-1,V=f==null?0:f.length;++B<V;)if(w(f[B],B,f))return!0;return!1},po=function(f,w){return f.has(w)},su=function(f,w,B,V,re,oe){var le=1&B,ge=f.length,_e=w.length;if(ge!=_e&&!(le&&_e>ge))return!1;var Ne=oe.get(f),ze=oe.get(w);if(Ne&&ze)return Ne==w&&ze==f;var Be=-1,nt=!0,_t=2&B?new no:void 0;for(oe.set(f,w),oe.set(w,f);++Be<ge;){var tr=f[Be],Pt=w[Be];if(V)var kt=le?V(Pt,tr,Be,w,f,oe):V(tr,Pt,Be,f,w,oe);if(kt!==void 0){if(kt)continue;nt=!1;break}if(_t){if(!Mo(w,function(Dt,pr){if(!po(_t,pr)&&(tr===Dt||re(tr,Dt,B,V,oe)))return _t.push(pr)})){nt=!1;break}}else if(tr!==Pt&&!re(tr,Pt,B,V,oe)){nt=!1;break}}return oe.delete(f),oe.delete(w),nt},gf=function(f){var w=-1,B=Array(f.size);return f.forEach(function(V,re){B[++w]=[re,V]}),B},uu=function(f){var w=-1,B=Array(f.size);return f.forEach(function(V){B[++w]=V}),B},_n=Ie?Ie.prototype:void 0,dn=_n?_n.valueOf:void 0,rc=function(f,w,B,V,re,oe,le){switch(B){case"[object DataView]":if(f.byteLength!=w.byteLength||f.byteOffset!=w.byteOffset)return!1;f=f.buffer,w=w.buffer;case"[object ArrayBuffer]":return!(f.byteLength!=w.byteLength||!oe(new Gi(f),new Gi(w)));case"[object Boolean]":case"[object Date]":case"[object Number]":return s(+f,+w);case"[object Error]":return f.name==w.name&&f.message==w.message;case"[object RegExp]":case"[object String]":return f==w+"";case"[object Map]":var ge=gf;case"[object Set]":var _e=1&V;if(ge||(ge=uu),f.size!=w.size&&!_e)return!1;var Ne=le.get(f);if(Ne)return Ne==w;V|=2,le.set(f,w);var ze=su(ge(f),ge(w),V,re,oe,le);return le.delete(f),ze;case"[object Symbol]":if(dn)return dn.call(f)==dn.call(w)}return!1},ai=Object.prototype.hasOwnProperty,Ps=function(f,w,B,V,re,oe){var le=1&B,ge=Ai(f),_e=ge.length;if(_e!=Ai(w).length&&!le)return!1;for(var Ne=_e;Ne--;){var ze=ge[Ne];if(!(le?ze in w:ai.call(w,ze)))return!1}var Be=oe.get(f),nt=oe.get(w);if(Be&&nt)return Be==w&&nt==f;var _t=!0;oe.set(f,w),oe.set(w,f);for(var tr=le;++Ne<_e;){var Pt=f[ze=ge[Ne]],kt=w[ze];if(V)var Dt=le?V(kt,Pt,ze,w,f,oe):V(Pt,kt,ze,f,w,oe);if(!(Dt===void 0?Pt===kt||re(Pt,kt,B,V,oe):Dt)){_t=!1;break}tr||(tr=ze=="constructor")}if(_t&&!tr){var pr=f.constructor,Xr=w.constructor;pr==Xr||!("constructor"in f)||!("constructor"in w)||typeof pr=="function"&&pr instanceof pr&&typeof Xr=="function"&&Xr instanceof Xr||(_t=!1)}return oe.delete(f),oe.delete(w),_t},$o=Object.prototype.hasOwnProperty,Ba=function(f,w,B,V,re,oe){var le=Le(f),ge=Le(w),_e=le?"[object Array]":Si(f),Ne=ge?"[object Array]":Si(w),ze=(_e=_e=="[object Arguments]"?"[object Object]":_e)=="[object Object]",Be=(Ne=Ne=="[object Arguments]"?"[object Object]":Ne)=="[object Object]",nt=_e==Ne;if(nt&&qe(f)){if(!qe(w))return!1;le=!0,ze=!1}if(nt&&!ze)return oe||(oe=new xn),le||Dr(f)?su(f,w,B,V,re,oe):rc(f,w,_e,B,V,re,oe);if(!(1&B)){var _t=ze&&$o.call(f,"__wrapped__"),tr=Be&&$o.call(w,"__wrapped__");if(_t||tr){var Pt=_t?f.value():f,kt=tr?w.value():w;return oe||(oe=new xn),re(Pt,kt,B,V,oe)}}return!!nt&&(oe||(oe=new xn),Ps(f,w,B,V,re,oe))},$a=function f(w,B,V,re,oe){return w===B||(w==null||B==null||!b(w)&&!b(B)?w!=w&&B!=B:Ba(w,B,V,re,f,oe))},Qo=function(f,w,B,V){var re=B.length,oe=re,le=!V;if(f==null)return!oe;for(f=Object(f);re--;){var ge=B[re];if(le&&ge[2]?ge[1]!==f[ge[0]]:!(ge[0]in f))return!1}for(;++re<oe;){var _e=(ge=B[re])[0],Ne=f[_e],ze=ge[1];if(le&&ge[2]){if(Ne===void 0&&!(_e in f))return!1}else{var Be=new xn;if(V)var nt=V(Ne,ze,_e,f,w,Be);if(!(nt===void 0?$a(ze,Ne,3,V,Be):nt))return!1}}return!0},Jo=function(f){return f==f&&!ft(f)},vs=function(f){for(var w=at(f),B=w.length;B--;){var V=w[B],re=f[V];w[B]=[V,re,Jo(re)]}return w},Bu=function(f,w){return function(B){return B!=null&&B[f]===w&&(w!==void 0||f in Object(B))}},Fu=function(f){var w=vs(f);return w.length==1&&w[0][2]?Bu(w[0][0],w[0][1]):function(B){return B===f||Qo(B,f,w)}},Fa=function(f){return typeof f=="symbol"||b(f)&&He(f)=="[object Symbol]"},yo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gs=/^\w*$/,fu=function(f,w){if(Le(f))return!1;var B=typeof f;return!(B!="number"&&B!="symbol"&&B!="boolean"&&f!=null&&!Fa(f))||gs.test(f)||!yo.test(f)||w!=null&&f in Object(w)};function cu(f,w){if(typeof f!="function"||w!=null&&typeof w!="function")throw new TypeError("Expected a function");var B=function(){var V=arguments,re=w?w.apply(this,V):V[0],oe=B.cache;if(oe.has(re))return oe.get(re);var le=f.apply(this,V);return B.cache=oe.set(re,le)||oe,le};return B.cache=new(cu.Cache||Sn),B}cu.Cache=Sn;var ks=cu,ps=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ys=/\\(\\)?/g,Gu=function(f){var w=ks(f,function(V){return B.size===500&&B.clear(),V}),B=w.cache;return w}(function(f){var w=[];return f.charCodeAt(0)===46&&w.push(""),f.replace(ps,function(B,V,re,oe){w.push(re?oe.replace(ys,"$1"):V||B)}),w}),Oi=function(f,w){for(var B=-1,V=f==null?0:f.length,re=Array(V);++B<V;)re[B]=w(f[B],B,f);return re},ko=Ie?Ie.prototype:void 0,Rs=ko?ko.toString:void 0,zu=function f(w){if(typeof w=="string")return w;if(Le(w))return Oi(w,f)+"";if(Fa(w))return Rs?Rs.call(w):"";var B=w+"";return B=="0"&&1/w==-1/0?"-0":B},lu=function(f){return f==null?"":zu(f)},Bs=function(f,w){return Le(f)?f:fu(f,w)?[f]:Gu(lu(f))},qo=function(f){if(typeof f=="string"||Fa(f))return f;var w=f+"";return w=="0"&&1/f==-1/0?"-0":w},Fs=function(f,w){for(var B=0,V=(w=Bs(w,f)).length;f!=null&&B<V;)f=f[qo(w[B++])];return B&&B==V?f:void 0},du=function(f,w,B){var V=f==null?void 0:Fs(f,w);return V===void 0?B:V},hu=function(f,w){return f!=null&&w in Object(f)},Uu=function(f,w,B){for(var V=-1,re=(w=Bs(w,f)).length,oe=!1;++V<re;){var le=qo(w[V]);if(!(oe=f!=null&&B(f,le)))break;f=f[le]}return oe||++V!=re?oe:!!(re=f==null?0:f.length)&&Ft(re)&&nr(le,re)&&(Le(f)||me(f))},Wu=function(f,w){return f!=null&&Uu(f,w,hu)},ao=function(f,w){return fu(f)&&Jo(w)?Bu(qo(f),w):function(B){var V=du(B,f);return V===void 0&&V===w?Wu(B,f):$a(w,V,3)}},Ro=function(f){return function(w){return w==null?void 0:w[f]}},Xu=function(f){return function(w){return Fs(w,f)}},vu=function(f){return fu(f)?Ro(qo(f)):Xu(f)},Xi=function(f){return typeof f=="function"?f:f==null?xi:typeof f=="object"?Le(f)?ao(f[0],f[1]):Fu(f):vu(f)},pf=function(f,w){return(Le(f)?Tt:wi)(f,Xi(w))},ju=Object.prototype.hasOwnProperty,yf=function(f,w){return f!=null&&ju.call(f,w)},Gs=function(f,w){return f!=null&&Uu(f,w,yf)},nc=Object.prototype.hasOwnProperty,mf=function(f){if(f==null)return!0;if(In(f)&&(Le(f)||typeof f=="string"||typeof f.splice=="function"||qe(f)||Dr(f)||me(f)))return!f.length;var w=Si(f);if(w=="[object Map]"||w=="[object Set]")return!f.size;if(gn(f))return!Vr(f).length;for(var B in f)if(nc.call(f,B))return!1;return!0},bf=function(f){return f===void 0},zs=function(f,w){var B=-1,V=In(f)?Array(f.length):[];return hi(f,function(re,oe,le){V[++B]=w(re,oe,le)}),V},Vu=function(f,w){return(Le(f)?Oi:zs)(f,Xi(w))},gu=function(f,w,B,V){var re=-1,oe=f==null?0:f.length;for(V&&oe&&(B=f[++re]);++re<oe;)B=w(B,f[re],re,f);return B},pu=function(f,w,B,V,re){return re(f,function(oe,le,ge){B=V?(V=!1,oe):w(B,oe,le,ge)}),B},yu=function(f,w,B){var V=Le(f)?gu:pu,re=arguments.length<3;return V(f,Xi(w),B,re,hi)},Us=function(f){return typeof f=="string"||!Le(f)&&b(f)&&He(f)=="[object String]"},Bo=Ro("length"),es=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),vi=function(f){return es.test(f)},Ws="[\\ud800-\\udfff]",Xs="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ef="\\ud83c[\\udffb-\\udfff]",xf="[^\\ud800-\\udfff]",Yu="(?:\\ud83c[\\udde6-\\uddff]){2}",js="[\\ud800-\\udbff][\\udc00-\\udfff]",ji="(?:"+Xs+"|"+Ef+")?",mo="[\\ufe0e\\ufe0f]?"+ji+("(?:\\u200d(?:"+[xf,Yu,js].join("|")+")[\\ufe0e\\ufe0f]?"+ji+")*"),ac="(?:"+[xf+Xs+"?",Xs,Yu,js,Ws].join("|")+")",Vs=RegExp(Ef+"(?="+Ef+")|"+ac+mo,"g"),Vi=function(f){for(var w=Vs.lastIndex=0;Vs.test(f);)++w;return w},Fo=function(f){return vi(f)?Vi(f):Bo(f)},wf=function(f){if(f==null)return 0;if(In(f))return Us(f)?Fo(f):f.length;var w=Si(f);return w=="[object Map]"||w=="[object Set]"?f.size:Vr(f).length},Sf=function(f,w,B){var V=Le(f),re=V||qe(f)||Dr(f);if(w=Xi(w),B==null){var oe=f&&f.constructor;B=re?V?new oe:[]:ft(f)&&Jt(oe)?Va(jn(f)):{}}return(re?vn:_o)(f,function(le,ge,_e){return w(B,le,ge,_e)}),B},Ys=Ie?Ie.isConcatSpreadable:void 0,Hu=function(f){return Le(f)||me(f)||!!(Ys&&f&&f[Ys])},ts=function f(w,B,V,re,oe){var le=-1,ge=w.length;for(V||(V=Hu),oe||(oe=[]);++le<ge;){var _e=w[le];B>0&&V(_e)?B>1?f(_e,B-1,V,re,oe):Jr(oe,_e):re||(oe[oe.length]=_e)}return oe},ms=function(f,w,B){switch(B.length){case 0:return f.call(w);case 1:return f.call(w,B[0]);case 2:return f.call(w,B[0],B[1]);case 3:return f.call(w,B[0],B[1],B[2])}return f.apply(w,B)},Zu=Math.max,rs=function(f,w,B){return w=Zu(w===void 0?f.length-1:w,0),function(){for(var V=arguments,re=-1,oe=Zu(V.length-w,0),le=Array(oe);++re<oe;)le[re]=V[w+re];re=-1;for(var ge=Array(w+1);++re<w;)ge[re]=V[re];return ge[w]=B(le),ms(f,this,ge)}},ii=un?function(f,w){return un(f,"toString",{configurable:!0,enumerable:!1,value:di(w),writable:!0})}:xi,Hs=Date.now,bs=function(f){var w=0,B=0;return function(){var V=Hs(),re=16-(V-B);if(B=V,re>0){if(++w>=800)return arguments[0]}else w=0;return f.apply(void 0,arguments)}}(ii),io=function(f,w){return bs(rs(f,w,xi),f+"")},ns=function(f,w,B,V){for(var re=f.length,oe=B+(V?1:-1);V?oe--:++oe<re;)if(w(f[oe],oe,f))return oe;return-1},_f=function(f){return f!=f},Mf=function(f,w,B){for(var V=B-1,re=f.length;++V<re;)if(f[V]===w)return V;return-1},Co=function(f,w,B){return w==w?Mf(f,w,B):ns(f,_f,B)},ic=function(f,w){return!!(f!=null&&f.length)&&Co(f,w,0)>-1},oc=function(f,w,B){for(var V=-1,re=f==null?0:f.length;++V<re;)if(B(w,f[V]))return!0;return!1},Es=function(){},Cf=Kn&&1/uu(new Kn([,-0]))[1]==1/0?function(f){return new Kn(f)}:Es,mu=function(f,w,B){var V=-1,re=ic,oe=f.length,le=!0,ge=[],_e=ge;if(B)le=!1,re=oc;else if(oe>=200){var Ne=w?null:Cf(f);if(Ne)return uu(Ne);le=!1,re=po,_e=new no}else _e=w?[]:ge;e:for(;++V<oe;){var ze=f[V],Be=w?w(ze):ze;if(ze=B||ze!==0?ze:0,le&&Be==Be){for(var nt=_e.length;nt--;)if(_e[nt]===Be)continue e;w&&_e.push(Be),ge.push(ze)}else re(_e,Be,B)||(_e!==ge&&_e.push(Be),ge.push(ze))}return ge},Ku=function(f){return b(f)&&In(f)},$u=io(function(f){return mu(ts(f,1,Ku,!0))}),bu=function(f,w){return Oi(w,function(B){return f[B]})},as,Eu=function(f){return f==null?[]:bu(f,at(f))};try{as={clone:ou,constant:di,each:qa,filter:pf,has:Gs,isArray:Le,isEmpty:mf,isFunction:Jt,isUndefined:bf,keys:at,map:Vu,reduce:yu,size:wf,transform:Sf,union:$u,values:Eu}}catch(f){}as||(as=window._);var Qr=as,is=na;function na(f){this._isDirected=!Qr.has(f,"directed")||f.directed,this._isMultigraph=!!Qr.has(f,"multigraph")&&f.multigraph,this._isCompound=!!Qr.has(f,"compound")&&f.compound,this._label=void 0,this._defaultNodeLabelFn=Qr.constant(void 0),this._defaultEdgeLabelFn=Qr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function Zs(f,w){f[w]?f[w]++:f[w]=1}function Ks(f,w){--f[w]||delete f[w]}function Go(f,w,B,V){var re=""+w,oe=""+B;if(!f&&re>oe){var le=re;re=oe,oe=le}return re+""+oe+""+(Qr.isUndefined(V)?"\0":V)}function Tf(f,w,B,V){var re=""+w,oe=""+B;if(!f&&re>oe){var le=re;re=oe,oe=le}var ge={v:re,w:oe};return V&&(ge.name=V),ge}function xs(f,w){return Go(f,w.v,w.w,w.name)}na.prototype._nodeCount=0,na.prototype._edgeCount=0,na.prototype.isDirected=function(){return this._isDirected},na.prototype.isMultigraph=function(){return this._isMultigraph},na.prototype.isCompound=function(){return this._isCompound},na.prototype.setGraph=function(f){return this._label=f,this},na.prototype.graph=function(){return this._label},na.prototype.setDefaultNodeLabel=function(f){return Qr.isFunction(f)||(f=Qr.constant(f)),this._defaultNodeLabelFn=f,this},na.prototype.nodeCount=function(){return this._nodeCount},na.prototype.nodes=function(){return Qr.keys(this._nodes)},na.prototype.sources=function(){var f=this;return Qr.filter(this.nodes(),function(w){return Qr.isEmpty(f._in[w])})},na.prototype.sinks=function(){var f=this;return Qr.filter(this.nodes(),function(w){return Qr.isEmpty(f._out[w])})},na.prototype.setNodes=function(f,w){var B=arguments,V=this;return Qr.each(f,function(re){B.length>1?V.setNode(re,w):V.setNode(re)}),this},na.prototype.setNode=function(f,w){return Qr.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=w),this):(this._nodes[f]=arguments.length>1?w:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]="\0",this._children[f]={},this._children["\0"][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},na.prototype.node=function(f){return this._nodes[f]},na.prototype.hasNode=function(f){return Qr.has(this._nodes,f)},na.prototype.removeNode=function(f){var w=this;if(Qr.has(this._nodes,f)){var B=function(V){w.removeEdge(w._edgeObjs[V])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],Qr.each(this.children(f),function(V){w.setParent(V)}),delete this._children[f]),Qr.each(Qr.keys(this._in[f]),B),delete this._in[f],delete this._preds[f],Qr.each(Qr.keys(this._out[f]),B),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},na.prototype.setParent=function(f,w){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Qr.isUndefined(w))w="\0";else{for(var B=w+="";!Qr.isUndefined(B);B=this.parent(B))if(B===f)throw new Error("Setting "+w+" as parent of "+f+" would create a cycle");this.setNode(w)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=w,this._children[w][f]=!0,this},na.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},na.prototype.parent=function(f){if(this._isCompound){var w=this._parent[f];if(w!=="\0")return w}},na.prototype.children=function(f){if(Qr.isUndefined(f)&&(f="\0"),this._isCompound){var w=this._children[f];if(w)return Qr.keys(w)}else{if(f==="\0")return this.nodes();if(this.hasNode(f))return[]}},na.prototype.predecessors=function(f){var w=this._preds[f];if(w)return Qr.keys(w)},na.prototype.successors=function(f){var w=this._sucs[f];if(w)return Qr.keys(w)},na.prototype.neighbors=function(f){var w=this.predecessors(f);if(w)return Qr.union(w,this.successors(f))},na.prototype.isLeaf=function(f){return(this.isDirected()?this.successors(f):this.neighbors(f)).length===0},na.prototype.filterNodes=function(f){var w=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});w.setGraph(this.graph());var B=this;Qr.each(this._nodes,function(oe,le){f(le)&&w.setNode(le,oe)}),Qr.each(this._edgeObjs,function(oe){w.hasNode(oe.v)&&w.hasNode(oe.w)&&w.setEdge(oe,B.edge(oe))});var V={};function re(oe){var le=B.parent(oe);return le===void 0||w.hasNode(le)?(V[oe]=le,le):le in V?V[le]:re(le)}return this._isCompound&&Qr.each(w.nodes(),function(oe){w.setParent(oe,re(oe))}),w},na.prototype.setDefaultEdgeLabel=function(f){return Qr.isFunction(f)||(f=Qr.constant(f)),this._defaultEdgeLabelFn=f,this},na.prototype.edgeCount=function(){return this._edgeCount},na.prototype.edges=function(){return Qr.values(this._edgeObjs)},na.prototype.setPath=function(f,w){var B=this,V=arguments;return Qr.reduce(f,function(re,oe){return V.length>1?B.setEdge(re,oe,w):B.setEdge(re,oe),oe}),this},na.prototype.setEdge=function(){var f,w,B,V,re=!1,oe=arguments[0];typeof oe=="object"&&oe!==null&&"v"in oe?(f=oe.v,w=oe.w,B=oe.name,arguments.length===2&&(V=arguments[1],re=!0)):(f=oe,w=arguments[1],B=arguments[3],arguments.length>2&&(V=arguments[2],re=!0)),f=""+f,w=""+w,Qr.isUndefined(B)||(B=""+B);var le=Go(this._isDirected,f,w,B);if(Qr.has(this._edgeLabels,le))return re&&(this._edgeLabels[le]=V),this;if(!Qr.isUndefined(B)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(w),this._edgeLabels[le]=re?V:this._defaultEdgeLabelFn(f,w,B);var ge=Tf(this._isDirected,f,w,B);return f=ge.v,w=ge.w,Object.freeze(ge),this._edgeObjs[le]=ge,Zs(this._preds[w],f),Zs(this._sucs[f],w),this._in[w][le]=ge,this._out[f][le]=ge,this._edgeCount++,this},na.prototype.edge=function(f,w,B){var V=arguments.length===1?xs(this._isDirected,arguments[0]):Go(this._isDirected,f,w,B);return this._edgeLabels[V]},na.prototype.hasEdge=function(f,w,B){var V=arguments.length===1?xs(this._isDirected,arguments[0]):Go(this._isDirected,f,w,B);return Qr.has(this._edgeLabels,V)},na.prototype.removeEdge=function(f,w,B){var V=arguments.length===1?xs(this._isDirected,arguments[0]):Go(this._isDirected,f,w,B),re=this._edgeObjs[V];return re&&(f=re.v,w=re.w,delete this._edgeLabels[V],delete this._edgeObjs[V],Ks(this._preds[w],f),Ks(this._sucs[f],w),delete this._in[w][V],delete this._out[f][V],this._edgeCount--),this},na.prototype.inEdges=function(f,w){var B=this._in[f];if(B){var V=Qr.values(B);return w?Qr.filter(V,function(re){return re.v===w}):V}},na.prototype.outEdges=function(f,w){var B=this._out[f];if(B){var V=Qr.values(B);return w?Qr.filter(V,function(re){return re.w===w}):V}},na.prototype.nodeEdges=function(f,w){var B=this.inEdges(f,w);if(B)return B.concat(this.outEdges(f,w))};var xu={Graph:is,version:"2.1.8"},If={write:function(f){var w={options:{directed:f.isDirected(),multigraph:f.isMultigraph(),compound:f.isCompound()},nodes:Af(f),edges:oo(f)};return Qr.isUndefined(f.graph())||(w.value=Qr.clone(f.graph())),w},read:function(f){var w=new is(f.options).setGraph(f.value);return Qr.each(f.nodes,function(B){w.setNode(B.v,B.value),B.parent&&w.setParent(B.v,B.parent)}),Qr.each(f.edges,function(B){w.setEdge({v:B.v,w:B.w,name:B.name},B.value)}),w}};function Af(f){return Qr.map(f.nodes(),function(w){var B=f.node(w),V=f.parent(w),re={v:w};return Qr.isUndefined(B)||(re.value=B),Qr.isUndefined(V)||(re.parent=V),re})}function oo(f){return Qr.map(f.edges(),function(w){var B=f.edge(w),V={v:w.v,w:w.w};return Qr.isUndefined(w.name)||(V.name=w.name),Qr.isUndefined(B)||(V.value=B),V})}var q=function(f){var w,B={},V=[];function re(oe){Qr.has(B,oe)||(B[oe]=!0,w.push(oe),Qr.each(f.successors(oe),re),Qr.each(f.predecessors(oe),re))}return Qr.each(f.nodes(),function(oe){w=[],re(oe),w.length&&V.push(w)}),V},de=Ee;function Ee(){this._arr=[],this._keyIndices={}}Ee.prototype.size=function(){return this._arr.length},Ee.prototype.keys=function(){return this._arr.map(function(f){return f.key})},Ee.prototype.has=function(f){return Qr.has(this._keyIndices,f)},Ee.prototype.priority=function(f){var w=this._keyIndices[f];if(w!==void 0)return this._arr[w].priority},Ee.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Ee.prototype.add=function(f,w){var B=this._keyIndices;if(f=String(f),!Qr.has(B,f)){var V=this._arr,re=V.length;return B[f]=re,V.push({key:f,priority:w}),this._decrease(re),!0}return!1},Ee.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var f=this._arr.pop();return delete this._keyIndices[f.key],this._heapify(0),f.key},Ee.prototype.decrease=function(f,w){var B=this._keyIndices[f];if(w>this._arr[B].priority)throw new Error("New priority is greater than current priority. Key: "+f+" Old: "+this._arr[B].priority+" New: "+w);this._arr[B].priority=w,this._decrease(B)},Ee.prototype._heapify=function(f){var w=this._arr,B=2*f,V=B+1,re=f;B<w.length&&(re=w[B].priority<w[re].priority?B:re,V<w.length&&(re=w[V].priority<w[re].priority?V:re),re!==f&&(this._swap(f,re),this._heapify(re)))},Ee.prototype._decrease=function(f){for(var w,B=this._arr,V=B[f].priority;f!==0&&!(B[w=f>>1].priority<V);)this._swap(f,w),f=w},Ee.prototype._swap=function(f,w){var B=this._arr,V=this._keyIndices,re=B[f],oe=B[w];B[f]=oe,B[w]=re,V[oe.key]=f,V[re.key]=w};var Pe=function(f,w,B,V){return function(re,oe,le,ge){var _e,Ne,ze={},Be=new de,nt=function(_t){var tr=_t.v!==_e?_t.v:_t.w,Pt=ze[tr],kt=le(_t),Dt=Ne.distance+kt;if(kt<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+_t+" Weight: "+kt);Dt<Pt.distance&&(Pt.distance=Dt,Pt.predecessor=_e,Be.decrease(tr,Dt))};for(re.nodes().forEach(function(_t){var tr=_t===oe?0:Number.POSITIVE_INFINITY;ze[_t]={distance:tr},Be.add(_t,tr)});Be.size()>0&&(_e=Be.removeMin(),(Ne=ze[_e]).distance!==Number.POSITIVE_INFINITY);)ge(_e).forEach(nt);return ze}(f,String(w),B||je,V||function(re){return f.outEdges(re)})},je=Qr.constant(1),bt=function(f,w,B){return Qr.transform(f.nodes(),function(V,re){V[re]=Pe(f,re,w,B)},{})},St=function(f){var w=0,B=[],V={},re=[];function oe(le){var ge=V[le]={onStack:!0,lowlink:w,index:w++};if(B.push(le),f.successors(le).forEach(function(ze){Qr.has(V,ze)?V[ze].onStack&&(ge.lowlink=Math.min(ge.lowlink,V[ze].index)):(oe(ze),ge.lowlink=Math.min(ge.lowlink,V[ze].lowlink))}),ge.lowlink===ge.index){var _e,Ne=[];do _e=B.pop(),V[_e].onStack=!1,Ne.push(_e);while(le!==_e);re.push(Ne)}}return f.nodes().forEach(function(le){Qr.has(V,le)||oe(le)}),re},jt=function(f){return Qr.filter(St(f),function(w){return w.length>1||w.length===1&&f.hasEdge(w[0],w[0])})},vr=function(f,w,B){return function(V,re,oe){var le={},ge=V.nodes();return ge.forEach(function(_e){le[_e]={},le[_e][_e]={distance:0},ge.forEach(function(Ne){_e!==Ne&&(le[_e][Ne]={distance:Number.POSITIVE_INFINITY})}),oe(_e).forEach(function(Ne){var ze=Ne.v===_e?Ne.w:Ne.v,Be=re(Ne);le[_e][ze]={distance:Be,predecessor:_e}})}),ge.forEach(function(_e){var Ne=le[_e];ge.forEach(function(ze){var Be=le[ze];ge.forEach(function(nt){var _t=Be[_e],tr=Ne[nt],Pt=Be[nt],kt=_t.distance+tr.distance;kt<Pt.distance&&(Pt.distance=kt,Pt.predecessor=tr.predecessor)})})}),le}(f,w||xr,B||function(V){return f.outEdges(V)})},xr=Qr.constant(1),$r=an;function an(f){var w={},B={},V=[];if(Qr.each(f.sinks(),function re(oe){if(Qr.has(B,oe))throw new tn;Qr.has(w,oe)||(B[oe]=!0,w[oe]=!0,Qr.each(f.predecessors(oe),re),delete B[oe],V.push(oe))}),Qr.size(w)!==f.nodeCount())throw new tn;return V}function tn(){}an.CycleException=tn,tn.prototype=new Error;var Gn=function(f,w,B){Qr.isArray(w)||(w=[w]);var V=(f.isDirected()?f.successors:f.neighbors).bind(f),re=[],oe={};return Qr.each(w,function(le){if(!f.hasNode(le))throw new Error("Graph does not have node: "+le);$n(f,le,B==="post",oe,V,re)}),re};function $n(f,w,B,V,re,oe){Qr.has(V,w)||(V[w]=!0,B||oe.push(w),Qr.each(re(w),function(le){$n(f,le,B,V,re,oe)}),B&&oe.push(w))}var Dn,Nn={Graph:xu.Graph,json:If,alg:{components:q,dijkstra:Pe,dijkstraAll:bt,findCycles:jt,floydWarshall:vr,isAcyclic:function(f){try{$r(f)}catch(w){if(w instanceof $r.CycleException)return!1;throw w}return!0},postorder:function(f,w){return Gn(f,w,"post")},preorder:function(f,w){return Gn(f,w,"pre")},prim:function(f,w){var B,V=new is,re={},oe=new de;function le(_e){var Ne=_e.v===B?_e.w:_e.v,ze=oe.priority(Ne);if(ze!==void 0){var Be=w(_e);Be<ze&&(re[Ne]=B,oe.decrease(Ne,Be))}}if(f.nodeCount()===0)return V;Qr.each(f.nodes(),function(_e){oe.add(_e,Number.POSITIVE_INFINITY),V.setNode(_e)}),oe.decrease(f.nodes()[0],0);for(var ge=!1;oe.size()>0;){if(B=oe.removeMin(),Qr.has(re,B))V.setEdge(B,re[B]);else{if(ge)throw new Error("Input graph is not connected: "+f);ge=!0}f.nodeEdges(B).forEach(le)}return V},tarjan:St,topsort:$r},version:xu.version};try{Dn=Nn}catch(f){}Dn||(Dn=window.graphlib);var zn=Dn,pn=function(f){return So(f,5)},Yn=function(f,w,B){if(!ft(B))return!1;var V=typeof w;return!!(V=="number"?In(B)&&nr(w,B.length):V=="string"&&w in B)&&s(B[w],f)},Xn=Object.prototype,bn=Xn.hasOwnProperty,Qn=io(function(f,w){f=Object(f);var B=-1,V=w.length,re=V>2?w[2]:void 0;for(re&&Yn(w[0],w[1],re)&&(V=1);++B<V;)for(var oe=w[B],le=De(oe),ge=-1,_e=le.length;++ge<_e;){var Ne=le[ge],ze=f[Ne];(ze===void 0||s(ze,Xn[Ne])&&!bn.call(f,Ne))&&(f[Ne]=oe[Ne])}return f}),ga=function(f){return function(w,B,V){var re=Object(w);if(!In(w)){var oe=Xi(B);w=at(w),B=function(ge){return oe(re[ge],ge,re)}}var le=f(w,B,V);return le>-1?re[oe?w[le]:le]:void 0}},Da=/^\s+|\s+$/g,Ma=/^[-+]0x[0-9a-f]+$/i,ha=/^0b[01]+$/i,Pa=/^0o[0-7]+$/i,Qa=parseInt,Ya=function(f){if(typeof f=="number")return f;if(Fa(f))return NaN;if(ft(f)){var w=typeof f.valueOf=="function"?f.valueOf():f;f=ft(w)?w+"":w}if(typeof f!="string")return f===0?f:+f;f=f.replace(Da,"");var B=ha.test(f);return B||Pa.test(f)?Qa(f.slice(2),B?2:8):Ma.test(f)?NaN:+f},zo=function(f){return f?(f=Ya(f))===1/0||f===-1/0?17976931348623157e292*(f<0?-1:1):f==f?f:0:f===0?f:0},Qu=function(f){var w=zo(f),B=w%1;return w==w?B?w-B:w:0},To=Math.max,$s=ga(function(f,w,B){var V=f==null?0:f.length;if(!V)return-1;var re=B==null?0:Qu(B);return re<0&&(re=To(V+re,0)),ns(f,Xi(w),re)}),Qi=function(f){return f!=null&&f.length?ts(f,1):[]},Io=function(f,w){return f==null?f:mi(f,Vn(w),De)},wu=function(f){var w=f==null?0:f.length;return w?f[w-1]:void 0},sc=function(f,w){var B={};return w=Xi(w),_o(f,function(V,re,oe){Wn(B,re,w(V,re,oe))}),B},Qs=function(f,w,B){for(var V=-1,re=f.length;++V<re;){var oe=f[V],le=w(oe);if(le!=null&&(ge===void 0?le==le&&!Fa(le):B(le,ge)))var ge=le,_e=oe}return _e},ei=function(f,w){return f>w},Of=function(f){return f&&f.length?Qs(f,xi,ei):void 0},ws=function(f,w,B){(B!==void 0&&!s(f[w],B)||B===void 0&&!(w in f))&&Wn(f,w,B)},Ss=Function.prototype,Ju=Object.prototype,so=Ss.toString,qu=Ju.hasOwnProperty,Uo=so.call(Object),_s=function(f){if(!b(f)||He(f)!="[object Object]")return!1;var w=jn(f);if(w===null)return!0;var B=qu.call(w,"constructor")&&w.constructor;return typeof B=="function"&&B instanceof B&&so.call(B)==Uo},Zr=function(f,w){if((w!=="constructor"||typeof f[w]!="function")&&w!="__proto__")return f[w]},uc=function(f){return ee(f,De(f))},al=function(f,w,B,V,re,oe,le){var ge=Zr(f,B),_e=Zr(w,B),Ne=le.get(_e);if(Ne)ws(f,B,Ne);else{var ze=oe?oe(ge,_e,B+"",f,w,le):void 0,Be=ze===void 0;if(Be){var nt=Le(_e),_t=!nt&&qe(_e),tr=!nt&&!_t&&Dr(_e);ze=_e,nt||_t||tr?Le(ge)?ze=ge:Ku(ge)?ze=lt(ge):_t?(Be=!1,ze=Je(_e,!0)):tr?(Be=!1,ze=Ho(_e,!0)):ze=[]:_s(_e)||me(_e)?(ze=ge,me(ge)?ze=uc(ge):ft(ge)&&!Jt(ge)||(ze=ro(_e))):Be=!1}Be&&(le.set(_e,ze),re(ze,_e,V,oe,le),le.delete(_e)),ws(f,B,ze)}},Ji=function f(w,B,V,re,oe){w!==B&&mi(B,function(le,ge){if(oe||(oe=new xn),ft(le))al(w,B,ge,V,f,re,oe);else{var _e=re?re(Zr(w,ge),le,ge+"",w,B,oe):void 0;_e===void 0&&(_e=le),ws(w,ge,_e)}},De)},Wo=function(f){return io(function(w,B){var V=-1,re=B.length,oe=re>1?B[re-1]:void 0,le=re>2?B[2]:void 0;for(oe=f.length>3&&typeof oe=="function"?(re--,oe):void 0,le&&Yn(B[0],B[1],le)&&(oe=re<3?void 0:oe,re=1),w=Object(w);++V<re;){var ge=B[V];ge&&f(w,ge,V,oe)}return w})}(function(f,w,B){Ji(f,w,B)}),ka=function(f,w){return f<w},Su=function(f){return f&&f.length?Qs(f,xi,ka):void 0},_u=function(f,w){return f&&f.length?Qs(f,Xi(w),ka):void 0},os=function(){return fe.Date.now()},Mu=function(f,w,B,V){if(!ft(f))return f;for(var re=-1,oe=(w=Bs(w,f)).length,le=oe-1,ge=f;ge!=null&&++re<oe;){var _e=qo(w[re]),Ne=B;if(_e==="__proto__"||_e==="constructor"||_e==="prototype")return f;if(re!=le){var ze=ge[_e];(Ne=V?V(ze,_e,ge):void 0)===void 0&&(Ne=ft(ze)?ze:nr(w[re+1])?[]:{})}ie(ge,_e,Ne),ge=ge[_e]}return f},Lf=function(f,w,B){for(var V=-1,re=w.length,oe={};++V<re;){var le=w[V],ge=Fs(f,le);B(ge,le)&&Mu(oe,Bs(le,f),ge)}return oe},fc=function(f,w){return Lf(f,w,function(B,V){return Wu(f,V)})},cc=function(f){return bs(rs(f,void 0,Qi),f+"")}(function(f,w){return f==null?{}:fc(f,w)}),lc=Math.ceil,ef=Math.max,dc=function(f,w,B,V){for(var re=-1,oe=ef(lc((w-f)/(B||1)),0),le=Array(oe);oe--;)le[V?oe:++re]=f,f+=B;return le},kc=function(f){return function(w,B,V){return V&&typeof V!="number"&&Yn(w,B,V)&&(B=V=void 0),w=zo(w),B===void 0?(B=w,w=0):B=zo(B),V=V===void 0?w<B?1:-1:zo(V),dc(w,B,V,f)}}(),hc=function(f,w){var B=f.length;for(f.sort(w);B--;)f[B]=f[B].value;return f},vc=function(f,w){if(f!==w){var B=f!==void 0,V=f===null,re=f==f,oe=Fa(f),le=w!==void 0,ge=w===null,_e=w==w,Ne=Fa(w);if(!ge&&!Ne&&!oe&&f>w||oe&&le&&_e&&!ge&&!Ne||V&&le&&_e||!B&&_e||!re)return 1;if(!V&&!oe&&!Ne&&f<w||Ne&&B&&re&&!V&&!oe||ge&&B&&re||!le&&re||!_e)return-1}return 0},gc=function(f,w,B){for(var V=-1,re=f.criteria,oe=w.criteria,le=re.length,ge=B.length;++V<le;){var _e=vc(re[V],oe[V]);if(_e)return V>=ge?_e:_e*(B[V]=="desc"?-1:1)}return f.index-w.index},Cu=function(f,w,B){w=w.length?Oi(w,function(oe){return Le(oe)?function(le){return Fs(le,oe.length===1?oe[0]:oe)}:oe}):[xi];var V=-1;w=Oi(w,Ct(Xi));var re=zs(f,function(oe,le,ge){return{criteria:Oi(w,function(_e){return _e(oe)}),index:++V,value:oe}});return hc(re,function(oe,le){return gc(oe,le,B)})},tf=io(function(f,w){if(f==null)return[];var B=w.length;return B>1&&Yn(f,w[0],w[1])?w=[]:B>2&&Yn(w[0],w[1],w[2])&&(w=[w[0]]),Cu(f,ts(w,1),[])}),Ci=0,Df=function(f){var w=++Ci;return lu(f)+w},il=function(f,w,B){for(var V=-1,re=f.length,oe=w.length,le={};++V<re;){var ge=V<oe?w[V]:void 0;B(le,f[V],ge)}return le},Nf,Rc=function(f,w){return il(f||[],w||[],ie)};try{Nf={cloneDeep:pn,constant:di,defaults:Qn,each:qa,filter:pf,find:$s,flatten:Qi,forEach:ni,forIn:Io,has:Gs,isUndefined:bf,last:wu,map:Vu,mapValues:sc,max:Of,merge:Wo,min:Su,minBy:_u,now:os,pick:cc,range:kc,reduce:yu,sortBy:tf,uniqueId:Df,values:Eu,zipObject:Rc}}catch(f){}Nf||(Nf=window._);var ht=Nf,ol=rf;function rf(){var f={};f._next=f._prev=f,this._sentinel=f}function pc(f){f._prev._next=f._next,f._next._prev=f._prev,delete f._next,delete f._prev}function sl(f,w){if(f!=="_next"&&f!=="_prev")return w}rf.prototype.dequeue=function(){var f=this._sentinel,w=f._prev;if(w!==f)return pc(w),w},rf.prototype.enqueue=function(f){var w=this._sentinel;f._prev&&f._next&&pc(f),f._next=w._next,w._next._prev=f,w._next=f,f._prev=w},rf.prototype.toString=function(){for(var f=[],w=this._sentinel,B=w._prev;B!==w;)f.push(JSON.stringify(B,sl)),B=B._prev;return"["+f.join(", ")+"]"};var Bc=zn.Graph,ul=function(f,w){if(f.nodeCount()<=1)return[];var B=function(re,oe){var le=new Bc,ge=0,_e=0;ht.forEach(re.nodes(),function(Be){le.setNode(Be,{v:Be,in:0,out:0})}),ht.forEach(re.edges(),function(Be){var nt=le.edge(Be.v,Be.w)||0,_t=oe(Be),tr=nt+_t;le.setEdge(Be.v,Be.w,tr),_e=Math.max(_e,le.node(Be.v).out+=_t),ge=Math.max(ge,le.node(Be.w).in+=_t)});var Ne=ht.range(_e+ge+3).map(function(){return new ol}),ze=ge+1;return ht.forEach(le.nodes(),function(Be){yc(Ne,ze,le.node(Be))}),{graph:le,buckets:Ne,zeroIdx:ze}}(f,w||fl),V=function(re,oe,le){for(var ge,_e=[],Ne=oe[oe.length-1],ze=oe[0];re.nodeCount();){for(;ge=ze.dequeue();)Pf(re,oe,le,ge);for(;ge=Ne.dequeue();)Pf(re,oe,le,ge);if(re.nodeCount()){for(var Be=oe.length-2;Be>0;--Be)if(ge=oe[Be].dequeue()){_e=_e.concat(Pf(re,oe,le,ge,!0));break}}}return _e}(B.graph,B.buckets,B.zeroIdx);return ht.flatten(ht.map(V,function(re){return f.outEdges(re.v,re.w)}),!0)},fl=ht.constant(1);function Pf(f,w,B,V,re){var oe=re?[]:void 0;return ht.forEach(f.inEdges(V.v),function(le){var ge=f.edge(le),_e=f.node(le.v);re&&oe.push({v:le.v,w:le.w}),_e.out-=ge,yc(w,B,_e)}),ht.forEach(f.outEdges(V.v),function(le){var ge=f.edge(le),_e=le.w,Ne=f.node(_e);Ne.in-=ge,yc(w,B,Ne)}),f.removeNode(V.v),oe}function yc(f,w,B){B.out?B.in?f[B.out-B.in+w].enqueue(B):f[f.length-1].enqueue(B):f[0].enqueue(B)}var oi={run:function(f){var w=f.graph().acyclicer==="greedy"?ul(f,function(B){return function(V){return B.edge(V).weight}}(f)):function(B){var V=[],re={},oe={};function le(ge){ht.has(oe,ge)||(oe[ge]=!0,re[ge]=!0,ht.forEach(B.outEdges(ge),function(_e){ht.has(re,_e.w)?V.push(_e):le(_e.w)}),delete re[ge])}return ht.forEach(B.nodes(),le),V}(f);ht.forEach(w,function(B){var V=f.edge(B);f.removeEdge(B),V.forwardName=B.name,V.reversed=!0,f.setEdge(B.w,B.v,V,ht.uniqueId("rev"))})},undo:function(f){ht.forEach(f.edges(),function(w){var B=f.edge(w);if(B.reversed){f.removeEdge(w);var V=B.forwardName;delete B.reversed,delete B.forwardName,f.setEdge(w.w,w.v,B,V)}})}},kf=zn.Graph,gi={addDummyNode:Ms,simplify:function(f){var w=new kf().setGraph(f.graph());return ht.forEach(f.nodes(),function(B){w.setNode(B,f.node(B))}),ht.forEach(f.edges(),function(B){var V=w.edge(B.v,B.w)||{weight:0,minlen:1},re=f.edge(B);w.setEdge(B.v,B.w,{weight:V.weight+re.weight,minlen:Math.max(V.minlen,re.minlen)})}),w},asNonCompoundGraph:function(f){var w=new kf({multigraph:f.isMultigraph()}).setGraph(f.graph());return ht.forEach(f.nodes(),function(B){f.children(B).length||w.setNode(B,f.node(B))}),ht.forEach(f.edges(),function(B){w.setEdge(B,f.edge(B))}),w},successorWeights:function(f){var w=ht.map(f.nodes(),function(B){var V={};return ht.forEach(f.outEdges(B),function(re){V[re.w]=(V[re.w]||0)+f.edge(re).weight}),V});return ht.zipObject(f.nodes(),w)},predecessorWeights:function(f){var w=ht.map(f.nodes(),function(B){var V={};return ht.forEach(f.inEdges(B),function(re){V[re.v]=(V[re.v]||0)+f.edge(re).weight}),V});return ht.zipObject(f.nodes(),w)},intersectRect:function(f,w){var B,V,re=f.x,oe=f.y,le=w.x-re,ge=w.y-oe,_e=f.width/2,Ne=f.height/2;if(!le&&!ge)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(ge)*_e>Math.abs(le)*Ne?(ge<0&&(Ne=-Ne),B=Ne*le/ge,V=Ne):(le<0&&(_e=-_e),B=_e,V=_e*ge/le),{x:re+B,y:oe+V}},buildLayerMatrix:function(f){var w=ht.map(ht.range(mc(f)+1),function(){return[]});return ht.forEach(f.nodes(),function(B){var V=f.node(B),re=V.rank;ht.isUndefined(re)||(w[re][V.order]=B)}),w},normalizeRanks:function(f){var w=ht.min(ht.map(f.nodes(),function(B){return f.node(B).rank}));ht.forEach(f.nodes(),function(B){var V=f.node(B);ht.has(V,"rank")&&(V.rank-=w)})},removeEmptyRanks:function(f){var w=ht.min(ht.map(f.nodes(),function(oe){return f.node(oe).rank})),B=[];ht.forEach(f.nodes(),function(oe){var le=f.node(oe).rank-w;B[le]||(B[le]=[]),B[le].push(oe)});var V=0,re=f.graph().nodeRankFactor;ht.forEach(B,function(oe,le){ht.isUndefined(oe)&&le%re!=0?--V:V&&ht.forEach(oe,function(ge){f.node(ge).rank+=V})})},addBorderNode:function(f,w,B,V){var re={width:0,height:0};return arguments.length>=4&&(re.rank=B,re.order=V),Ms(f,"border",re,w)},maxRank:mc,partition:function(f,w){var B={lhs:[],rhs:[]};return ht.forEach(f,function(V){w(V)?B.lhs.push(V):B.rhs.push(V)}),B},time:function(f,w){var B=ht.now();try{return w()}finally{console.log(f+" time: "+(ht.now()-B)+"ms")}},notime:function(f,w){return w()}};function Ms(f,w,B,V){var re;do re=ht.uniqueId(V);while(f.hasNode(re));return B.dummy=w,f.setNode(re,B),re}function mc(f){return ht.max(ht.map(f.nodes(),function(w){var B=f.node(w).rank;if(!ht.isUndefined(B))return B}))}var nf={run:function(f){f.graph().dummyChains=[],ht.forEach(f.edges(),function(w){(function(B,V){var re,oe,le,ge=V.v,_e=B.node(ge).rank,Ne=V.w,ze=B.node(Ne).rank,Be=V.name,nt=B.edge(V),_t=nt.labelRank;if(ze!==_e+1){for(B.removeEdge(V),le=0,++_e;_e<ze;++le,++_e)nt.points=[],oe={width:0,height:0,edgeLabel:nt,edgeObj:V,rank:_e},re=gi.addDummyNode(B,"edge",oe,"_d"),_e===_t&&(oe.width=nt.width,oe.height=nt.height,oe.dummy="edge-label",oe.labelpos=nt.labelpos),B.setEdge(ge,re,{weight:nt.weight},Be),le===0&&B.graph().dummyChains.push(re),ge=re;B.setEdge(ge,Ne,{weight:nt.weight},Be)}})(f,w)})},undo:function(f){ht.forEach(f.graph().dummyChains,function(w){var B,V=f.node(w),re=V.edgeLabel;for(f.setEdge(V.edgeObj,re);V.dummy;)B=f.successors(w)[0],f.removeNode(w),re.points.push({x:V.x,y:V.y}),V.dummy==="edge-label"&&(re.x=V.x,re.y=V.y,re.width=V.width,re.height=V.height),w=B,V=f.node(w)})}},Xo=function(f){var w={};ht.forEach(f.sources(),function B(V){var re=f.node(V);if(ht.has(w,V))return re.rank;w[V]=!0;var oe=ht.min(ht.map(f.outEdges(V),function(le){return B(le.w)-f.edge(le).minlen}));return oe!==Number.POSITIVE_INFINITY&&oe!=null||(oe=0),re.rank=oe})},Js=function(f,w){return f.node(w.w).rank-f.node(w.v).rank-f.edge(w).minlen},ta=zn.Graph,qi=Js,Tu=function(f){var w,B,V=new ta({directed:!1}),re=f.nodes()[0],oe=f.nodeCount();for(V.setNode(re,{});qs(V,f)<oe;)w=jo(V,f),B=V.hasNode(w.v)?qi(f,w):-qi(f,w),eu(V,f,B);return V};function qs(f,w){return ht.forEach(f.nodes(),function B(V){ht.forEach(w.nodeEdges(V),function(re){var oe=re.v,le=V===oe?re.w:oe;f.hasNode(le)||qi(w,re)||(f.setNode(le,{}),f.setEdge(V,le,{}),B(le))})}),f.nodeCount()}function jo(f,w){return ht.minBy(w.edges(),function(B){if(f.hasNode(B.v)!==f.hasNode(B.w))return qi(w,B)})}function eu(f,w,B){ht.forEach(f.nodes(),function(V){w.node(V).rank+=B})}var Rf=Js,Bf=Xo,af=zn.alg.preorder,ua=zn.alg.postorder,bc=gi.simplify,ss=uo;function uo(f){f=bc(f),Bf(f);var w,B=Tu(f);for(Ff(B),Ec(B,f);w=wc(B);)tu(B,f,w,Gc(B,f,w))}function Ec(f,w){var B=ua(f,f.nodes());B=B.slice(0,B.length-1),ht.forEach(B,function(V){(function(re,oe,le){var ge=re.node(le).parent;re.edge(le,ge).cutvalue=Fc(re,oe,le)})(f,w,V)})}function Fc(f,w,B){var V=f.node(B).parent,re=!0,oe=w.edge(B,V),le=0;return oe||(re=!1,oe=w.edge(V,B)),le=oe.weight,ht.forEach(w.nodeEdges(B),function(ge){var _e,Ne,ze=ge.v===B,Be=ze?ge.w:ge.v;if(Be!==V){var nt=ze===re,_t=w.edge(ge).weight;if(le+=nt?_t:-_t,_e=B,Ne=Be,f.hasEdge(_e,Ne)){var tr=f.edge(B,Be).cutvalue;le+=nt?-tr:tr}}}),le}function Ff(f,w){arguments.length<2&&(w=f.nodes()[0]),xc(f,{},1,w)}function xc(f,w,B,V,re){var oe=B,le=f.node(V);return w[V]=!0,ht.forEach(f.neighbors(V),function(ge){ht.has(w,ge)||(B=xc(f,w,B,ge,V))}),le.low=oe,le.lim=B++,re?le.parent=re:delete le.parent,B}function wc(f){return ht.find(f.edges(),function(w){return f.edge(w).cutvalue<0})}function Gc(f,w,B){var V=B.v,re=B.w;w.hasEdge(V,re)||(V=B.w,re=B.v);var oe=f.node(V),le=f.node(re),ge=oe,_e=!1;oe.lim>le.lim&&(ge=le,_e=!0);var Ne=ht.filter(w.edges(),function(ze){return _e===Sc(f,f.node(ze.v),ge)&&_e!==Sc(f,f.node(ze.w),ge)});return ht.minBy(Ne,function(ze){return Rf(w,ze)})}function tu(f,w,B,V){var re=B.v,oe=B.w;f.removeEdge(re,oe),f.setEdge(V.v,V.w,{}),Ff(f),Ec(f,w),function(le,ge){var _e=ht.find(le.nodes(),function(ze){return!ge.node(ze).parent}),Ne=af(le,_e);Ne=Ne.slice(1),ht.forEach(Ne,function(ze){var Be=le.node(ze).parent,nt=ge.edge(ze,Be),_t=!1;nt||(nt=ge.edge(Be,ze),_t=!0),ge.node(ze).rank=ge.node(Be).rank+(_t?nt.minlen:-nt.minlen)})}(f,w)}function Sc(f,w,B){return B.low<=w.lim&&w.lim<=B.lim}uo.initLowLimValues=Ff,uo.initCutValues=Ec,uo.calcCutValue=Fc,uo.leaveEdge=wc,uo.enterEdge=Gc,uo.exchangeEdges=tu;var _c=Xo,cl=function(f){switch(f.graph().ranker){case"network-simplex":zc(f);break;case"tight-tree":(function(w){_c(w),Tu(w)})(f);break;case"longest-path":Vo(f);break;default:zc(f)}},Vo=_c;function zc(f){ss(f)}var ll=function(f){var w=function(B){var V={},re=0;function oe(le){var ge=re;ht.forEach(B.children(le),oe),V[le]={low:ge,lim:re++}}return ht.forEach(B.children(),oe),V}(f);ht.forEach(f.graph().dummyChains,function(B){for(var V=f.node(B),re=V.edgeObj,oe=function(Be,nt,_t,tr){var Pt,kt,Dt=[],pr=[],Xr=Math.min(nt[_t].low,nt[tr].low),Or=Math.max(nt[_t].lim,nt[tr].lim);Pt=_t;do Pt=Be.parent(Pt),Dt.push(Pt);while(Pt&&(nt[Pt].low>Xr||Or>nt[Pt].lim));for(kt=Pt,Pt=tr;(Pt=Be.parent(Pt))!==kt;)pr.push(Pt);return{path:Dt.concat(pr.reverse()),lca:kt}}(f,w,re.v,re.w),le=oe.path,ge=oe.lca,_e=0,Ne=le[_e],ze=!0;B!==re.w;){if(V=f.node(B),ze){for(;(Ne=le[_e])!==ge&&f.node(Ne).maxRank<V.rank;)_e++;Ne===ge&&(ze=!1)}if(!ze){for(;_e<le.length-1&&f.node(Ne=le[_e+1]).minRank<=V.rank;)_e++;Ne=le[_e]}f.setParent(B,Ne),B=f.successors(B)[0]}})},Uc={run:function(f){var w=gi.addDummyNode(f,"root",{},"_root"),B=function(le){var ge={};function _e(Ne,ze){var Be=le.children(Ne);Be&&Be.length&&ht.forEach(Be,function(nt){_e(nt,ze+1)}),ge[Ne]=ze}return ht.forEach(le.children(),function(Ne){_e(Ne,1)}),ge}(f),V=ht.max(ht.values(B))-1,re=2*V+1;f.graph().nestingRoot=w,ht.forEach(f.edges(),function(le){f.edge(le).minlen*=re});var oe=function(le){return ht.reduce(le.edges(),function(ge,_e){return ge+le.edge(_e).weight},0)}(f)+1;ht.forEach(f.children(),function(le){Wc(f,w,re,oe,V,B,le)}),f.graph().nodeRankFactor=re},cleanup:function(f){var w=f.graph();f.removeNode(w.nestingRoot),delete w.nestingRoot,ht.forEach(f.edges(),function(B){f.edge(B).nestingEdge&&f.removeEdge(B)})}};function Wc(f,w,B,V,re,oe,le){var ge=f.children(le);if(ge.length){var _e=gi.addBorderNode(f,"_bt"),Ne=gi.addBorderNode(f,"_bb"),ze=f.node(le);f.setParent(_e,le),ze.borderTop=_e,f.setParent(Ne,le),ze.borderBottom=Ne,ht.forEach(ge,function(Be){Wc(f,w,B,V,re,oe,Be);var nt=f.node(Be),_t=nt.borderTop?nt.borderTop:Be,tr=nt.borderBottom?nt.borderBottom:Be,Pt=nt.borderTop?V:2*V,kt=_t!==tr?1:re-oe[le]+1;f.setEdge(_e,_t,{weight:Pt,minlen:kt,nestingEdge:!0}),f.setEdge(tr,Ne,{weight:Pt,minlen:kt,nestingEdge:!0})}),f.parent(le)||f.setEdge(w,_e,{weight:0,minlen:re+oe[le]})}else le!==w&&f.setEdge(w,le,{weight:0,minlen:B})}var dl=function(f){ht.forEach(f.children(),function w(B){var V=f.children(B),re=f.node(B);if(V.length&&ht.forEach(V,w),ht.has(re,"minRank")){re.borderLeft=[],re.borderRight=[];for(var oe=re.minRank,le=re.maxRank+1;oe<le;++oe)Xc(f,"borderLeft","_bl",B,re,oe),Xc(f,"borderRight","_br",B,re,oe)}})};function Xc(f,w,B,V,re,oe){var le={width:0,height:0,rank:oe,borderType:w},ge=re[w][oe-1],_e=gi.addDummyNode(f,"border",le,B);re[w][oe]=_e,f.setParent(_e,V),ge&&f.setEdge(ge,_e,{weight:1})}var jc={adjust:function(f){var w=f.graph().rankdir.toLowerCase();w!=="lr"&&w!=="rl"||ru(f)},undo:function(f){var w=f.graph().rankdir.toLowerCase();w!=="bt"&&w!=="rl"||function(B){ht.forEach(B.nodes(),function(V){zf(B.node(V))}),ht.forEach(B.edges(),function(V){var re=B.edge(V);ht.forEach(re.points,zf),ht.has(re,"y")&&zf(re)})}(f),w!=="lr"&&w!=="rl"||(function(B){ht.forEach(B.nodes(),function(V){Iu(B.node(V))}),ht.forEach(B.edges(),function(V){var re=B.edge(V);ht.forEach(re.points,Iu),ht.has(re,"x")&&Iu(re)})}(f),ru(f))}};function ru(f){ht.forEach(f.nodes(),function(w){Gf(f.node(w))}),ht.forEach(f.edges(),function(w){Gf(f.edge(w))})}function Gf(f){var w=f.width;f.width=f.height,f.height=w}function zf(f){f.y=-f.y}function Iu(f){var w=f.x;f.x=f.y,f.y=w}var nu=function(f){var w={},B=ht.filter(f.nodes(),function(ge){return!f.children(ge).length}),V=ht.max(ht.map(B,function(ge){return f.node(ge).rank})),re=ht.map(ht.range(V+1),function(){return[]});function oe(ge){if(!ht.has(w,ge)){w[ge]=!0;var _e=f.node(ge);re[_e.rank].push(ge),ht.forEach(f.successors(ge),oe)}}var le=ht.sortBy(B,function(ge){return f.node(ge).rank});return ht.forEach(le,oe),re},Uf=function(f,w){for(var B=0,V=1;V<w.length;++V)B+=Wf(f,w[V-1],w[V]);return B};function Wf(f,w,B){for(var V=ht.zipObject(B,ht.map(B,function(Ne,ze){return ze})),re=ht.flatten(ht.map(w,function(Ne){return ht.sortBy(ht.map(f.outEdges(Ne),function(ze){return{pos:V[ze.w],weight:f.edge(ze).weight}}),"pos")}),!0),oe=1;oe<B.length;)oe<<=1;var le=2*oe-1;oe-=1;var ge=ht.map(new Array(le),function(){return 0}),_e=0;return ht.forEach(re.forEach(function(Ne){var ze=Ne.pos+oe;ge[ze]+=Ne.weight;for(var Be=0;ze>0;)ze%2&&(Be+=ge[ze+1]),ge[ze=ze-1>>1]+=Ne.weight;_e+=Ne.weight*Be})),_e}var Mc=function(f,w){return ht.map(w,function(B){var V=f.inEdges(B);if(V.length){var re=ht.reduce(V,function(oe,le){var ge=f.edge(le),_e=f.node(le.v);return{sum:oe.sum+ge.weight*_e.order,weight:oe.weight+ge.weight}},{sum:0,weight:0});return{v:B,barycenter:re.sum/re.weight,weight:re.weight}}return{v:B}})},Xf=function(f,w){var B={};return ht.forEach(f,function(V,re){var oe=B[V.v]={indegree:0,in:[],out:[],vs:[V.v],i:re};ht.isUndefined(V.barycenter)||(oe.barycenter=V.barycenter,oe.weight=V.weight)}),ht.forEach(w.edges(),function(V){var re=B[V.v],oe=B[V.w];ht.isUndefined(re)||ht.isUndefined(oe)||(oe.indegree++,re.out.push(B[V.w]))}),function(V){var re=[];function oe(_e){return function(Ne){Ne.merged||(ht.isUndefined(Ne.barycenter)||ht.isUndefined(_e.barycenter)||Ne.barycenter>=_e.barycenter)&&function(ze,Be){var nt=0,_t=0;ze.weight&&(nt+=ze.barycenter*ze.weight,_t+=ze.weight),Be.weight&&(nt+=Be.barycenter*Be.weight,_t+=Be.weight),ze.vs=Be.vs.concat(ze.vs),ze.barycenter=nt/_t,ze.weight=_t,ze.i=Math.min(Be.i,ze.i),Be.merged=!0}(_e,Ne)}}function le(_e){return function(Ne){Ne.in.push(_e),--Ne.indegree==0&&V.push(Ne)}}for(;V.length;){var ge=V.pop();re.push(ge),ht.forEach(ge.in.reverse(),oe(ge)),ht.forEach(ge.out,le(ge))}return ht.map(ht.filter(re,function(_e){return!_e.merged}),function(_e){return ht.pick(_e,["vs","i","barycenter","weight"])})}(ht.filter(B,function(V){return!V.indegree}))},Au=function(f,w){var B=gi.partition(f,function(Be){return ht.has(Be,"barycenter")}),V=B.lhs,re=ht.sortBy(B.rhs,function(Be){return-Be.i}),oe=[],le=0,ge=0,_e=0;V.sort((Ne=!!w,function(Be,nt){return Be.barycenter<nt.barycenter?-1:Be.barycenter>nt.barycenter?1:Ne?nt.i-Be.i:Be.i-nt.i})),_e=of(oe,re,_e),ht.forEach(V,function(Be){_e+=Be.vs.length,oe.push(Be.vs),le+=Be.barycenter*Be.weight,ge+=Be.weight,_e=of(oe,re,_e)});var Ne,ze={vs:ht.flatten(oe,!0)};return ge&&(ze.barycenter=le/ge,ze.weight=ge),ze};function of(f,w,B){for(var V;w.length&&(V=ht.last(w)).i<=B;)w.pop(),f.push(V.vs),B++;return B}var Cc=function f(w,B,V,re){var oe=w.children(B),le=w.node(B),ge=le?le.borderLeft:void 0,_e=le?le.borderRight:void 0,Ne={};ge&&(oe=ht.filter(oe,function(Pt){return Pt!==ge&&Pt!==_e}));var ze=Mc(w,oe);ht.forEach(ze,function(Pt){if(w.children(Pt.v).length){var kt=f(w,Pt.v,V,re);Ne[Pt.v]=kt,ht.has(kt,"barycenter")&&(Dt=Pt,pr=kt,ht.isUndefined(Dt.barycenter)?(Dt.barycenter=pr.barycenter,Dt.weight=pr.weight):(Dt.barycenter=(Dt.barycenter*Dt.weight+pr.barycenter*pr.weight)/(Dt.weight+pr.weight),Dt.weight+=pr.weight))}var Dt,pr});var Be=Xf(ze,V);(function(Pt,kt){ht.forEach(Pt,function(Dt){Dt.vs=ht.flatten(Dt.vs.map(function(pr){return kt[pr]?kt[pr].vs:pr}),!0)})})(Be,Ne);var nt=Au(Be,re);if(ge&&(nt.vs=ht.flatten([ge,nt.vs,_e],!0),w.predecessors(ge).length)){var _t=w.node(w.predecessors(ge)[0]),tr=w.node(w.predecessors(_e)[0]);ht.has(nt,"barycenter")||(nt.barycenter=0,nt.weight=0),nt.barycenter=(nt.barycenter*nt.weight+_t.order+tr.order)/(nt.weight+2),nt.weight+=2}return nt},jf=zn.Graph,sf=function(f,w,B){var V=function(oe){for(var le;oe.hasNode(le=ht.uniqueId("_root")););return le}(f),re=new jf({compound:!0}).setGraph({root:V}).setDefaultNodeLabel(function(oe){return f.node(oe)});return ht.forEach(f.nodes(),function(oe){var le=f.node(oe),ge=f.parent(oe);(le.rank===w||le.minRank<=w&&w<=le.maxRank)&&(re.setNode(oe),re.setParent(oe,ge||V),ht.forEach(f[B](oe),function(_e){var Ne=_e.v===oe?_e.w:_e.v,ze=re.edge(Ne,oe),Be=ht.isUndefined(ze)?0:ze.weight;re.setEdge(Ne,oe,{weight:f.edge(_e).weight+Be})}),ht.has(le,"minRank")&&re.setNode(oe,{borderLeft:le.borderLeft[w],borderRight:le.borderRight[w]}))}),re},uf=function(f,w,B){var V,re={};ht.forEach(B,function(oe){for(var le,ge,_e=f.parent(oe);_e;){if((le=f.parent(_e))?(ge=re[le],re[le]=_e):(ge=V,V=_e),ge&&ge!==_e)return void w.setEdge(ge,_e);_e=le}})},Ou=zn.Graph,ff=function(f){var w=gi.maxRank(f),B=Lu(f,ht.range(1,w+1),"inEdges"),V=Lu(f,ht.range(w-1,-1,-1),"outEdges"),re=nu(f);Cs(f,re);for(var oe,le=Number.POSITIVE_INFINITY,ge=0,_e=0;_e<4;++ge,++_e){Du(ge%2?B:V,ge%4>=2),re=gi.buildLayerMatrix(f);var Ne=Uf(f,re);Ne<le&&(_e=0,oe=ht.cloneDeep(re),le=Ne)}Cs(f,oe)};function Lu(f,w,B){return ht.map(w,function(V){return sf(f,V,B)})}function Du(f,w){var B=new Ou;ht.forEach(f,function(V){var re=V.graph().root,oe=Cc(V,re,B,w);ht.forEach(oe.vs,function(le,ge){V.node(le).order=ge}),uf(V,B,oe.vs)})}function Cs(f,w){ht.forEach(w,function(B){ht.forEach(B,function(V,re){f.node(V).order=re})})}var Tc=zn.Graph,cf=function(f){var w,B=gi.buildLayerMatrix(f),V=ht.merge(au(f,B),Vf(f,B)),re={};ht.forEach(["u","d"],function(le){w=le==="u"?B:ht.values(B).reverse(),ht.forEach(["l","r"],function(ge){ge==="r"&&(w=ht.map(w,function(Be){return ht.values(Be).reverse()}));var _e=(le==="u"?f.predecessors:f.successors).bind(f),Ne=aa(f,w,V,_e),ze=vl(f,w,Ne.root,Ne.align,ge==="r");ge==="r"&&(ze=ht.mapValues(ze,function(Be){return-Be})),re[le+ge]=ze})});var oe=si(f,re);return Vc(re,oe),Ic(re,f.graph().align)};function au(f,w){var B={};return ht.reduce(w,function(V,re){var oe=0,le=0,ge=V.length,_e=ht.last(re);return ht.forEach(re,function(Ne,ze){var Be=function(_t,tr){if(_t.node(tr).dummy)return ht.find(_t.predecessors(tr),function(Pt){return _t.node(Pt).dummy})}(f,Ne),nt=Be?f.node(Be).order:ge;(Be||Ne===_e)&&(ht.forEach(re.slice(le,ze+1),function(_t){ht.forEach(f.predecessors(_t),function(tr){var Pt=f.node(tr),kt=Pt.order;!(kt<oe||nt<kt)||Pt.dummy&&f.node(_t).dummy||Yf(B,tr,_t)})}),le=ze+1,oe=nt)}),re}),B}function Vf(f,w){var B={};function V(re,oe,le,ge,_e){var Ne;ht.forEach(ht.range(oe,le),function(ze){Ne=re[ze],f.node(Ne).dummy&&ht.forEach(f.predecessors(Ne),function(Be){var nt=f.node(Be);nt.dummy&&(nt.order<ge||nt.order>_e)&&Yf(B,Be,Ne)})})}return ht.reduce(w,function(re,oe){var le,ge=-1,_e=0;return ht.forEach(oe,function(Ne,ze){if(f.node(Ne).dummy==="border"){var Be=f.predecessors(Ne);Be.length&&(le=f.node(Be[0]).order,V(oe,_e,ze,ge,le),_e=ze,ge=le)}V(oe,_e,oe.length,le,re.length)}),oe}),B}function Yf(f,w,B){if(w>B){var V=w;w=B,B=V}var re=f[w];re||(f[w]=re={}),re[B]=!0}function hl(f,w,B){if(w>B){var V=w;w=B,B=V}return ht.has(f[w],B)}function aa(f,w,B,V){var re={},oe={},le={};return ht.forEach(w,function(ge){ht.forEach(ge,function(_e,Ne){re[_e]=_e,oe[_e]=_e,le[_e]=Ne})}),ht.forEach(w,function(ge){var _e=-1;ht.forEach(ge,function(Ne){var ze=V(Ne);if(ze.length)for(var Be=((ze=ht.sortBy(ze,function(Pt){return le[Pt]})).length-1)/2,nt=Math.floor(Be),_t=Math.ceil(Be);nt<=_t;++nt){var tr=ze[nt];oe[Ne]===Ne&&_e<le[tr]&&!hl(B,Ne,tr)&&(oe[tr]=Ne,oe[Ne]=re[Ne]=re[tr],_e=le[tr])}})}),{root:re,align:oe}}function vl(f,w,B,V,re){var oe={},le=function(Ne,ze,Be,nt){var _t=new Tc,tr=Ne.graph(),Pt=function(kt,Dt,pr){return function(Xr,Or,fn){var cn,Mn=Xr.node(Or),Un=Xr.node(fn),kn=0;if(kn+=Mn.width/2,ht.has(Mn,"labelpos"))switch(Mn.labelpos.toLowerCase()){case"l":cn=-Mn.width/2;break;case"r":cn=Mn.width/2}if(cn&&(kn+=pr?cn:-cn),cn=0,kn+=(Mn.dummy?Dt:kt)/2,kn+=(Un.dummy?Dt:kt)/2,kn+=Un.width/2,ht.has(Un,"labelpos"))switch(Un.labelpos.toLowerCase()){case"l":cn=Un.width/2;break;case"r":cn=-Un.width/2}return cn&&(kn+=pr?cn:-cn),cn=0,kn}}(tr.nodesep,tr.edgesep,nt);return ht.forEach(ze,function(kt){var Dt;ht.forEach(kt,function(pr){var Xr=Be[pr];if(_t.setNode(Xr),Dt){var Or=Be[Dt],fn=_t.edge(Or,Xr);_t.setEdge(Or,Xr,Math.max(Pt(Ne,pr,Dt),fn||0))}Dt=pr})}),_t}(f,w,B,re),ge=re?"borderLeft":"borderRight";function _e(Ne,ze){for(var Be=le.nodes(),nt=Be.pop(),_t={};nt;)_t[nt]?Ne(nt):(_t[nt]=!0,Be.push(nt),Be=Be.concat(ze(nt))),nt=Be.pop()}return _e(function(Ne){oe[Ne]=le.inEdges(Ne).reduce(function(ze,Be){return Math.max(ze,oe[Be.v]+le.edge(Be))},0)},le.predecessors.bind(le)),_e(function(Ne){var ze=le.outEdges(Ne).reduce(function(nt,_t){return Math.min(nt,oe[_t.w]-le.edge(_t))},Number.POSITIVE_INFINITY),Be=f.node(Ne);ze!==Number.POSITIVE_INFINITY&&Be.borderType!==ge&&(oe[Ne]=Math.max(oe[Ne],ze))},le.successors.bind(le)),ht.forEach(V,function(Ne){oe[Ne]=oe[B[Ne]]}),oe}function si(f,w){return ht.minBy(ht.values(w),function(B){var V=Number.NEGATIVE_INFINITY,re=Number.POSITIVE_INFINITY;return ht.forIn(B,function(oe,le){var ge=function(_e,Ne){return _e.node(Ne).width}(f,le)/2;V=Math.max(oe+ge,V),re=Math.min(oe-ge,re)}),V-re})}function Vc(f,w){var B=ht.values(w),V=ht.min(B),re=ht.max(B);ht.forEach(["u","d"],function(oe){ht.forEach(["l","r"],function(le){var ge,_e=oe+le,Ne=f[_e];if(Ne!==w){var ze=ht.values(Ne);(ge=le==="l"?V-ht.min(ze):re-ht.max(ze))&&(f[_e]=ht.mapValues(Ne,function(Be){return Be+ge}))}})})}function Ic(f,w){return ht.mapValues(f.ul,function(B,V){if(w)return f[w.toLowerCase()][V];var re=ht.sortBy(ht.map(f,V));return(re[1]+re[2])/2})}var Yc=cf,gl=function(f){(function(w){var B=gi.buildLayerMatrix(w),V=w.graph().ranksep,re=0;ht.forEach(B,function(oe){var le=ht.max(ht.map(oe,function(ge){return w.node(ge).height}));ht.forEach(oe,function(ge){w.node(ge).y=re+le/2}),re+=le+V})})(f=gi.asNonCompoundGraph(f)),ht.forEach(Yc(f),function(w,B){f.node(B).x=w})},Hc=gi.normalizeRanks,Hf=gi.removeEmptyRanks,Ti=gi,Zc=zn.Graph,Nu=function(f,w){var B=w&&w.debugTiming?Ti.time:Ti.notime;B("layout",function(){var V=B(" buildLayoutGraph",function(){return function(re){var oe=new Zc({multigraph:!0,compound:!0}),le=Qf(re.graph());return oe.setGraph(ht.merge({},Zf,Li(le,Ts),ht.pick(le,Kf))),ht.forEach(re.nodes(),function(ge){var _e=Qf(re.node(ge));oe.setNode(ge,ht.defaults(Li(_e,$f),Kc)),oe.setParent(ge,re.parent(ge))}),ht.forEach(re.edges(),function(ge){var _e=Qf(re.edge(ge));oe.setEdge(ge,ht.merge({},Is,Li(_e,Yi),ht.pick(_e,Ja)))}),oe}(f)});B(" runLayout",function(){(function(re,oe){oe(" makeSpaceForEdgeLabels",function(){(function(le){var ge=le.graph();ge.ranksep/=2,ht.forEach(le.edges(),function(_e){var Ne=le.edge(_e);Ne.minlen*=2,Ne.labelpos.toLowerCase()!=="c"&&(ge.rankdir==="TB"||ge.rankdir==="BT"?Ne.width+=Ne.labeloffset:Ne.height+=Ne.labeloffset)})})(re)}),oe(" removeSelfEdges",function(){(function(le){ht.forEach(le.edges(),function(ge){if(ge.v===ge.w){var _e=le.node(ge.v);_e.selfEdges||(_e.selfEdges=[]),_e.selfEdges.push({e:ge,label:le.edge(ge)}),le.removeEdge(ge)}})})(re)}),oe(" acyclic",function(){oi.run(re)}),oe(" nestingGraph.run",function(){Uc.run(re)}),oe(" rank",function(){cl(Ti.asNonCompoundGraph(re))}),oe(" injectEdgeLabelProxies",function(){(function(le){ht.forEach(le.edges(),function(ge){var _e=le.edge(ge);if(_e.width&&_e.height){var Ne=le.node(ge.v),ze={rank:(le.node(ge.w).rank-Ne.rank)/2+Ne.rank,e:ge};Ti.addDummyNode(le,"edge-proxy",ze,"_ep")}})})(re)}),oe(" removeEmptyRanks",function(){Hf(re)}),oe(" nestingGraph.cleanup",function(){Uc.cleanup(re)}),oe(" normalizeRanks",function(){Hc(re)}),oe(" assignRankMinMax",function(){(function(le){var ge=0;ht.forEach(le.nodes(),function(_e){var Ne=le.node(_e);Ne.borderTop&&(Ne.minRank=le.node(Ne.borderTop).rank,Ne.maxRank=le.node(Ne.borderBottom).rank,ge=ht.max(ge,Ne.maxRank))}),le.graph().maxRank=ge})(re)}),oe(" removeEdgeLabelProxies",function(){(function(le){ht.forEach(le.nodes(),function(ge){var _e=le.node(ge);_e.dummy==="edge-proxy"&&(le.edge(_e.e).labelRank=_e.rank,le.removeNode(ge))})})(re)}),oe(" normalize.run",function(){nf.run(re)}),oe(" parentDummyChains",function(){ll(re)}),oe(" addBorderSegments",function(){dl(re)}),oe(" order",function(){ff(re)}),oe(" insertSelfEdges",function(){(function(le){var ge=Ti.buildLayerMatrix(le);ht.forEach(ge,function(_e){var Ne=0;ht.forEach(_e,function(ze,Be){var nt=le.node(ze);nt.order=Be+Ne,ht.forEach(nt.selfEdges,function(_t){Ti.addDummyNode(le,"selfedge",{width:_t.label.width,height:_t.label.height,rank:nt.rank,order:Be+ ++Ne,e:_t.e,label:_t.label},"_se")}),delete nt.selfEdges})})})(re)}),oe(" adjustCoordinateSystem",function(){jc.adjust(re)}),oe(" position",function(){gl(re)}),oe(" positionSelfEdges",function(){(function(le){ht.forEach(le.nodes(),function(ge){var _e=le.node(ge);if(_e.dummy==="selfedge"){var Ne=le.node(_e.e.v),ze=Ne.x+Ne.width/2,Be=Ne.y,nt=_e.x-ze,_t=Ne.height/2;le.setEdge(_e.e,_e.label),le.removeNode(ge),_e.label.points=[{x:ze+2*nt/3,y:Be-_t},{x:ze+5*nt/6,y:Be-_t},{x:ze+nt,y:Be},{x:ze+5*nt/6,y:Be+_t},{x:ze+2*nt/3,y:Be+_t}],_e.label.x=_e.x,_e.label.y=_e.y}})})(re)}),oe(" removeBorderNodes",function(){(function(le){ht.forEach(le.nodes(),function(ge){if(le.children(ge).length){var _e=le.node(ge),Ne=le.node(_e.borderTop),ze=le.node(_e.borderBottom),Be=le.node(ht.last(_e.borderLeft)),nt=le.node(ht.last(_e.borderRight));_e.width=Math.abs(nt.x-Be.x),_e.height=Math.abs(ze.y-Ne.y),_e.x=Be.x+_e.width/2,_e.y=Ne.y+_e.height/2}}),ht.forEach(le.nodes(),function(ge){le.node(ge).dummy==="border"&&le.removeNode(ge)})})(re)}),oe(" normalize.undo",function(){nf.undo(re)}),oe(" fixupEdgeLabelCoords",function(){(function(le){ht.forEach(le.edges(),function(ge){var _e=le.edge(ge);if(ht.has(_e,"x"))switch(_e.labelpos!=="l"&&_e.labelpos!=="r"||(_e.width-=_e.labeloffset),_e.labelpos){case"l":_e.x-=_e.width/2+_e.labeloffset;break;case"r":_e.x+=_e.width/2+_e.labeloffset}})})(re)}),oe(" undoCoordinateSystem",function(){jc.undo(re)}),oe(" translateGraph",function(){(function(le){var ge=Number.POSITIVE_INFINITY,_e=0,Ne=Number.POSITIVE_INFINITY,ze=0,Be=le.graph(),nt=Be.marginx||0,_t=Be.marginy||0;function tr(Pt){var kt=Pt.x,Dt=Pt.y,pr=Pt.width,Xr=Pt.height;ge=Math.min(ge,kt-pr/2),_e=Math.max(_e,kt+pr/2),Ne=Math.min(Ne,Dt-Xr/2),ze=Math.max(ze,Dt+Xr/2)}ht.forEach(le.nodes(),function(Pt){tr(le.node(Pt))}),ht.forEach(le.edges(),function(Pt){var kt=le.edge(Pt);ht.has(kt,"x")&&tr(kt)}),ge-=nt,Ne-=_t,ht.forEach(le.nodes(),function(Pt){var kt=le.node(Pt);kt.x-=ge,kt.y-=Ne}),ht.forEach(le.edges(),function(Pt){var kt=le.edge(Pt);ht.forEach(kt.points,function(Dt){Dt.x-=ge,Dt.y-=Ne}),ht.has(kt,"x")&&(kt.x-=ge),ht.has(kt,"y")&&(kt.y-=Ne)}),Be.width=_e-ge+nt,Be.height=ze-Ne+_t})(re)}),oe(" assignNodeIntersects",function(){(function(le){ht.forEach(le.edges(),function(ge){var _e,Ne,ze=le.edge(ge),Be=le.node(ge.v),nt=le.node(ge.w);ze.points?(_e=ze.points[0],Ne=ze.points[ze.points.length-1]):(ze.points=[],_e=nt,Ne=Be),ze.points.unshift(Ti.intersectRect(Be,_e)),ze.points.push(Ti.intersectRect(nt,Ne))})})(re)}),oe(" reversePoints",function(){(function(le){ht.forEach(le.edges(),function(ge){var _e=le.edge(ge);_e.reversed&&_e.points.reverse()})})(re)}),oe(" acyclic.undo",function(){oi.undo(re)})})(V,B)}),B(" updateInputGraph",function(){(function(re,oe){ht.forEach(re.nodes(),function(le){var ge=re.node(le),_e=oe.node(le);ge&&(ge.x=_e.x,ge.y=_e.y,oe.children(le).length&&(ge.width=_e.width,ge.height=_e.height))}),ht.forEach(re.edges(),function(le){var ge=re.edge(le),_e=oe.edge(le);ge.points=_e.points,ht.has(_e,"x")&&(ge.x=_e.x,ge.y=_e.y)}),re.graph().width=oe.graph().width,re.graph().height=oe.graph().height})(f,V)})})},Ts=["nodesep","edgesep","ranksep","marginx","marginy"],Zf={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Kf=["acyclicer","ranker","rankdir","align"],$f=["width","height"],Kc={width:0,height:0},Yi=["minlen","weight","width","height","labeloffset"],Is={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ja=["labelpos"];function Li(f,w){return ht.mapValues(ht.pick(f,w),Number)}function Qf(f){var w={};return ht.forEach(f,function(B,V){w[V.toLowerCase()]=B}),w}var pl=zn.Graph,Ao={graphlib:zn,layout:Nu,debug:{debugOrdering:function(f){var w=gi.buildLayerMatrix(f),B=new pl({compound:!0,multigraph:!0}).setGraph({});return ht.forEach(f.nodes(),function(V){B.setNode(V,{label:V}),B.setParent(V,"layer"+f.node(V).rank)}),ht.forEach(f.edges(),function(V){B.setEdge(V.v,V.w,{},V.name)}),ht.forEach(w,function(V,re){var oe="layer"+re;B.setNode(oe,{rank:"same"}),ht.reduce(V,function(le,ge){return B.setEdge(le,ge,{style:"invis"}),ge})}),B}},util:{time:gi.time,notime:gi.notime},version:"0.8.5"},yl=Ao.graphlib,$c=Ao.layout;class Qc{constructor(w){this.cardinality=1,this.include=x.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=T.NODE,this.name=w.name,this.attr=w.attr||{},this.inputs=w.inputs,this.path=w.path||[],this.width=w.width,this.height=w.height}}class ml{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}function bl(f){const w=new ml;return f.nodes.map(B=>new Qc(B)).forEach(B=>{w.nodes[B.name]=B,B.inputs.forEach(V=>{(function(re,oe,le){le.name!==oe.name&&re.edges.push(Object.assign(Object.assign({},le.attr),{v:le.name,w:oe.name}))})(w,B,V)})}),w}class Ac{constructor(w,B={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=x.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=T.META,this.path=[],this.name=w,this.metaGraph=qf(w,p.META,B)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map(w=>this.metaGraph.node(w))}leaves(){let w,B=[],V=[this];for(;V.length;){let re=V.shift();re.isGroupNode?(w=re.metaGraph,w.nodes().forEach(oe=>V.push(w.node(oe)))):B.push(re.name)}return B}}class Jf{constructor(w,B){this.v=w,this.w=B,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(w,B){this.baseEdgeList.push(w)}}function Oc(f,w={}){return new Ac(f,w)}function Lc(f,w){return new Jf(f,w)}function qf(f,w,B){const V=B||{},re=new yl.Graph(V);return re.setGraph({name:f,rankdir:V.rankdir,type:w,align:V.align}),re}class Jc{constructor(w={}){this.graphOptions=w,this.index={},this.graphOptions.compound=!0,this.root=Oc(_,this.graphOptions),this.index[_]=this.root}getNodeMap(){return this.index}node(w){return this.index[w]}setNode(w,B){this.index[w]=B}getBridgeGraph(w){const B=this.index[w];if(!B)throw Error("Could not find node in hierarchy: "+w);if(!("metaGraph"in B))return null;const V=B;if(V.bridgeGraph)return V.bridgeGraph;const re=qf(I,p.BRIDGE,this.graphOptions);if(V.bridgeGraph=re,!B.parentNode||!("metaGraph"in B.parentNode))return re;const oe=B.parentNode;return[oe.metaGraph,this.getBridgeGraph(oe.name)].forEach(le=>{le.edges().filter(ge=>ge.v===w||ge.w===w).forEach(ge=>{const _e=ge.w===w;le.edge(ge).baseEdgeList.forEach(Ne=>{const[ze,Be]=_e?[Ne.w,ge.v]:[Ne.v,ge.w],nt=this.getChildName(w,ze),_t={v:_e?Be:nt,w:_e?nt:Be};let tr=re.edge(_t);tr||(tr=Lc(_t.v,_t.w),tr.inbound=_e,re.setEdge(_t.v,_t.w,tr)),tr.addBaseEdge(Ne,this)})})}),re}getChildName(w,B){let V=this.index[B];for(;V;){if(V.parentNode&&V.parentNode.name===w)return V.name;V=V.parentNode}throw Error("Could not find immediate child for descendant: "+B)}getPredecessors(w){const B=this.index[w];if(!B)throw Error("Could not find node with name: "+w);return this.getOneWayEdges(B,!0)}getSuccessors(w){const B=this.index[w];if(!B)throw Error("Could not find node with name: "+w);return this.getOneWayEdges(B,!1)}getOneWayEdges(w,B){const V=[];if(!w.parentNode||!w.parentNode.isGroupNode)return V;const re=w.parentNode,oe=re.metaGraph,le=this.getBridgeGraph(re.name);return el(oe,w,B,V),el(le,w,B,V),V}}function qc(f,w){const{rankDirection:B,align:V}=w,re=new Jc({rankdir:B,align:V});return function(oe,le){Object.keys(le.nodes).forEach(ge=>{const _e=le.nodes[ge],Ne=_e.path;let ze=oe.root;ze.depth=Math.max(Ne.length,ze.depth);for(let Be=0;Be<Ne.length&&(ze.depth=Math.max(ze.depth,Ne.length-Be),ze.cardinality+=_e.cardinality,Be!==Ne.length-1);Be++){const nt=Ne[Be];let _t=oe.node(nt);_t||(_t=Oc(nt,oe.graphOptions),_t.path=_e.path.slice(0,Be+1),_t.parentNode=ze,oe.setNode(nt,_t),ze.metaGraph.setNode(nt,_t)),ze=_t}oe.setNode(_e.name,_e),_e.parentNode=ze,ze.metaGraph.setNode(_e.name,_e)})}(re,f),function(oe,le){const ge=oe.getNodeMap();let _e=[],Ne=[];const ze=(Be,nt)=>{let _t=0;for(;Be;)nt[_t++]=Be.name,Be=Be.parentNode;return _t-1};le.edges.forEach(Be=>{_e=[],Ne=[];let nt=ze(le.nodes[Be.v],_e),_t=ze(le.nodes[Be.w],Ne);for(;_e[nt]===Ne[_t];)if(nt--,_t--,nt<0||_t<0)throw Error("No difference found between ancestor paths.");const tr=ge[_e[nt+1]],Pt=_e[nt],kt=Ne[_t];let Dt=tr.metaGraph.edge(Pt,kt);Dt||(Dt=Lc(Pt,kt),tr.metaGraph.setEdge(Pt,kt,Dt)),Dt.addBaseEdge(Be,oe)})}(re,f),re}function el(f,w,B,V){(B?f.inEdges(w.name):f.outEdges(w.name)).forEach(re=>{const oe=f.edge(re);V.push(oe)})}class tl{constructor(w){this.hierarchy=w,this.index={},this.hasSubHierarchy={},this.root=new We(this.hierarchy.root,this.hierarchy.graphOptions),this.index[w.root.name]=this.root,this.buildSubHierarchy(w.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(w){if(w in this.hasSubHierarchy)return;this.hasSubHierarchy[w]=!0;const B=this.index[w];if(B.node.type!==T.META)return;const V=B,re=V.node.metaGraph,oe=V.coreGraph;re.nodes().forEach(ze=>{const Be=this.getOrCreateRenderNodeByName(ze);oe.setNode(ze,Be)}),re.edges().forEach(ze=>{const Be=re.edge(ze),nt=new he(Be);oe.setEdge(ze.v,ze.w,nt)});const le=V.node.parentNode;if(!le)return;const ge=this.getRenderNodeByName(le.name),_e=(ze,...Be)=>Be.concat([ze?"IN":"OUT"]).join("~~"),Ne=this.hierarchy.getBridgeGraph(w);Ne.edges().forEach(ze=>{const Be=Ne.edge(ze),nt=!!re.node(ze.w),[_t,tr]=nt?[ze.w,ze.v]:[ze.v,ze.w],Pt=fn=>{const cn=nt?{v:fn,w}:{v:w,w:fn};return ge.coreGraph.edge(cn)};let kt=Pt(tr);kt||(kt=Pt(_e(nt,tr,le.name)));const Dt=_e(nt,w),pr=_e(nt,tr,w);let Xr=oe.node(pr);if(!Xr){let fn=oe.node(Dt);if(!fn){const Mn={name:Dt,type:T.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:x.UNSPECIFIED,inbound:nt,attr:{}};fn=new ec(Mn),this.index[Dt]=fn,oe.setNode(Dt,fn)}const cn={name:pr,type:T.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:x.UNSPECIFIED,inbound:nt,attr:{}};Xr=new ec(cn),this.index[pr]=Xr,oe.setNode(pr,Xr),oe.setParent(pr,Dt),fn.node.cardinality++}const Or=new he(Be);Or.adjoiningMetaEdge=kt,nt?oe.setEdge(pr,_t,Or):oe.setEdge(_t,pr,Or)})}getOrCreateRenderNodeByName(w){if(!w)return null;if(w in this.index)return this.index[w];const B=this.getNodeByName(w);return B?(this.index[w]=B.isGroupNode?new We(B,this.hierarchy.graphOptions):new ec(B),this.index[w]):null}getRenderNodeByName(w){return this.index[w]}getNodeByName(w){return this.hierarchy.node(w)}}class ec{constructor(w){this.node=w,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=w.width||0,this.height=w.height||0,this.displayName=w.name,this.attr=w.attr}}class he{constructor(w){this.metaEdge=w,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class We extends ec{constructor(w,B){super(w);const V=w.metaGraph.graph();B.compound=!0,this.coreGraph=qf(V.name,p.CORE,B)}}function it(f,w){f.node.isGroupNode&&function(B,V){const re=U(V);B.coreGraph.nodes().map(oe=>B.coreGraph.node(oe)).forEach(oe=>{var le,ge,_e,Ne,ze,Be;const{height:nt,width:_t}=oe;switch(oe.node.type){case T.NODE:Object.assign(oe,re.nodeSize.node),oe.height=nt||re.nodeSize.node.height,oe.width=_t||re.nodeSize.node.width;break;case T.BRIDGE:Object.assign(oe,re.nodeSize.bridge);break;case T.META:oe.expanded?it(oe,V):(Object.assign(oe,re.nodeSize.meta),oe.height=re.nodeSize.meta.height,oe.width=re.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+oe.node.type)}if(!oe.expanded){const tr=oe.attr;(function(Pt,kt=!1){if(Pt.coreBox.width=Pt.width,Pt.coreBox.height=Pt.height,!kt){const Dt=`${Pt.displayName}`.length,pr=3;Pt.width=Math.max(Pt.coreBox.width,Dt*pr)}})(oe,V&&(oe.node.type===0&&!!(!((ge=(le=V==null?void 0:V.nodeSize)===null||le===void 0?void 0:le.meta)===null||ge===void 0)&&ge.width)||oe.node.type===1&&(!!(!((Ne=(_e=V==null?void 0:V.nodeSize)===null||_e===void 0?void 0:_e.node)===null||Ne===void 0)&&Ne.width)||!!tr.width)||oe.node.type===2&&!!(!((Be=(ze=V==null?void 0:V.nodeSize)===null||ze===void 0?void 0:ze.bridge)===null||Be===void 0)&&Be.width)))}})}(f,w),f.node.type===T.META&&function(B,V){const re=U(V),oe=re.subScene.meta;Object.assign(B,oe);const{nodeSep:le,rankSep:ge,edgeSep:_e,align:Ne}=re.graph.meta,ze={nodesep:le,ranksep:ge,edgesep:_e,align:Ne};Object.assign(B.coreBox,function(_t,tr){const{ranksep:Pt,nodesep:kt,edgesep:Dt,align:pr}=tr;Object.assign(_t.graph(),{ranksep:Pt,nodesep:kt,edgesep:Dt,align:pr});const Xr=[];if(_t.nodes().forEach(Un=>{_t.node(Un).node.type!==T.BRIDGE&&Xr.push(Un)}),!Xr.length)return{width:0,height:0};$c(_t);let Or=1/0,fn=1/0,cn=-1/0,Mn=-1/0;return Xr.forEach(Un=>{const kn=_t.node(Un),Na=.5*kn.width,Bn=kn.x-Na,Ha=kn.x+Na;Or=Bn<Or?Bn:Or,cn=Ha>cn?Ha:cn;const Aa=.5*kn.height,fa=kn.y-Aa,Wa=kn.y+Aa;fn=fa<fn?fa:fn,Mn=Wa>Mn?Wa:Mn}),_t.edges().forEach(Un=>{const kn=_t.edge(Un),Na=_t.node(kn.metaEdge.v),Bn=_t.node(kn.metaEdge.w);if(kn.points.length===3&&function(fa){let Wa=Zt(fa[0],fa[1]);for(let Za=1;Za<fa.length-1;Za++){const pi=Zt(fa[Za],fa[Za+1]);if(Math.abs(pi-Wa)>1)return!1;Wa=pi}return!0}(kn.points)){if(Na!=null){const fa=Na.expanded?Na.x:or(Na);kn.points[0].x=fa}if(Bn!=null){const fa=Bn.expanded?Bn.x:or(Bn);kn.points[2].x=fa}kn.points=[kn.points[0],kn.points[1]]}const Ha=kn.points[kn.points.length-2];Bn!=null&&(kn.points[kn.points.length-1]=Xt(Ha,Bn));const Aa=kn.points[1];Na!=null&&(kn.points[0]=Xt(Aa,Na)),kn.points.forEach(fa=>{Or=fa.x<Or?fa.x:Or,cn=fa.x>cn?fa.x:cn,fn=fa.y<fn?fa.y:fn,Mn=fa.y>Mn?fa.y:Mn})}),_t.nodes().forEach(Un=>{const kn=_t.node(Un);kn.x-=Or,kn.y-=fn}),_t.edges().forEach(Un=>{_t.edge(Un).points.forEach(kn=>{kn.x-=Or,kn.y-=fn})}),{width:cn-Or,height:Mn-fn}}(B.coreGraph,ze));let Be=0;B.coreGraph.nodeCount()>0&&Be++;const nt=Be<=1?0:Be;B.coreBox.width+=nt+nt,B.coreBox.height=oe.labelHeight+B.coreBox.height,B.width=B.coreBox.width+oe.paddingLeft+oe.paddingRight,B.height=B.paddingTop+B.coreBox.height+B.paddingBottom}(f,w)}function Zt(f,w){const B=w.x-f.x,V=w.y-f.y;return 180*Math.atan(V/B)/Math.PI}function or(f){return f.expanded?f.x:f.x-f.width/2+0+f.coreBox.width/2}function Xt(f,w){const B=w.expanded?w.x:or(w),V=w.y,re=f.x-B,oe=f.y-V;let le,ge,_e=w.expanded?w.width:w.coreBox.width,Ne=w.expanded?w.height:w.coreBox.height;return Math.abs(oe)*_e/2>Math.abs(re)*Ne/2?(oe<0&&(Ne=-Ne),le=oe===0?0:Ne/2*re/oe,ge=Ne/2):(re<0&&(_e=-_e),le=_e/2,ge=re===0?0:_e/2*oe/re),{x:B+le,y:V+ge}}function Qt(f,w,B){var V,re,oe,le;const ge=f.nodes.filter((Be,nt,_t)=>_t.findIndex(tr=>tr.id===Be.id)!==nt).map(Be=>Be.id);if(ge.length)throw new Error(`Duplicated ids found: ${ge.join(", ")}`);const _e=function(Be){const nt={nodes:[]},_t=Be.compound,tr=Object.keys(_t||{}),Pt=new Map,kt=(pr,Xr=[])=>{if(Pt.has(pr))return Pt.get(pr);for(let Or=0;Or<tr.length;Or++){let fn=tr[Or];if(_t&&_t[fn].indexOf(pr)!==-1)return Xr.unshift(fn),kt(fn,Xr)}return Xr.length===0&&Pt.set(pr,Xr),Xr},Dt=pr=>Be.edges.filter(Xr=>Xr.w===pr).map(Xr=>({name:Xr.v}));return Be.nodes.forEach(pr=>{const Xr=pr.id,Or=[...kt(Xr),Xr];let fn=Dt(Xr);nt.nodes.push({name:Xr,path:Or,inputs:fn,width:pr.width,height:pr.height,attr:Object.assign({},pr)})}),nt}(f),Ne=function(Be,nt){const _t=(Pt,kt)=>{for(let Dt of kt.values())if(Dt.includes(Pt))return!0;return!1},tr=(Pt,kt=[])=>{if(Object.keys(Pt).length===0)return[...new Set(kt)];const Dt=new Map(Object.keys(Pt).map(Xr=>[Xr,Pt[Xr]])),pr={};for(let[Xr,Or]of Dt)_t(Xr,Dt)?pr[Xr]=Or:kt=kt.concat(Xr,Or);return tr(pr,kt)};return tr(Be).filter(Pt=>nt.includes(Pt))}(f.compound||{},(w==null?void 0:w.expanded)||[]),ze=function(Be,nt){return function(_t){return new tl(_t)}(qc(bl(Be),nt))}(_e,{rankDirection:((re=(V=B==null?void 0:B.graph)===null||V===void 0?void 0:V.meta)===null||re===void 0?void 0:re.rankDir)||(w==null?void 0:w.rankDirection)||k.graph.meta.rankDir,align:((le=(oe=B==null?void 0:B.graph)===null||oe===void 0?void 0:oe.meta)===null||le===void 0?void 0:le.align)||k.graph.meta.align});return function(Be,nt){nt.forEach(_t=>{const tr=Be.getRenderInfoNodes().find(Dt=>Dt.displayName===_t);let Pt=tr&&tr.node&&tr.node.name||"";const kt=Be.getRenderNodeByName(Pt);if(!kt)throw new Error(`No nodes found: ${Pt}`);kt.expanded=!0,Be.buildSubHierarchy(Pt)})}(ze,Ne),it(ze.root,B),wr(ze.root)}function gr(f,w=!1){const B=JSON.parse(JSON.stringify(f)),V={nodes:[B],edges:[...B.edges]};return B.nodes.forEach(function re(oe){(oe.type===0||oe.type===1)&&V.nodes.push(oe),oe.type===0&&(V.edges=V.edges.concat(oe.edges)),Array.isArray(oe.nodes)&&oe.nodes.forEach(re)}),w&&V.nodes.forEach(re=>{const oe=V.nodes.find(le=>le.id===re.parentNodeName);if(oe){const le=oe.x-oe.width/2+oe.paddingLeft,ge=oe.y-oe.height/2+oe.labelHeight+oe.paddingTop;oe.id!==_&&(re.x+=le,re.y+=ge),re.type===0&&re.edges.forEach(_e=>{_e.points.forEach(Ne=>{Ne.x+=re.x-re.width/2+re.paddingLeft,Ne.y+=re.y-re.height/2+re.labelHeight+re.paddingTop})})}}),V}function Er(f,w,B,V){var re,oe;let le=[];const ge=((re=B.find(Be=>Be.id===f))===null||re===void 0?void 0:re.path)||[],_e=((oe=B.find(Be=>Be.id===w))===null||oe===void 0?void 0:oe.path)||[],Ne=[_,...ge].slice(0,ge.length).reverse(),ze=[_,..._e].slice(0,_e.length);return Ne.forEach(Be=>{const nt=B.find(_t=>_t.id===Be);le=le.concat(nt.edges.filter(_t=>_t.baseEdgeList.some(tr=>tr.v===((V==null?void 0:V.v)||f)&&tr.w===((V==null?void 0:V.w)||w))))}),ze.filter(Be=>!Ne.includes(Be)).forEach(Be=>{const nt=B.find(_t=>_t.id===Be);le=le.concat(nt.edges.filter(_t=>_t.baseEdgeList.some(tr=>tr.v===((V==null?void 0:V.v)||f)&&tr.w===((V==null?void 0:V.w)||w))))}),le}function wr(f){const w=f.coreGraph.nodes().map(V=>f.coreGraph.node(V));return Object.assign(Object.assign({},_r(f)),{expanded:f.expanded,nodes:f.expanded?(B=w,B.map(V=>V.node.type===T.META?wr(V):_r(V))):[],edges:f.expanded?Br(f):[]});var B}function _r(f){return{id:f.node.name,name:f.node.name,type:f.node.type,cardinality:f.node.cardinality,attr:f.attr,parentNodeName:f.node.parentNode?f.node.parentNode.name:null,coreBox:Object.assign({},f.coreBox),x:f.x,y:f.y,width:f.width,height:f.height,radius:f.radius,labelHeight:f.labelHeight,labelOffset:f.labelOffset,outboxWidth:f.outboxWidth,paddingLeft:f.paddingLeft,paddingTop:f.paddingTop,paddingRight:f.paddingRight,paddingBottom:f.paddingBottom,path:f.node.path}}function Br(f){return f.coreGraph.edges().map(w=>({renderInfoEdge:f.coreGraph.edge(w),edge:w})).filter(({renderInfoEdge:w})=>w.metaEdge).map(({edge:w,renderInfoEdge:B})=>{const V=function(re,oe){const le=oe.points.map(ge=>Object.assign({},ge));if(oe.adjoiningMetaEdge){const ge=oe.adjoiningMetaEdge.points,_e=oe.metaEdge.inbound,Ne=_e?ge[ge.length-1]:ge[0],ze=le[_e?0:le.length-1],Be=re.x-re.width/2,nt=re.y-re.height/2,_t=Ne.x-Be,tr=Ne.y-nt,Pt=-re.paddingLeft,kt=-(re.paddingTop+re.labelHeight);ze.x=_t+Pt,ze.y=tr+kt}return le}(f,B);return{adjoiningEdge:B.adjoiningMetaEdge?{w:B.adjoiningMetaEdge.metaEdge.w,v:B.adjoiningMetaEdge.metaEdge.v}:null,inbound:B.metaEdge.inbound,w:w.w,v:w.v,points:V,weight:B.weight,baseEdgeList:B.metaEdge.baseEdgeList,parentNodeName:f.node.name}})}},47385:function(Mt,N,F){"use strict";F.r(N),F.d(N,{glMatrix:function(){return _},mat2:function(){return I},mat2d:function(){return k},mat3:function(){return Ae},mat4:function(){return Se},quat:function(){return U},quat2:function(){return L},vec2:function(){return at},vec3:function(){return we},vec4:function(){return Te}});var k={};F.r(k),F.d(k,{add:function(){return Z},clone:function(){return x},copy:function(){return p},create:function(){return T},determinant:function(){return s},equals:function(){return fe},exactEquals:function(){return se},frob:function(){return H},fromRotation:function(){return j},fromScaling:function(){return Q},fromTranslation:function(){return G},fromValues:function(){return g},identity:function(){return v},invert:function(){return c},mul:function(){return Ie},multiply:function(){return m},multiplyScalar:function(){return K},multiplyScalarAndAdd:function(){return ne},rotate:function(){return M},scale:function(){return P},set:function(){return d},str:function(){return W},sub:function(){return ye},subtract:function(){return J},translate:function(){return R}});var U={};F.r(U),F.d(U,{add:function(){return Gr},calculateW:function(){return xt},clone:function(){return ar},conjugate:function(){return Nr},copy:function(){return Pr},create:function(){return ke},dot:function(){return Sr},equals:function(){return hr},exactEquals:function(){return Vt},exp:function(){return dt},fromEuler:function(){return It},fromMat3:function(){return Hr},fromValues:function(){return Oe},getAngle:function(){return ft},getAxisAngle:function(){return He},identity:function(){return Ge},invert:function(){return Ir},len:function(){return yn},length:function(){return Rn},lerp:function(){return qr},ln:function(){return pt},mul:function(){return mr},multiply:function(){return Lt},normalize:function(){return zt},pow:function(){return wt},random:function(){return ur},rotateX:function(){return Jt},rotateY:function(){return Qe},rotateZ:function(){return ut},rotationTo:function(){return Ar},scale:function(){return rn},set:function(){return Cr},setAxes:function(){return Fr},setAxisAngle:function(){return tt},slerp:function(){return mt},sqlerp:function(){return en},sqrLen:function(){return Rt},squaredLength:function(){return zr},str:function(){return qt}});var L={};F.r(L),F.d(L,{add:function(){return Ft},clone:function(){return Sn},conjugate:function(){return br},copy:function(){return Y},create:function(){return Cn},dot:function(){return Kt},equals:function(){return In},exactEquals:function(){return Vr},fromMat4:function(){return Wn},fromRotation:function(){return un},fromRotationTranslation:function(){return xn},fromRotationTranslationValues:function(){return jr},fromTranslation:function(){return vn},fromValues:function(){return oa},getDual:function(){return b},getReal:function(){return C},getTranslation:function(){return pe},identity:function(){return ie},invert:function(){return Dr},len:function(){return ea},length:function(){return sa},lerp:function(){return lr},mul:function(){return Ur},multiply:function(){return er},normalize:function(){return ra},rotateAroundAxis:function(){return nr},rotateByQuatAppend:function(){return qe},rotateByQuatPrepend:function(){return Nt},rotateX:function(){return me},rotateY:function(){return Le},rotateZ:function(){return st},scale:function(){return Ct},set:function(){return ee},setDual:function(){return X},setReal:function(){return S},sqrLen:function(){return Tn},squaredLength:function(){return gn},str:function(){return Zn},translate:function(){return Me}});var _=F(31767),I=F(76406);function T(){var D=new _.ARRAY_TYPE(6);return _.ARRAY_TYPE!=Float32Array&&(D[1]=0,D[2]=0,D[4]=0,D[5]=0),D[0]=1,D[3]=1,D}function x(D){var te=new _.ARRAY_TYPE(6);return te[0]=D[0],te[1]=D[1],te[2]=D[2],te[3]=D[3],te[4]=D[4],te[5]=D[5],te}function p(D,te){return D[0]=te[0],D[1]=te[1],D[2]=te[2],D[3]=te[3],D[4]=te[4],D[5]=te[5],D}function v(D){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=0,D[5]=0,D}function g(D,te,xe,be,De,Xe){var Je=new _.ARRAY_TYPE(6);return Je[0]=D,Je[1]=te,Je[2]=xe,Je[3]=be,Je[4]=De,Je[5]=Xe,Je}function d(D,te,xe,be,De,Xe,Je){return D[0]=te,D[1]=xe,D[2]=be,D[3]=De,D[4]=Xe,D[5]=Je,D}function c(D,te){var xe=te[0],be=te[1],De=te[2],Xe=te[3],Je=te[4],lt=te[5],Tt=xe*Xe-be*De;return Tt?(Tt=1/Tt,D[0]=Xe*Tt,D[1]=-be*Tt,D[2]=-De*Tt,D[3]=xe*Tt,D[4]=(De*lt-Xe*Je)*Tt,D[5]=(be*Je-xe*lt)*Tt,D):null}function s(D){return D[0]*D[3]-D[1]*D[2]}function m(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=te[4],Tt=te[5],Ht=xe[0],ir=xe[1],Kr=xe[2],nn=xe[3],mn=xe[4],Jr=xe[5];return D[0]=be*Ht+Xe*ir,D[1]=De*Ht+Je*ir,D[2]=be*Kr+Xe*nn,D[3]=De*Kr+Je*nn,D[4]=be*mn+Xe*Jr+lt,D[5]=De*mn+Je*Jr+Tt,D}function M(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=te[4],Tt=te[5],Ht=Math.sin(xe),ir=Math.cos(xe);return D[0]=be*ir+Xe*Ht,D[1]=De*ir+Je*Ht,D[2]=be*-Ht+Xe*ir,D[3]=De*-Ht+Je*ir,D[4]=lt,D[5]=Tt,D}function P(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=te[4],Tt=te[5],Ht=xe[0],ir=xe[1];return D[0]=be*Ht,D[1]=De*Ht,D[2]=Xe*ir,D[3]=Je*ir,D[4]=lt,D[5]=Tt,D}function R(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=te[4],Tt=te[5],Ht=xe[0],ir=xe[1];return D[0]=be,D[1]=De,D[2]=Xe,D[3]=Je,D[4]=be*Ht+Xe*ir+lt,D[5]=De*Ht+Je*ir+Tt,D}function j(D,te){var xe=Math.sin(te),be=Math.cos(te);return D[0]=be,D[1]=xe,D[2]=-xe,D[3]=be,D[4]=0,D[5]=0,D}function Q(D,te){return D[0]=te[0],D[1]=0,D[2]=0,D[3]=te[1],D[4]=0,D[5]=0,D}function G(D,te){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=te[0],D[5]=te[1],D}function W(D){return"mat2d("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+", "+D[4]+", "+D[5]+")"}function H(D){return Math.hypot(D[0],D[1],D[2],D[3],D[4],D[5],1)}function Z(D,te,xe){return D[0]=te[0]+xe[0],D[1]=te[1]+xe[1],D[2]=te[2]+xe[2],D[3]=te[3]+xe[3],D[4]=te[4]+xe[4],D[5]=te[5]+xe[5],D}function J(D,te,xe){return D[0]=te[0]-xe[0],D[1]=te[1]-xe[1],D[2]=te[2]-xe[2],D[3]=te[3]-xe[3],D[4]=te[4]-xe[4],D[5]=te[5]-xe[5],D}function K(D,te,xe){return D[0]=te[0]*xe,D[1]=te[1]*xe,D[2]=te[2]*xe,D[3]=te[3]*xe,D[4]=te[4]*xe,D[5]=te[5]*xe,D}function ne(D,te,xe,be){return D[0]=te[0]+xe[0]*be,D[1]=te[1]+xe[1]*be,D[2]=te[2]+xe[2]*be,D[3]=te[3]+xe[3]*be,D[4]=te[4]+xe[4]*be,D[5]=te[5]+xe[5]*be,D}function se(D,te){return D[0]===te[0]&&D[1]===te[1]&&D[2]===te[2]&&D[3]===te[3]&&D[4]===te[4]&&D[5]===te[5]}function fe(D,te){var xe=D[0],be=D[1],De=D[2],Xe=D[3],Je=D[4],lt=D[5],Tt=te[0],Ht=te[1],ir=te[2],Kr=te[3],nn=te[4],mn=te[5];return Math.abs(xe-Tt)<=_.EPSILON*Math.max(1,Math.abs(xe),Math.abs(Tt))&&Math.abs(be-Ht)<=_.EPSILON*Math.max(1,Math.abs(be),Math.abs(Ht))&&Math.abs(De-ir)<=_.EPSILON*Math.max(1,Math.abs(De),Math.abs(ir))&&Math.abs(Xe-Kr)<=_.EPSILON*Math.max(1,Math.abs(Xe),Math.abs(Kr))&&Math.abs(Je-nn)<=_.EPSILON*Math.max(1,Math.abs(Je),Math.abs(nn))&&Math.abs(lt-mn)<=_.EPSILON*Math.max(1,Math.abs(lt),Math.abs(mn))}var Ie=m,ye=J,Ae=F(73485),Se=F(39536),we=F(54442),Te=F(49953);function ke(){var D=new _.ARRAY_TYPE(4);return _.ARRAY_TYPE!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0),D[3]=1,D}function Ge(D){return D[0]=0,D[1]=0,D[2]=0,D[3]=1,D}function tt(D,te,xe){xe=xe*.5;var be=Math.sin(xe);return D[0]=be*te[0],D[1]=be*te[1],D[2]=be*te[2],D[3]=Math.cos(xe),D}function He(D,te){var xe=Math.acos(te[3])*2,be=Math.sin(xe/2);return be>_.EPSILON?(D[0]=te[0]/be,D[1]=te[1]/be,D[2]=te[2]/be):(D[0]=1,D[1]=0,D[2]=0),xe}function ft(D,te){var xe=Sr(D,te);return Math.acos(2*xe*xe-1)}function Lt(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=xe[0],Tt=xe[1],Ht=xe[2],ir=xe[3];return D[0]=be*ir+Je*lt+De*Ht-Xe*Tt,D[1]=De*ir+Je*Tt+Xe*lt-be*Ht,D[2]=Xe*ir+Je*Ht+be*Tt-De*lt,D[3]=Je*ir-be*lt-De*Tt-Xe*Ht,D}function Jt(D,te,xe){xe*=.5;var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=Math.sin(xe),Tt=Math.cos(xe);return D[0]=be*Tt+Je*lt,D[1]=De*Tt+Xe*lt,D[2]=Xe*Tt-De*lt,D[3]=Je*Tt-be*lt,D}function Qe(D,te,xe){xe*=.5;var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=Math.sin(xe),Tt=Math.cos(xe);return D[0]=be*Tt-Xe*lt,D[1]=De*Tt+Je*lt,D[2]=Xe*Tt+be*lt,D[3]=Je*Tt-De*lt,D}function ut(D,te,xe){xe*=.5;var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=Math.sin(xe),Tt=Math.cos(xe);return D[0]=be*Tt+De*lt,D[1]=De*Tt-be*lt,D[2]=Xe*Tt+Je*lt,D[3]=Je*Tt-Xe*lt,D}function xt(D,te){var xe=te[0],be=te[1],De=te[2];return D[0]=xe,D[1]=be,D[2]=De,D[3]=Math.sqrt(Math.abs(1-xe*xe-be*be-De*De)),D}function dt(D,te){var xe=te[0],be=te[1],De=te[2],Xe=te[3],Je=Math.sqrt(xe*xe+be*be+De*De),lt=Math.exp(Xe),Tt=Je>0?lt*Math.sin(Je)/Je:0;return D[0]=xe*Tt,D[1]=be*Tt,D[2]=De*Tt,D[3]=lt*Math.cos(Je),D}function pt(D,te){var xe=te[0],be=te[1],De=te[2],Xe=te[3],Je=Math.sqrt(xe*xe+be*be+De*De),lt=Je>0?Math.atan2(Je,Xe)/Je:0;return D[0]=xe*lt,D[1]=be*lt,D[2]=De*lt,D[3]=.5*Math.log(xe*xe+be*be+De*De+Xe*Xe),D}function wt(D,te,xe){return pt(D,te),rn(D,D,xe),dt(D,D),D}function mt(D,te,xe,be){var De=te[0],Xe=te[1],Je=te[2],lt=te[3],Tt=xe[0],Ht=xe[1],ir=xe[2],Kr=xe[3],nn,mn,Jr,jn,_a;return mn=De*Tt+Xe*Ht+Je*ir+lt*Kr,mn<0&&(mn=-mn,Tt=-Tt,Ht=-Ht,ir=-ir,Kr=-Kr),1-mn>_.EPSILON?(nn=Math.acos(mn),Jr=Math.sin(nn),jn=Math.sin((1-be)*nn)/Jr,_a=Math.sin(be*nn)/Jr):(jn=1-be,_a=be),D[0]=jn*De+_a*Tt,D[1]=jn*Xe+_a*Ht,D[2]=jn*Je+_a*ir,D[3]=jn*lt+_a*Kr,D}function ur(D){var te=_.RANDOM(),xe=_.RANDOM(),be=_.RANDOM(),De=Math.sqrt(1-te),Xe=Math.sqrt(te);return D[0]=De*Math.sin(2*Math.PI*xe),D[1]=De*Math.cos(2*Math.PI*xe),D[2]=Xe*Math.sin(2*Math.PI*be),D[3]=Xe*Math.cos(2*Math.PI*be),D}function Ir(D,te){var xe=te[0],be=te[1],De=te[2],Xe=te[3],Je=xe*xe+be*be+De*De+Xe*Xe,lt=Je?1/Je:0;return D[0]=-xe*lt,D[1]=-be*lt,D[2]=-De*lt,D[3]=Xe*lt,D}function Nr(D,te){return D[0]=-te[0],D[1]=-te[1],D[2]=-te[2],D[3]=te[3],D}function Hr(D,te){var xe=te[0]+te[4]+te[8],be;if(xe>0)be=Math.sqrt(xe+1),D[3]=.5*be,be=.5/be,D[0]=(te[5]-te[7])*be,D[1]=(te[6]-te[2])*be,D[2]=(te[1]-te[3])*be;else{var De=0;te[4]>te[0]&&(De=1),te[8]>te[De*3+De]&&(De=2);var Xe=(De+1)%3,Je=(De+2)%3;be=Math.sqrt(te[De*3+De]-te[Xe*3+Xe]-te[Je*3+Je]+1),D[De]=.5*be,be=.5/be,D[3]=(te[Xe*3+Je]-te[Je*3+Xe])*be,D[Xe]=(te[Xe*3+De]+te[De*3+Xe])*be,D[Je]=(te[Je*3+De]+te[De*3+Je])*be}return D}function It(D,te,xe,be){var De=.5*Math.PI/180;te*=De,xe*=De,be*=De;var Xe=Math.sin(te),Je=Math.cos(te),lt=Math.sin(xe),Tt=Math.cos(xe),Ht=Math.sin(be),ir=Math.cos(be);return D[0]=Xe*Tt*ir-Je*lt*Ht,D[1]=Je*lt*ir+Xe*Tt*Ht,D[2]=Je*Tt*Ht-Xe*lt*ir,D[3]=Je*Tt*ir+Xe*lt*Ht,D}function qt(D){return"quat("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+")"}var ar=Te.clone,Oe=Te.fromValues,Pr=Te.copy,Cr=Te.set,Gr=Te.add,mr=Lt,rn=Te.scale,Sr=Te.dot,qr=Te.lerp,Rn=Te.length,yn=Rn,zr=Te.squaredLength,Rt=zr,zt=Te.normalize,Vt=Te.exactEquals,hr=Te.equals,Ar=function(){var D=we.create(),te=we.fromValues(1,0,0),xe=we.fromValues(0,1,0);return function(be,De,Xe){var Je=we.dot(De,Xe);return Je<-.999999?(we.cross(D,te,De),we.len(D)<1e-6&&we.cross(D,xe,De),we.normalize(D,D),tt(be,D,Math.PI),be):Je>.999999?(be[0]=0,be[1]=0,be[2]=0,be[3]=1,be):(we.cross(D,De,Xe),be[0]=D[0],be[1]=D[1],be[2]=D[2],be[3]=1+Je,zt(be,be))}}(),en=function(){var D=ke(),te=ke();return function(xe,be,De,Xe,Je,lt){return mt(D,be,Je,lt),mt(te,De,Xe,lt),mt(xe,D,te,2*lt*(1-lt)),xe}}(),Fr=function(){var D=Ae.create();return function(te,xe,be,De){return D[0]=be[0],D[3]=be[1],D[6]=be[2],D[1]=De[0],D[4]=De[1],D[7]=De[2],D[2]=-xe[0],D[5]=-xe[1],D[8]=-xe[2],zt(te,Hr(te,D))}}();function Cn(){var D=new _.ARRAY_TYPE(8);return _.ARRAY_TYPE!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0,D[4]=0,D[5]=0,D[6]=0,D[7]=0),D[3]=1,D}function Sn(D){var te=new _.ARRAY_TYPE(8);return te[0]=D[0],te[1]=D[1],te[2]=D[2],te[3]=D[3],te[4]=D[4],te[5]=D[5],te[6]=D[6],te[7]=D[7],te}function oa(D,te,xe,be,De,Xe,Je,lt){var Tt=new _.ARRAY_TYPE(8);return Tt[0]=D,Tt[1]=te,Tt[2]=xe,Tt[3]=be,Tt[4]=De,Tt[5]=Xe,Tt[6]=Je,Tt[7]=lt,Tt}function jr(D,te,xe,be,De,Xe,Je){var lt=new _.ARRAY_TYPE(8);lt[0]=D,lt[1]=te,lt[2]=xe,lt[3]=be;var Tt=De*.5,Ht=Xe*.5,ir=Je*.5;return lt[4]=Tt*be+Ht*xe-ir*te,lt[5]=Ht*be+ir*D-Tt*xe,lt[6]=ir*be+Tt*te-Ht*D,lt[7]=-Tt*D-Ht*te-ir*xe,lt}function xn(D,te,xe){var be=xe[0]*.5,De=xe[1]*.5,Xe=xe[2]*.5,Je=te[0],lt=te[1],Tt=te[2],Ht=te[3];return D[0]=Je,D[1]=lt,D[2]=Tt,D[3]=Ht,D[4]=be*Ht+De*Tt-Xe*lt,D[5]=De*Ht+Xe*Je-be*Tt,D[6]=Xe*Ht+be*lt-De*Je,D[7]=-be*Je-De*lt-Xe*Tt,D}function vn(D,te){return D[0]=0,D[1]=0,D[2]=0,D[3]=1,D[4]=te[0]*.5,D[5]=te[1]*.5,D[6]=te[2]*.5,D[7]=0,D}function un(D,te){return D[0]=te[0],D[1]=te[1],D[2]=te[2],D[3]=te[3],D[4]=0,D[5]=0,D[6]=0,D[7]=0,D}function Wn(D,te){var xe=ke();Se.getRotation(xe,te);var be=new _.ARRAY_TYPE(3);return Se.getTranslation(be,te),xn(D,xe,be),D}function Y(D,te){return D[0]=te[0],D[1]=te[1],D[2]=te[2],D[3]=te[3],D[4]=te[4],D[5]=te[5],D[6]=te[6],D[7]=te[7],D}function ie(D){return D[0]=0,D[1]=0,D[2]=0,D[3]=1,D[4]=0,D[5]=0,D[6]=0,D[7]=0,D}function ee(D,te,xe,be,De,Xe,Je,lt,Tt){return D[0]=te,D[1]=xe,D[2]=be,D[3]=De,D[4]=Xe,D[5]=Je,D[6]=lt,D[7]=Tt,D}var C=Pr;function b(D,te){return D[0]=te[4],D[1]=te[5],D[2]=te[6],D[3]=te[7],D}var S=Pr;function X(D,te){return D[4]=te[0],D[5]=te[1],D[6]=te[2],D[7]=te[3],D}function pe(D,te){var xe=te[4],be=te[5],De=te[6],Xe=te[7],Je=-te[0],lt=-te[1],Tt=-te[2],Ht=te[3];return D[0]=(xe*Ht+Xe*Je+be*Tt-De*lt)*2,D[1]=(be*Ht+Xe*lt+De*Je-xe*Tt)*2,D[2]=(De*Ht+Xe*Tt+xe*lt-be*Je)*2,D}function Me(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=xe[0]*.5,Tt=xe[1]*.5,Ht=xe[2]*.5,ir=te[4],Kr=te[5],nn=te[6],mn=te[7];return D[0]=be,D[1]=De,D[2]=Xe,D[3]=Je,D[4]=Je*lt+De*Ht-Xe*Tt+ir,D[5]=Je*Tt+Xe*lt-be*Ht+Kr,D[6]=Je*Ht+be*Tt-De*lt+nn,D[7]=-be*lt-De*Tt-Xe*Ht+mn,D}function me(D,te,xe){var be=-te[0],De=-te[1],Xe=-te[2],Je=te[3],lt=te[4],Tt=te[5],Ht=te[6],ir=te[7],Kr=lt*Je+ir*be+Tt*Xe-Ht*De,nn=Tt*Je+ir*De+Ht*be-lt*Xe,mn=Ht*Je+ir*Xe+lt*De-Tt*be,Jr=ir*Je-lt*be-Tt*De-Ht*Xe;return Jt(D,te,xe),be=D[0],De=D[1],Xe=D[2],Je=D[3],D[4]=Kr*Je+Jr*be+nn*Xe-mn*De,D[5]=nn*Je+Jr*De+mn*be-Kr*Xe,D[6]=mn*Je+Jr*Xe+Kr*De-nn*be,D[7]=Jr*Je-Kr*be-nn*De-mn*Xe,D}function Le(D,te,xe){var be=-te[0],De=-te[1],Xe=-te[2],Je=te[3],lt=te[4],Tt=te[5],Ht=te[6],ir=te[7],Kr=lt*Je+ir*be+Tt*Xe-Ht*De,nn=Tt*Je+ir*De+Ht*be-lt*Xe,mn=Ht*Je+ir*Xe+lt*De-Tt*be,Jr=ir*Je-lt*be-Tt*De-Ht*Xe;return Qe(D,te,xe),be=D[0],De=D[1],Xe=D[2],Je=D[3],D[4]=Kr*Je+Jr*be+nn*Xe-mn*De,D[5]=nn*Je+Jr*De+mn*be-Kr*Xe,D[6]=mn*Je+Jr*Xe+Kr*De-nn*be,D[7]=Jr*Je-Kr*be-nn*De-mn*Xe,D}function st(D,te,xe){var be=-te[0],De=-te[1],Xe=-te[2],Je=te[3],lt=te[4],Tt=te[5],Ht=te[6],ir=te[7],Kr=lt*Je+ir*be+Tt*Xe-Ht*De,nn=Tt*Je+ir*De+Ht*be-lt*Xe,mn=Ht*Je+ir*Xe+lt*De-Tt*be,Jr=ir*Je-lt*be-Tt*De-Ht*Xe;return ut(D,te,xe),be=D[0],De=D[1],Xe=D[2],Je=D[3],D[4]=Kr*Je+Jr*be+nn*Xe-mn*De,D[5]=nn*Je+Jr*De+mn*be-Kr*Xe,D[6]=mn*Je+Jr*Xe+Kr*De-nn*be,D[7]=Jr*Je-Kr*be-nn*De-mn*Xe,D}function qe(D,te,xe){var be=xe[0],De=xe[1],Xe=xe[2],Je=xe[3],lt=te[0],Tt=te[1],Ht=te[2],ir=te[3];return D[0]=lt*Je+ir*be+Tt*Xe-Ht*De,D[1]=Tt*Je+ir*De+Ht*be-lt*Xe,D[2]=Ht*Je+ir*Xe+lt*De-Tt*be,D[3]=ir*Je-lt*be-Tt*De-Ht*Xe,lt=te[4],Tt=te[5],Ht=te[6],ir=te[7],D[4]=lt*Je+ir*be+Tt*Xe-Ht*De,D[5]=Tt*Je+ir*De+Ht*be-lt*Xe,D[6]=Ht*Je+ir*Xe+lt*De-Tt*be,D[7]=ir*Je-lt*be-Tt*De-Ht*Xe,D}function Nt(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=xe[0],Tt=xe[1],Ht=xe[2],ir=xe[3];return D[0]=be*ir+Je*lt+De*Ht-Xe*Tt,D[1]=De*ir+Je*Tt+Xe*lt-be*Ht,D[2]=Xe*ir+Je*Ht+be*Tt-De*lt,D[3]=Je*ir-be*lt-De*Tt-Xe*Ht,lt=xe[4],Tt=xe[5],Ht=xe[6],ir=xe[7],D[4]=be*ir+Je*lt+De*Ht-Xe*Tt,D[5]=De*ir+Je*Tt+Xe*lt-be*Ht,D[6]=Xe*ir+Je*Ht+be*Tt-De*lt,D[7]=Je*ir-be*lt-De*Tt-Xe*Ht,D}function nr(D,te,xe,be){if(Math.abs(be)<_.EPSILON)return Y(D,te);var De=Math.hypot(xe[0],xe[1],xe[2]);be=be*.5;var Xe=Math.sin(be),Je=Xe*xe[0]/De,lt=Xe*xe[1]/De,Tt=Xe*xe[2]/De,Ht=Math.cos(be),ir=te[0],Kr=te[1],nn=te[2],mn=te[3];D[0]=ir*Ht+mn*Je+Kr*Tt-nn*lt,D[1]=Kr*Ht+mn*lt+nn*Je-ir*Tt,D[2]=nn*Ht+mn*Tt+ir*lt-Kr*Je,D[3]=mn*Ht-ir*Je-Kr*lt-nn*Tt;var Jr=te[4],jn=te[5],_a=te[6],Fn=te[7];return D[4]=Jr*Ht+Fn*Je+jn*Tt-_a*lt,D[5]=jn*Ht+Fn*lt+_a*Je-Jr*Tt,D[6]=_a*Ht+Fn*Tt+Jr*lt-jn*Je,D[7]=Fn*Ht-Jr*Je-jn*lt-_a*Tt,D}function Ft(D,te,xe){return D[0]=te[0]+xe[0],D[1]=te[1]+xe[1],D[2]=te[2]+xe[2],D[3]=te[3]+xe[3],D[4]=te[4]+xe[4],D[5]=te[5]+xe[5],D[6]=te[6]+xe[6],D[7]=te[7]+xe[7],D}function er(D,te,xe){var be=te[0],De=te[1],Xe=te[2],Je=te[3],lt=xe[4],Tt=xe[5],Ht=xe[6],ir=xe[7],Kr=te[4],nn=te[5],mn=te[6],Jr=te[7],jn=xe[0],_a=xe[1],Fn=xe[2],ya=xe[3];return D[0]=be*ya+Je*jn+De*Fn-Xe*_a,D[1]=De*ya+Je*_a+Xe*jn-be*Fn,D[2]=Xe*ya+Je*Fn+be*_a-De*jn,D[3]=Je*ya-be*jn-De*_a-Xe*Fn,D[4]=be*ir+Je*lt+De*Ht-Xe*Tt+Kr*ya+Jr*jn+nn*Fn-mn*_a,D[5]=De*ir+Je*Tt+Xe*lt-be*Ht+nn*ya+Jr*_a+mn*jn-Kr*Fn,D[6]=Xe*ir+Je*Ht+be*Tt-De*lt+mn*ya+Jr*Fn+Kr*_a-nn*jn,D[7]=Je*ir-be*lt-De*Tt-Xe*Ht+Jr*ya-Kr*jn-nn*_a-mn*Fn,D}var Ur=er;function Ct(D,te,xe){return D[0]=te[0]*xe,D[1]=te[1]*xe,D[2]=te[2]*xe,D[3]=te[3]*xe,D[4]=te[4]*xe,D[5]=te[5]*xe,D[6]=te[6]*xe,D[7]=te[7]*xe,D}var Kt=Sr;function lr(D,te,xe,be){var De=1-be;return Kt(te,xe)<0&&(be=-be),D[0]=te[0]*De+xe[0]*be,D[1]=te[1]*De+xe[1]*be,D[2]=te[2]*De+xe[2]*be,D[3]=te[3]*De+xe[3]*be,D[4]=te[4]*De+xe[4]*be,D[5]=te[5]*De+xe[5]*be,D[6]=te[6]*De+xe[6]*be,D[7]=te[7]*De+xe[7]*be,D}function Dr(D,te){var xe=gn(te);return D[0]=-te[0]/xe,D[1]=-te[1]/xe,D[2]=-te[2]/xe,D[3]=te[3]/xe,D[4]=-te[4]/xe,D[5]=-te[5]/xe,D[6]=-te[6]/xe,D[7]=te[7]/xe,D}function br(D,te){return D[0]=-te[0],D[1]=-te[1],D[2]=-te[2],D[3]=te[3],D[4]=-te[4],D[5]=-te[5],D[6]=-te[6],D[7]=te[7],D}var sa=Rn,ea=sa,gn=zr,Tn=gn;function ra(D,te){var xe=gn(te);if(xe>0){xe=Math.sqrt(xe);var be=te[0]/xe,De=te[1]/xe,Xe=te[2]/xe,Je=te[3]/xe,lt=te[4],Tt=te[5],Ht=te[6],ir=te[7],Kr=be*lt+De*Tt+Xe*Ht+Je*ir;D[0]=be,D[1]=De,D[2]=Xe,D[3]=Je,D[4]=(lt-be*Kr)/xe,D[5]=(Tt-De*Kr)/xe,D[6]=(Ht-Xe*Kr)/xe,D[7]=(ir-Je*Kr)/xe}return D}function Zn(D){return"quat2("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+", "+D[4]+", "+D[5]+", "+D[6]+", "+D[7]+")"}function Vr(D,te){return D[0]===te[0]&&D[1]===te[1]&&D[2]===te[2]&&D[3]===te[3]&&D[4]===te[4]&&D[5]===te[5]&&D[6]===te[6]&&D[7]===te[7]}function In(D,te){var xe=D[0],be=D[1],De=D[2],Xe=D[3],Je=D[4],lt=D[5],Tt=D[6],Ht=D[7],ir=te[0],Kr=te[1],nn=te[2],mn=te[3],Jr=te[4],jn=te[5],_a=te[6],Fn=te[7];return Math.abs(xe-ir)<=_.EPSILON*Math.max(1,Math.abs(xe),Math.abs(ir))&&Math.abs(be-Kr)<=_.EPSILON*Math.max(1,Math.abs(be),Math.abs(Kr))&&Math.abs(De-nn)<=_.EPSILON*Math.max(1,Math.abs(De),Math.abs(nn))&&Math.abs(Xe-mn)<=_.EPSILON*Math.max(1,Math.abs(Xe),Math.abs(mn))&&Math.abs(Je-Jr)<=_.EPSILON*Math.max(1,Math.abs(Je),Math.abs(Jr))&&Math.abs(lt-jn)<=_.EPSILON*Math.max(1,Math.abs(lt),Math.abs(jn))&&Math.abs(Tt-_a)<=_.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(_a))&&Math.abs(Ht-Fn)<=_.EPSILON*Math.max(1,Math.abs(Ht),Math.abs(Fn))}var at=F(38015)},89486:function(Mt){var N=[],F=[],k="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function U(_,I){if(I=I||{},_===void 0)throw new Error(k);var T=I.prepend===!0?"prepend":"append",x=I.container!==void 0?I.container:document.querySelector("head"),p=N.indexOf(x);p===-1&&(p=N.push(x)-1,F[p]={});var v;return F[p]!==void 0&&F[p][T]!==void 0?v=F[p][T]:(v=F[p][T]=L(),T==="prepend"?x.insertBefore(v,x.childNodes[0]):x.appendChild(v)),_.charCodeAt(0)===65279&&(_=_.substr(1,_.length)),v.styleSheet?v.styleSheet.cssText+=_:v.textContent+=_,v}function L(){var _=document.createElement("style");return _.setAttribute("type","text/css"),_}Mt.exports=U,Mt.exports.insertCss=U},60804:function(Mt,N,F){"use strict";F.r(N),F.d(N,{isAnyArray:function(){return U}});const k=Object.prototype.toString;function U(L){const _=k.call(L);return _.endsWith("Array]")&&!_.includes("Big")}},22882:function(Mt,N,F){var k=F(80732),U=F(17216),L=F(55073),_="[object Arguments]",I="[object Array]",T="[object Boolean]",x="[object Date]",p="[object Error]",v="[object Function]",g="[object Map]",d="[object Number]",c="[object Object]",s="[object RegExp]",m="[object Set]",M="[object String]",P="[object WeakMap]",R="[object ArrayBuffer]",j="[object DataView]",Q="[object Float32Array]",G="[object Float64Array]",W="[object Int8Array]",H="[object Int16Array]",Z="[object Int32Array]",J="[object Uint8Array]",K="[object Uint8ClampedArray]",ne="[object Uint16Array]",se="[object Uint32Array]",fe={};fe[Q]=fe[G]=fe[W]=fe[H]=fe[Z]=fe[J]=fe[K]=fe[ne]=fe[se]=!0,fe[_]=fe[I]=fe[R]=fe[T]=fe[j]=fe[x]=fe[p]=fe[v]=fe[g]=fe[d]=fe[c]=fe[s]=fe[m]=fe[M]=fe[P]=!1;function Ie(ye){return L(ye)&&U(ye.length)&&!!fe[k(ye)]}Mt.exports=Ie},58792:function(Mt){function N(F){return function(k){return F(k)}}Mt.exports=N},11389:function(Mt,N,F){var k=F(75542),U=k(Object.getPrototypeOf,Object);Mt.exports=U},8478:function(Mt,N,F){Mt=F.nmd(Mt);var k=F(96476),U=N&&!N.nodeType&&N,L=U&&!0&&Mt&&!Mt.nodeType&&Mt,_=L&&L.exports===U,I=_&&k.process,T=function(){try{var x=L&&L.require&&L.require("util").types;return x||I&&I.binding&&I.binding("util")}catch(p){}}();Mt.exports=T},75542:function(Mt){function N(F,k){return function(U){return F(k(U))}}Mt.exports=N},24669:function(Mt){var N=Array.isArray;Mt.exports=N},17216:function(Mt){var N=9007199254740991;function F(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=N}Mt.exports=F},69143:function(Mt,N,F){var k=F(80732),U=F(11389),L=F(55073),_="[object Object]",I=Function.prototype,T=Object.prototype,x=I.toString,p=T.hasOwnProperty,v=x.call(Object);function g(d){if(!L(d)||k(d)!=_)return!1;var c=U(d);if(c===null)return!0;var s=p.call(c,"constructor")&&c.constructor;return typeof s=="function"&&s instanceof s&&x.call(s)==v}Mt.exports=g},73806:function(Mt,N,F){var k=F(22882),U=F(58792),L=F(8478),_=L&&L.isTypedArray,I=_?U(_):k;Mt.exports=I},85650:function(Mt,N,F){"use strict";F.r(N),F.d(N,{default:function(){return _}});var k=F(60804);function U(I){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,k.isAnyArray)(I))throw new TypeError("input must be an array");if(I.length===0)throw new TypeError("input must not be empty");var x=T.fromIndex,p=x===void 0?0:x,v=T.toIndex,g=v===void 0?I.length:v;if(p<0||p>=I.length||!Number.isInteger(p))throw new Error("fromIndex must be a positive integer smaller than length");if(g<=p||g>I.length||!Number.isInteger(g))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var d=I[p],c=p+1;c<g;c++)I[c]>d&&(d=I[c]);return d}function L(I){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,k.isAnyArray)(I))throw new TypeError("input must be an array");if(I.length===0)throw new TypeError("input must not be empty");var x=T.fromIndex,p=x===void 0?0:x,v=T.toIndex,g=v===void 0?I.length:v;if(p<0||p>=I.length||!Number.isInteger(p))throw new Error("fromIndex must be a positive integer smaller than length");if(g<=p||g>I.length||!Number.isInteger(g))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var d=I[p],c=p+1;c<g;c++)I[c]<d&&(d=I[c]);return d}function _(I){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,k.isAnyArray)(I)){if(I.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var x;if(T.output!==void 0){if(!(0,k.isAnyArray)(T.output))throw new TypeError("output option must be an array if specified");x=T.output}else x=new Array(I.length);var p=L(I),v=U(I);if(p===v)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var g=T.min,d=g===void 0?T.autoMinMax?p:0:g,c=T.max,s=c===void 0?T.autoMinMax?v:1:c;if(d>=s)throw new RangeError("min option must be smaller than max option");for(var m=(s-d)/(v-p),M=0;M<I.length;M++)x[M]=(I[M]-p)*m+d;return x}},40224:function(Mt){(function(N,F){Mt.exports=F()})(this,function(){"use strict";var N=function(he){return he instanceof Uint8Array||he instanceof Uint16Array||he instanceof Uint32Array||he instanceof Int8Array||he instanceof Int16Array||he instanceof Int32Array||he instanceof Float32Array||he instanceof Float64Array||he instanceof Uint8ClampedArray},F=function(he,We){for(var it=Object.keys(We),Zt=0;Zt<it.length;++Zt)he[it[Zt]]=We[it[Zt]];return he},k=`
`;function U(he){return typeof atob!="undefined"?atob(he):"base64:"+he}function L(he){var We=new Error("(regl) "+he);throw console.error(We),We}function _(he,We){he||L(We)}function I(he){return he?": "+he:""}function T(he,We,it){he in We||L("unknown parameter ("+he+")"+I(it)+". possible values: "+Object.keys(We).join())}function x(he,We){N(he)||L("invalid parameter type"+I(We)+". must be a typed array")}function p(he,We){switch(We){case"number":return typeof he=="number";case"object":return typeof he=="object";case"string":return typeof he=="string";case"boolean":return typeof he=="boolean";case"function":return typeof he=="function";case"undefined":return typeof he=="undefined";case"symbol":return typeof he=="symbol"}}function v(he,We,it){p(he,We)||L("invalid parameter type"+I(it)+". expected "+We+", got "+typeof he)}function g(he,We){he>=0&&(he|0)===he||L("invalid parameter type, ("+he+")"+I(We)+". must be a nonnegative integer")}function d(he,We,it){We.indexOf(he)<0&&L("invalid value"+I(it)+". must be one of: "+We)}var c=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function s(he){Object.keys(he).forEach(function(We){c.indexOf(We)<0&&L('invalid regl constructor argument "'+We+'". must be one of '+c)})}function m(he,We){for(he=he+"";he.length<We;)he=" "+he;return he}function M(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function P(he,We){this.number=he,this.line=We,this.errors=[]}function R(he,We,it){this.file=he,this.line=We,this.message=it}function j(){var he=new Error,We=(he.stack||he).toString(),it=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(We);if(it)return it[1];var Zt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(We);return Zt?Zt[1]:"unknown"}function Q(){var he=new Error,We=(he.stack||he).toString(),it=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(We);if(it)return it[1];var Zt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(We);return Zt?Zt[1]:"unknown"}function G(he,We){var it=he.split(`
`),Zt=1,or=0,Xt={unknown:new M,0:new M};Xt.unknown.name=Xt[0].name=We||j(),Xt.unknown.lines.push(new P(0,""));for(var Qt=0;Qt<it.length;++Qt){var gr=it[Qt],Er=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(gr);if(Er)switch(Er[1]){case"line":var wr=/(\d+)(\s+\d+)?/.exec(Er[2]);wr&&(Zt=wr[1]|0,wr[2]&&(or=wr[2]|0,or in Xt||(Xt[or]=new M)));break;case"define":var _r=/SHADER_NAME(_B64)?\s+(.*)$/.exec(Er[2]);_r&&(Xt[or].name=_r[1]?U(_r[2]):_r[2]);break}Xt[or].lines.push(new P(Zt++,gr))}return Object.keys(Xt).forEach(function(Br){var f=Xt[Br];f.lines.forEach(function(w){f.index[w.number]=w})}),Xt}function W(he){var We=[];return he.split(`
`).forEach(function(it){if(!(it.length<5)){var Zt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(it);Zt?We.push(new R(Zt[1]|0,Zt[2]|0,Zt[3].trim())):it.length>0&&We.push(new R("unknown",0,it))}}),We}function H(he,We){We.forEach(function(it){var Zt=he[it.file];if(Zt){var or=Zt.index[it.line];if(or){or.errors.push(it),Zt.hasErrors=!0;return}}he.unknown.hasErrors=!0,he.unknown.lines[0].errors.push(it)})}function Z(he,We,it,Zt,or){if(!he.getShaderParameter(We,he.COMPILE_STATUS)){var Xt=he.getShaderInfoLog(We),Qt=Zt===he.FRAGMENT_SHADER?"fragment":"vertex";ye(it,"string",Qt+" shader source must be a string",or);var gr=G(it,or),Er=W(Xt);H(gr,Er),Object.keys(gr).forEach(function(wr){var _r=gr[wr];if(!_r.hasErrors)return;var Br=[""],f=[""];function w(B,V){Br.push(B),f.push(V||"")}w("file number "+wr+": "+_r.name+`
`,"color:red;text-decoration:underline;font-weight:bold"),_r.lines.forEach(function(B){if(B.errors.length>0){w(m(B.number,4)+"| ","background-color:yellow; font-weight:bold"),w(B.line+k,"color:red; background-color:yellow; font-weight:bold");var V=0;B.errors.forEach(function(re){var oe=re.message,le=/^\s*'(.*)'\s*:\s*(.*)$/.exec(oe);if(le){var ge=le[1];switch(oe=le[2],ge){case"assign":ge="=";break}V=Math.max(B.line.indexOf(ge,V),0)}else V=0;w(m("| ",6)),w(m("^^^",V+3)+k,"font-weight:bold"),w(m("| ",6)),w(oe+k,"font-weight:bold")}),w(m("| ",6)+k)}else w(m(B.number,4)+"| "),w(B.line+k,"color:red")}),typeof document!="undefined"&&!window.chrome?(f[0]=Br.join("%c"),console.log.apply(console,f)):console.log(Br.join(""))}),_.raise("Error compiling "+Qt+" shader, "+gr[0].name)}}function J(he,We,it,Zt,or){if(!he.getProgramParameter(We,he.LINK_STATUS)){var Xt=he.getProgramInfoLog(We),Qt=G(it,or),gr=G(Zt,or),Er='Error linking program with vertex shader, "'+gr[0].name+'", and fragment shader "'+Qt[0].name+'"';typeof document!="undefined"?console.log("%c"+Er+k+"%c"+Xt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Er+k+Xt),_.raise(Er)}}function K(he){he._commandRef=j()}function ne(he,We,it,Zt){K(he);function or(Er){return Er?Zt.id(Er):0}he._fragId=or(he.static.frag),he._vertId=or(he.static.vert);function Xt(Er,wr){Object.keys(wr).forEach(function(_r){Er[Zt.id(_r)]=!0})}var Qt=he._uniformSet={};Xt(Qt,We.static),Xt(Qt,We.dynamic);var gr=he._attributeSet={};Xt(gr,it.static),Xt(gr,it.dynamic),he._hasCount="count"in he.static||"count"in he.dynamic||"elements"in he.static||"elements"in he.dynamic}function se(he,We){var it=Q();L(he+" in command "+(We||j())+(it==="unknown"?"":" called from "+it))}function fe(he,We,it){he||se(We,it||j())}function Ie(he,We,it,Zt){he in We||se("unknown parameter ("+he+")"+I(it)+". possible values: "+Object.keys(We).join(),Zt||j())}function ye(he,We,it,Zt){p(he,We)||se("invalid parameter type"+I(it)+". expected "+We+", got "+typeof he,Zt||j())}function Ae(he){he()}function Se(he,We,it){he.texture?d(he.texture._texture.internalformat,We,"unsupported texture format for attachment"):d(he.renderbuffer._renderbuffer.format,it,"unsupported renderbuffer format for attachment")}var we=33071,Te=9728,ke=9984,Ge=9985,tt=9986,He=9987,ft=5120,Lt=5121,Jt=5122,Qe=5123,ut=5124,xt=5125,dt=5126,pt=32819,wt=32820,mt=33635,ur=34042,Ir=36193,Nr={};Nr[ft]=Nr[Lt]=1,Nr[Jt]=Nr[Qe]=Nr[Ir]=Nr[mt]=Nr[pt]=Nr[wt]=2,Nr[ut]=Nr[xt]=Nr[dt]=Nr[ur]=4;function Hr(he,We){return he===wt||he===pt||he===mt?2:he===ur?4:Nr[he]*We}function It(he){return!(he&he-1)&&!!he}function qt(he,We,it){var Zt,or=We.width,Xt=We.height,Qt=We.channels;_(or>0&&or<=it.maxTextureSize&&Xt>0&&Xt<=it.maxTextureSize,"invalid texture shape"),(he.wrapS!==we||he.wrapT!==we)&&_(It(or)&&It(Xt),"incompatible wrap mode for texture, both width and height must be power of 2"),We.mipmask===1?or!==1&&Xt!==1&&_(he.minFilter!==ke&&he.minFilter!==tt&&he.minFilter!==Ge&&he.minFilter!==He,"min filter requires mipmap"):(_(It(or)&&It(Xt),"texture must be a square power of 2 to support mipmapping"),_(We.mipmask===(or<<1)-1,"missing or incomplete mipmap data")),We.type===dt&&(it.extensions.indexOf("oes_texture_float_linear")<0&&_(he.minFilter===Te&&he.magFilter===Te,"filter not supported, must enable oes_texture_float_linear"),_(!he.genMipmaps,"mipmap generation not supported with float textures"));var gr=We.images;for(Zt=0;Zt<16;++Zt)if(gr[Zt]){var Er=or>>Zt,wr=Xt>>Zt;_(We.mipmask&1<<Zt,"missing mipmap data");var _r=gr[Zt];if(_(_r.width===Er&&_r.height===wr,"invalid shape for mip images"),_(_r.format===We.format&&_r.internalformat===We.internalformat&&_r.type===We.type,"incompatible type for mip image"),!_r.compressed)if(_r.data){var Br=Math.ceil(Hr(_r.type,Qt)*Er/_r.unpackAlignment)*_r.unpackAlignment;_(_r.data.byteLength===Br*wr,"invalid data for image, buffer size is inconsistent with image format")}else _r.element||_r.copy}else he.genMipmaps||_((We.mipmask&1<<Zt)===0,"extra mipmap data");We.compressed&&_(!he.genMipmaps,"mipmap generation for compressed images not supported")}function ar(he,We,it,Zt){var or=he.width,Xt=he.height,Qt=he.channels;_(or>0&&or<=Zt.maxTextureSize&&Xt>0&&Xt<=Zt.maxTextureSize,"invalid texture shape"),_(or===Xt,"cube map must be square"),_(We.wrapS===we&&We.wrapT===we,"wrap mode not supported by cube map");for(var gr=0;gr<it.length;++gr){var Er=it[gr];_(Er.width===or&&Er.height===Xt,"inconsistent cube map face shape"),We.genMipmaps&&(_(!Er.compressed,"can not generate mipmap for compressed textures"),_(Er.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var wr=Er.images,_r=0;_r<16;++_r){var Br=wr[_r];if(Br){var f=or>>_r,w=Xt>>_r;_(Er.mipmask&1<<_r,"missing mipmap data"),_(Br.width===f&&Br.height===w,"invalid shape for mip images"),_(Br.format===he.format&&Br.internalformat===he.internalformat&&Br.type===he.type,"incompatible type for mip image"),Br.compressed||(Br.data?_(Br.data.byteLength===f*w*Math.max(Hr(Br.type,Qt),Br.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Br.element||Br.copy)}}}}var Oe=F(_,{optional:Ae,raise:L,commandRaise:se,command:fe,parameter:T,commandParameter:Ie,constructor:s,type:v,commandType:ye,isTypedArray:x,nni:g,oneOf:d,shaderError:Z,linkError:J,callSite:Q,saveCommandRef:K,saveDrawInfo:ne,framebufferFormat:Se,guessCommand:j,texture2D:qt,textureCube:ar}),Pr=0,Cr=0,Gr=5,mr=6;function rn(he,We){this.id=Pr++,this.type=he,this.data=We}function Sr(he){return he.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function qr(he){if(he.length===0)return[];var We=he.charAt(0),it=he.charAt(he.length-1);if(he.length>1&&We===it&&(We==='"'||We==="'"))return['"'+Sr(he.substr(1,he.length-2))+'"'];var Zt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(he);if(Zt)return qr(he.substr(0,Zt.index)).concat(qr(Zt[1])).concat(qr(he.substr(Zt.index+Zt[0].length)));var or=he.split(".");if(or.length===1)return['"'+Sr(he)+'"'];for(var Xt=[],Qt=0;Qt<or.length;++Qt)Xt=Xt.concat(qr(or[Qt]));return Xt}function Rn(he){return"["+qr(he).join("][")+"]"}function yn(he,We){return new rn(he,Rn(We+""))}function zr(he){return typeof he=="function"&&!he._reglType||he instanceof rn}function Rt(he,We){if(typeof he=="function")return new rn(Cr,he);if(typeof he=="number"||typeof he=="boolean")return new rn(Gr,he);if(Array.isArray(he))return new rn(mr,he.map((it,Zt)=>Rt(it,We+"["+Zt+"]")));if(he instanceof rn)return he;Oe(!1,"invalid option type in uniform "+We)}var zt={DynamicVariable:rn,define:yn,isDynamic:zr,unbox:Rt,accessor:Rn},Vt={next:typeof requestAnimationFrame=="function"?function(he){return requestAnimationFrame(he)}:function(he){return setTimeout(he,16)},cancel:typeof cancelAnimationFrame=="function"?function(he){return cancelAnimationFrame(he)}:clearTimeout},hr=typeof performance!="undefined"&&performance.now?function(){return performance.now()}:function(){return+new Date};function Ar(){var he={"":0},We=[""];return{id:function(it){var Zt=he[it];return Zt||(Zt=he[it]=We.length,We.push(it),Zt)},str:function(it){return We[it]}}}function en(he,We,it){var Zt=document.createElement("canvas");F(Zt.style,{border:0,margin:0,padding:0,top:0,left:0}),he.appendChild(Zt),he===document.body&&(Zt.style.position="absolute",F(he.style,{margin:0,padding:0}));function or(){var gr=window.innerWidth,Er=window.innerHeight;if(he!==document.body){var wr=he.getBoundingClientRect();gr=wr.right-wr.left,Er=wr.bottom-wr.top}Zt.width=it*gr,Zt.height=it*Er,F(Zt.style,{width:gr+"px",height:Er+"px"})}var Xt;he!==document.body&&typeof ResizeObserver=="function"?(Xt=new ResizeObserver(function(){setTimeout(or)}),Xt.observe(he)):window.addEventListener("resize",or,!1);function Qt(){Xt?Xt.disconnect():window.removeEventListener("resize",or),he.removeChild(Zt)}return or(),{canvas:Zt,onDestroy:Qt}}function Fr(he,We){function it(Zt){try{return he.getContext(Zt,We)}catch(or){return null}}return it("webgl")||it("experimental-webgl")||it("webgl-experimental")}function Cn(he){return typeof he.nodeName=="string"&&typeof he.appendChild=="function"&&typeof he.getBoundingClientRect=="function"}function Sn(he){return typeof he.drawArrays=="function"||typeof he.drawElements=="function"}function oa(he){return typeof he=="string"?he.split():(Oe(Array.isArray(he),"invalid extension array"),he)}function jr(he){return typeof he=="string"?(Oe(typeof document!="undefined","not supported outside of DOM"),document.querySelector(he)):he}function xn(he){var We=he||{},it,Zt,or,Xt,Qt={},gr=[],Er=[],wr=typeof window=="undefined"?1:window.devicePixelRatio,_r=!1,Br=function(B){B&&Oe.raise(B)},f=function(){};if(typeof We=="string"?(Oe(typeof document!="undefined","selector queries only supported in DOM enviroments"),it=document.querySelector(We),Oe(it,"invalid query string for element")):typeof We=="object"?Cn(We)?it=We:Sn(We)?(Xt=We,or=Xt.canvas):(Oe.constructor(We),"gl"in We?Xt=We.gl:"canvas"in We?or=jr(We.canvas):"container"in We&&(Zt=jr(We.container)),"attributes"in We&&(Qt=We.attributes,Oe.type(Qt,"object","invalid context attributes")),"extensions"in We&&(gr=oa(We.extensions)),"optionalExtensions"in We&&(Er=oa(We.optionalExtensions)),"onDone"in We&&(Oe.type(We.onDone,"function","invalid or missing onDone callback"),Br=We.onDone),"profile"in We&&(_r=!!We.profile),"pixelRatio"in We&&(wr=+We.pixelRatio,Oe(wr>0,"invalid pixel ratio"))):Oe.raise("invalid arguments to regl"),it&&(it.nodeName.toLowerCase()==="canvas"?or=it:Zt=it),!Xt){if(!or){Oe(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var w=en(Zt||document.body,Br,wr);if(!w)return null;or=w.canvas,f=w.onDestroy}Qt.premultipliedAlpha===void 0&&(Qt.premultipliedAlpha=!0),Xt=Fr(or,Qt)}return Xt?{gl:Xt,canvas:or,container:Zt,extensions:gr,optionalExtensions:Er,pixelRatio:wr,profile:_r,onDone:Br,onDestroy:f}:(f(),Br("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function vn(he,We){var it={};function Zt(Qt){Oe.type(Qt,"string","extension name must be string");var gr=Qt.toLowerCase(),Er;try{Er=it[gr]=he.getExtension(gr)}catch(wr){}return!!Er}for(var or=0;or<We.extensions.length;++or){var Xt=We.extensions[or];if(!Zt(Xt))return We.onDestroy(),We.onDone('"'+Xt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return We.optionalExtensions.forEach(Zt),{extensions:it,restore:function(){Object.keys(it).forEach(function(Qt){if(it[Qt]&&!Zt(Qt))throw new Error("(regl): error restoring extension "+Qt)})}}}function un(he,We){for(var it=Array(he),Zt=0;Zt<he;++Zt)it[Zt]=We(Zt);return it}var Wn=5120,Y=5121,ie=5122,ee=5123,C=5124,b=5125,S=5126;function X(he){for(var We=16;We<=1<<28;We*=16)if(he<=We)return We;return 0}function pe(he){var We,it;return We=(he>65535)<<4,he>>>=We,it=(he>255)<<3,he>>>=it,We|=it,it=(he>15)<<2,he>>>=it,We|=it,it=(he>3)<<1,he>>>=it,We|=it,We|he>>1}function Me(){var he=un(8,function(){return[]});function We(Xt){var Qt=X(Xt),gr=he[pe(Qt)>>2];return gr.length>0?gr.pop():new ArrayBuffer(Qt)}function it(Xt){he[pe(Xt.byteLength)>>2].push(Xt)}function Zt(Xt,Qt){var gr=null;switch(Xt){case Wn:gr=new Int8Array(We(Qt),0,Qt);break;case Y:gr=new Uint8Array(We(Qt),0,Qt);break;case ie:gr=new Int16Array(We(2*Qt),0,Qt);break;case ee:gr=new Uint16Array(We(2*Qt),0,Qt);break;case C:gr=new Int32Array(We(4*Qt),0,Qt);break;case b:gr=new Uint32Array(We(4*Qt),0,Qt);break;case S:gr=new Float32Array(We(4*Qt),0,Qt);break;default:return null}return gr.length!==Qt?gr.subarray(0,Qt):gr}function or(Xt){it(Xt.buffer)}return{alloc:We,free:it,allocType:Zt,freeType:or}}var me=Me();me.zero=Me();var Le=3408,st=3410,qe=3411,Nt=3412,nr=3413,Ft=3414,er=3415,Ur=33901,Ct=33902,Kt=3379,lr=3386,Dr=34921,br=36347,sa=36348,ea=35661,gn=35660,Tn=34930,ra=36349,Zn=34076,Vr=34024,In=7936,at=7937,D=7938,te=35724,xe=34047,be=36063,De=34852,Xe=3553,Je=34067,lt=34069,Tt=33984,Ht=6408,ir=5126,Kr=5121,nn=36160,mn=36053,Jr=36064,jn=16384,_a=function(he,We){var it=1;We.ext_texture_filter_anisotropic&&(it=he.getParameter(xe));var Zt=1,or=1;We.webgl_draw_buffers&&(Zt=he.getParameter(De),or=he.getParameter(be));var Xt=!!We.oes_texture_float;if(Xt){var Qt=he.createTexture();he.bindTexture(Xe,Qt),he.texImage2D(Xe,0,Ht,1,1,0,Ht,ir,null);var gr=he.createFramebuffer();if(he.bindFramebuffer(nn,gr),he.framebufferTexture2D(nn,Jr,Xe,Qt,0),he.bindTexture(Xe,null),he.checkFramebufferStatus(nn)!==mn)Xt=!1;else{he.viewport(0,0,1,1),he.clearColor(1,0,0,1),he.clear(jn);var Er=me.allocType(ir,4);he.readPixels(0,0,1,1,Ht,ir,Er),he.getError()?Xt=!1:(he.deleteFramebuffer(gr),he.deleteTexture(Qt),Xt=Er[0]===1),me.freeType(Er)}}var wr=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),_r=!0;if(!wr){var Br=he.createTexture(),f=me.allocType(Kr,36);he.activeTexture(Tt),he.bindTexture(Je,Br),he.texImage2D(lt,0,Ht,3,3,0,Ht,Kr,f),me.freeType(f),he.bindTexture(Je,null),he.deleteTexture(Br),_r=!he.getError()}return{colorBits:[he.getParameter(st),he.getParameter(qe),he.getParameter(Nt),he.getParameter(nr)],depthBits:he.getParameter(Ft),stencilBits:he.getParameter(er),subpixelBits:he.getParameter(Le),extensions:Object.keys(We).filter(function(w){return!!We[w]}),maxAnisotropic:it,maxDrawbuffers:Zt,maxColorAttachments:or,pointSizeDims:he.getParameter(Ur),lineWidthDims:he.getParameter(Ct),maxViewportDims:he.getParameter(lr),maxCombinedTextureUnits:he.getParameter(ea),maxCubeMapSize:he.getParameter(Zn),maxRenderbufferSize:he.getParameter(Vr),maxTextureUnits:he.getParameter(Tn),maxTextureSize:he.getParameter(Kt),maxAttributes:he.getParameter(Dr),maxVertexUniforms:he.getParameter(br),maxVertexTextureUnits:he.getParameter(gn),maxVaryingVectors:he.getParameter(sa),maxFragmentUniforms:he.getParameter(ra),glsl:he.getParameter(te),renderer:he.getParameter(at),vendor:he.getParameter(In),version:he.getParameter(D),readFloat:Xt,npotTextureCube:_r}};function Fn(he){return!!he&&typeof he=="object"&&Array.isArray(he.shape)&&Array.isArray(he.stride)&&typeof he.offset=="number"&&he.shape.length===he.stride.length&&(Array.isArray(he.data)||N(he.data))}var ya=function(he){return Object.keys(he).map(function(We){return he[We]})},Ai={shape:Ei,flatten:ho};function bo(he,We,it){for(var Zt=0;Zt<We;++Zt)it[Zt]=he[Zt]}function Zi(he,We,it,Zt){for(var or=0,Xt=0;Xt<We;++Xt)for(var Qt=he[Xt],gr=0;gr<it;++gr)Zt[or++]=Qt[gr]}function Fi(he,We,it,Zt,or,Xt){for(var Qt=Xt,gr=0;gr<We;++gr)for(var Er=he[gr],wr=0;wr<it;++wr)for(var _r=Er[wr],Br=0;Br<Zt;++Br)or[Qt++]=_r[Br]}function Kn(he,We,it,Zt,or){for(var Xt=1,Qt=it+1;Qt<We.length;++Qt)Xt*=We[Qt];var gr=We[it];if(We.length-it===4){var Er=We[it+1],wr=We[it+2],_r=We[it+3];for(Qt=0;Qt<gr;++Qt)Fi(he[Qt],Er,wr,_r,Zt,or),or+=Xt}else for(Qt=0;Qt<gr;++Qt)Kn(he[Qt],We,it+1,Zt,or),or+=Xt}function ho(he,We,it,Zt){var or=1;if(We.length)for(var Xt=0;Xt<We.length;++Xt)or*=We[Xt];else or=0;var Qt=Zt||me.allocType(it,or);switch(We.length){case 0:break;case 1:bo(he,We[0],Qt);break;case 2:Zi(he,We[0],We[1],Qt);break;case 3:Fi(he,We[0],We[1],We[2],Qt,0);break;default:Kn(he,We,0,Qt,0)}return Qt}function Ei(he){for(var We=[],it=he;it.length;it=it[0])We.push(it.length);return We}var eo={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Eo=5120,Yo=5122,Po=5124,Ki=5121,Si=5123,Ns=5125,On=5126,Gi=5126,to={int8:Eo,int16:Yo,int32:Po,uint8:Ki,uint16:Si,uint32:Ns,float:On,float32:Gi},_i=35048,Ru=35040,xo={dynamic:_i,stream:Ru,static:35044},ri=Ai.flatten,wo=Ai.shape,ds=35044,Ho=35040,zi=5121,$i=5126,Va=[];Va[5120]=1,Va[5122]=2,Va[5124]=4,Va[5121]=1,Va[5123]=2,Va[5125]=4,Va[5126]=4;function ro(he){return eo[Object.prototype.toString.call(he)]|0}function Zo(he,We){for(var it=0;it<We.length;++it)he[it]=We[it]}function Ui(he,We,it,Zt,or,Xt,Qt){for(var gr=0,Er=0;Er<it;++Er)for(var wr=0;wr<Zt;++wr)he[gr++]=We[or*Er+Xt*wr+Qt]}function Wi(he,We,it,Zt){var or=0,Xt={};function Qt(V){this.id=or++,this.buffer=he.createBuffer(),this.type=V,this.usage=ds,this.byteLength=0,this.dimension=1,this.dtype=zi,this.persistentData=null,it.profile&&(this.stats={size:0})}Qt.prototype.bind=function(){he.bindBuffer(this.type,this.buffer)},Qt.prototype.destroy=function(){f(this)};var gr=[];function Er(V,re){var oe=gr.pop();return oe||(oe=new Qt(V)),oe.bind(),Br(oe,re,Ho,0,1,!1),oe}function wr(V){gr.push(V)}function _r(V,re,oe){V.byteLength=re.byteLength,he.bufferData(V.type,re,oe)}function Br(V,re,oe,le,ge,_e){var Ne;if(V.usage=oe,Array.isArray(re)){if(V.dtype=le||$i,re.length>0){var ze;if(Array.isArray(re[0])){Ne=wo(re);for(var Be=1,nt=1;nt<Ne.length;++nt)Be*=Ne[nt];V.dimension=Be,ze=ri(re,Ne,V.dtype),_r(V,ze,oe),_e?V.persistentData=ze:me.freeType(ze)}else if(typeof re[0]=="number"){V.dimension=ge;var _t=me.allocType(V.dtype,re.length);Zo(_t,re),_r(V,_t,oe),_e?V.persistentData=_t:me.freeType(_t)}else N(re[0])?(V.dimension=re[0].length,V.dtype=le||ro(re[0])||$i,ze=ri(re,[re.length,re[0].length],V.dtype),_r(V,ze,oe),_e?V.persistentData=ze:me.freeType(ze)):Oe.raise("invalid buffer data")}}else if(N(re))V.dtype=le||ro(re),V.dimension=ge,_r(V,re,oe),_e&&(V.persistentData=new Uint8Array(new Uint8Array(re.buffer)));else if(Fn(re)){Ne=re.shape;var tr=re.stride,Pt=re.offset,kt=0,Dt=0,pr=0,Xr=0;Ne.length===1?(kt=Ne[0],Dt=1,pr=tr[0],Xr=0):Ne.length===2?(kt=Ne[0],Dt=Ne[1],pr=tr[0],Xr=tr[1]):Oe.raise("invalid shape"),V.dtype=le||ro(re.data)||$i,V.dimension=Dt;var Or=me.allocType(V.dtype,kt*Dt);Ui(Or,re.data,kt,Dt,pr,Xr,Pt),_r(V,Or,oe),_e?V.persistentData=Or:me.freeType(Or)}else re instanceof ArrayBuffer?(V.dtype=zi,V.dimension=ge,_r(V,re,oe),_e&&(V.persistentData=new Uint8Array(new Uint8Array(re)))):Oe.raise("invalid buffer data")}function f(V){We.bufferCount--,Zt(V);var re=V.buffer;Oe(re,"buffer must not be deleted already"),he.deleteBuffer(re),V.buffer=null,delete Xt[V.id]}function w(V,re,oe,le){We.bufferCount++;var ge=new Qt(re);Xt[ge.id]=ge;function _e(Be){var nt=ds,_t=null,tr=0,Pt=0,kt=1;return Array.isArray(Be)||N(Be)||Fn(Be)||Be instanceof ArrayBuffer?_t=Be:typeof Be=="number"?tr=Be|0:Be&&(Oe.type(Be,"object","buffer arguments must be an object, a number or an array"),"data"in Be&&(Oe(_t===null||Array.isArray(_t)||N(_t)||Fn(_t),"invalid data for buffer"),_t=Be.data),"usage"in Be&&(Oe.parameter(Be.usage,xo,"invalid buffer usage"),nt=xo[Be.usage]),"type"in Be&&(Oe.parameter(Be.type,to,"invalid buffer type"),Pt=to[Be.type]),"dimension"in Be&&(Oe.type(Be.dimension,"number","invalid dimension"),kt=Be.dimension|0),"length"in Be&&(Oe.nni(tr,"buffer length must be a nonnegative integer"),tr=Be.length|0)),ge.bind(),_t?Br(ge,_t,nt,Pt,kt,le):(tr&&he.bufferData(ge.type,tr,nt),ge.dtype=Pt||zi,ge.usage=nt,ge.dimension=kt,ge.byteLength=tr),it.profile&&(ge.stats.size=ge.byteLength*Va[ge.dtype]),_e}function Ne(Be,nt){Oe(nt+Be.byteLength<=ge.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Be.byteLength+" starting from offset "+nt+" to a buffer of size "+ge.byteLength),he.bufferSubData(ge.type,nt,Be)}function ze(Be,nt){var _t=(nt||0)|0,tr;if(ge.bind(),N(Be)||Be instanceof ArrayBuffer)Ne(Be,_t);else if(Array.isArray(Be)){if(Be.length>0)if(typeof Be[0]=="number"){var Pt=me.allocType(ge.dtype,Be.length);Zo(Pt,Be),Ne(Pt,_t),me.freeType(Pt)}else if(Array.isArray(Be[0])||N(Be[0])){tr=wo(Be);var kt=ri(Be,tr,ge.dtype);Ne(kt,_t),me.freeType(kt)}else Oe.raise("invalid buffer data")}else if(Fn(Be)){tr=Be.shape;var Dt=Be.stride,pr=0,Xr=0,Or=0,fn=0;tr.length===1?(pr=tr[0],Xr=1,Or=Dt[0],fn=0):tr.length===2?(pr=tr[0],Xr=tr[1],Or=Dt[0],fn=Dt[1]):Oe.raise("invalid shape");var cn=Array.isArray(Be.data)?ge.dtype:ro(Be.data),Mn=me.allocType(cn,pr*Xr);Ui(Mn,Be.data,pr,Xr,Or,fn,Be.offset),Ne(Mn,_t),me.freeType(Mn)}else Oe.raise("invalid data for buffer subdata");return _e}return oe||_e(V),_e._reglType="buffer",_e._buffer=ge,_e.subdata=ze,it.profile&&(_e.stats=ge.stats),_e.destroy=function(){f(ge)},_e}function B(){ya(Xt).forEach(function(V){V.buffer=he.createBuffer(),he.bindBuffer(V.type,V.buffer),he.bufferData(V.type,V.persistentData||V.byteLength,V.usage)})}return it.profile&&(We.getTotalBufferSize=function(){var V=0;return Object.keys(Xt).forEach(function(re){V+=Xt[re].stats.size}),V}),{create:w,createStream:Er,destroyStream:wr,clear:function(){ya(Xt).forEach(f),gr.forEach(f)},getBuffer:function(V){return V&&V._buffer instanceof Qt?V._buffer:null},restore:B,_initBuffer:Br}}var Ko=0,vo=0,hs=1,Ca=1,So=4,ou=4,di={points:Ko,point:vo,lines:hs,line:Ca,triangles:So,triangle:ou,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},mi=0,_o=1,hi=4,xi=5120,Vn=5121,ni=5122,qa=5123,wi=5124,bi=5125,Mi=34963,go=35040,no=35044;function Mo(he,We,it,Zt){var or={},Xt=0,Qt={uint8:Vn,uint16:qa};We.oes_element_index_uint&&(Qt.uint32=bi);function gr(B){this.id=Xt++,or[this.id]=this,this.buffer=B,this.primType=hi,this.vertCount=0,this.type=0}gr.prototype.bind=function(){this.buffer.bind()};var Er=[];function wr(B){var V=Er.pop();return V||(V=new gr(it.create(null,Mi,!0,!1)._buffer)),Br(V,B,go,-1,-1,0,0),V}function _r(B){Er.push(B)}function Br(B,V,re,oe,le,ge,_e){B.buffer.bind();var Ne;if(V){var ze=_e;!_e&&(!N(V)||Fn(V)&&!N(V.data))&&(ze=We.oes_element_index_uint?bi:qa),it._initBuffer(B.buffer,V,re,ze,3)}else he.bufferData(Mi,ge,re),B.buffer.dtype=Ne||Vn,B.buffer.usage=re,B.buffer.dimension=3,B.buffer.byteLength=ge;if(Ne=_e,!_e){switch(B.buffer.dtype){case Vn:case xi:Ne=Vn;break;case qa:case ni:Ne=qa;break;case bi:case wi:Ne=bi;break;default:Oe.raise("unsupported type for element array")}B.buffer.dtype=Ne}B.type=Ne,Oe(Ne!==bi||!!We.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Be=le;Be<0&&(Be=B.buffer.byteLength,Ne===qa?Be>>=1:Ne===bi&&(Be>>=2)),B.vertCount=Be;var nt=oe;if(oe<0){nt=hi;var _t=B.buffer.dimension;_t===1&&(nt=mi),_t===2&&(nt=_o),_t===3&&(nt=hi)}B.primType=nt}function f(B){Zt.elementsCount--,Oe(B.buffer!==null,"must not double destroy elements"),delete or[B.id],B.buffer.destroy(),B.buffer=null}function w(B,V){var re=it.create(null,Mi,!0),oe=new gr(re._buffer);Zt.elementsCount++;function le(ge){if(!ge)re(),oe.primType=hi,oe.vertCount=0,oe.type=Vn;else if(typeof ge=="number")re(ge),oe.primType=hi,oe.vertCount=ge|0,oe.type=Vn;else{var _e=null,Ne=no,ze=-1,Be=-1,nt=0,_t=0;Array.isArray(ge)||N(ge)||Fn(ge)?_e=ge:(Oe.type(ge,"object","invalid arguments for elements"),"data"in ge&&(_e=ge.data,Oe(Array.isArray(_e)||N(_e)||Fn(_e),"invalid data for element buffer")),"usage"in ge&&(Oe.parameter(ge.usage,xo,"invalid element buffer usage"),Ne=xo[ge.usage]),"primitive"in ge&&(Oe.parameter(ge.primitive,di,"invalid element buffer primitive"),ze=di[ge.primitive]),"count"in ge&&(Oe(typeof ge.count=="number"&&ge.count>=0,"invalid vertex count for elements"),Be=ge.count|0),"type"in ge&&(Oe.parameter(ge.type,Qt,"invalid buffer type"),_t=Qt[ge.type]),"length"in ge?nt=ge.length|0:(nt=Be,_t===qa||_t===ni?nt*=2:(_t===bi||_t===wi)&&(nt*=4))),Br(oe,_e,Ne,ze,Be,nt,_t)}return le}return le(B),le._reglType="elements",le._elements=oe,le.subdata=function(ge,_e){return re.subdata(ge,_e),le},le.destroy=function(){f(oe)},le}return{create:w,createStream:wr,destroyStream:_r,getElements:function(B){return typeof B=="function"&&B._elements instanceof gr?B._elements:null},clear:function(){ya(or).forEach(f)}}}var po=new Float32Array(1),su=new Uint32Array(po.buffer),gf=5123;function uu(he){for(var We=me.allocType(gf,he.length),it=0;it<he.length;++it)if(isNaN(he[it]))We[it]=65535;else if(he[it]===1/0)We[it]=31744;else if(he[it]===-1/0)We[it]=64512;else{po[0]=he[it];var Zt=su[0],or=Zt>>>31<<15,Xt=(Zt<<1>>>24)-127,Qt=Zt>>13&1024-1;if(Xt<-24)We[it]=or;else if(Xt<-14){var gr=-14-Xt;We[it]=or+(Qt+1024>>gr)}else Xt>15?We[it]=or+31744:We[it]=or+(Xt+15<<10)+Qt}return We}function _n(he){return Array.isArray(he)||N(he)}var dn=function(he){return!(he&he-1)&&!!he},rc=34467,ai=3553,Ps=34067,$o=34069,Ba=6408,$a=6406,Qo=6407,Jo=6409,vs=6410,Bu=32854,Fu=32855,Fa=36194,yo=32819,gs=32820,fu=33635,cu=34042,ks=6402,ps=34041,ys=35904,Gu=35906,Oi=36193,ko=33776,Rs=33777,zu=33778,lu=33779,Bs=35986,qo=35987,Fs=34798,du=35840,hu=35841,Uu=35842,Wu=35843,ao=36196,Ro=5121,Xu=5123,vu=5125,Xi=5126,pf=10242,ju=10243,yf=10497,Gs=33071,nc=33648,mf=10240,bf=10241,zs=9728,Vu=9729,gu=9984,pu=9985,yu=9986,Us=9987,Bo=33170,es=4352,vi=4353,Ws=4354,Xs=34046,Ef=3317,xf=37440,Yu=37441,js=37443,ji=37444,mo=33984,ac=[gu,yu,pu,Us],Vs=[0,Jo,vs,Qo,Ba],Vi={};Vi[Jo]=Vi[$a]=Vi[ks]=1,Vi[ps]=Vi[vs]=2,Vi[Qo]=Vi[ys]=3,Vi[Ba]=Vi[Gu]=4;function Fo(he){return"[object "+he+"]"}var wf=Fo("HTMLCanvasElement"),Sf=Fo("OffscreenCanvas"),Ys=Fo("CanvasRenderingContext2D"),Hu=Fo("ImageBitmap"),ts=Fo("HTMLImageElement"),ms=Fo("HTMLVideoElement"),Zu=Object.keys(eo).concat([wf,Sf,Ys,Hu,ts,ms]),rs=[];rs[Ro]=1,rs[Xi]=4,rs[Oi]=2,rs[Xu]=2,rs[vu]=4;var ii=[];ii[Bu]=2,ii[Fu]=2,ii[Fa]=2,ii[ps]=4,ii[ko]=.5,ii[Rs]=.5,ii[zu]=1,ii[lu]=1,ii[Bs]=.5,ii[qo]=1,ii[Fs]=1,ii[du]=.5,ii[hu]=.25,ii[Uu]=.5,ii[Wu]=.25,ii[ao]=.5;function Hs(he){return Array.isArray(he)&&(he.length===0||typeof he[0]=="number")}function bs(he){if(!Array.isArray(he))return!1;var We=he.length;return!(We===0||!_n(he[0]))}function io(he){return Object.prototype.toString.call(he)}function ns(he){return io(he)===wf}function _f(he){return io(he)===Sf}function Mf(he){return io(he)===Ys}function Co(he){return io(he)===Hu}function ic(he){return io(he)===ts}function oc(he){return io(he)===ms}function Es(he){if(!he)return!1;var We=io(he);return Zu.indexOf(We)>=0?!0:Hs(he)||bs(he)||Fn(he)}function Cf(he){return eo[Object.prototype.toString.call(he)]|0}function mu(he,We){var it=We.length;switch(he.type){case Ro:case Xu:case vu:case Xi:var Zt=me.allocType(he.type,it);Zt.set(We),he.data=Zt;break;case Oi:he.data=uu(We);break;default:Oe.raise("unsupported texture type, must specify a typed array")}}function Ku(he,We){return me.allocType(he.type===Oi?Xi:he.type,We)}function $u(he,We){he.type===Oi?(he.data=uu(We),me.freeType(We)):he.data=We}function bu(he,We,it,Zt,or,Xt){for(var Qt=he.width,gr=he.height,Er=he.channels,wr=Qt*gr*Er,_r=Ku(he,wr),Br=0,f=0;f<gr;++f)for(var w=0;w<Qt;++w)for(var B=0;B<Er;++B)_r[Br++]=We[it*w+Zt*f+or*B+Xt];$u(he,_r)}function as(he,We,it,Zt,or,Xt){var Qt;if(typeof ii[he]!="undefined"?Qt=ii[he]:Qt=Vi[he]*rs[We],Xt&&(Qt*=6),or){for(var gr=0,Er=it;Er>=1;)gr+=Qt*Er*Er,Er/=2;return gr}else return Qt*it*Zt}function Eu(he,We,it,Zt,or,Xt,Qt){var gr={"don't care":es,"dont care":es,nice:Ws,fast:vi},Er={repeat:yf,clamp:Gs,mirror:nc},wr={nearest:zs,linear:Vu},_r=F({mipmap:Us,"nearest mipmap nearest":gu,"linear mipmap nearest":pu,"nearest mipmap linear":yu,"linear mipmap linear":Us},wr),Br={none:0,browser:ji},f={uint8:Ro,rgba4:yo,rgb565:fu,"rgb5 a1":gs},w={alpha:$a,luminance:Jo,"luminance alpha":vs,rgb:Qo,rgba:Ba,rgba4:Bu,"rgb5 a1":Fu,rgb565:Fa},B={};We.ext_srgb&&(w.srgb=ys,w.srgba=Gu),We.oes_texture_float&&(f.float32=f.float=Xi),We.oes_texture_half_float&&(f.float16=f["half float"]=Oi),We.webgl_depth_texture&&(F(w,{depth:ks,"depth stencil":ps}),F(f,{uint16:Xu,uint32:vu,"depth stencil":cu})),We.webgl_compressed_texture_s3tc&&F(B,{"rgb s3tc dxt1":ko,"rgba s3tc dxt1":Rs,"rgba s3tc dxt3":zu,"rgba s3tc dxt5":lu}),We.webgl_compressed_texture_atc&&F(B,{"rgb atc":Bs,"rgba atc explicit alpha":qo,"rgba atc interpolated alpha":Fs}),We.webgl_compressed_texture_pvrtc&&F(B,{"rgb pvrtc 4bppv1":du,"rgb pvrtc 2bppv1":hu,"rgba pvrtc 4bppv1":Uu,"rgba pvrtc 2bppv1":Wu}),We.webgl_compressed_texture_etc1&&(B["rgb etc1"]=ao);var V=Array.prototype.slice.call(he.getParameter(rc));Object.keys(B).forEach(function(rt){var $t=B[rt];V.indexOf($t)>=0&&(w[rt]=$t)});var re=Object.keys(w);it.textureFormats=re;var oe=[];Object.keys(w).forEach(function(rt){var $t=w[rt];oe[$t]=rt});var le=[];Object.keys(f).forEach(function(rt){var $t=f[rt];le[$t]=rt});var ge=[];Object.keys(wr).forEach(function(rt){var $t=wr[rt];ge[$t]=rt});var _e=[];Object.keys(_r).forEach(function(rt){var $t=_r[rt];_e[$t]=rt});var Ne=[];Object.keys(Er).forEach(function(rt){var $t=Er[rt];Ne[$t]=rt});var ze=re.reduce(function(rt,$t){var Yt=w[$t];return Yt===Jo||Yt===$a||Yt===Jo||Yt===vs||Yt===ks||Yt===ps||We.ext_srgb&&(Yt===ys||Yt===Gu)?rt[Yt]=Yt:Yt===Fu||$t.indexOf("rgba")>=0?rt[Yt]=Ba:rt[Yt]=Qo,rt},{});function Be(){this.internalformat=Ba,this.format=Ba,this.type=Ro,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ji,this.width=0,this.height=0,this.channels=0}function nt(rt,$t){rt.internalformat=$t.internalformat,rt.format=$t.format,rt.type=$t.type,rt.compressed=$t.compressed,rt.premultiplyAlpha=$t.premultiplyAlpha,rt.flipY=$t.flipY,rt.unpackAlignment=$t.unpackAlignment,rt.colorSpace=$t.colorSpace,rt.width=$t.width,rt.height=$t.height,rt.channels=$t.channels}function _t(rt,$t){if(!(typeof $t!="object"||!$t)){if("premultiplyAlpha"in $t&&(Oe.type($t.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),rt.premultiplyAlpha=$t.premultiplyAlpha),"flipY"in $t&&(Oe.type($t.flipY,"boolean","invalid texture flip"),rt.flipY=$t.flipY),"alignment"in $t&&(Oe.oneOf($t.alignment,[1,2,4,8],"invalid texture unpack alignment"),rt.unpackAlignment=$t.alignment),"colorSpace"in $t&&(Oe.parameter($t.colorSpace,Br,"invalid colorSpace"),rt.colorSpace=Br[$t.colorSpace]),"type"in $t){var Yt=$t.type;Oe(We.oes_texture_float||!(Yt==="float"||Yt==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),Oe(We.oes_texture_half_float||!(Yt==="half float"||Yt==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Oe(We.webgl_depth_texture||!(Yt==="uint16"||Yt==="uint32"||Yt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Oe.parameter(Yt,f,"invalid texture type"),rt.type=f[Yt]}var Lr=rt.width,ia=rt.height,Ze=rt.channels,Fe=!1;"shape"in $t?(Oe(Array.isArray($t.shape)&&$t.shape.length>=2,"shape must be an array"),Lr=$t.shape[0],ia=$t.shape[1],$t.shape.length===3&&(Ze=$t.shape[2],Oe(Ze>0&&Ze<=4,"invalid number of channels"),Fe=!0),Oe(Lr>=0&&Lr<=it.maxTextureSize,"invalid width"),Oe(ia>=0&&ia<=it.maxTextureSize,"invalid height")):("radius"in $t&&(Lr=ia=$t.radius,Oe(Lr>=0&&Lr<=it.maxTextureSize,"invalid radius")),"width"in $t&&(Lr=$t.width,Oe(Lr>=0&&Lr<=it.maxTextureSize,"invalid width")),"height"in $t&&(ia=$t.height,Oe(ia>=0&&ia<=it.maxTextureSize,"invalid height")),"channels"in $t&&(Ze=$t.channels,Oe(Ze>0&&Ze<=4,"invalid number of channels"),Fe=!0)),rt.width=Lr|0,rt.height=ia|0,rt.channels=Ze|0;var vt=!1;if("format"in $t){var Bt=$t.format;Oe(We.webgl_depth_texture||!(Bt==="depth"||Bt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Oe.parameter(Bt,w,"invalid texture format");var Ut=rt.internalformat=w[Bt];rt.format=ze[Ut],Bt in f&&("type"in $t||(rt.type=f[Bt])),Bt in B&&(rt.compressed=!0),vt=!0}!Fe&&vt?rt.channels=Vi[rt.format]:Fe&&!vt?rt.channels!==Vs[rt.format]&&(rt.format=rt.internalformat=Vs[rt.channels]):vt&&Fe&&Oe(rt.channels===Vi[rt.format],"number of channels inconsistent with specified format")}}function tr(rt){he.pixelStorei(xf,rt.flipY),he.pixelStorei(Yu,rt.premultiplyAlpha),he.pixelStorei(js,rt.colorSpace),he.pixelStorei(Ef,rt.unpackAlignment)}function Pt(){Be.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function kt(rt,$t){var Yt=null;if(Es($t)?Yt=$t:$t&&(Oe.type($t,"object","invalid pixel data type"),_t(rt,$t),"x"in $t&&(rt.xOffset=$t.x|0),"y"in $t&&(rt.yOffset=$t.y|0),Es($t.data)&&(Yt=$t.data)),Oe(!rt.compressed||Yt instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),$t.copy){Oe(!Yt,"can not specify copy and data field for the same texture");var Lr=or.viewportWidth,ia=or.viewportHeight;rt.width=rt.width||Lr-rt.xOffset,rt.height=rt.height||ia-rt.yOffset,rt.needsCopy=!0,Oe(rt.xOffset>=0&&rt.xOffset<Lr&&rt.yOffset>=0&&rt.yOffset<ia&&rt.width>0&&rt.width<=Lr&&rt.height>0&&rt.height<=ia,"copy texture read out of bounds")}else if(!Yt)rt.width=rt.width||1,rt.height=rt.height||1,rt.channels=rt.channels||4;else if(N(Yt))rt.channels=rt.channels||4,rt.data=Yt,!("type"in $t)&&rt.type===Ro&&(rt.type=Cf(Yt));else if(Hs(Yt))rt.channels=rt.channels||4,mu(rt,Yt),rt.alignment=1,rt.needsFree=!0;else if(Fn(Yt)){var Ze=Yt.data;!Array.isArray(Ze)&&rt.type===Ro&&(rt.type=Cf(Ze));var Fe=Yt.shape,vt=Yt.stride,Bt,Ut,Et,gt,Ot,Ke;Fe.length===3?(Et=Fe[2],Ke=vt[2]):(Oe(Fe.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Et=1,Ke=1),Bt=Fe[0],Ut=Fe[1],gt=vt[0],Ot=vt[1],rt.alignment=1,rt.width=Bt,rt.height=Ut,rt.channels=Et,rt.format=rt.internalformat=Vs[Et],rt.needsFree=!0,bu(rt,Ze,gt,Ot,Ke,Yt.offset)}else if(ns(Yt)||_f(Yt)||Mf(Yt))ns(Yt)||_f(Yt)?rt.element=Yt:rt.element=Yt.canvas,rt.width=rt.element.width,rt.height=rt.element.height,rt.channels=4;else if(Co(Yt))rt.element=Yt,rt.width=Yt.width,rt.height=Yt.height,rt.channels=4;else if(ic(Yt))rt.element=Yt,rt.width=Yt.naturalWidth,rt.height=Yt.naturalHeight,rt.channels=4;else if(oc(Yt))rt.element=Yt,rt.width=Yt.videoWidth,rt.height=Yt.videoHeight,rt.channels=4;else if(bs(Yt)){var ct=rt.width||Yt[0].length,Ye=rt.height||Yt.length,At=rt.channels;_n(Yt[0][0])?At=At||Yt[0][0].length:At=At||1;for(var Wt=Ai.shape(Yt),sr=1,fr=0;fr<Wt.length;++fr)sr*=Wt[fr];var rr=Ku(rt,sr);Ai.flatten(Yt,Wt,"",rr),$u(rt,rr),rt.alignment=1,rt.width=ct,rt.height=Ye,rt.channels=At,rt.format=rt.internalformat=Vs[At],rt.needsFree=!0}rt.type===Xi?Oe(it.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):rt.type===Oi&&Oe(it.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Dt(rt,$t,Yt){var Lr=rt.element,ia=rt.data,Ze=rt.internalformat,Fe=rt.format,vt=rt.type,Bt=rt.width,Ut=rt.height;tr(rt),Lr?he.texImage2D($t,Yt,Fe,Fe,vt,Lr):rt.compressed?he.compressedTexImage2D($t,Yt,Ze,Bt,Ut,0,ia):rt.needsCopy?(Zt(),he.copyTexImage2D($t,Yt,Fe,rt.xOffset,rt.yOffset,Bt,Ut,0)):he.texImage2D($t,Yt,Fe,Bt,Ut,0,Fe,vt,ia||null)}function pr(rt,$t,Yt,Lr,ia){var Ze=rt.element,Fe=rt.data,vt=rt.internalformat,Bt=rt.format,Ut=rt.type,Et=rt.width,gt=rt.height;tr(rt),Ze?he.texSubImage2D($t,ia,Yt,Lr,Bt,Ut,Ze):rt.compressed?he.compressedTexSubImage2D($t,ia,Yt,Lr,vt,Et,gt,Fe):rt.needsCopy?(Zt(),he.copyTexSubImage2D($t,ia,Yt,Lr,rt.xOffset,rt.yOffset,Et,gt)):he.texSubImage2D($t,ia,Yt,Lr,Et,gt,Bt,Ut,Fe)}var Xr=[];function Or(){return Xr.pop()||new Pt}function fn(rt){rt.needsFree&&me.freeType(rt.data),Pt.call(rt),Xr.push(rt)}function cn(){Be.call(this),this.genMipmaps=!1,this.mipmapHint=es,this.mipmask=0,this.images=Array(16)}function Mn(rt,$t,Yt){var Lr=rt.images[0]=Or();rt.mipmask=1,Lr.width=rt.width=$t,Lr.height=rt.height=Yt,Lr.channels=rt.channels=4}function Un(rt,$t){var Yt=null;if(Es($t))Yt=rt.images[0]=Or(),nt(Yt,rt),kt(Yt,$t),rt.mipmask=1;else if(_t(rt,$t),Array.isArray($t.mipmap))for(var Lr=$t.mipmap,ia=0;ia<Lr.length;++ia)Yt=rt.images[ia]=Or(),nt(Yt,rt),Yt.width>>=ia,Yt.height>>=ia,kt(Yt,Lr[ia]),rt.mipmask|=1<<ia;else Yt=rt.images[0]=Or(),nt(Yt,rt),kt(Yt,$t),rt.mipmask=1;nt(rt,rt.images[0]),rt.compressed&&(rt.internalformat===ko||rt.internalformat===Rs||rt.internalformat===zu||rt.internalformat===lu)&&Oe(rt.width%4===0&&rt.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function kn(rt,$t){for(var Yt=rt.images,Lr=0;Lr<Yt.length;++Lr){if(!Yt[Lr])return;Dt(Yt[Lr],$t,Lr)}}var Na=[];function Bn(){var rt=Na.pop()||new cn;Be.call(rt),rt.mipmask=0;for(var $t=0;$t<16;++$t)rt.images[$t]=null;return rt}function Ha(rt){for(var $t=rt.images,Yt=0;Yt<$t.length;++Yt)$t[Yt]&&fn($t[Yt]),$t[Yt]=null;Na.push(rt)}function Aa(){this.minFilter=zs,this.magFilter=zs,this.wrapS=Gs,this.wrapT=Gs,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=es}function fa(rt,$t){if("min"in $t){var Yt=$t.min;Oe.parameter(Yt,_r),rt.minFilter=_r[Yt],ac.indexOf(rt.minFilter)>=0&&!("faces"in $t)&&(rt.genMipmaps=!0)}if("mag"in $t){var Lr=$t.mag;Oe.parameter(Lr,wr),rt.magFilter=wr[Lr]}var ia=rt.wrapS,Ze=rt.wrapT;if("wrap"in $t){var Fe=$t.wrap;typeof Fe=="string"?(Oe.parameter(Fe,Er),ia=Ze=Er[Fe]):Array.isArray(Fe)&&(Oe.parameter(Fe[0],Er),Oe.parameter(Fe[1],Er),ia=Er[Fe[0]],Ze=Er[Fe[1]])}else{if("wrapS"in $t){var vt=$t.wrapS;Oe.parameter(vt,Er),ia=Er[vt]}if("wrapT"in $t){var Bt=$t.wrapT;Oe.parameter(Bt,Er),Ze=Er[Bt]}}if(rt.wrapS=ia,rt.wrapT=Ze,"anisotropic"in $t){var Ut=$t.anisotropic;Oe(typeof Ut=="number"&&Ut>=1&&Ut<=it.maxAnisotropic,"aniso samples must be between 1 and "),rt.anisotropic=$t.anisotropic}if("mipmap"in $t){var Et=!1;switch(typeof $t.mipmap){case"string":Oe.parameter($t.mipmap,gr,"invalid mipmap hint"),rt.mipmapHint=gr[$t.mipmap],rt.genMipmaps=!0,Et=!0;break;case"boolean":Et=rt.genMipmaps=$t.mipmap;break;case"object":Oe(Array.isArray($t.mipmap),"invalid mipmap type"),rt.genMipmaps=!1,Et=!0;break;default:Oe.raise("invalid mipmap type")}Et&&!("min"in $t)&&(rt.minFilter=gu)}}function Wa(rt,$t){he.texParameteri($t,bf,rt.minFilter),he.texParameteri($t,mf,rt.magFilter),he.texParameteri($t,pf,rt.wrapS),he.texParameteri($t,ju,rt.wrapT),We.ext_texture_filter_anisotropic&&he.texParameteri($t,Xs,rt.anisotropic),rt.genMipmaps&&(he.hint(Bo,rt.mipmapHint),he.generateMipmap($t))}var Za=0,pi={},Di=it.maxTextureUnits,ui=Array(Di).map(function(){return null});function Jn(rt){Be.call(this),this.mipmask=0,this.internalformat=Ba,this.id=Za++,this.refCount=1,this.target=rt,this.texture=he.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Aa,Qt.profile&&(this.stats={size:0})}function Ni(rt){he.activeTexture(mo),he.bindTexture(rt.target,rt.texture)}function ma(){var rt=ui[0];rt?he.bindTexture(rt.target,rt.texture):he.bindTexture(ai,null)}function An(rt){var $t=rt.texture;Oe($t,"must not double destroy texture");var Yt=rt.unit,Lr=rt.target;Yt>=0&&(he.activeTexture(mo+Yt),he.bindTexture(Lr,null),ui[Yt]=null),he.deleteTexture($t),rt.texture=null,rt.params=null,rt.pixels=null,rt.refCount=0,delete pi[rt.id],Xt.textureCount--}F(Jn.prototype,{bind:function(){var rt=this;rt.bindCount+=1;var $t=rt.unit;if($t<0){for(var Yt=0;Yt<Di;++Yt){var Lr=ui[Yt];if(Lr){if(Lr.bindCount>0)continue;Lr.unit=-1}ui[Yt]=rt,$t=Yt;break}$t>=Di&&Oe.raise("insufficient number of texture units"),Qt.profile&&Xt.maxTextureUnits<$t+1&&(Xt.maxTextureUnits=$t+1),rt.unit=$t,he.activeTexture(mo+$t),he.bindTexture(rt.target,rt.texture)}return $t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&An(this)}});function ca(rt,$t){var Yt=new Jn(ai);pi[Yt.id]=Yt,Xt.textureCount++;function Lr(Fe,vt){var Bt=Yt.texInfo;Aa.call(Bt);var Ut=Bn();return typeof Fe=="number"?typeof vt=="number"?Mn(Ut,Fe|0,vt|0):Mn(Ut,Fe|0,Fe|0):Fe?(Oe.type(Fe,"object","invalid arguments to regl.texture"),fa(Bt,Fe),Un(Ut,Fe)):Mn(Ut,1,1),Bt.genMipmaps&&(Ut.mipmask=(Ut.width<<1)-1),Yt.mipmask=Ut.mipmask,nt(Yt,Ut),Oe.texture2D(Bt,Ut,it),Yt.internalformat=Ut.internalformat,Lr.width=Ut.width,Lr.height=Ut.height,Ni(Yt),kn(Ut,ai),Wa(Bt,ai),ma(),Ha(Ut),Qt.profile&&(Yt.stats.size=as(Yt.internalformat,Yt.type,Ut.width,Ut.height,Bt.genMipmaps,!1)),Lr.format=oe[Yt.internalformat],Lr.type=le[Yt.type],Lr.mag=ge[Bt.magFilter],Lr.min=_e[Bt.minFilter],Lr.wrapS=Ne[Bt.wrapS],Lr.wrapT=Ne[Bt.wrapT],Lr}function ia(Fe,vt,Bt,Ut){Oe(!!Fe,"must specify image data");var Et=vt|0,gt=Bt|0,Ot=Ut|0,Ke=Or();return nt(Ke,Yt),Ke.width=0,Ke.height=0,kt(Ke,Fe),Ke.width=Ke.width||(Yt.width>>Ot)-Et,Ke.height=Ke.height||(Yt.height>>Ot)-gt,Oe(Yt.type===Ke.type&&Yt.format===Ke.format&&Yt.internalformat===Ke.internalformat,"incompatible format for texture.subimage"),Oe(Et>=0&&gt>=0&&Et+Ke.width<=Yt.width&&gt+Ke.height<=Yt.height,"texture.subimage write out of bounds"),Oe(Yt.mipmask&1<<Ot,"missing mipmap data"),Oe(Ke.data||Ke.element||Ke.needsCopy,"missing image data"),Ni(Yt),pr(Ke,ai,Et,gt,Ot),ma(),fn(Ke),Lr}function Ze(Fe,vt){var Bt=Fe|0,Ut=vt|0||Bt;if(Bt===Yt.width&&Ut===Yt.height)return Lr;Lr.width=Yt.width=Bt,Lr.height=Yt.height=Ut,Ni(Yt);for(var Et=0;Yt.mipmask>>Et;++Et){var gt=Bt>>Et,Ot=Ut>>Et;if(!gt||!Ot)break;he.texImage2D(ai,Et,Yt.format,gt,Ot,0,Yt.format,Yt.type,null)}return ma(),Qt.profile&&(Yt.stats.size=as(Yt.internalformat,Yt.type,Bt,Ut,!1,!1)),Lr}return Lr(rt,$t),Lr.subimage=ia,Lr.resize=Ze,Lr._reglType="texture2d",Lr._texture=Yt,Qt.profile&&(Lr.stats=Yt.stats),Lr.destroy=function(){Yt.decRef()},Lr}function ba(rt,$t,Yt,Lr,ia,Ze){var Fe=new Jn(Ps);pi[Fe.id]=Fe,Xt.cubeCount++;var vt=new Array(6);function Bt(gt,Ot,Ke,ct,Ye,At){var Wt,sr=Fe.texInfo;for(Aa.call(sr),Wt=0;Wt<6;++Wt)vt[Wt]=Bn();if(typeof gt=="number"||!gt){var fr=gt|0||1;for(Wt=0;Wt<6;++Wt)Mn(vt[Wt],fr,fr)}else if(typeof gt=="object")if(Ot)Un(vt[0],gt),Un(vt[1],Ot),Un(vt[2],Ke),Un(vt[3],ct),Un(vt[4],Ye),Un(vt[5],At);else if(fa(sr,gt),_t(Fe,gt),"faces"in gt){var rr=gt.faces;for(Oe(Array.isArray(rr)&&rr.length===6,"cube faces must be a length 6 array"),Wt=0;Wt<6;++Wt)Oe(typeof rr[Wt]=="object"&&!!rr[Wt],"invalid input for cube map face"),nt(vt[Wt],Fe),Un(vt[Wt],rr[Wt])}else for(Wt=0;Wt<6;++Wt)Un(vt[Wt],gt);else Oe.raise("invalid arguments to cube map");for(nt(Fe,vt[0]),it.npotTextureCube||Oe(dn(Fe.width)&&dn(Fe.height),"your browser does not support non power or two texture dimensions"),sr.genMipmaps?Fe.mipmask=(vt[0].width<<1)-1:Fe.mipmask=vt[0].mipmask,Oe.textureCube(Fe,sr,vt,it),Fe.internalformat=vt[0].internalformat,Bt.width=vt[0].width,Bt.height=vt[0].height,Ni(Fe),Wt=0;Wt<6;++Wt)kn(vt[Wt],$o+Wt);for(Wa(sr,Ps),ma(),Qt.profile&&(Fe.stats.size=as(Fe.internalformat,Fe.type,Bt.width,Bt.height,sr.genMipmaps,!0)),Bt.format=oe[Fe.internalformat],Bt.type=le[Fe.type],Bt.mag=ge[sr.magFilter],Bt.min=_e[sr.minFilter],Bt.wrapS=Ne[sr.wrapS],Bt.wrapT=Ne[sr.wrapT],Wt=0;Wt<6;++Wt)Ha(vt[Wt]);return Bt}function Ut(gt,Ot,Ke,ct,Ye){Oe(!!Ot,"must specify image data"),Oe(typeof gt=="number"&&gt===(gt|0)&&gt>=0&&gt<6,"invalid face");var At=Ke|0,Wt=ct|0,sr=Ye|0,fr=Or();return nt(fr,Fe),fr.width=0,fr.height=0,kt(fr,Ot),fr.width=fr.width||(Fe.width>>sr)-At,fr.height=fr.height||(Fe.height>>sr)-Wt,Oe(Fe.type===fr.type&&Fe.format===fr.format&&Fe.internalformat===fr.internalformat,"incompatible format for texture.subimage"),Oe(At>=0&&Wt>=0&&At+fr.width<=Fe.width&&Wt+fr.height<=Fe.height,"texture.subimage write out of bounds"),Oe(Fe.mipmask&1<<sr,"missing mipmap data"),Oe(fr.data||fr.element||fr.needsCopy,"missing image data"),Ni(Fe),pr(fr,$o+gt,At,Wt,sr),ma(),fn(fr),Bt}function Et(gt){var Ot=gt|0;if(Ot!==Fe.width){Bt.width=Fe.width=Ot,Bt.height=Fe.height=Ot,Ni(Fe);for(var Ke=0;Ke<6;++Ke)for(var ct=0;Fe.mipmask>>ct;++ct)he.texImage2D($o+Ke,ct,Fe.format,Ot>>ct,Ot>>ct,0,Fe.format,Fe.type,null);return ma(),Qt.profile&&(Fe.stats.size=as(Fe.internalformat,Fe.type,Bt.width,Bt.height,!1,!0)),Bt}}return Bt(rt,$t,Yt,Lr,ia,Ze),Bt.subimage=Ut,Bt.resize=Et,Bt._reglType="textureCube",Bt._texture=Fe,Qt.profile&&(Bt.stats=Fe.stats),Bt.destroy=function(){Fe.decRef()},Bt}function fi(){for(var rt=0;rt<Di;++rt)he.activeTexture(mo+rt),he.bindTexture(ai,null),ui[rt]=null;ya(pi).forEach(An),Xt.cubeCount=0,Xt.textureCount=0}Qt.profile&&(Xt.getTotalTextureSize=function(){var rt=0;return Object.keys(pi).forEach(function($t){rt+=pi[$t].stats.size}),rt});function fo(){for(var rt=0;rt<Di;++rt){var $t=ui[rt];$t&&($t.bindCount=0,$t.unit=-1,ui[rt]=null)}ya(pi).forEach(function(Yt){Yt.texture=he.createTexture(),he.bindTexture(Yt.target,Yt.texture);for(var Lr=0;Lr<32;++Lr)if(Yt.mipmask&1<<Lr)if(Yt.target===ai)he.texImage2D(ai,Lr,Yt.internalformat,Yt.width>>Lr,Yt.height>>Lr,0,Yt.internalformat,Yt.type,null);else for(var ia=0;ia<6;++ia)he.texImage2D($o+ia,Lr,Yt.internalformat,Yt.width>>Lr,Yt.height>>Lr,0,Yt.internalformat,Yt.type,null);Wa(Yt.texInfo,Yt.target)})}function lf(){for(var rt=0;rt<Di;++rt){var $t=ui[rt];$t&&($t.bindCount=0,$t.unit=-1,ui[rt]=null),he.activeTexture(mo+rt),he.bindTexture(ai,null),he.bindTexture(Ps,null)}}return{create2D:ca,createCube:ba,clear:fi,getTexture:function(rt){return null},restore:fo,refresh:lf}}var Qr=36161,is=32854,na=32855,Zs=36194,Ks=33189,Go=36168,Tf=34041,xs=35907,xu=34836,If=34842,Af=34843,oo=[];oo[is]=2,oo[na]=2,oo[Zs]=2,oo[Ks]=2,oo[Go]=1,oo[Tf]=4,oo[xs]=4,oo[xu]=16,oo[If]=8,oo[Af]=6;function q(he,We,it){return oo[he]*We*it}var de=function(he,We,it,Zt,or){var Xt={rgba4:is,rgb565:Zs,"rgb5 a1":na,depth:Ks,stencil:Go,"depth stencil":Tf};We.ext_srgb&&(Xt.srgba=xs),We.ext_color_buffer_half_float&&(Xt.rgba16f=If,Xt.rgb16f=Af),We.webgl_color_buffer_float&&(Xt.rgba32f=xu);var Qt=[];Object.keys(Xt).forEach(function(w){var B=Xt[w];Qt[B]=w});var gr=0,Er={};function wr(w){this.id=gr++,this.refCount=1,this.renderbuffer=w,this.format=is,this.width=0,this.height=0,or.profile&&(this.stats={size:0})}wr.prototype.decRef=function(){--this.refCount<=0&&_r(this)};function _r(w){var B=w.renderbuffer;Oe(B,"must not double destroy renderbuffer"),he.bindRenderbuffer(Qr,null),he.deleteRenderbuffer(B),w.renderbuffer=null,w.refCount=0,delete Er[w.id],Zt.renderbufferCount--}function Br(w,B){var V=new wr(he.createRenderbuffer());Er[V.id]=V,Zt.renderbufferCount++;function re(le,ge){var _e=0,Ne=0,ze=is;if(typeof le=="object"&&le){var Be=le;if("shape"in Be){var nt=Be.shape;Oe(Array.isArray(nt)&&nt.length>=2,"invalid renderbuffer shape"),_e=nt[0]|0,Ne=nt[1]|0}else"radius"in Be&&(_e=Ne=Be.radius|0),"width"in Be&&(_e=Be.width|0),"height"in Be&&(Ne=Be.height|0);"format"in Be&&(Oe.parameter(Be.format,Xt,"invalid renderbuffer format"),ze=Xt[Be.format])}else typeof le=="number"?(_e=le|0,typeof ge=="number"?Ne=ge|0:Ne=_e):le?Oe.raise("invalid arguments to renderbuffer constructor"):_e=Ne=1;if(Oe(_e>0&&Ne>0&&_e<=it.maxRenderbufferSize&&Ne<=it.maxRenderbufferSize,"invalid renderbuffer size"),!(_e===V.width&&Ne===V.height&&ze===V.format))return re.width=V.width=_e,re.height=V.height=Ne,V.format=ze,he.bindRenderbuffer(Qr,V.renderbuffer),he.renderbufferStorage(Qr,ze,_e,Ne),Oe(he.getError()===0,"invalid render buffer format"),or.profile&&(V.stats.size=q(V.format,V.width,V.height)),re.format=Qt[V.format],re}function oe(le,ge){var _e=le|0,Ne=ge|0||_e;return _e===V.width&&Ne===V.height||(Oe(_e>0&&Ne>0&&_e<=it.maxRenderbufferSize&&Ne<=it.maxRenderbufferSize,"invalid renderbuffer size"),re.width=V.width=_e,re.height=V.height=Ne,he.bindRenderbuffer(Qr,V.renderbuffer),he.renderbufferStorage(Qr,V.format,_e,Ne),Oe(he.getError()===0,"invalid render buffer format"),or.profile&&(V.stats.size=q(V.format,V.width,V.height))),re}return re(w,B),re.resize=oe,re._reglType="renderbuffer",re._renderbuffer=V,or.profile&&(re.stats=V.stats),re.destroy=function(){V.decRef()},re}or.profile&&(Zt.getTotalRenderbufferSize=function(){var w=0;return Object.keys(Er).forEach(function(B){w+=Er[B].stats.size}),w});function f(){ya(Er).forEach(function(w){w.renderbuffer=he.createRenderbuffer(),he.bindRenderbuffer(Qr,w.renderbuffer),he.renderbufferStorage(Qr,w.format,w.width,w.height)}),he.bindRenderbuffer(Qr,null)}return{create:Br,clear:function(){ya(Er).forEach(_r)},restore:f}},Ee=36160,Pe=36161,je=3553,bt=34069,St=36064,jt=36096,vr=36128,xr=33306,$r=36053,an=36054,tn=36055,Gn=36057,$n=36061,Dn=36193,Nn=5121,zn=5126,pn=6407,Yn=6408,Xn=6402,bn=[pn,Yn],Qn=[];Qn[Yn]=4,Qn[pn]=3;var ga=[];ga[Nn]=1,ga[zn]=4,ga[Dn]=2;var Da=32854,Ma=32855,ha=36194,Pa=33189,Qa=36168,Ya=34041,zo=35907,Qu=34836,To=34842,$s=34843,Qi=[Da,Ma,ha,zo,To,$s,Qu],Io={};Io[$r]="complete",Io[an]="incomplete attachment",Io[Gn]="incomplete dimensions",Io[tn]="incomplete, missing attachment",Io[$n]="unsupported";function wu(he,We,it,Zt,or,Xt){var Qt={cur:null,next:null,dirty:!1,setFBO:null},gr=["rgba"],Er=["rgba4","rgb565","rgb5 a1"];We.ext_srgb&&Er.push("srgba"),We.ext_color_buffer_half_float&&Er.push("rgba16f","rgb16f"),We.webgl_color_buffer_float&&Er.push("rgba32f");var wr=["uint8"];We.oes_texture_half_float&&wr.push("half float","float16"),We.oes_texture_float&&wr.push("float","float32");function _r(Pt,kt,Dt){this.target=Pt,this.texture=kt,this.renderbuffer=Dt;var pr=0,Xr=0;kt?(pr=kt.width,Xr=kt.height):Dt&&(pr=Dt.width,Xr=Dt.height),this.width=pr,this.height=Xr}function Br(Pt){Pt&&(Pt.texture&&Pt.texture._texture.decRef(),Pt.renderbuffer&&Pt.renderbuffer._renderbuffer.decRef())}function f(Pt,kt,Dt){if(Pt)if(Pt.texture){var pr=Pt.texture._texture,Xr=Math.max(1,pr.width),Or=Math.max(1,pr.height);Oe(Xr===kt&&Or===Dt,"inconsistent width/height for supplied texture"),pr.refCount+=1}else{var fn=Pt.renderbuffer._renderbuffer;Oe(fn.width===kt&&fn.height===Dt,"inconsistent width/height for renderbuffer"),fn.refCount+=1}}function w(Pt,kt){kt&&(kt.texture?he.framebufferTexture2D(Ee,Pt,kt.target,kt.texture._texture.texture,0):he.framebufferRenderbuffer(Ee,Pt,Pe,kt.renderbuffer._renderbuffer.renderbuffer))}function B(Pt){var kt=je,Dt=null,pr=null,Xr=Pt;typeof Pt=="object"&&(Xr=Pt.data,"target"in Pt&&(kt=Pt.target|0)),Oe.type(Xr,"function","invalid attachment data");var Or=Xr._reglType;return Or==="texture2d"?(Dt=Xr,Oe(kt===je)):Or==="textureCube"?(Dt=Xr,Oe(kt>=bt&&kt<bt+6,"invalid cube map target")):Or==="renderbuffer"?(pr=Xr,kt=Pe):Oe.raise("invalid regl object for attachment"),new _r(kt,Dt,pr)}function V(Pt,kt,Dt,pr,Xr){if(Dt){var Or=Zt.create2D({width:Pt,height:kt,format:pr,type:Xr});return Or._texture.refCount=0,new _r(je,Or,null)}else{var fn=or.create({width:Pt,height:kt,format:pr});return fn._renderbuffer.refCount=0,new _r(Pe,null,fn)}}function re(Pt){return Pt&&(Pt.texture||Pt.renderbuffer)}function oe(Pt,kt,Dt){Pt&&(Pt.texture?Pt.texture.resize(kt,Dt):Pt.renderbuffer&&Pt.renderbuffer.resize(kt,Dt),Pt.width=kt,Pt.height=Dt)}var le=0,ge={};function _e(){this.id=le++,ge[this.id]=this,this.framebuffer=he.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Ne(Pt){Pt.colorAttachments.forEach(Br),Br(Pt.depthAttachment),Br(Pt.stencilAttachment),Br(Pt.depthStencilAttachment)}function ze(Pt){var kt=Pt.framebuffer;Oe(kt,"must not double destroy framebuffer"),he.deleteFramebuffer(kt),Pt.framebuffer=null,Xt.framebufferCount--,delete ge[Pt.id]}function Be(Pt){var kt;he.bindFramebuffer(Ee,Pt.framebuffer);var Dt=Pt.colorAttachments;for(kt=0;kt<Dt.length;++kt)w(St+kt,Dt[kt]);for(kt=Dt.length;kt<it.maxColorAttachments;++kt)he.framebufferTexture2D(Ee,St+kt,je,null,0);he.framebufferTexture2D(Ee,xr,je,null,0),he.framebufferTexture2D(Ee,jt,je,null,0),he.framebufferTexture2D(Ee,vr,je,null,0),w(jt,Pt.depthAttachment),w(vr,Pt.stencilAttachment),w(xr,Pt.depthStencilAttachment);var pr=he.checkFramebufferStatus(Ee);!he.isContextLost()&&pr!==$r&&Oe.raise("framebuffer configuration not supported, status = "+Io[pr]),he.bindFramebuffer(Ee,Qt.next?Qt.next.framebuffer:null),Qt.cur=Qt.next,he.getError()}function nt(Pt,kt){var Dt=new _e;Xt.framebufferCount++;function pr(Or,fn){var cn;Oe(Qt.next!==Dt,"can not update framebuffer which is currently in use");var Mn=0,Un=0,kn=!0,Na=!0,Bn=null,Ha=!0,Aa="rgba",fa="uint8",Wa=1,Za=null,pi=null,Di=null,ui=!1;if(typeof Or=="number")Mn=Or|0,Un=fn|0||Mn;else if(!Or)Mn=Un=1;else{Oe.type(Or,"object","invalid arguments for framebuffer");var Jn=Or;if("shape"in Jn){var Ni=Jn.shape;Oe(Array.isArray(Ni)&&Ni.length>=2,"invalid shape for framebuffer"),Mn=Ni[0],Un=Ni[1]}else"radius"in Jn&&(Mn=Un=Jn.radius),"width"in Jn&&(Mn=Jn.width),"height"in Jn&&(Un=Jn.height);("color"in Jn||"colors"in Jn)&&(Bn=Jn.color||Jn.colors,Array.isArray(Bn)&&Oe(Bn.length===1||We.webgl_draw_buffers,"multiple render targets not supported")),Bn||("colorCount"in Jn&&(Wa=Jn.colorCount|0,Oe(Wa>0,"invalid color buffer count")),"colorTexture"in Jn&&(Ha=!!Jn.colorTexture,Aa="rgba4"),"colorType"in Jn&&(fa=Jn.colorType,Ha?(Oe(We.oes_texture_float||!(fa==="float"||fa==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Oe(We.oes_texture_half_float||!(fa==="half float"||fa==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):fa==="half float"||fa==="float16"?(Oe(We.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Aa="rgba16f"):(fa==="float"||fa==="float32")&&(Oe(We.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Aa="rgba32f"),Oe.oneOf(fa,wr,"invalid color type")),"colorFormat"in Jn&&(Aa=Jn.colorFormat,gr.indexOf(Aa)>=0?Ha=!0:Er.indexOf(Aa)>=0?Ha=!1:Ha?Oe.oneOf(Jn.colorFormat,gr,"invalid color format for texture"):Oe.oneOf(Jn.colorFormat,Er,"invalid color format for renderbuffer"))),("depthTexture"in Jn||"depthStencilTexture"in Jn)&&(ui=!!(Jn.depthTexture||Jn.depthStencilTexture),Oe(!ui||We.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Jn&&(typeof Jn.depth=="boolean"?kn=Jn.depth:(Za=Jn.depth,Na=!1)),"stencil"in Jn&&(typeof Jn.stencil=="boolean"?Na=Jn.stencil:(pi=Jn.stencil,kn=!1)),"depthStencil"in Jn&&(typeof Jn.depthStencil=="boolean"?kn=Na=Jn.depthStencil:(Di=Jn.depthStencil,kn=!1,Na=!1))}var ma=null,An=null,ca=null,ba=null;if(Array.isArray(Bn))ma=Bn.map(B);else if(Bn)ma=[B(Bn)];else for(ma=new Array(Wa),cn=0;cn<Wa;++cn)ma[cn]=V(Mn,Un,Ha,Aa,fa);Oe(We.webgl_draw_buffers||ma.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),Oe(ma.length<=it.maxColorAttachments,"too many color attachments, not supported"),Mn=Mn||ma[0].width,Un=Un||ma[0].height,Za?An=B(Za):kn&&!Na&&(An=V(Mn,Un,ui,"depth","uint32")),pi?ca=B(pi):Na&&!kn&&(ca=V(Mn,Un,!1,"stencil","uint8")),Di?ba=B(Di):!Za&&!pi&&Na&&kn&&(ba=V(Mn,Un,ui,"depth stencil","depth stencil")),Oe(!!Za+!!pi+!!Di<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var fi=null;for(cn=0;cn<ma.length;++cn)if(f(ma[cn],Mn,Un),Oe(!ma[cn]||ma[cn].texture&&bn.indexOf(ma[cn].texture._texture.format)>=0||ma[cn].renderbuffer&&Qi.indexOf(ma[cn].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+cn+" is invalid"),ma[cn]&&ma[cn].texture){var fo=Qn[ma[cn].texture._texture.format]*ga[ma[cn].texture._texture.type];fi===null?fi=fo:Oe(fi===fo,"all color attachments much have the same number of bits per pixel.")}return f(An,Mn,Un),Oe(!An||An.texture&&An.texture._texture.format===Xn||An.renderbuffer&&An.renderbuffer._renderbuffer.format===Pa,"invalid depth attachment for framebuffer object"),f(ca,Mn,Un),Oe(!ca||ca.renderbuffer&&ca.renderbuffer._renderbuffer.format===Qa,"invalid stencil attachment for framebuffer object"),f(ba,Mn,Un),Oe(!ba||ba.texture&&ba.texture._texture.format===Ya||ba.renderbuffer&&ba.renderbuffer._renderbuffer.format===Ya,"invalid depth-stencil attachment for framebuffer object"),Ne(Dt),Dt.width=Mn,Dt.height=Un,Dt.colorAttachments=ma,Dt.depthAttachment=An,Dt.stencilAttachment=ca,Dt.depthStencilAttachment=ba,pr.color=ma.map(re),pr.depth=re(An),pr.stencil=re(ca),pr.depthStencil=re(ba),pr.width=Dt.width,pr.height=Dt.height,Be(Dt),pr}function Xr(Or,fn){Oe(Qt.next!==Dt,"can not resize a framebuffer which is currently in use");var cn=Math.max(Or|0,1),Mn=Math.max(fn|0||cn,1);if(cn===Dt.width&&Mn===Dt.height)return pr;for(var Un=Dt.colorAttachments,kn=0;kn<Un.length;++kn)oe(Un[kn],cn,Mn);return oe(Dt.depthAttachment,cn,Mn),oe(Dt.stencilAttachment,cn,Mn),oe(Dt.depthStencilAttachment,cn,Mn),Dt.width=pr.width=cn,Dt.height=pr.height=Mn,Be(Dt),pr}return pr(Pt,kt),F(pr,{resize:Xr,_reglType:"framebuffer",_framebuffer:Dt,destroy:function(){ze(Dt),Ne(Dt)},use:function(Or){Qt.setFBO({framebuffer:pr},Or)}})}function _t(Pt){var kt=Array(6);function Dt(Xr){var Or;Oe(kt.indexOf(Qt.next)<0,"can not update framebuffer which is currently in use");var fn={color:null},cn=0,Mn=null,Un="rgba",kn="uint8",Na=1;if(typeof Xr=="number")cn=Xr|0;else if(!Xr)cn=1;else{Oe.type(Xr,"object","invalid arguments for framebuffer");var Bn=Xr;if("shape"in Bn){var Ha=Bn.shape;Oe(Array.isArray(Ha)&&Ha.length>=2,"invalid shape for framebuffer"),Oe(Ha[0]===Ha[1],"cube framebuffer must be square"),cn=Ha[0]}else"radius"in Bn&&(cn=Bn.radius|0),"width"in Bn?(cn=Bn.width|0,"height"in Bn&&Oe(Bn.height===cn,"must be square")):"height"in Bn&&(cn=Bn.height|0);("color"in Bn||"colors"in Bn)&&(Mn=Bn.color||Bn.colors,Array.isArray(Mn)&&Oe(Mn.length===1||We.webgl_draw_buffers,"multiple render targets not supported")),Mn||("colorCount"in Bn&&(Na=Bn.colorCount|0,Oe(Na>0,"invalid color buffer count")),"colorType"in Bn&&(Oe.oneOf(Bn.colorType,wr,"invalid color type"),kn=Bn.colorType),"colorFormat"in Bn&&(Un=Bn.colorFormat,Oe.oneOf(Bn.colorFormat,gr,"invalid color format for texture"))),"depth"in Bn&&(fn.depth=Bn.depth),"stencil"in Bn&&(fn.stencil=Bn.stencil),"depthStencil"in Bn&&(fn.depthStencil=Bn.depthStencil)}var Aa;if(Mn)if(Array.isArray(Mn))for(Aa=[],Or=0;Or<Mn.length;++Or)Aa[Or]=Mn[Or];else Aa=[Mn];else{Aa=Array(Na);var fa={radius:cn,format:Un,type:kn};for(Or=0;Or<Na;++Or)Aa[Or]=Zt.createCube(fa)}for(fn.color=Array(Aa.length),Or=0;Or<Aa.length;++Or){var Wa=Aa[Or];Oe(typeof Wa=="function"&&Wa._reglType==="textureCube","invalid cube map"),cn=cn||Wa.width,Oe(Wa.width===cn&&Wa.height===cn,"invalid cube map shape"),fn.color[Or]={target:bt,data:Aa[Or]}}for(Or=0;Or<6;++Or){for(var Za=0;Za<Aa.length;++Za)fn.color[Za].target=bt+Or;Or>0&&(fn.depth=kt[0].depth,fn.stencil=kt[0].stencil,fn.depthStencil=kt[0].depthStencil),kt[Or]?kt[Or](fn):kt[Or]=nt(fn)}return F(Dt,{width:cn,height:cn,color:Aa})}function pr(Xr){var Or,fn=Xr|0;if(Oe(fn>0&&fn<=it.maxCubeMapSize,"invalid radius for cube fbo"),fn===Dt.width)return Dt;var cn=Dt.color;for(Or=0;Or<cn.length;++Or)cn[Or].resize(fn);for(Or=0;Or<6;++Or)kt[Or].resize(fn);return Dt.width=Dt.height=fn,Dt}return Dt(Pt),F(Dt,{faces:kt,resize:pr,_reglType:"framebufferCube",destroy:function(){kt.forEach(function(Xr){Xr.destroy()})}})}function tr(){Qt.cur=null,Qt.next=null,Qt.dirty=!0,ya(ge).forEach(function(Pt){Pt.framebuffer=he.createFramebuffer(),Be(Pt)})}return F(Qt,{getFramebuffer:function(Pt){if(typeof Pt=="function"&&Pt._reglType==="framebuffer"){var kt=Pt._framebuffer;if(kt instanceof _e)return kt}return null},create:nt,createCube:_t,clear:function(){ya(ge).forEach(ze)},restore:tr})}var sc=5126,Qs=34962;function ei(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=sc,this.offset=0,this.stride=0,this.divisor=0}function Of(he,We,it,Zt,or){for(var Xt=it.maxAttributes,Qt=new Array(Xt),gr=0;gr<Xt;++gr)Qt[gr]=new ei;var Er=0,wr={},_r={Record:ei,scope:{},state:Qt,currentVAO:null,targetVAO:null,restore:f()?ge:function(){},createVAO:_e,getVAO:B,destroyBuffer:Br,setVAO:f()?V:re,clear:f()?oe:function(){}};function Br(Ne){for(var ze=0;ze<Qt.length;++ze){var Be=Qt[ze];Be.buffer===Ne&&(he.disableVertexAttribArray(ze),Be.buffer=null)}}function f(){return We.oes_vertex_array_object}function w(){return We.angle_instanced_arrays}function B(Ne){return typeof Ne=="function"&&Ne._vao?Ne._vao:null}function V(Ne){if(Ne!==_r.currentVAO){var ze=f();Ne?ze.bindVertexArrayOES(Ne.vao):ze.bindVertexArrayOES(null),_r.currentVAO=Ne}}function re(Ne){if(Ne!==_r.currentVAO){if(Ne)Ne.bindAttrs();else for(var ze=w(),Be=0;Be<Qt.length;++Be){var nt=Qt[Be];nt.buffer?(he.enableVertexAttribArray(Be),he.vertexAttribPointer(Be,nt.size,nt.type,nt.normalized,nt.stride,nt.offfset),ze&&nt.divisor&&ze.vertexAttribDivisorANGLE(Be,nt.divisor)):(he.disableVertexAttribArray(Be),he.vertexAttrib4f(Be,nt.x,nt.y,nt.z,nt.w))}_r.currentVAO=Ne}}function oe(){ya(wr).forEach(function(Ne){Ne.destroy()})}function le(){this.id=++Er,this.attributes=[];var Ne=f();Ne?this.vao=Ne.createVertexArrayOES():this.vao=null,wr[this.id]=this,this.buffers=[]}le.prototype.bindAttrs=function(){for(var Ne=w(),ze=this.attributes,Be=0;Be<ze.length;++Be){var nt=ze[Be];nt.buffer?(he.enableVertexAttribArray(Be),he.bindBuffer(Qs,nt.buffer.buffer),he.vertexAttribPointer(Be,nt.size,nt.type,nt.normalized,nt.stride,nt.offset),Ne&&nt.divisor&&Ne.vertexAttribDivisorANGLE(Be,nt.divisor)):(he.disableVertexAttribArray(Be),he.vertexAttrib4f(Be,nt.x,nt.y,nt.z,nt.w))}for(var _t=ze.length;_t<Xt;++_t)he.disableVertexAttribArray(_t)},le.prototype.refresh=function(){var Ne=f();Ne&&(Ne.bindVertexArrayOES(this.vao),this.bindAttrs(),_r.currentVAO=this)},le.prototype.destroy=function(){if(this.vao){var Ne=f();this===_r.currentVAO&&(_r.currentVAO=null,Ne.bindVertexArrayOES(null)),Ne.deleteVertexArrayOES(this.vao),this.vao=null}wr[this.id]&&(delete wr[this.id],Zt.vaoCount-=1)};function ge(){var Ne=f();Ne&&ya(wr).forEach(function(ze){ze.refresh()})}function _e(Ne){var ze=new le;Zt.vaoCount+=1;function Be(nt){Oe(Array.isArray(nt),"arguments to vertex array constructor must be an array"),Oe(nt.length<Xt,"too many attributes"),Oe(nt.length>0,"must specify at least one attribute");var _t={},tr=ze.attributes;tr.length=nt.length;for(var Pt=0;Pt<nt.length;++Pt){var kt=nt[Pt],Dt=tr[Pt]=new ei,pr=kt.data||kt;if(Array.isArray(pr)||N(pr)||Fn(pr)){var Xr;ze.buffers[Pt]&&(Xr=ze.buffers[Pt],N(pr)&&Xr._buffer.byteLength>=pr.byteLength?Xr.subdata(pr):(Xr.destroy(),ze.buffers[Pt]=null)),ze.buffers[Pt]||(Xr=ze.buffers[Pt]=or.create(kt,Qs,!1,!0)),Dt.buffer=or.getBuffer(Xr),Dt.size=Dt.buffer.dimension|0,Dt.normalized=!1,Dt.type=Dt.buffer.dtype,Dt.offset=0,Dt.stride=0,Dt.divisor=0,Dt.state=1,_t[Pt]=1}else or.getBuffer(kt)?(Dt.buffer=or.getBuffer(kt),Dt.size=Dt.buffer.dimension|0,Dt.normalized=!1,Dt.type=Dt.buffer.dtype,Dt.offset=0,Dt.stride=0,Dt.divisor=0,Dt.state=1):or.getBuffer(kt.buffer)?(Dt.buffer=or.getBuffer(kt.buffer),Dt.size=(+kt.size||Dt.buffer.dimension)|0,Dt.normalized=!!kt.normalized||!1,"type"in kt?(Oe.parameter(kt.type,to,"invalid buffer type"),Dt.type=to[kt.type]):Dt.type=Dt.buffer.dtype,Dt.offset=(kt.offset||0)|0,Dt.stride=(kt.stride||0)|0,Dt.divisor=(kt.divisor||0)|0,Dt.state=1,Oe(Dt.size>=1&&Dt.size<=4,"size must be between 1 and 4"),Oe(Dt.offset>=0,"invalid offset"),Oe(Dt.stride>=0&&Dt.stride<=255,"stride must be between 0 and 255"),Oe(Dt.divisor>=0,"divisor must be positive"),Oe(!Dt.divisor||!!We.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in kt?(Oe(Pt>0,"first attribute must not be a constant"),Dt.x=+kt.x||0,Dt.y=+kt.y||0,Dt.z=+kt.z||0,Dt.w=+kt.w||0,Dt.state=2):Oe(!1,"invalid attribute spec for location "+Pt)}for(var Or=0;Or<ze.buffers.length;++Or)!_t[Or]&&ze.buffers[Or]&&(ze.buffers[Or].destroy(),ze.buffers[Or]=null);return ze.refresh(),Be}return Be.destroy=function(){for(var nt=0;nt<ze.buffers.length;++nt)ze.buffers[nt]&&ze.buffers[nt].destroy();ze.buffers.length=0,ze.destroy()},Be._vao=ze,Be._reglType="vao",Be(Ne)}return _r}var ws=35632,Ss=35633,Ju=35718,so=35721;function qu(he,We,it,Zt){var or={},Xt={};function Qt(V,re,oe,le){this.name=V,this.id=re,this.location=oe,this.info=le}function gr(V,re){for(var oe=0;oe<V.length;++oe)if(V[oe].id===re.id){V[oe].location=re.location;return}V.push(re)}function Er(V,re,oe){var le=V===ws?or:Xt,ge=le[re];if(!ge){var _e=We.str(re);ge=he.createShader(V),he.shaderSource(ge,_e),he.compileShader(ge),Oe.shaderError(he,ge,_e,V,oe),le[re]=ge}return ge}var wr={},_r=[],Br=0;function f(V,re){this.id=Br++,this.fragId=V,this.vertId=re,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,Zt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function w(V,re,oe){var le,ge,_e=Er(ws,V.fragId),Ne=Er(Ss,V.vertId),ze=V.program=he.createProgram();if(he.attachShader(ze,_e),he.attachShader(ze,Ne),oe)for(le=0;le<oe.length;++le){var Be=oe[le];he.bindAttribLocation(ze,Be[0],Be[1])}he.linkProgram(ze),Oe.linkError(he,ze,We.str(V.fragId),We.str(V.vertId),re);var nt=he.getProgramParameter(ze,Ju);Zt.profile&&(V.stats.uniformsCount=nt);var _t=V.uniforms;for(le=0;le<nt;++le)if(ge=he.getActiveUniform(ze,le),ge)if(ge.size>1)for(var tr=0;tr<ge.size;++tr){var Pt=ge.name.replace("[0]","["+tr+"]");gr(_t,new Qt(Pt,We.id(Pt),he.getUniformLocation(ze,Pt),ge))}else gr(_t,new Qt(ge.name,We.id(ge.name),he.getUniformLocation(ze,ge.name),ge));var kt=he.getProgramParameter(ze,so);Zt.profile&&(V.stats.attributesCount=kt);var Dt=V.attributes;for(le=0;le<kt;++le)ge=he.getActiveAttrib(ze,le),ge&&gr(Dt,new Qt(ge.name,We.id(ge.name),he.getAttribLocation(ze,ge.name),ge))}Zt.profile&&(it.getMaxUniformsCount=function(){var V=0;return _r.forEach(function(re){re.stats.uniformsCount>V&&(V=re.stats.uniformsCount)}),V},it.getMaxAttributesCount=function(){var V=0;return _r.forEach(function(re){re.stats.attributesCount>V&&(V=re.stats.attributesCount)}),V});function B(){or={},Xt={};for(var V=0;V<_r.length;++V)w(_r[V],null,_r[V].attributes.map(function(re){return[re.location,re.name]}))}return{clear:function(){var V=he.deleteShader.bind(he);ya(or).forEach(V),or={},ya(Xt).forEach(V),Xt={},_r.forEach(function(re){he.deleteProgram(re.program)}),_r.length=0,wr={},it.shaderCount=0},program:function(V,re,oe,le){Oe.command(V>=0,"missing vertex shader",oe),Oe.command(re>=0,"missing fragment shader",oe);var ge=wr[re];ge||(ge=wr[re]={});var _e=ge[V];if(_e&&(_e.refCount++,!le))return _e;var Ne=new f(re,V);return it.shaderCount++,w(Ne,oe,le),_e||(ge[V]=Ne),_r.push(Ne),F(Ne,{destroy:function(){if(Ne.refCount--,Ne.refCount<=0){he.deleteProgram(Ne.program);var ze=_r.indexOf(Ne);_r.splice(ze,1),it.shaderCount--}ge[Ne.vertId].refCount<=0&&(he.deleteShader(Xt[Ne.vertId]),delete Xt[Ne.vertId],delete wr[Ne.fragId][Ne.vertId]),Object.keys(wr[Ne.fragId]).length||(he.deleteShader(or[Ne.fragId]),delete or[Ne.fragId],delete wr[Ne.fragId])}})},restore:B,shader:Er,frag:-1,vert:-1}}var Uo=6408,_s=5121,Zr=3333,uc=5126;function al(he,We,it,Zt,or,Xt,Qt){function gr(_r){var Br;We.next===null?(Oe(or.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Br=_s):(Oe(We.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Br=We.next.colorAttachments[0].texture._texture.type,Xt.oes_texture_float?(Oe(Br===_s||Br===uc,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Br===uc&&Oe(Qt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):Oe(Br===_s,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,w=0,B=Zt.framebufferWidth,V=Zt.framebufferHeight,re=null;N(_r)?re=_r:_r&&(Oe.type(_r,"object","invalid arguments to regl.read()"),f=_r.x|0,w=_r.y|0,Oe(f>=0&&f<Zt.framebufferWidth,"invalid x offset for regl.read"),Oe(w>=0&&w<Zt.framebufferHeight,"invalid y offset for regl.read"),B=(_r.width||Zt.framebufferWidth-f)|0,V=(_r.height||Zt.framebufferHeight-w)|0,re=_r.data||null),re&&(Br===_s?Oe(re instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Br===uc&&Oe(re instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),Oe(B>0&&B+f<=Zt.framebufferWidth,"invalid width for read pixels"),Oe(V>0&&V+w<=Zt.framebufferHeight,"invalid height for read pixels"),it();var oe=B*V*4;return re||(Br===_s?re=new Uint8Array(oe):Br===uc&&(re=re||new Float32Array(oe))),Oe.isTypedArray(re,"data buffer for regl.read() must be a typedarray"),Oe(re.byteLength>=oe,"data buffer for regl.read() too small"),he.pixelStorei(Zr,4),he.readPixels(f,w,B,V,Uo,Br,re),re}function Er(_r){var Br;return We.setFBO({framebuffer:_r.framebuffer},function(){Br=gr(_r)}),Br}function wr(_r){return!_r||!("framebuffer"in _r)?gr(_r):Er(_r)}return wr}function Ji(he){return Array.prototype.slice.call(he)}function Wo(he){return Ji(he).join("")}function ka(){var he=0,We=[],it=[];function Zt(Br){for(var f=0;f<it.length;++f)if(it[f]===Br)return We[f];var w="g"+he++;return We.push(w),it.push(Br),w}function or(){var Br=[];function f(){Br.push.apply(Br,Ji(arguments))}var w=[];function B(){var V="v"+he++;return w.push(V),arguments.length>0&&(Br.push(V,"="),Br.push.apply(Br,Ji(arguments)),Br.push(";")),V}return F(f,{def:B,toString:function(){return Wo([w.length>0?"var "+w.join(",")+";":"",Wo(Br)])}})}function Xt(){var Br=or(),f=or(),w=Br.toString,B=f.toString;function V(re,oe){f(re,oe,"=",Br.def(re,oe),";")}return F(function(){Br.apply(Br,Ji(arguments))},{def:Br.def,entry:Br,exit:f,save:V,set:function(re,oe,le){V(re,oe),Br(re,oe,"=",le,";")},toString:function(){return w()+B()}})}function Qt(){var Br=Wo(arguments),f=Xt(),w=Xt(),B=f.toString,V=w.toString;return F(f,{then:function(){return f.apply(f,Ji(arguments)),this},else:function(){return w.apply(w,Ji(arguments)),this},toString:function(){var re=V();return re&&(re="else{"+re+"}"),Wo(["if(",Br,"){",B(),"}",re])}})}var gr=or(),Er={};function wr(Br,f){var w=[];function B(){var ge="a"+w.length;return w.push(ge),ge}f=f||0;for(var V=0;V<f;++V)B();var re=Xt(),oe=re.toString,le=Er[Br]=F(re,{arg:B,toString:function(){return Wo(["function(",w.join(),"){",oe(),"}"])}});return le}function _r(){var Br=['"use strict";',gr,"return {"];Object.keys(Er).forEach(function(B){Br.push('"',B,'":',Er[B].toString(),",")}),Br.push("}");var f=Wo(Br).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),w=Function.apply(null,We.concat(f));return w.apply(null,it)}return{global:gr,link:Zt,block:or,proc:wr,scope:Xt,cond:Qt,compile:_r}}var Su="xyzw".split(""),_u=5121,os=1,Mu=2,Lf=0,fc=1,cc=2,lc=3,ef=4,dc=5,kc=6,hc="dither",vc="blend.enable",gc="blend.color",Cu="blend.equation",tf="blend.func",Ci="depth.enable",Df="depth.func",il="depth.range",Nf="depth.mask",Rc="colorMask",ht="cull.enable",ol="cull.face",rf="frontFace",pc="lineWidth",sl="polygonOffset.enable",Bc="polygonOffset.offset",ul="sample.alpha",fl="sample.enable",Pf="sample.coverage",yc="stencil.enable",oi="stencil.mask",kf="stencil.func",gi="stencil.opFront",Ms="stencil.opBack",mc="scissor.enable",nf="scissor.box",Xo="viewport",Js="profile",ta="framebuffer",qi="vert",Tu="frag",qs="elements",jo="primitive",eu="count",Rf="offset",Bf="instances",af="vao",ua="Width",bc="Height",ss=ta+ua,uo=ta+bc,Ec=Xo+ua,Fc=Xo+bc,Ff="drawingBuffer",xc=Ff+ua,wc=Ff+bc,Gc=[tf,Cu,kf,gi,Ms,Pf,Xo,nf,Bc],tu=34962,Sc=34963,_c=35632,cl=35633,Vo=3553,zc=34067,ll=2884,Uc=3042,Wc=3024,dl=2960,Xc=2929,jc=3089,ru=32823,Gf=32926,zf=32928,Iu=5126,nu=35664,Uf=35665,Wf=35666,Mc=5124,Xf=35667,Au=35668,of=35669,Cc=35670,jf=35671,sf=35672,uf=35673,Ou=35674,ff=35675,Lu=35676,Du=35678,Cs=35680,Tc=4,cf=1028,au=1029,Vf=2304,Yf=2305,hl=32775,aa=32776,vl=519,si=7680,Vc=0,Ic=1,Yc=32774,gl=513,Hc=36160,Hf=36064,Ti={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Zc=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Nu={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ts={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Zf={frag:_c,vert:cl},Kf={cw:Vf,ccw:Yf};function $f(he){return Array.isArray(he)||N(he)||Fn(he)}function Kc(he){return he.sort(function(We,it){return We===Xo?-1:it===Xo?1:We<it?-1:1})}function Yi(he,We,it,Zt){this.thisDep=he,this.contextDep=We,this.propDep=it,this.append=Zt}function Is(he){return he&&!(he.thisDep||he.contextDep||he.propDep)}function Ja(he){return new Yi(!1,!1,!1,he)}function Li(he,We){var it=he.type;if(it===Lf){var Zt=he.data.length;return new Yi(!0,Zt>=1,Zt>=2,We)}else if(it===ef){var or=he.data;return new Yi(or.thisDep,or.contextDep,or.propDep,We)}else{if(it===dc)return new Yi(!1,!1,!1,We);if(it===kc){for(var Xt=!1,Qt=!1,gr=!1,Er=0;Er<he.data.length;++Er){var wr=he.data[Er];if(wr.type===fc)gr=!0;else if(wr.type===cc)Qt=!0;else if(wr.type===lc)Xt=!0;else if(wr.type===Lf){Xt=!0;var _r=wr.data;_r>=1&&(Qt=!0),_r>=2&&(gr=!0)}else wr.type===ef&&(Xt=Xt||wr.data.thisDep,Qt=Qt||wr.data.contextDep,gr=gr||wr.data.propDep)}return new Yi(Xt,Qt,gr,We)}else return new Yi(it===lc,it===cc,it===fc,We)}}var Qf=new Yi(!1,!1,!1,function(){});function pl(he,We,it,Zt,or,Xt,Qt,gr,Er,wr,_r,Br,f,w,B){var V=wr.Record,re={add:32774,subtract:32778,"reverse subtract":32779};it.ext_blend_minmax&&(re.min=hl,re.max=aa);var oe=it.angle_instanced_arrays,le=it.webgl_draw_buffers,ge={dirty:!0,profile:B.profile},_e={},Ne=[],ze={},Be={};function nt(Ze){return Ze.replace(".","_")}function _t(Ze,Fe,vt){var Bt=nt(Ze);Ne.push(Ze),_e[Bt]=ge[Bt]=!!vt,ze[Bt]=Fe}function tr(Ze,Fe,vt){var Bt=nt(Ze);Ne.push(Ze),Array.isArray(vt)?(ge[Bt]=vt.slice(),_e[Bt]=vt.slice()):ge[Bt]=_e[Bt]=vt,Be[Bt]=Fe}_t(hc,Wc),_t(vc,Uc),tr(gc,"blendColor",[0,0,0,0]),tr(Cu,"blendEquationSeparate",[Yc,Yc]),tr(tf,"blendFuncSeparate",[Ic,Vc,Ic,Vc]),_t(Ci,Xc,!0),tr(Df,"depthFunc",gl),tr(il,"depthRange",[0,1]),tr(Nf,"depthMask",!0),tr(Rc,Rc,[!0,!0,!0,!0]),_t(ht,ll),tr(ol,"cullFace",au),tr(rf,rf,Yf),tr(pc,pc,1),_t(sl,ru),tr(Bc,"polygonOffset",[0,0]),_t(ul,Gf),_t(fl,zf),tr(Pf,"sampleCoverage",[1,!1]),_t(yc,dl),tr(oi,"stencilMask",-1),tr(kf,"stencilFunc",[vl,0,-1]),tr(gi,"stencilOpSeparate",[cf,si,si,si]),tr(Ms,"stencilOpSeparate",[au,si,si,si]),_t(mc,jc),tr(nf,"scissor",[0,0,he.drawingBufferWidth,he.drawingBufferHeight]),tr(Xo,Xo,[0,0,he.drawingBufferWidth,he.drawingBufferHeight]);var Pt={gl:he,context:f,strings:We,next:_e,current:ge,draw:Br,elements:Xt,buffer:or,shader:_r,attributes:wr.state,vao:wr,uniforms:Er,framebuffer:gr,extensions:it,timer:w,isBufferArgs:$f},kt={primTypes:di,compareFuncs:Nu,blendFuncs:Ti,blendEquations:re,stencilOps:Ts,glTypes:to,orientationType:Kf};Oe.optional(function(){Pt.isArrayLike=_n}),le&&(kt.backBuffer=[au],kt.drawBuffer=un(Zt.maxDrawbuffers,function(Ze){return Ze===0?[0]:un(Ze,function(Fe){return Hf+Fe})}));var Dt=0;function pr(){var Ze=ka(),Fe=Ze.link,vt=Ze.global;Ze.id=Dt++,Ze.batchId="0";var Bt=Fe(Pt),Ut=Ze.shared={props:"a0"};Object.keys(Pt).forEach(function(ct){Ut[ct]=vt.def(Bt,".",ct)}),Oe.optional(function(){Ze.CHECK=Fe(Oe),Ze.commandStr=Oe.guessCommand(),Ze.command=Fe(Ze.commandStr),Ze.assert=function(ct,Ye,At){ct("if(!(",Ye,"))",this.CHECK,".commandRaise(",Fe(At),",",this.command,");")},kt.invalidBlendCombinations=Zc});var Et=Ze.next={},gt=Ze.current={};Object.keys(Be).forEach(function(ct){Array.isArray(ge[ct])&&(Et[ct]=vt.def(Ut.next,".",ct),gt[ct]=vt.def(Ut.current,".",ct))});var Ot=Ze.constants={};Object.keys(kt).forEach(function(ct){Ot[ct]=vt.def(JSON.stringify(kt[ct]))}),Ze.invoke=function(ct,Ye){switch(Ye.type){case Lf:var At=["this",Ut.context,Ut.props,Ze.batchId];return ct.def(Fe(Ye.data),".call(",At.slice(0,Math.max(Ye.data.length+1,4)),")");case fc:return ct.def(Ut.props,Ye.data);case cc:return ct.def(Ut.context,Ye.data);case lc:return ct.def("this",Ye.data);case ef:return Ye.data.append(Ze,ct),Ye.data.ref;case dc:return Ye.data.toString();case kc:return Ye.data.map(function(Wt){return Ze.invoke(ct,Wt)})}},Ze.attribCache={};var Ke={};return Ze.scopeAttrib=function(ct){var Ye=We.id(ct);if(Ye in Ke)return Ke[Ye];var At=wr.scope[Ye];At||(At=wr.scope[Ye]=new V);var Wt=Ke[Ye]=Fe(At);return Wt},Ze}function Xr(Ze){var Fe=Ze.static,vt=Ze.dynamic,Bt;if(Js in Fe){var Ut=!!Fe[Js];Bt=Ja(function(gt,Ot){return Ut}),Bt.enable=Ut}else if(Js in vt){var Et=vt[Js];Bt=Li(Et,function(gt,Ot){return gt.invoke(Ot,Et)})}return Bt}function Or(Ze,Fe){var vt=Ze.static,Bt=Ze.dynamic;if(ta in vt){var Ut=vt[ta];return Ut?(Ut=gr.getFramebuffer(Ut),Oe.command(Ut,"invalid framebuffer object"),Ja(function(gt,Ot){var Ke=gt.link(Ut),ct=gt.shared;Ot.set(ct.framebuffer,".next",Ke);var Ye=ct.context;return Ot.set(Ye,"."+ss,Ke+".width"),Ot.set(Ye,"."+uo,Ke+".height"),Ke})):Ja(function(gt,Ot){var Ke=gt.shared;Ot.set(Ke.framebuffer,".next","null");var ct=Ke.context;return Ot.set(ct,"."+ss,ct+"."+xc),Ot.set(ct,"."+uo,ct+"."+wc),"null"})}else if(ta in Bt){var Et=Bt[ta];return Li(Et,function(gt,Ot){var Ke=gt.invoke(Ot,Et),ct=gt.shared,Ye=ct.framebuffer,At=Ot.def(Ye,".getFramebuffer(",Ke,")");Oe.optional(function(){gt.assert(Ot,"!"+Ke+"||"+At,"invalid framebuffer object")}),Ot.set(Ye,".next",At);var Wt=ct.context;return Ot.set(Wt,"."+ss,At+"?"+At+".width:"+Wt+"."+xc),Ot.set(Wt,"."+uo,At+"?"+At+".height:"+Wt+"."+wc),At})}else return null}function fn(Ze,Fe,vt){var Bt=Ze.static,Ut=Ze.dynamic;function Et(Ke){if(Ke in Bt){var ct=Bt[Ke];Oe.commandType(ct,"object","invalid "+Ke,vt.commandStr);var Ye=!0,At=ct.x|0,Wt=ct.y|0,sr,fr;return"width"in ct?(sr=ct.width|0,Oe.command(sr>=0,"invalid "+Ke,vt.commandStr)):Ye=!1,"height"in ct?(fr=ct.height|0,Oe.command(fr>=0,"invalid "+Ke,vt.commandStr)):Ye=!1,new Yi(!Ye&&Fe&&Fe.thisDep,!Ye&&Fe&&Fe.contextDep,!Ye&&Fe&&Fe.propDep,function(En,qn){var ln=En.shared.context,Ln=sr;"width"in ct||(Ln=qn.def(ln,".",ss,"-",At));var Hn=fr;return"height"in ct||(Hn=qn.def(ln,".",uo,"-",Wt)),[At,Wt,Ln,Hn]})}else if(Ke in Ut){var rr=Ut[Ke],Tr=Li(rr,function(En,qn){var ln=En.invoke(qn,rr);Oe.optional(function(){En.assert(qn,ln+"&&typeof "+ln+'==="object"',"invalid "+Ke)});var Ln=En.shared.context,Hn=qn.def(ln,".x|0"),wa=qn.def(ln,".y|0"),Ka=qn.def('"width" in ',ln,"?",ln,".width|0:","(",Ln,".",ss,"-",Hn,")"),co=qn.def('"height" in ',ln,"?",ln,".height|0:","(",Ln,".",uo,"-",wa,")");return Oe.optional(function(){En.assert(qn,Ka+">=0&&"+co+">=0","invalid "+Ke)}),[Hn,wa,Ka,co]});return Fe&&(Tr.thisDep=Tr.thisDep||Fe.thisDep,Tr.contextDep=Tr.contextDep||Fe.contextDep,Tr.propDep=Tr.propDep||Fe.propDep),Tr}else return Fe?new Yi(Fe.thisDep,Fe.contextDep,Fe.propDep,function(En,qn){var ln=En.shared.context;return[0,0,qn.def(ln,".",ss),qn.def(ln,".",uo)]}):null}var gt=Et(Xo);if(gt){var Ot=gt;gt=new Yi(gt.thisDep,gt.contextDep,gt.propDep,function(Ke,ct){var Ye=Ot.append(Ke,ct),At=Ke.shared.context;return ct.set(At,"."+Ec,Ye[2]),ct.set(At,"."+Fc,Ye[3]),Ye})}return{viewport:gt,scissor_box:Et(nf)}}function cn(Ze,Fe){var vt=Ze.static,Bt=typeof vt[Tu]=="string"&&typeof vt[qi]=="string";if(Bt){if(Object.keys(Fe.dynamic).length>0)return null;var Ut=Fe.static,Et=Object.keys(Ut);if(Et.length>0&&typeof Ut[Et[0]]=="number"){for(var gt=[],Ot=0;Ot<Et.length;++Ot)Oe(typeof Ut[Et[Ot]]=="number","must specify all vertex attribute locations when using vaos"),gt.push([Ut[Et[Ot]]|0,Et[Ot]]);return gt}}return null}function Mn(Ze,Fe,vt){var Bt=Ze.static,Ut=Ze.dynamic;function Et(Ye){if(Ye in Bt){var At=We.id(Bt[Ye]);Oe.optional(function(){_r.shader(Zf[Ye],At,Oe.guessCommand())});var Wt=Ja(function(){return At});return Wt.id=At,Wt}else if(Ye in Ut){var sr=Ut[Ye];return Li(sr,function(fr,rr){var Tr=fr.invoke(rr,sr),En=rr.def(fr.shared.strings,".id(",Tr,")");return Oe.optional(function(){rr(fr.shared.shader,".shader(",Zf[Ye],",",En,",",fr.command,");")}),En})}return null}var gt=Et(Tu),Ot=Et(qi),Ke=null,ct;return Is(gt)&&Is(Ot)?(Ke=_r.program(Ot.id,gt.id,null,vt),ct=Ja(function(Ye,At){return Ye.link(Ke)})):ct=new Yi(gt&&gt.thisDep||Ot&&Ot.thisDep,gt&&gt.contextDep||Ot&&Ot.contextDep,gt&&gt.propDep||Ot&&Ot.propDep,function(Ye,At){var Wt=Ye.shared.shader,sr;gt?sr=gt.append(Ye,At):sr=At.def(Wt,".",Tu);var fr;Ot?fr=Ot.append(Ye,At):fr=At.def(Wt,".",qi);var rr=Wt+".program("+fr+","+sr;return Oe.optional(function(){rr+=","+Ye.command}),At.def(rr+")")}),{frag:gt,vert:Ot,progVar:ct,program:Ke}}function Un(Ze,Fe){var vt=Ze.static,Bt=Ze.dynamic;function Ut(){if(qs in vt){var Ye=vt[qs];$f(Ye)?Ye=Xt.getElements(Xt.create(Ye,!0)):Ye&&(Ye=Xt.getElements(Ye),Oe.command(Ye,"invalid elements",Fe.commandStr));var At=Ja(function(sr,fr){if(Ye){var rr=sr.link(Ye);return sr.ELEMENTS=rr,rr}return sr.ELEMENTS=null,null});return At.value=Ye,At}else if(qs in Bt){var Wt=Bt[qs];return Li(Wt,function(sr,fr){var rr=sr.shared,Tr=rr.isBufferArgs,En=rr.elements,qn=sr.invoke(fr,Wt),ln=fr.def("null"),Ln=fr.def(Tr,"(",qn,")"),Hn=sr.cond(Ln).then(ln,"=",En,".createStream(",qn,");").else(ln,"=",En,".getElements(",qn,");");return Oe.optional(function(){sr.assert(Hn.else,"!"+qn+"||"+ln,"invalid elements")}),fr.entry(Hn),fr.exit(sr.cond(Ln).then(En,".destroyStream(",ln,");")),sr.ELEMENTS=ln,ln})}return null}var Et=Ut();function gt(){if(jo in vt){var Ye=vt[jo];return Oe.commandParameter(Ye,di,"invalid primitve",Fe.commandStr),Ja(function(Wt,sr){return di[Ye]})}else if(jo in Bt){var At=Bt[jo];return Li(At,function(Wt,sr){var fr=Wt.constants.primTypes,rr=Wt.invoke(sr,At);return Oe.optional(function(){Wt.assert(sr,rr+" in "+fr,"invalid primitive, must be one of "+Object.keys(di))}),sr.def(fr,"[",rr,"]")})}else if(Et)return Is(Et)?Et.value?Ja(function(Wt,sr){return sr.def(Wt.ELEMENTS,".primType")}):Ja(function(){return Tc}):new Yi(Et.thisDep,Et.contextDep,Et.propDep,function(Wt,sr){var fr=Wt.ELEMENTS;return sr.def(fr,"?",fr,".primType:",Tc)});return null}function Ot(Ye,At){if(Ye in vt){var Wt=vt[Ye]|0;return Oe.command(!At||Wt>=0,"invalid "+Ye,Fe.commandStr),Ja(function(fr,rr){return At&&(fr.OFFSET=Wt),Wt})}else if(Ye in Bt){var sr=Bt[Ye];return Li(sr,function(fr,rr){var Tr=fr.invoke(rr,sr);return At&&(fr.OFFSET=Tr,Oe.optional(function(){fr.assert(rr,Tr+">=0","invalid "+Ye)})),Tr})}else if(At&&Et)return Ja(function(fr,rr){return fr.OFFSET="0",0});return null}var Ke=Ot(Rf,!0);function ct(){if(eu in vt){var Ye=vt[eu]|0;return Oe.command(typeof Ye=="number"&&Ye>=0,"invalid vertex count",Fe.commandStr),Ja(function(){return Ye})}else if(eu in Bt){var At=Bt[eu];return Li(At,function(fr,rr){var Tr=fr.invoke(rr,At);return Oe.optional(function(){fr.assert(rr,"typeof "+Tr+'==="number"&&'+Tr+">=0&&"+Tr+"===("+Tr+"|0)","invalid vertex count")}),Tr})}else if(Et)if(Is(Et)){if(Et)return Ke?new Yi(Ke.thisDep,Ke.contextDep,Ke.propDep,function(fr,rr){var Tr=rr.def(fr.ELEMENTS,".vertCount-",fr.OFFSET);return Oe.optional(function(){fr.assert(rr,Tr+">=0","invalid vertex offset/element buffer too small")}),Tr}):Ja(function(fr,rr){return rr.def(fr.ELEMENTS,".vertCount")});var Wt=Ja(function(){return-1});return Oe.optional(function(){Wt.MISSING=!0}),Wt}else{var sr=new Yi(Et.thisDep||Ke.thisDep,Et.contextDep||Ke.contextDep,Et.propDep||Ke.propDep,function(fr,rr){var Tr=fr.ELEMENTS;return fr.OFFSET?rr.def(Tr,"?",Tr,".vertCount-",fr.OFFSET,":-1"):rr.def(Tr,"?",Tr,".vertCount:-1")});return Oe.optional(function(){sr.DYNAMIC=!0}),sr}return null}return{elements:Et,primitive:gt(),count:ct(),instances:Ot(Bf,!1),offset:Ke}}function kn(Ze,Fe){var vt=Ze.static,Bt=Ze.dynamic,Ut={};return Ne.forEach(function(Et){var gt=nt(Et);function Ot(Ke,ct){if(Et in vt){var Ye=Ke(vt[Et]);Ut[gt]=Ja(function(){return Ye})}else if(Et in Bt){var At=Bt[Et];Ut[gt]=Li(At,function(Wt,sr){return ct(Wt,sr,Wt.invoke(sr,At))})}}switch(Et){case ht:case vc:case hc:case yc:case Ci:case mc:case sl:case ul:case fl:case Nf:return Ot(function(Ke){return Oe.commandType(Ke,"boolean",Et,Fe.commandStr),Ke},function(Ke,ct,Ye){return Oe.optional(function(){Ke.assert(ct,"typeof "+Ye+'==="boolean"',"invalid flag "+Et,Ke.commandStr)}),Ye});case Df:return Ot(function(Ke){return Oe.commandParameter(Ke,Nu,"invalid "+Et,Fe.commandStr),Nu[Ke]},function(Ke,ct,Ye){var At=Ke.constants.compareFuncs;return Oe.optional(function(){Ke.assert(ct,Ye+" in "+At,"invalid "+Et+", must be one of "+Object.keys(Nu))}),ct.def(At,"[",Ye,"]")});case il:return Ot(function(Ke){return Oe.command(_n(Ke)&&Ke.length===2&&typeof Ke[0]=="number"&&typeof Ke[1]=="number"&&Ke[0]<=Ke[1],"depth range is 2d array",Fe.commandStr),Ke},function(Ke,ct,Ye){Oe.optional(function(){Ke.assert(ct,Ke.shared.isArrayLike+"("+Ye+")&&"+Ye+".length===2&&typeof "+Ye+'[0]==="number"&&typeof '+Ye+'[1]==="number"&&'+Ye+"[0]<="+Ye+"[1]","depth range must be a 2d array")});var At=ct.def("+",Ye,"[0]"),Wt=ct.def("+",Ye,"[1]");return[At,Wt]});case tf:return Ot(function(Ke){Oe.commandType(Ke,"object","blend.func",Fe.commandStr);var ct="srcRGB"in Ke?Ke.srcRGB:Ke.src,Ye="srcAlpha"in Ke?Ke.srcAlpha:Ke.src,At="dstRGB"in Ke?Ke.dstRGB:Ke.dst,Wt="dstAlpha"in Ke?Ke.dstAlpha:Ke.dst;return Oe.commandParameter(ct,Ti,gt+".srcRGB",Fe.commandStr),Oe.commandParameter(Ye,Ti,gt+".srcAlpha",Fe.commandStr),Oe.commandParameter(At,Ti,gt+".dstRGB",Fe.commandStr),Oe.commandParameter(Wt,Ti,gt+".dstAlpha",Fe.commandStr),Oe.command(Zc.indexOf(ct+", "+At)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+ct+", "+At+")",Fe.commandStr),[Ti[ct],Ti[At],Ti[Ye],Ti[Wt]]},function(Ke,ct,Ye){var At=Ke.constants.blendFuncs;Oe.optional(function(){Ke.assert(ct,Ye+"&&typeof "+Ye+'==="object"',"invalid blend func, must be an object")});function Wt(ln,Ln){var Hn=ct.def('"',ln,Ln,'" in ',Ye,"?",Ye,".",ln,Ln,":",Ye,".",ln);return Oe.optional(function(){Ke.assert(ct,Hn+" in "+At,"invalid "+Et+"."+ln+Ln+", must be one of "+Object.keys(Ti))}),Hn}var sr=Wt("src","RGB"),fr=Wt("dst","RGB");Oe.optional(function(){var ln=Ke.constants.invalidBlendCombinations;Ke.assert(ct,ln+".indexOf("+sr+'+", "+'+fr+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var rr=ct.def(At,"[",sr,"]"),Tr=ct.def(At,"[",Wt("src","Alpha"),"]"),En=ct.def(At,"[",fr,"]"),qn=ct.def(At,"[",Wt("dst","Alpha"),"]");return[rr,En,Tr,qn]});case Cu:return Ot(function(Ke){if(typeof Ke=="string")return Oe.commandParameter(Ke,re,"invalid "+Et,Fe.commandStr),[re[Ke],re[Ke]];if(typeof Ke=="object")return Oe.commandParameter(Ke.rgb,re,Et+".rgb",Fe.commandStr),Oe.commandParameter(Ke.alpha,re,Et+".alpha",Fe.commandStr),[re[Ke.rgb],re[Ke.alpha]];Oe.commandRaise("invalid blend.equation",Fe.commandStr)},function(Ke,ct,Ye){var At=Ke.constants.blendEquations,Wt=ct.def(),sr=ct.def(),fr=Ke.cond("typeof ",Ye,'==="string"');return Oe.optional(function(){function rr(Tr,En,qn){Ke.assert(Tr,qn+" in "+At,"invalid "+En+", must be one of "+Object.keys(re))}rr(fr.then,Et,Ye),Ke.assert(fr.else,Ye+"&&typeof "+Ye+'==="object"',"invalid "+Et),rr(fr.else,Et+".rgb",Ye+".rgb"),rr(fr.else,Et+".alpha",Ye+".alpha")}),fr.then(Wt,"=",sr,"=",At,"[",Ye,"];"),fr.else(Wt,"=",At,"[",Ye,".rgb];",sr,"=",At,"[",Ye,".alpha];"),ct(fr),[Wt,sr]});case gc:return Ot(function(Ke){return Oe.command(_n(Ke)&&Ke.length===4,"blend.color must be a 4d array",Fe.commandStr),un(4,function(ct){return+Ke[ct]})},function(Ke,ct,Ye){return Oe.optional(function(){Ke.assert(ct,Ke.shared.isArrayLike+"("+Ye+")&&"+Ye+".length===4","blend.color must be a 4d array")}),un(4,function(At){return ct.def("+",Ye,"[",At,"]")})});case oi:return Ot(function(Ke){return Oe.commandType(Ke,"number",gt,Fe.commandStr),Ke|0},function(Ke,ct,Ye){return Oe.optional(function(){Ke.assert(ct,"typeof "+Ye+'==="number"',"invalid stencil.mask")}),ct.def(Ye,"|0")});case kf:return Ot(function(Ke){Oe.commandType(Ke,"object",gt,Fe.commandStr);var ct=Ke.cmp||"keep",Ye=Ke.ref||0,At="mask"in Ke?Ke.mask:-1;return Oe.commandParameter(ct,Nu,Et+".cmp",Fe.commandStr),Oe.commandType(Ye,"number",Et+".ref",Fe.commandStr),Oe.commandType(At,"number",Et+".mask",Fe.commandStr),[Nu[ct],Ye,At]},function(Ke,ct,Ye){var At=Ke.constants.compareFuncs;Oe.optional(function(){function rr(){Ke.assert(ct,Array.prototype.join.call(arguments,""),"invalid stencil.func")}rr(Ye+"&&typeof ",Ye,'==="object"'),rr('!("cmp" in ',Ye,")||(",Ye,".cmp in ",At,")")});var Wt=ct.def('"cmp" in ',Ye,"?",At,"[",Ye,".cmp]",":",si),sr=ct.def(Ye,".ref|0"),fr=ct.def('"mask" in ',Ye,"?",Ye,".mask|0:-1");return[Wt,sr,fr]});case gi:case Ms:return Ot(function(Ke){Oe.commandType(Ke,"object",gt,Fe.commandStr);var ct=Ke.fail||"keep",Ye=Ke.zfail||"keep",At=Ke.zpass||"keep";return Oe.commandParameter(ct,Ts,Et+".fail",Fe.commandStr),Oe.commandParameter(Ye,Ts,Et+".zfail",Fe.commandStr),Oe.commandParameter(At,Ts,Et+".zpass",Fe.commandStr),[Et===Ms?au:cf,Ts[ct],Ts[Ye],Ts[At]]},function(Ke,ct,Ye){var At=Ke.constants.stencilOps;Oe.optional(function(){Ke.assert(ct,Ye+"&&typeof "+Ye+'==="object"',"invalid "+Et)});function Wt(sr){return Oe.optional(function(){Ke.assert(ct,'!("'+sr+'" in '+Ye+")||("+Ye+"."+sr+" in "+At+")","invalid "+Et+"."+sr+", must be one of "+Object.keys(Ts))}),ct.def('"',sr,'" in ',Ye,"?",At,"[",Ye,".",sr,"]:",si)}return[Et===Ms?au:cf,Wt("fail"),Wt("zfail"),Wt("zpass")]});case Bc:return Ot(function(Ke){Oe.commandType(Ke,"object",gt,Fe.commandStr);var ct=Ke.factor|0,Ye=Ke.units|0;return Oe.commandType(ct,"number",gt+".factor",Fe.commandStr),Oe.commandType(Ye,"number",gt+".units",Fe.commandStr),[ct,Ye]},function(Ke,ct,Ye){Oe.optional(function(){Ke.assert(ct,Ye+"&&typeof "+Ye+'==="object"',"invalid "+Et)});var At=ct.def(Ye,".factor|0"),Wt=ct.def(Ye,".units|0");return[At,Wt]});case ol:return Ot(function(Ke){var ct=0;return Ke==="front"?ct=cf:Ke==="back"&&(ct=au),Oe.command(!!ct,gt,Fe.commandStr),ct},function(Ke,ct,Ye){return Oe.optional(function(){Ke.assert(ct,Ye+'==="front"||'+Ye+'==="back"',"invalid cull.face")}),ct.def(Ye,'==="front"?',cf,":",au)});case pc:return Ot(function(Ke){return Oe.command(typeof Ke=="number"&&Ke>=Zt.lineWidthDims[0]&&Ke<=Zt.lineWidthDims[1],"invalid line width, must be a positive number between "+Zt.lineWidthDims[0]+" and "+Zt.lineWidthDims[1],Fe.commandStr),Ke},function(Ke,ct,Ye){return Oe.optional(function(){Ke.assert(ct,"typeof "+Ye+'==="number"&&'+Ye+">="+Zt.lineWidthDims[0]+"&&"+Ye+"<="+Zt.lineWidthDims[1],"invalid line width")}),Ye});case rf:return Ot(function(Ke){return Oe.commandParameter(Ke,Kf,gt,Fe.commandStr),Kf[Ke]},function(Ke,ct,Ye){return Oe.optional(function(){Ke.assert(ct,Ye+'==="cw"||'+Ye+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),ct.def(Ye+'==="cw"?'+Vf+":"+Yf)});case Rc:return Ot(function(Ke){return Oe.command(_n(Ke)&&Ke.length===4,"color.mask must be length 4 array",Fe.commandStr),Ke.map(function(ct){return!!ct})},function(Ke,ct,Ye){return Oe.optional(function(){Ke.assert(ct,Ke.shared.isArrayLike+"("+Ye+")&&"+Ye+".length===4","invalid color.mask")}),un(4,function(At){return"!!"+Ye+"["+At+"]"})});case Pf:return Ot(function(Ke){Oe.command(typeof Ke=="object"&&Ke,gt,Fe.commandStr);var ct="value"in Ke?Ke.value:1,Ye=!!Ke.invert;return Oe.command(typeof ct=="number"&&ct>=0&&ct<=1,"sample.coverage.value must be a number between 0 and 1",Fe.commandStr),[ct,Ye]},function(Ke,ct,Ye){Oe.optional(function(){Ke.assert(ct,Ye+"&&typeof "+Ye+'==="object"',"invalid sample.coverage")});var At=ct.def('"value" in ',Ye,"?+",Ye,".value:1"),Wt=ct.def("!!",Ye,".invert");return[At,Wt]})}}),Ut}function Na(Ze,Fe){var vt=Ze.static,Bt=Ze.dynamic,Ut={};return Object.keys(vt).forEach(function(Et){var gt=vt[Et],Ot;if(typeof gt=="number"||typeof gt=="boolean")Ot=Ja(function(){return gt});else if(typeof gt=="function"){var Ke=gt._reglType;Ke==="texture2d"||Ke==="textureCube"?Ot=Ja(function(ct){return ct.link(gt)}):Ke==="framebuffer"||Ke==="framebufferCube"?(Oe.command(gt.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Et+'"',Fe.commandStr),Ot=Ja(function(ct){return ct.link(gt.color[0])})):Oe.commandRaise('invalid data for uniform "'+Et+'"',Fe.commandStr)}else _n(gt)?Ot=Ja(function(ct){var Ye=ct.global.def("[",un(gt.length,function(At){return Oe.command(typeof gt[At]=="number"||typeof gt[At]=="boolean","invalid uniform "+Et,ct.commandStr),gt[At]}),"]");return Ye}):Oe.commandRaise('invalid or missing data for uniform "'+Et+'"',Fe.commandStr);Ot.value=gt,Ut[Et]=Ot}),Object.keys(Bt).forEach(function(Et){var gt=Bt[Et];Ut[Et]=Li(gt,function(Ot,Ke){return Ot.invoke(Ke,gt)})}),Ut}function Bn(Ze,Fe){var vt=Ze.static,Bt=Ze.dynamic,Ut={};return Object.keys(vt).forEach(function(Et){var gt=vt[Et],Ot=We.id(Et),Ke=new V;if($f(gt))Ke.state=os,Ke.buffer=or.getBuffer(or.create(gt,tu,!1,!0)),Ke.type=0;else{var ct=or.getBuffer(gt);if(ct)Ke.state=os,Ke.buffer=ct,Ke.type=0;else if(Oe.command(typeof gt=="object"&&gt,"invalid data for attribute "+Et,Fe.commandStr),"constant"in gt){var Ye=gt.constant;Ke.buffer="null",Ke.state=Mu,typeof Ye=="number"?Ke.x=Ye:(Oe.command(_n(Ye)&&Ye.length>0&&Ye.length<=4,"invalid constant for attribute "+Et,Fe.commandStr),Su.forEach(function(En,qn){qn<Ye.length&&(Ke[En]=Ye[qn])}))}else{$f(gt.buffer)?ct=or.getBuffer(or.create(gt.buffer,tu,!1,!0)):ct=or.getBuffer(gt.buffer),Oe.command(!!ct,'missing buffer for attribute "'+Et+'"',Fe.commandStr);var At=gt.offset|0;Oe.command(At>=0,'invalid offset for attribute "'+Et+'"',Fe.commandStr);var Wt=gt.stride|0;Oe.command(Wt>=0&&Wt<256,'invalid stride for attribute "'+Et+'", must be integer betweeen [0, 255]',Fe.commandStr);var sr=gt.size|0;Oe.command(!("size"in gt)||sr>0&&sr<=4,'invalid size for attribute "'+Et+'", must be 1,2,3,4',Fe.commandStr);var fr=!!gt.normalized,rr=0;"type"in gt&&(Oe.commandParameter(gt.type,to,"invalid type for attribute "+Et,Fe.commandStr),rr=to[gt.type]);var Tr=gt.divisor|0;"divisor"in gt&&(Oe.command(Tr===0||oe,'cannot specify divisor for attribute "'+Et+'", instancing not supported',Fe.commandStr),Oe.command(Tr>=0,'invalid divisor for attribute "'+Et+'"',Fe.commandStr)),Oe.optional(function(){var En=Fe.commandStr,qn=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(gt).forEach(function(ln){Oe.command(qn.indexOf(ln)>=0,'unknown parameter "'+ln+'" for attribute pointer "'+Et+'" (valid parameters are '+qn+")",En)})}),Ke.buffer=ct,Ke.state=os,Ke.size=sr,Ke.normalized=fr,Ke.type=rr||ct.dtype,Ke.offset=At,Ke.stride=Wt,Ke.divisor=Tr}}Ut[Et]=Ja(function(En,qn){var ln=En.attribCache;if(Ot in ln)return ln[Ot];var Ln={isStream:!1};return Object.keys(Ke).forEach(function(Hn){Ln[Hn]=Ke[Hn]}),Ke.buffer&&(Ln.buffer=En.link(Ke.buffer),Ln.type=Ln.type||Ln.buffer+".dtype"),ln[Ot]=Ln,Ln})}),Object.keys(Bt).forEach(function(Et){var gt=Bt[Et];function Ot(Ke,ct){var Ye=Ke.invoke(ct,gt),At=Ke.shared,Wt=Ke.constants,sr=At.isBufferArgs,fr=At.buffer;Oe.optional(function(){Ke.assert(ct,Ye+"&&(typeof "+Ye+'==="object"||typeof '+Ye+'==="function")&&('+sr+"("+Ye+")||"+fr+".getBuffer("+Ye+")||"+fr+".getBuffer("+Ye+".buffer)||"+sr+"("+Ye+'.buffer)||("constant" in '+Ye+"&&(typeof "+Ye+'.constant==="number"||'+At.isArrayLike+"("+Ye+".constant))))",'invalid dynamic attribute "'+Et+'"')});var rr={isStream:ct.def(!1)},Tr=new V;Tr.state=os,Object.keys(Tr).forEach(function(Ln){rr[Ln]=ct.def(""+Tr[Ln])});var En=rr.buffer,qn=rr.type;ct("if(",sr,"(",Ye,")){",rr.isStream,"=true;",En,"=",fr,".createStream(",tu,",",Ye,");",qn,"=",En,".dtype;","}else{",En,"=",fr,".getBuffer(",Ye,");","if(",En,"){",qn,"=",En,".dtype;",'}else if("constant" in ',Ye,"){",rr.state,"=",Mu,";","if(typeof "+Ye+'.constant === "number"){',rr[Su[0]],"=",Ye,".constant;",Su.slice(1).map(function(Ln){return rr[Ln]}).join("="),"=0;","}else{",Su.map(function(Ln,Hn){return rr[Ln]+"="+Ye+".constant.length>"+Hn+"?"+Ye+".constant["+Hn+"]:0;"}).join(""),"}}else{","if(",sr,"(",Ye,".buffer)){",En,"=",fr,".createStream(",tu,",",Ye,".buffer);","}else{",En,"=",fr,".getBuffer(",Ye,".buffer);","}",qn,'="type" in ',Ye,"?",Wt.glTypes,"[",Ye,".type]:",En,".dtype;",rr.normalized,"=!!",Ye,".normalized;");function ln(Ln){ct(rr[Ln],"=",Ye,".",Ln,"|0;")}return ln("size"),ln("offset"),ln("stride"),ln("divisor"),ct("}}"),ct.exit("if(",rr.isStream,"){",fr,".destroyStream(",En,");","}"),rr}Ut[Et]=Li(gt,Ot)}),Ut}function Ha(Ze,Fe){var vt=Ze.static,Bt=Ze.dynamic;if(af in vt){var Ut=vt[af];return Ut!==null&&wr.getVAO(Ut)===null&&(Ut=wr.createVAO(Ut)),Ja(function(gt){return gt.link(wr.getVAO(Ut))})}else if(af in Bt){var Et=Bt[af];return Li(Et,function(gt,Ot){var Ke=gt.invoke(Ot,Et);return Ot.def(gt.shared.vao+".getVAO("+Ke+")")})}return null}function Aa(Ze){var Fe=Ze.static,vt=Ze.dynamic,Bt={};return Object.keys(Fe).forEach(function(Ut){var Et=Fe[Ut];Bt[Ut]=Ja(function(gt,Ot){return typeof Et=="number"||typeof Et=="boolean"?""+Et:gt.link(Et)})}),Object.keys(vt).forEach(function(Ut){var Et=vt[Ut];Bt[Ut]=Li(Et,function(gt,Ot){return gt.invoke(Ot,Et)})}),Bt}function fa(Ze,Fe,vt,Bt,Ut){var Et=Ze.static,gt=Ze.dynamic;Oe.optional(function(){var ln=[ta,qi,Tu,qs,jo,Rf,eu,Bf,Js,af].concat(Ne);function Ln(Hn){Object.keys(Hn).forEach(function(wa){Oe.command(ln.indexOf(wa)>=0,'unknown parameter "'+wa+'"',Ut.commandStr)})}Ln(Et),Ln(gt)});var Ot=cn(Ze,Fe),Ke=Or(Ze,Ut),ct=fn(Ze,Ke,Ut),Ye=Un(Ze,Ut),At=kn(Ze,Ut),Wt=Mn(Ze,Ut,Ot);function sr(ln){var Ln=ct[ln];Ln&&(At[ln]=Ln)}sr(Xo),sr(nt(nf));var fr=Object.keys(At).length>0,rr={framebuffer:Ke,draw:Ye,shader:Wt,state:At,dirty:fr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(rr.profile=Xr(Ze,Ut),rr.uniforms=Na(vt,Ut),rr.drawVAO=rr.scopeVAO=Ha(Ze,Ut),!rr.drawVAO&&Wt.program&&!Ot&&it.angle_instanced_arrays){var Tr=!0,En=Wt.program.attributes.map(function(ln){var Ln=Fe.static[ln];return Tr=Tr&&!!Ln,Ln});if(Tr&&En.length>0){var qn=wr.getVAO(wr.createVAO(En));rr.drawVAO=new Yi(null,null,null,function(ln,Ln){return ln.link(qn)}),rr.useVAO=!0}}return Ot?rr.useVAO=!0:rr.attributes=Bn(Fe,Ut),rr.context=Aa(Bt,Ut),rr}function Wa(Ze,Fe,vt){var Bt=Ze.shared,Ut=Bt.context,Et=Ze.scope();Object.keys(vt).forEach(function(gt){Fe.save(Ut,"."+gt);var Ot=vt[gt],Ke=Ot.append(Ze,Fe);Array.isArray(Ke)?Et(Ut,".",gt,"=[",Ke.join(),"];"):Et(Ut,".",gt,"=",Ke,";")}),Fe(Et)}function Za(Ze,Fe,vt,Bt){var Ut=Ze.shared,Et=Ut.gl,gt=Ut.framebuffer,Ot;le&&(Ot=Fe.def(Ut.extensions,".webgl_draw_buffers"));var Ke=Ze.constants,ct=Ke.drawBuffer,Ye=Ke.backBuffer,At;vt?At=vt.append(Ze,Fe):At=Fe.def(gt,".next"),Bt||Fe("if(",At,"!==",gt,".cur){"),Fe("if(",At,"){",Et,".bindFramebuffer(",Hc,",",At,".framebuffer);"),le&&Fe(Ot,".drawBuffersWEBGL(",ct,"[",At,".colorAttachments.length]);"),Fe("}else{",Et,".bindFramebuffer(",Hc,",null);"),le&&Fe(Ot,".drawBuffersWEBGL(",Ye,");"),Fe("}",gt,".cur=",At,";"),Bt||Fe("}")}function pi(Ze,Fe,vt){var Bt=Ze.shared,Ut=Bt.gl,Et=Ze.current,gt=Ze.next,Ot=Bt.current,Ke=Bt.next,ct=Ze.cond(Ot,".dirty");Ne.forEach(function(Ye){var At=nt(Ye);if(!(At in vt.state)){var Wt,sr;if(At in gt){Wt=gt[At],sr=Et[At];var fr=un(ge[At].length,function(Tr){return ct.def(Wt,"[",Tr,"]")});ct(Ze.cond(fr.map(function(Tr,En){return Tr+"!=="+sr+"["+En+"]"}).join("||")).then(Ut,".",Be[At],"(",fr,");",fr.map(function(Tr,En){return sr+"["+En+"]="+Tr}).join(";"),";"))}else{Wt=ct.def(Ke,".",At);var rr=Ze.cond(Wt,"!==",Ot,".",At);ct(rr),At in ze?rr(Ze.cond(Wt).then(Ut,".enable(",ze[At],");").else(Ut,".disable(",ze[At],");"),Ot,".",At,"=",Wt,";"):rr(Ut,".",Be[At],"(",Wt,");",Ot,".",At,"=",Wt,";")}}}),Object.keys(vt.state).length===0&&ct(Ot,".dirty=false;"),Fe(ct)}function Di(Ze,Fe,vt,Bt){var Ut=Ze.shared,Et=Ze.current,gt=Ut.current,Ot=Ut.gl;Kc(Object.keys(vt)).forEach(function(Ke){var ct=vt[Ke];if(!(Bt&&!Bt(ct))){var Ye=ct.append(Ze,Fe);if(ze[Ke]){var At=ze[Ke];Is(ct)?Ye?Fe(Ot,".enable(",At,");"):Fe(Ot,".disable(",At,");"):Fe(Ze.cond(Ye).then(Ot,".enable(",At,");").else(Ot,".disable(",At,");")),Fe(gt,".",Ke,"=",Ye,";")}else if(_n(Ye)){var Wt=Et[Ke];Fe(Ot,".",Be[Ke],"(",Ye,");",Ye.map(function(sr,fr){return Wt+"["+fr+"]="+sr}).join(";"),";")}else Fe(Ot,".",Be[Ke],"(",Ye,");",gt,".",Ke,"=",Ye,";")}})}function ui(Ze,Fe){oe&&(Ze.instancing=Fe.def(Ze.shared.extensions,".angle_instanced_arrays"))}function Jn(Ze,Fe,vt,Bt,Ut){var Et=Ze.shared,gt=Ze.stats,Ot=Et.current,Ke=Et.timer,ct=vt.profile;function Ye(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var At,Wt;function sr(ln){At=Fe.def(),ln(At,"=",Ye(),";"),typeof Ut=="string"?ln(gt,".count+=",Ut,";"):ln(gt,".count++;"),w&&(Bt?(Wt=Fe.def(),ln(Wt,"=",Ke,".getNumPendingQueries();")):ln(Ke,".beginQuery(",gt,");"))}function fr(ln){ln(gt,".cpuTime+=",Ye(),"-",At,";"),w&&(Bt?ln(Ke,".pushScopeStats(",Wt,",",Ke,".getNumPendingQueries(),",gt,");"):ln(Ke,".endQuery();"))}function rr(ln){var Ln=Fe.def(Ot,".profile");Fe(Ot,".profile=",ln,";"),Fe.exit(Ot,".profile=",Ln,";")}var Tr;if(ct){if(Is(ct)){ct.enable?(sr(Fe),fr(Fe.exit),rr("true")):rr("false");return}Tr=ct.append(Ze,Fe),rr(Tr)}else Tr=Fe.def(Ot,".profile");var En=Ze.block();sr(En),Fe("if(",Tr,"){",En,"}");var qn=Ze.block();fr(qn),Fe.exit("if(",Tr,"){",qn,"}")}function Ni(Ze,Fe,vt,Bt,Ut){var Et=Ze.shared;function gt(Ke){switch(Ke){case nu:case Xf:case jf:return 2;case Uf:case Au:case sf:return 3;case Wf:case of:case uf:return 4;default:return 1}}function Ot(Ke,ct,Ye){var At=Et.gl,Wt=Fe.def(Ke,".location"),sr=Fe.def(Et.attributes,"[",Wt,"]"),fr=Ye.state,rr=Ye.buffer,Tr=[Ye.x,Ye.y,Ye.z,Ye.w],En=["buffer","normalized","offset","stride"];function qn(){Fe("if(!",sr,".buffer){",At,".enableVertexAttribArray(",Wt,");}");var Ln=Ye.type,Hn;if(Ye.size?Hn=Fe.def(Ye.size,"||",ct):Hn=ct,Fe("if(",sr,".type!==",Ln,"||",sr,".size!==",Hn,"||",En.map(function(Ka){return sr+"."+Ka+"!=="+Ye[Ka]}).join("||"),"){",At,".bindBuffer(",tu,",",rr,".buffer);",At,".vertexAttribPointer(",[Wt,Hn,Ln,Ye.normalized,Ye.stride,Ye.offset],");",sr,".type=",Ln,";",sr,".size=",Hn,";",En.map(function(Ka){return sr+"."+Ka+"="+Ye[Ka]+";"}).join(""),"}"),oe){var wa=Ye.divisor;Fe("if(",sr,".divisor!==",wa,"){",Ze.instancing,".vertexAttribDivisorANGLE(",[Wt,wa],");",sr,".divisor=",wa,";}")}}function ln(){Fe("if(",sr,".buffer){",At,".disableVertexAttribArray(",Wt,");",sr,".buffer=null;","}if(",Su.map(function(Ln,Hn){return sr+"."+Ln+"!=="+Tr[Hn]}).join("||"),"){",At,".vertexAttrib4f(",Wt,",",Tr,");",Su.map(function(Ln,Hn){return sr+"."+Ln+"="+Tr[Hn]+";"}).join(""),"}")}fr===os?qn():fr===Mu?ln():(Fe("if(",fr,"===",os,"){"),qn(),Fe("}else{"),ln(),Fe("}"))}Bt.forEach(function(Ke){var ct=Ke.name,Ye=vt.attributes[ct],At;if(Ye){if(!Ut(Ye))return;At=Ye.append(Ze,Fe)}else{if(!Ut(Qf))return;var Wt=Ze.scopeAttrib(ct);Oe.optional(function(){Ze.assert(Fe,Wt+".state","missing attribute "+ct)}),At={},Object.keys(new V).forEach(function(sr){At[sr]=Fe.def(Wt,".",sr)})}Ot(Ze.link(Ke),gt(Ke.info.type),At)})}function ma(Ze,Fe,vt,Bt,Ut){for(var Et=Ze.shared,gt=Et.gl,Ot,Ke=0;Ke<Bt.length;++Ke){var ct=Bt[Ke],Ye=ct.name,At=ct.info.type,Wt=vt.uniforms[Ye],sr=Ze.link(ct),fr=sr+".location",rr;if(Wt){if(!Ut(Wt))continue;if(Is(Wt)){var Tr=Wt.value;if(Oe.command(Tr!==null&&typeof Tr!="undefined",'missing uniform "'+Ye+'"',Ze.commandStr),At===Du||At===Cs){Oe.command(typeof Tr=="function"&&(At===Du&&(Tr._reglType==="texture2d"||Tr._reglType==="framebuffer")||At===Cs&&(Tr._reglType==="textureCube"||Tr._reglType==="framebufferCube")),"invalid texture for uniform "+Ye,Ze.commandStr);var En=Ze.link(Tr._texture||Tr.color[0]._texture);Fe(gt,".uniform1i(",fr,",",En+".bind());"),Fe.exit(En,".unbind();")}else if(At===Ou||At===ff||At===Lu){Oe.optional(function(){Oe.command(_n(Tr),"invalid matrix for uniform "+Ye,Ze.commandStr),Oe.command(At===Ou&&Tr.length===4||At===ff&&Tr.length===9||At===Lu&&Tr.length===16,"invalid length for matrix uniform "+Ye,Ze.commandStr)});var qn=Ze.global.def("new Float32Array(["+Array.prototype.slice.call(Tr)+"])"),ln=2;At===ff?ln=3:At===Lu&&(ln=4),Fe(gt,".uniformMatrix",ln,"fv(",fr,",false,",qn,");")}else{switch(At){case Iu:Oe.commandType(Tr,"number","uniform "+Ye,Ze.commandStr),Ot="1f";break;case nu:Oe.command(_n(Tr)&&Tr.length===2,"uniform "+Ye,Ze.commandStr),Ot="2f";break;case Uf:Oe.command(_n(Tr)&&Tr.length===3,"uniform "+Ye,Ze.commandStr),Ot="3f";break;case Wf:Oe.command(_n(Tr)&&Tr.length===4,"uniform "+Ye,Ze.commandStr),Ot="4f";break;case Cc:Oe.commandType(Tr,"boolean","uniform "+Ye,Ze.commandStr),Ot="1i";break;case Mc:Oe.commandType(Tr,"number","uniform "+Ye,Ze.commandStr),Ot="1i";break;case jf:Oe.command(_n(Tr)&&Tr.length===2,"uniform "+Ye,Ze.commandStr),Ot="2i";break;case Xf:Oe.command(_n(Tr)&&Tr.length===2,"uniform "+Ye,Ze.commandStr),Ot="2i";break;case sf:Oe.command(_n(Tr)&&Tr.length===3,"uniform "+Ye,Ze.commandStr),Ot="3i";break;case Au:Oe.command(_n(Tr)&&Tr.length===3,"uniform "+Ye,Ze.commandStr),Ot="3i";break;case uf:Oe.command(_n(Tr)&&Tr.length===4,"uniform "+Ye,Ze.commandStr),Ot="4i";break;case of:Oe.command(_n(Tr)&&Tr.length===4,"uniform "+Ye,Ze.commandStr),Ot="4i";break}Fe(gt,".uniform",Ot,"(",fr,",",_n(Tr)?Array.prototype.slice.call(Tr):Tr,");")}continue}else rr=Wt.append(Ze,Fe)}else{if(!Ut(Qf))continue;rr=Fe.def(Et.uniforms,"[",We.id(Ye),"]")}At===Du?(Oe(!Array.isArray(rr),"must specify a scalar prop for textures"),Fe("if(",rr,"&&",rr,'._reglType==="framebuffer"){',rr,"=",rr,".color[0];","}")):At===Cs&&(Oe(!Array.isArray(rr),"must specify a scalar prop for cube maps"),Fe("if(",rr,"&&",rr,'._reglType==="framebufferCube"){',rr,"=",rr,".color[0];","}")),Oe.optional(function(){function co(us,Sl){Ze.assert(Fe,us,'bad data or missing for uniform "'+Ye+'". '+Sl)}function rl(us){Oe(!Array.isArray(rr),"must not specify an array type for uniform"),co("typeof "+rr+'==="'+us+'"',"invalid type, expected "+us)}function Oo(us,Sl){Array.isArray(rr)?Oe(rr.length===us,"must have length "+us):co(Et.isArrayLike+"("+rr+")&&"+rr+".length==="+us,"invalid vector, should have length "+us,Ze.commandStr)}function wl(us){Oe(!Array.isArray(rr),"must not specify a value type"),co("typeof "+rr+'==="function"&&'+rr+'._reglType==="texture'+(us===Vo?"2d":"Cube")+'"',"invalid texture type",Ze.commandStr)}switch(At){case Mc:rl("number");break;case Xf:Oo(2,"number");break;case Au:Oo(3,"number");break;case of:Oo(4,"number");break;case Iu:rl("number");break;case nu:Oo(2,"number");break;case Uf:Oo(3,"number");break;case Wf:Oo(4,"number");break;case Cc:rl("boolean");break;case jf:Oo(2,"boolean");break;case sf:Oo(3,"boolean");break;case uf:Oo(4,"boolean");break;case Ou:Oo(4,"number");break;case ff:Oo(9,"number");break;case Lu:Oo(16,"number");break;case Du:wl(Vo);break;case Cs:wl(zc);break}});var Ln=1;switch(At){case Du:case Cs:var Hn=Fe.def(rr,"._texture");Fe(gt,".uniform1i(",fr,",",Hn,".bind());"),Fe.exit(Hn,".unbind();");continue;case Mc:case Cc:Ot="1i";break;case Xf:case jf:Ot="2i",Ln=2;break;case Au:case sf:Ot="3i",Ln=3;break;case of:case uf:Ot="4i",Ln=4;break;case Iu:Ot="1f";break;case nu:Ot="2f",Ln=2;break;case Uf:Ot="3f",Ln=3;break;case Wf:Ot="4f",Ln=4;break;case Ou:Ot="Matrix2fv";break;case ff:Ot="Matrix3fv";break;case Lu:Ot="Matrix4fv";break}if(Fe(gt,".uniform",Ot,"(",fr,","),Ot.charAt(0)==="M"){var wa=Math.pow(At-Ou+2,2),Ka=Ze.global.def("new Float32Array(",wa,")");Array.isArray(rr)?Fe("false,(",un(wa,function(co){return Ka+"["+co+"]="+rr[co]}),",",Ka,")"):Fe("false,(Array.isArray(",rr,")||",rr," instanceof Float32Array)?",rr,":(",un(wa,function(co){return Ka+"["+co+"]="+rr+"["+co+"]"}),",",Ka,")")}else Ln>1?Fe(un(Ln,function(co){return Array.isArray(rr)?rr[co]:rr+"["+co+"]"})):(Oe(!Array.isArray(rr),"uniform value must not be an array"),Fe(rr));Fe(");")}}function An(Ze,Fe,vt,Bt){var Ut=Ze.shared,Et=Ut.gl,gt=Ut.draw,Ot=Bt.draw;function Ke(){var Hn=Ot.elements,wa,Ka=Fe;return Hn?((Hn.contextDep&&Bt.contextDynamic||Hn.propDep)&&(Ka=vt),wa=Hn.append(Ze,Ka)):wa=Ka.def(gt,".",qs),wa&&Ka("if("+wa+")"+Et+".bindBuffer("+Sc+","+wa+".buffer.buffer);"),wa}function ct(){var Hn=Ot.count,wa,Ka=Fe;return Hn?((Hn.contextDep&&Bt.contextDynamic||Hn.propDep)&&(Ka=vt),wa=Hn.append(Ze,Ka),Oe.optional(function(){Hn.MISSING&&Ze.assert(Fe,"false","missing vertex count"),Hn.DYNAMIC&&Ze.assert(Ka,wa+">=0","missing vertex count")})):(wa=Ka.def(gt,".",eu),Oe.optional(function(){Ze.assert(Ka,wa+">=0","missing vertex count")})),wa}var Ye=Ke();function At(Hn){var wa=Ot[Hn];return wa?wa.contextDep&&Bt.contextDynamic||wa.propDep?wa.append(Ze,vt):wa.append(Ze,Fe):Fe.def(gt,".",Hn)}var Wt=At(jo),sr=At(Rf),fr=ct();if(typeof fr=="number"){if(fr===0)return}else vt("if(",fr,"){"),vt.exit("}");var rr,Tr;oe&&(rr=At(Bf),Tr=Ze.instancing);var En=Ye+".type",qn=Ot.elements&&Is(Ot.elements);function ln(){function Hn(){vt(Tr,".drawElementsInstancedANGLE(",[Wt,fr,En,sr+"<<(("+En+"-"+_u+")>>1)",rr],");")}function wa(){vt(Tr,".drawArraysInstancedANGLE(",[Wt,sr,fr,rr],");")}Ye?qn?Hn():(vt("if(",Ye,"){"),Hn(),vt("}else{"),wa(),vt("}")):wa()}function Ln(){function Hn(){vt(Et+".drawElements("+[Wt,fr,En,sr+"<<(("+En+"-"+_u+")>>1)"]+");")}function wa(){vt(Et+".drawArrays("+[Wt,sr,fr]+");")}Ye?qn?Hn():(vt("if(",Ye,"){"),Hn(),vt("}else{"),wa(),vt("}")):wa()}oe&&(typeof rr!="number"||rr>=0)?typeof rr=="string"?(vt("if(",rr,">0){"),ln(),vt("}else if(",rr,"<0){"),Ln(),vt("}")):ln():Ln()}function ca(Ze,Fe,vt,Bt,Ut){var Et=pr(),gt=Et.proc("body",Ut);return Oe.optional(function(){Et.commandStr=Fe.commandStr,Et.command=Et.link(Fe.commandStr)}),oe&&(Et.instancing=gt.def(Et.shared.extensions,".angle_instanced_arrays")),Ze(Et,gt,vt,Bt),Et.compile().body}function ba(Ze,Fe,vt,Bt){ui(Ze,Fe),vt.useVAO?vt.drawVAO?Fe(Ze.shared.vao,".setVAO(",vt.drawVAO.append(Ze,Fe),");"):Fe(Ze.shared.vao,".setVAO(",Ze.shared.vao,".targetVAO);"):(Fe(Ze.shared.vao,".setVAO(null);"),Ni(Ze,Fe,vt,Bt.attributes,function(){return!0})),ma(Ze,Fe,vt,Bt.uniforms,function(){return!0}),An(Ze,Fe,Fe,vt)}function fi(Ze,Fe){var vt=Ze.proc("draw",1);ui(Ze,vt),Wa(Ze,vt,Fe.context),Za(Ze,vt,Fe.framebuffer),pi(Ze,vt,Fe),Di(Ze,vt,Fe.state),Jn(Ze,vt,Fe,!1,!0);var Bt=Fe.shader.progVar.append(Ze,vt);if(vt(Ze.shared.gl,".useProgram(",Bt,".program);"),Fe.shader.program)ba(Ze,vt,Fe,Fe.shader.program);else{vt(Ze.shared.vao,".setVAO(null);");var Ut=Ze.global.def("{}"),Et=vt.def(Bt,".id"),gt=vt.def(Ut,"[",Et,"]");vt(Ze.cond(gt).then(gt,".call(this,a0);").else(gt,"=",Ut,"[",Et,"]=",Ze.link(function(Ot){return ca(ba,Ze,Fe,Ot,1)}),"(",Bt,");",gt,".call(this,a0);"))}Object.keys(Fe.state).length>0&&vt(Ze.shared.current,".dirty=true;")}function fo(Ze,Fe,vt,Bt){Ze.batchId="a1",ui(Ze,Fe);function Ut(){return!0}Ni(Ze,Fe,vt,Bt.attributes,Ut),ma(Ze,Fe,vt,Bt.uniforms,Ut),An(Ze,Fe,Fe,vt)}function lf(Ze,Fe,vt,Bt){ui(Ze,Fe);var Ut=vt.contextDep,Et=Fe.def(),gt="a0",Ot="a1",Ke=Fe.def();Ze.shared.props=Ke,Ze.batchId=Et;var ct=Ze.scope(),Ye=Ze.scope();Fe(ct.entry,"for(",Et,"=0;",Et,"<",Ot,";++",Et,"){",Ke,"=",gt,"[",Et,"];",Ye,"}",ct.exit);function At(En){return En.contextDep&&Ut||En.propDep}function Wt(En){return!At(En)}if(vt.needsContext&&Wa(Ze,Ye,vt.context),vt.needsFramebuffer&&Za(Ze,Ye,vt.framebuffer),Di(Ze,Ye,vt.state,At),vt.profile&&At(vt.profile)&&Jn(Ze,Ye,vt,!1,!0),Bt)vt.useVAO?vt.drawVAO?At(vt.drawVAO)?Ye(Ze.shared.vao,".setVAO(",vt.drawVAO.append(Ze,Ye),");"):ct(Ze.shared.vao,".setVAO(",vt.drawVAO.append(Ze,ct),");"):ct(Ze.shared.vao,".setVAO(",Ze.shared.vao,".targetVAO);"):(ct(Ze.shared.vao,".setVAO(null);"),Ni(Ze,ct,vt,Bt.attributes,Wt),Ni(Ze,Ye,vt,Bt.attributes,At)),ma(Ze,ct,vt,Bt.uniforms,Wt),ma(Ze,Ye,vt,Bt.uniforms,At),An(Ze,ct,Ye,vt);else{var sr=Ze.global.def("{}"),fr=vt.shader.progVar.append(Ze,Ye),rr=Ye.def(fr,".id"),Tr=Ye.def(sr,"[",rr,"]");Ye(Ze.shared.gl,".useProgram(",fr,".program);","if(!",Tr,"){",Tr,"=",sr,"[",rr,"]=",Ze.link(function(En){return ca(fo,Ze,vt,En,2)}),"(",fr,");}",Tr,".call(this,a0[",Et,"],",Et,");")}}function rt(Ze,Fe){var vt=Ze.proc("batch",2);Ze.batchId="0",ui(Ze,vt);var Bt=!1,Ut=!0;Object.keys(Fe.context).forEach(function(sr){Bt=Bt||Fe.context[sr].propDep}),Bt||(Wa(Ze,vt,Fe.context),Ut=!1);var Et=Fe.framebuffer,gt=!1;Et?(Et.propDep?Bt=gt=!0:Et.contextDep&&Bt&&(gt=!0),gt||Za(Ze,vt,Et)):Za(Ze,vt,null),Fe.state.viewport&&Fe.state.viewport.propDep&&(Bt=!0);function Ot(sr){return sr.contextDep&&Bt||sr.propDep}pi(Ze,vt,Fe),Di(Ze,vt,Fe.state,function(sr){return!Ot(sr)}),(!Fe.profile||!Ot(Fe.profile))&&Jn(Ze,vt,Fe,!1,"a1"),Fe.contextDep=Bt,Fe.needsContext=Ut,Fe.needsFramebuffer=gt;var Ke=Fe.shader.progVar;if(Ke.contextDep&&Bt||Ke.propDep)lf(Ze,vt,Fe,null);else{var ct=Ke.append(Ze,vt);if(vt(Ze.shared.gl,".useProgram(",ct,".program);"),Fe.shader.program)lf(Ze,vt,Fe,Fe.shader.program);else{vt(Ze.shared.vao,".setVAO(null);");var Ye=Ze.global.def("{}"),At=vt.def(ct,".id"),Wt=vt.def(Ye,"[",At,"]");vt(Ze.cond(Wt).then(Wt,".call(this,a0,a1);").else(Wt,"=",Ye,"[",At,"]=",Ze.link(function(sr){return ca(lf,Ze,Fe,sr,2)}),"(",ct,");",Wt,".call(this,a0,a1);"))}}Object.keys(Fe.state).length>0&&vt(Ze.shared.current,".dirty=true;")}function $t(Ze,Fe){var vt=Ze.proc("scope",3);Ze.batchId="a2";var Bt=Ze.shared,Ut=Bt.current;Wa(Ze,vt,Fe.context),Fe.framebuffer&&Fe.framebuffer.append(Ze,vt),Kc(Object.keys(Fe.state)).forEach(function(gt){var Ot=Fe.state[gt],Ke=Ot.append(Ze,vt);_n(Ke)?Ke.forEach(function(ct,Ye){vt.set(Ze.next[gt],"["+Ye+"]",ct)}):vt.set(Bt.next,"."+gt,Ke)}),Jn(Ze,vt,Fe,!0,!0),[qs,Rf,eu,Bf,jo].forEach(function(gt){var Ot=Fe.draw[gt];Ot&&vt.set(Bt.draw,"."+gt,""+Ot.append(Ze,vt))}),Object.keys(Fe.uniforms).forEach(function(gt){var Ot=Fe.uniforms[gt].append(Ze,vt);Array.isArray(Ot)&&(Ot="["+Ot.join()+"]"),vt.set(Bt.uniforms,"["+We.id(gt)+"]",Ot)}),Object.keys(Fe.attributes).forEach(function(gt){var Ot=Fe.attributes[gt].append(Ze,vt),Ke=Ze.scopeAttrib(gt);Object.keys(new V).forEach(function(ct){vt.set(Ke,"."+ct,Ot[ct])})}),Fe.scopeVAO&&vt.set(Bt.vao,".targetVAO",Fe.scopeVAO.append(Ze,vt));function Et(gt){var Ot=Fe.shader[gt];Ot&&vt.set(Bt.shader,"."+gt,Ot.append(Ze,vt))}Et(qi),Et(Tu),Object.keys(Fe.state).length>0&&(vt(Ut,".dirty=true;"),vt.exit(Ut,".dirty=true;")),vt("a1(",Ze.shared.context,",a0,",Ze.batchId,");")}function Yt(Ze){if(!(typeof Ze!="object"||_n(Ze))){for(var Fe=Object.keys(Ze),vt=0;vt<Fe.length;++vt)if(zt.isDynamic(Ze[Fe[vt]]))return!0;return!1}}function Lr(Ze,Fe,vt){var Bt=Fe.static[vt];if(!Bt||!Yt(Bt))return;var Ut=Ze.global,Et=Object.keys(Bt),gt=!1,Ot=!1,Ke=!1,ct=Ze.global.def("{}");Et.forEach(function(At){var Wt=Bt[At];if(zt.isDynamic(Wt)){typeof Wt=="function"&&(Wt=Bt[At]=zt.unbox(Wt));var sr=Li(Wt,null);gt=gt||sr.thisDep,Ke=Ke||sr.propDep,Ot=Ot||sr.contextDep}else{switch(Ut(ct,".",At,"="),typeof Wt){case"number":Ut(Wt);break;case"string":Ut('"',Wt,'"');break;case"object":Array.isArray(Wt)&&Ut("[",Wt.join(),"]");break;default:Ut(Ze.link(Wt));break}Ut(";")}});function Ye(At,Wt){Et.forEach(function(sr){var fr=Bt[sr];if(zt.isDynamic(fr)){var rr=At.invoke(Wt,fr);Wt(ct,".",sr,"=",rr,";")}})}Fe.dynamic[vt]=new zt.DynamicVariable(ef,{thisDep:gt,contextDep:Ot,propDep:Ke,ref:ct,append:Ye}),delete Fe.static[vt]}function ia(Ze,Fe,vt,Bt,Ut){var Et=pr();Et.stats=Et.link(Ut),Object.keys(Fe.static).forEach(function(Ot){Lr(Et,Fe,Ot)}),Gc.forEach(function(Ot){Lr(Et,Ze,Ot)});var gt=fa(Ze,Fe,vt,Bt,Et);return fi(Et,gt),$t(Et,gt),rt(Et,gt),F(Et.compile(),{destroy:function(){gt.shader.program.destroy()}})}return{next:_e,current:ge,procs:function(){var Ze=pr(),Fe=Ze.proc("poll"),vt=Ze.proc("refresh"),Bt=Ze.block();Fe(Bt),vt(Bt);var Ut=Ze.shared,Et=Ut.gl,gt=Ut.next,Ot=Ut.current;Bt(Ot,".dirty=false;"),Za(Ze,Fe),Za(Ze,vt,null,!0);var Ke;oe&&(Ke=Ze.link(oe)),it.oes_vertex_array_object&&vt(Ze.link(it.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var ct=0;ct<Zt.maxAttributes;++ct){var Ye=vt.def(Ut.attributes,"[",ct,"]"),At=Ze.cond(Ye,".buffer");At.then(Et,".enableVertexAttribArray(",ct,");",Et,".bindBuffer(",tu,",",Ye,".buffer.buffer);",Et,".vertexAttribPointer(",ct,",",Ye,".size,",Ye,".type,",Ye,".normalized,",Ye,".stride,",Ye,".offset);").else(Et,".disableVertexAttribArray(",ct,");",Et,".vertexAttrib4f(",ct,",",Ye,".x,",Ye,".y,",Ye,".z,",Ye,".w);",Ye,".buffer=null;"),vt(At),oe&&vt(Ke,".vertexAttribDivisorANGLE(",ct,",",Ye,".divisor);")}return vt(Ze.shared.vao,".currentVAO=null;",Ze.shared.vao,".setVAO(",Ze.shared.vao,".targetVAO);"),Object.keys(ze).forEach(function(Wt){var sr=ze[Wt],fr=Bt.def(gt,".",Wt),rr=Ze.block();rr("if(",fr,"){",Et,".enable(",sr,")}else{",Et,".disable(",sr,")}",Ot,".",Wt,"=",fr,";"),vt(rr),Fe("if(",fr,"!==",Ot,".",Wt,"){",rr,"}")}),Object.keys(Be).forEach(function(Wt){var sr=Be[Wt],fr=ge[Wt],rr,Tr,En=Ze.block();if(En(Et,".",sr,"("),_n(fr)){var qn=fr.length;rr=Ze.global.def(gt,".",Wt),Tr=Ze.global.def(Ot,".",Wt),En(un(qn,function(ln){return rr+"["+ln+"]"}),");",un(qn,function(ln){return Tr+"["+ln+"]="+rr+"["+ln+"];"}).join("")),Fe("if(",un(qn,function(ln){return rr+"["+ln+"]!=="+Tr+"["+ln+"]"}).join("||"),"){",En,"}")}else rr=Bt.def(gt,".",Wt),Tr=Bt.def(Ot,".",Wt),En(rr,");",Ot,".",Wt,"=",rr,";"),Fe("if(",rr,"!==",Tr,"){",En,"}");vt(En)}),Ze.compile()}(),compile:ia}}function Ao(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var yl=34918,$c=34919,Qc=35007,ml=function(he,We){if(!We.ext_disjoint_timer_query)return null;var it=[];function Zt(){return it.pop()||We.ext_disjoint_timer_query.createQueryEXT()}function or(oe){it.push(oe)}var Xt=[];function Qt(oe){var le=Zt();We.ext_disjoint_timer_query.beginQueryEXT(Qc,le),Xt.push(le),w(Xt.length-1,Xt.length,oe)}function gr(){We.ext_disjoint_timer_query.endQueryEXT(Qc)}function Er(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var wr=[];function _r(){return wr.pop()||new Er}function Br(oe){wr.push(oe)}var f=[];function w(oe,le,ge){var _e=_r();_e.startQueryIndex=oe,_e.endQueryIndex=le,_e.sum=0,_e.stats=ge,f.push(_e)}var B=[],V=[];function re(){var oe,le,ge=Xt.length;if(ge!==0){V.length=Math.max(V.length,ge+1),B.length=Math.max(B.length,ge+1),B[0]=0,V[0]=0;var _e=0;for(oe=0,le=0;le<Xt.length;++le){var Ne=Xt[le];We.ext_disjoint_timer_query.getQueryObjectEXT(Ne,$c)?(_e+=We.ext_disjoint_timer_query.getQueryObjectEXT(Ne,yl),or(Ne)):Xt[oe++]=Ne,B[le+1]=_e,V[le+1]=oe}for(Xt.length=oe,oe=0,le=0;le<f.length;++le){var ze=f[le],Be=ze.startQueryIndex,nt=ze.endQueryIndex;ze.sum+=B[nt]-B[Be];var _t=V[Be],tr=V[nt];tr===_t?(ze.stats.gpuTime+=ze.sum/1e6,Br(ze)):(ze.startQueryIndex=_t,ze.endQueryIndex=tr,f[oe++]=ze)}f.length=oe}}return{beginQuery:Qt,endQuery:gr,pushScopeStats:w,update:re,getNumPendingQueries:function(){return Xt.length},clear:function(){it.push.apply(it,Xt);for(var oe=0;oe<it.length;oe++)We.ext_disjoint_timer_query.deleteQueryEXT(it[oe]);Xt.length=0,it.length=0},restore:function(){Xt.length=0,it.length=0}}},bl=16384,Ac=256,Jf=1024,Oc=34962,Lc="webglcontextlost",qf="webglcontextrestored",Jc=1,qc=2,el=3;function tl(he,We){for(var it=0;it<he.length;++it)if(he[it]===We)return it;return-1}function ec(he){var We=xn(he);if(!We)return null;var it=We.gl,Zt=it.getContextAttributes(),or=it.isContextLost(),Xt=vn(it,We);if(!Xt)return null;var Qt=Ar(),gr=Ao(),Er=Xt.extensions,wr=ml(it,Er),_r=hr(),Br=it.drawingBufferWidth,f=it.drawingBufferHeight,w={tick:0,time:0,viewportWidth:Br,viewportHeight:f,framebufferWidth:Br,framebufferHeight:f,drawingBufferWidth:Br,drawingBufferHeight:f,pixelRatio:We.pixelRatio},B={},V={elements:null,primitive:4,count:-1,offset:0,instances:-1},re=_a(it,Er),oe=Wi(it,gr,We,ge),le=Of(it,Er,re,gr,oe);function ge(An){return le.destroyBuffer(An)}var _e=Mo(it,Er,oe,gr),Ne=qu(it,Qt,gr,We),ze=Eu(it,Er,re,function(){_t.procs.poll()},w,gr,We),Be=de(it,Er,re,gr,We),nt=wu(it,Er,re,ze,Be,gr),_t=pl(it,Qt,Er,re,oe,_e,ze,nt,B,le,Ne,V,w,wr,We),tr=al(it,nt,_t.procs.poll,w,Zt,Er,re),Pt=_t.next,kt=it.canvas,Dt=[],pr=[],Xr=[],Or=[We.onDestroy],fn=null;function cn(){if(Dt.length===0){wr&&wr.update(),fn=null;return}fn=Vt.next(cn),Di();for(var An=Dt.length-1;An>=0;--An){var ca=Dt[An];ca&&ca(w,null,0)}it.flush(),wr&&wr.update()}function Mn(){!fn&&Dt.length>0&&(fn=Vt.next(cn))}function Un(){fn&&(Vt.cancel(cn),fn=null)}function kn(An){An.preventDefault(),or=!0,Un(),pr.forEach(function(ca){ca()})}function Na(An){it.getError(),or=!1,Xt.restore(),Ne.restore(),oe.restore(),ze.restore(),Be.restore(),nt.restore(),le.restore(),wr&&wr.restore(),_t.procs.refresh(),Mn(),Xr.forEach(function(ca){ca()})}kt&&(kt.addEventListener(Lc,kn,!1),kt.addEventListener(qf,Na,!1));function Bn(){Dt.length=0,Un(),kt&&(kt.removeEventListener(Lc,kn),kt.removeEventListener(qf,Na)),Ne.clear(),nt.clear(),Be.clear(),ze.clear(),_e.clear(),oe.clear(),le.clear(),wr&&wr.clear(),Or.forEach(function(An){An()})}function Ha(An){Oe(!!An,"invalid args to regl({...})"),Oe.type(An,"object","invalid args to regl({...})");function ca(Ut){var Et=F({},Ut);delete Et.uniforms,delete Et.attributes,delete Et.context,delete Et.vao,"stencil"in Et&&Et.stencil.op&&(Et.stencil.opBack=Et.stencil.opFront=Et.stencil.op,delete Et.stencil.op);function gt(Ot){if(Ot in Et){var Ke=Et[Ot];delete Et[Ot],Object.keys(Ke).forEach(function(ct){Et[Ot+"."+ct]=Ke[ct]})}}return gt("blend"),gt("depth"),gt("cull"),gt("stencil"),gt("polygonOffset"),gt("scissor"),gt("sample"),"vao"in Ut&&(Et.vao=Ut.vao),Et}function ba(Ut,Et){var gt={},Ot={};return Object.keys(Ut).forEach(function(Ke){var ct=Ut[Ke];if(zt.isDynamic(ct)){Ot[Ke]=zt.unbox(ct,Ke);return}else if(Et&&Array.isArray(ct)){for(var Ye=0;Ye<ct.length;++Ye)if(zt.isDynamic(ct[Ye])){Ot[Ke]=zt.unbox(ct,Ke);return}}gt[Ke]=ct}),{dynamic:Ot,static:gt}}var fi=ba(An.context||{},!0),fo=ba(An.uniforms||{},!0),lf=ba(An.attributes||{},!1),rt=ba(ca(An),!1),$t={gpuTime:0,cpuTime:0,count:0},Yt=_t.compile(rt,lf,fo,fi,$t),Lr=Yt.draw,ia=Yt.batch,Ze=Yt.scope,Fe=[];function vt(Ut){for(;Fe.length<Ut;)Fe.push(null);return Fe}function Bt(Ut,Et){var gt;if(or&&Oe.raise("context lost"),typeof Ut=="function")return Ze.call(this,null,Ut,0);if(typeof Et=="function")if(typeof Ut=="number")for(gt=0;gt<Ut;++gt)Ze.call(this,null,Et,gt);else if(Array.isArray(Ut))for(gt=0;gt<Ut.length;++gt)Ze.call(this,Ut[gt],Et,gt);else return Ze.call(this,Ut,Et,0);else if(typeof Ut=="number"){if(Ut>0)return ia.call(this,vt(Ut|0),Ut|0)}else if(Array.isArray(Ut)){if(Ut.length)return ia.call(this,Ut,Ut.length)}else return Lr.call(this,Ut)}return F(Bt,{stats:$t,destroy:function(){Yt.destroy()}})}var Aa=nt.setFBO=Ha({framebuffer:zt.define.call(null,Jc,"framebuffer")});function fa(An,ca){var ba=0;_t.procs.poll();var fi=ca.color;fi&&(it.clearColor(+fi[0]||0,+fi[1]||0,+fi[2]||0,+fi[3]||0),ba|=bl),"depth"in ca&&(it.clearDepth(+ca.depth),ba|=Ac),"stencil"in ca&&(it.clearStencil(ca.stencil|0),ba|=Jf),Oe(!!ba,"called regl.clear with no buffer specified"),it.clear(ba)}function Wa(An){if(Oe(typeof An=="object"&&An,"regl.clear() takes an object as input"),"framebuffer"in An)if(An.framebuffer&&An.framebuffer_reglType==="framebufferCube")for(var ca=0;ca<6;++ca)Aa(F({framebuffer:An.framebuffer.faces[ca]},An),fa);else Aa(An,fa);else fa(null,An)}function Za(An){Oe.type(An,"function","regl.frame() callback must be a function"),Dt.push(An);function ca(){var ba=tl(Dt,An);Oe(ba>=0,"cannot cancel a frame twice");function fi(){var fo=tl(Dt,fi);Dt[fo]=Dt[Dt.length-1],Dt.length-=1,Dt.length<=0&&Un()}Dt[ba]=fi}return Mn(),{cancel:ca}}function pi(){var An=Pt.viewport,ca=Pt.scissor_box;An[0]=An[1]=ca[0]=ca[1]=0,w.viewportWidth=w.framebufferWidth=w.drawingBufferWidth=An[2]=ca[2]=it.drawingBufferWidth,w.viewportHeight=w.framebufferHeight=w.drawingBufferHeight=An[3]=ca[3]=it.drawingBufferHeight}function Di(){w.tick+=1,w.time=Jn(),pi(),_t.procs.poll()}function ui(){ze.refresh(),pi(),_t.procs.refresh(),wr&&wr.update()}function Jn(){return(hr()-_r)/1e3}ui();function Ni(An,ca){Oe.type(ca,"function","listener callback must be a function");var ba;switch(An){case"frame":return Za(ca);case"lost":ba=pr;break;case"restore":ba=Xr;break;case"destroy":ba=Or;break;default:Oe.raise("invalid event, must be one of frame,lost,restore,destroy")}return ba.push(ca),{cancel:function(){for(var fi=0;fi<ba.length;++fi)if(ba[fi]===ca){ba[fi]=ba[ba.length-1],ba.pop();return}}}}var ma=F(Ha,{clear:Wa,prop:zt.define.bind(null,Jc),context:zt.define.bind(null,qc),this:zt.define.bind(null,el),draw:Ha({}),buffer:function(An){return oe.create(An,Oc,!1,!1)},elements:function(An){return _e.create(An,!1)},texture:ze.create2D,cube:ze.createCube,renderbuffer:Be.create,framebuffer:nt.create,framebufferCube:nt.createCube,vao:le.createVAO,attributes:Zt,frame:Za,on:Ni,limits:re,hasExtension:function(An){return re.extensions.indexOf(An.toLowerCase())>=0},read:tr,destroy:Bn,_gl:it,_refresh:ui,poll:function(){Di(),wr&&wr.update()},now:Jn,stats:gr});return We.onDone(null,ma),ma}return ec})},68608:function(Mt){function N(F){if(F===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F}Mt.exports=N,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},38888:function(Mt,N,F){var k=F(44908),U=F(14614),L=F(91621);function _(I){var T=U();return function(){var p=k(I),v;if(T){var g=k(this).constructor;v=Reflect.construct(p,arguments,g)}else v=p.apply(this,arguments);return L(this,v)}}Mt.exports=_,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},44908:function(Mt){function N(F){return Mt.exports=N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports,N(F)}Mt.exports=N,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},58853:function(Mt,N,F){var k=F(49154);function U(L,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");L.prototype=Object.create(_&&_.prototype,{constructor:{value:L,writable:!0,configurable:!0}}),Object.defineProperty(L,"prototype",{writable:!1}),_&&k(L,_)}Mt.exports=U,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},14614:function(Mt){function N(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(F){return!1}}Mt.exports=N,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},91621:function(Mt,N,F){var k=F(37635).default,U=F(68608);function L(_,I){if(I&&(k(I)==="object"||typeof I=="function"))return I;if(I!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U(_)}Mt.exports=L,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},49154:function(Mt){function N(F,k){return Mt.exports=N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(L,_){return L.__proto__=_,L},Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports,N(F,k)}Mt.exports=N,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},75258:function(Mt,N,F){var k=F(42317).default;function U(){"use strict";Mt.exports=U=function(){return L},Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports;var L={},_=Object.prototype,I=_.hasOwnProperty,T=Object.defineProperty||function(ye,Ae,Se){ye[Ae]=Se.value},x=typeof Symbol=="function"?Symbol:{},p=x.iterator||"@@iterator",v=x.asyncIterator||"@@asyncIterator",g=x.toStringTag||"@@toStringTag";function d(ye,Ae,Se){return Object.defineProperty(ye,Ae,{value:Se,enumerable:!0,configurable:!0,writable:!0}),ye[Ae]}try{d({},"")}catch(ye){d=function(Se,we,Te){return Se[we]=Te}}function c(ye,Ae,Se,we){var Te=Ae&&Ae.prototype instanceof M?Ae:M,ke=Object.create(Te.prototype),Ge=new fe(we||[]);return T(ke,"_invoke",{value:J(ye,Se,Ge)}),ke}function s(ye,Ae,Se){try{return{type:"normal",arg:ye.call(Ae,Se)}}catch(we){return{type:"throw",arg:we}}}L.wrap=c;var m={};function M(){}function P(){}function R(){}var j={};d(j,p,function(){return this});var Q=Object.getPrototypeOf,G=Q&&Q(Q(Ie([])));G&&G!==_&&I.call(G,p)&&(j=G);var W=R.prototype=M.prototype=Object.create(j);function H(ye){["next","throw","return"].forEach(function(Ae){d(ye,Ae,function(Se){return this._invoke(Ae,Se)})})}function Z(ye,Ae){function Se(Te,ke,Ge,tt){var He=s(ye[Te],ye,ke);if(He.type!=="throw"){var ft=He.arg,Lt=ft.value;return Lt&&k(Lt)=="object"&&I.call(Lt,"__await")?Ae.resolve(Lt.__await).then(function(Jt){Se("next",Jt,Ge,tt)},function(Jt){Se("throw",Jt,Ge,tt)}):Ae.resolve(Lt).then(function(Jt){ft.value=Jt,Ge(ft)},function(Jt){return Se("throw",Jt,Ge,tt)})}tt(He.arg)}var we;T(this,"_invoke",{value:function(ke,Ge){function tt(){return new Ae(function(He,ft){Se(ke,Ge,He,ft)})}return we=we?we.then(tt,tt):tt()}})}function J(ye,Ae,Se){var we="suspendedStart";return function(Te,ke){if(we==="executing")throw new Error("Generator is already running");if(we==="completed"){if(Te==="throw")throw ke;return{value:void 0,done:!0}}for(Se.method=Te,Se.arg=ke;;){var Ge=Se.delegate;if(Ge){var tt=K(Ge,Se);if(tt){if(tt===m)continue;return tt}}if(Se.method==="next")Se.sent=Se._sent=Se.arg;else if(Se.method==="throw"){if(we==="suspendedStart")throw we="completed",Se.arg;Se.dispatchException(Se.arg)}else Se.method==="return"&&Se.abrupt("return",Se.arg);we="executing";var He=s(ye,Ae,Se);if(He.type==="normal"){if(we=Se.done?"completed":"suspendedYield",He.arg===m)continue;return{value:He.arg,done:Se.done}}He.type==="throw"&&(we="completed",Se.method="throw",Se.arg=He.arg)}}}function K(ye,Ae){var Se=Ae.method,we=ye.iterator[Se];if(we===void 0)return Ae.delegate=null,Se==="throw"&&ye.iterator.return&&(Ae.method="return",Ae.arg=void 0,K(ye,Ae),Ae.method==="throw")||Se!=="return"&&(Ae.method="throw",Ae.arg=new TypeError("The iterator does not provide a '"+Se+"' method")),m;var Te=s(we,ye.iterator,Ae.arg);if(Te.type==="throw")return Ae.method="throw",Ae.arg=Te.arg,Ae.delegate=null,m;var ke=Te.arg;return ke?ke.done?(Ae[ye.resultName]=ke.value,Ae.next=ye.nextLoc,Ae.method!=="return"&&(Ae.method="next",Ae.arg=void 0),Ae.delegate=null,m):ke:(Ae.method="throw",Ae.arg=new TypeError("iterator result is not an object"),Ae.delegate=null,m)}function ne(ye){var Ae={tryLoc:ye[0]};1 in ye&&(Ae.catchLoc=ye[1]),2 in ye&&(Ae.finallyLoc=ye[2],Ae.afterLoc=ye[3]),this.tryEntries.push(Ae)}function se(ye){var Ae=ye.completion||{};Ae.type="normal",delete Ae.arg,ye.completion=Ae}function fe(ye){this.tryEntries=[{tryLoc:"root"}],ye.forEach(ne,this),this.reset(!0)}function Ie(ye){if(ye||ye===""){var Ae=ye[p];if(Ae)return Ae.call(ye);if(typeof ye.next=="function")return ye;if(!isNaN(ye.length)){var Se=-1,we=function Te(){for(;++Se<ye.length;)if(I.call(ye,Se))return Te.value=ye[Se],Te.done=!1,Te;return Te.value=void 0,Te.done=!0,Te};return we.next=we}}throw new TypeError(k(ye)+" is not iterable")}return P.prototype=R,T(W,"constructor",{value:R,configurable:!0}),T(R,"constructor",{value:P,configurable:!0}),P.displayName=d(R,g,"GeneratorFunction"),L.isGeneratorFunction=function(ye){var Ae=typeof ye=="function"&&ye.constructor;return!!Ae&&(Ae===P||(Ae.displayName||Ae.name)==="GeneratorFunction")},L.mark=function(ye){return Object.setPrototypeOf?Object.setPrototypeOf(ye,R):(ye.__proto__=R,d(ye,g,"GeneratorFunction")),ye.prototype=Object.create(W),ye},L.awrap=function(ye){return{__await:ye}},H(Z.prototype),d(Z.prototype,v,function(){return this}),L.AsyncIterator=Z,L.async=function(ye,Ae,Se,we,Te){Te===void 0&&(Te=Promise);var ke=new Z(c(ye,Ae,Se,we),Te);return L.isGeneratorFunction(Ae)?ke:ke.next().then(function(Ge){return Ge.done?Ge.value:ke.next()})},H(W),d(W,g,"Generator"),d(W,p,function(){return this}),d(W,"toString",function(){return"[object Generator]"}),L.keys=function(ye){var Ae=Object(ye),Se=[];for(var we in Ae)Se.push(we);return Se.reverse(),function Te(){for(;Se.length;){var ke=Se.pop();if(ke in Ae)return Te.value=ke,Te.done=!1,Te}return Te.done=!0,Te}},L.values=Ie,fe.prototype={constructor:fe,reset:function(Ae){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(se),!Ae)for(var Se in this)Se.charAt(0)==="t"&&I.call(this,Se)&&!isNaN(+Se.slice(1))&&(this[Se]=void 0)},stop:function(){this.done=!0;var Ae=this.tryEntries[0].completion;if(Ae.type==="throw")throw Ae.arg;return this.rval},dispatchException:function(Ae){if(this.done)throw Ae;var Se=this;function we(ft,Lt){return Ge.type="throw",Ge.arg=Ae,Se.next=ft,Lt&&(Se.method="next",Se.arg=void 0),!!Lt}for(var Te=this.tryEntries.length-1;Te>=0;--Te){var ke=this.tryEntries[Te],Ge=ke.completion;if(ke.tryLoc==="root")return we("end");if(ke.tryLoc<=this.prev){var tt=I.call(ke,"catchLoc"),He=I.call(ke,"finallyLoc");if(tt&&He){if(this.prev<ke.catchLoc)return we(ke.catchLoc,!0);if(this.prev<ke.finallyLoc)return we(ke.finallyLoc)}else if(tt){if(this.prev<ke.catchLoc)return we(ke.catchLoc,!0)}else{if(!He)throw new Error("try statement without catch or finally");if(this.prev<ke.finallyLoc)return we(ke.finallyLoc)}}}},abrupt:function(Ae,Se){for(var we=this.tryEntries.length-1;we>=0;--we){var Te=this.tryEntries[we];if(Te.tryLoc<=this.prev&&I.call(Te,"finallyLoc")&&this.prev<Te.finallyLoc){var ke=Te;break}}ke&&(Ae==="break"||Ae==="continue")&&ke.tryLoc<=Se&&Se<=ke.finallyLoc&&(ke=null);var Ge=ke?ke.completion:{};return Ge.type=Ae,Ge.arg=Se,ke?(this.method="next",this.next=ke.finallyLoc,m):this.complete(Ge)},complete:function(Ae,Se){if(Ae.type==="throw")throw Ae.arg;return Ae.type==="break"||Ae.type==="continue"?this.next=Ae.arg:Ae.type==="return"?(this.rval=this.arg=Ae.arg,this.method="return",this.next="end"):Ae.type==="normal"&&Se&&(this.next=Se),m},finish:function(Ae){for(var Se=this.tryEntries.length-1;Se>=0;--Se){var we=this.tryEntries[Se];if(we.finallyLoc===Ae)return this.complete(we.completion,we.afterLoc),se(we),m}},catch:function(Ae){for(var Se=this.tryEntries.length-1;Se>=0;--Se){var we=this.tryEntries[Se];if(we.tryLoc===Ae){var Te=we.completion;if(Te.type==="throw"){var ke=Te.arg;se(we)}return ke}}throw new Error("illegal catch attempt")},delegateYield:function(Ae,Se,we){return this.delegate={iterator:Ie(Ae),resultName:Se,nextLoc:we},this.method==="next"&&(this.arg=void 0),m}},L}Mt.exports=U,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},42317:function(Mt){function N(F){"@babel/helpers - typeof";return Mt.exports=N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports,N(F)}Mt.exports=N,Mt.exports.__esModule=!0,Mt.exports.default=Mt.exports},15612:function(Mt,N,F){var k=F(75258)();Mt.exports=k;try{regeneratorRuntime=k}catch(U){typeof globalThis=="object"?globalThis.regeneratorRuntime=k:Function("r","regeneratorRuntime = r")(k)}}}]);