@nocobase/plugin-graph-collection-manager 1.5.0-alpha.5 → 1.5.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,11 +7,14 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("react-i18next"),require("react-router-dom"),require("@formily/reactive"),require("@formily/react"),require("@emotion/css"),require("react"),require("@formily/shared"),require("@nocobase/utils/client"),require("lodash"),require("@nocobase/client"),require("@ant-design/icons"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-graph-collection-manager",["ahooks","react-i18next","react-router-dom","@formily/reactive","@formily/react","@emotion/css","react","@formily/shared","@nocobase/utils/client","lodash","@nocobase/client","@ant-design/icons","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-graph-collection-manager"]=t(require("ahooks"),require("react-i18next"),require("react-router-dom"),require("@formily/reactive"),require("@formily/react"),require("@emotion/css"),require("react"),require("@formily/shared"),require("@nocobase/utils/client"),require("lodash"),require("@nocobase/client"),require("@ant-design/icons"),require("antd")):e["@nocobase/plugin-graph-collection-manager"]=t(e.ahooks,e["react-i18next"],e["react-router-dom"],e["@formily/reactive"],e["@formily/react"],e["@emotion/css"],e.react,e["@formily/shared"],e["@nocobase/utils/client"],e.lodash,e["@nocobase/client"],e["@ant-design/icons"],e.antd)}(self,function(e,t,n,r,i,o,s,l,a,u,c,h,d){return function(){var f={9652:function(){"object"==typeof window&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),!function(e){e.forEach(e=>{if(!Object.prototype.hasOwnProperty.call(e,"append"))Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...e){let t=document.createDocumentFragment();e.forEach(e=>{let n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))}),this.appendChild(t)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype])},1011:function(e,t,n){e.exports={graphlib:n(3874),layout:n(2253),debug:n(130),util:{time:n(1373).time,notime:n(1373).notime},version:n(7235)}},6354:function(e,t,n){"use strict";var r=n(5577),i=n(911);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),function o(s){if(!r.has(i,s))i[s]=!0,n[s]=!0,r.forEach(e.outEdges(s),function(e){r.has(n,e.w)?t.push(e):o(e.w)}),delete n[s]}),t}(e);r.forEach(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))})},undo:function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}},8665:function(e,t,n){var r=n(5577),i=n(1373);e.exports=function(e){r.forEach(e.children(),function t(n){var i=e.children(n),s=e.node(n);if(i.length&&r.forEach(i,t),r.has(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(var l=s.minRank,a=s.maxRank+1;l<a;++l)o(e,"borderLeft","_bl",n,s,l),o(e,"borderRight","_br",n,s,l)}})};function o(e,t,n,r,o,s){var l=o[t][s-1],a=i.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);o[t][s]=a,e.setParent(a,r),l&&e.setEdge(l,a,{weight:1})}},3674:function(e,t,n){"use strict";var r=n(5577);e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();("bt"===t||"rl"===t)&&function(e){r.forEach(e.nodes(),function(t){s(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"y")&&s(n)})}(e),("lr"===t||"rl"===t)&&(function(e){r.forEach(e.nodes(),function(t){l(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,l),r.has(n,"x")&&l(n)})}(e),i(e))}};function i(e){r.forEach(e.nodes(),function(t){o(e.node(t))}),r.forEach(e.edges(),function(t){o(e.edge(t))})}function o(e){var t=e.width;e.width=e.height,e.height=t}function s(e){e.y=-e.y}function l(e){var t=e.x;e.x=e.y,e.y=t}},5085:function(e){function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},130:function(e,t,n){var r=n(5577),i=n(1373),o=n(3874).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)}),r.forEach(e.edges(),function(e){n.setEdge(e.v,e.w,{},e.name)}),r.forEach(t,function(e,t){n.setNode("layer"+t,{rank:"same"}),r.reduce(e,function(e,t){return n.setEdge(e,t,{style:"invis"}),t})}),n}}},3874:function(e,t,n){var r;try{r=n(6076)}catch(e){}!r&&(r=window.graphlib),e.exports=r},911:function(e,t,n){var r=n(5577),i=n(3874).Graph,o=n(5085);e.exports=function(e,t){if(1>=e.nodeCount())return[];var n=function(e,t){var n=new i,s=0,l=0;r.forEach(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),r.forEach(e.edges(),function(e){var r=n.edge(e.v,e.w)||0,i=t(e);n.setEdge(e.v,e.w,r+i),l=Math.max(l,n.node(e.v).out+=i),s=Math.max(s,n.node(e.w).in+=i)});var u=r.range(l+s+3).map(function(){return new o}),c=s+1;return r.forEach(n.nodes(),function(e){a(u,c,n.node(e))}),{graph:n,buckets:u,zeroIdx:c}}(e,t||s),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],s=t[0];e.nodeCount();){for(;r=s.dequeue();)l(e,t,n,r);for(;r=o.dequeue();)l(e,t,n,r);if(e.nodeCount()){for(var a=t.length-2;a>0;--a)if(r=t[a].dequeue()){i=i.concat(l(e,t,n,r,!0));break}}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,function(t){return e.outEdges(t.v,t.w)}),!0)};var s=r.constant(1);function l(e,t,n,i,o){var s=o?[]:void 0;return r.forEach(e.inEdges(i.v),function(r){var i=e.edge(r),l=e.node(r.v);o&&s.push({v:r.v,w:r.w}),l.out-=i,a(t,n,l)}),r.forEach(e.outEdges(i.v),function(r){var i=e.edge(r),o=r.w,s=e.node(o);s.in-=i,a(t,n,s)}),e.removeNode(i.v),s}function a(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},2253:function(e,t,n){"use strict";var r=n(5577),i=n(6354),o=n(8791),s=n(1530),l=n(1373).normalizeRanks,a=n(9996),u=n(1373).removeEmptyRanks,c=n(1913),h=n(8665),d=n(3674),f=n(4661),p=n(40),g=n(1373),m=n(3874).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",function(){var t=n(" buildLayoutGraph",function(){return function(e){var t=new m({multigraph:!0,compound:!0}),n=O(e.graph());return t.setGraph(r.merge({},b,P(n,y),r.pick(n,v))),r.forEach(e.nodes(),function(n){var i=O(e.node(n));t.setNode(n,r.defaults(P(i,x),w)),t.setParent(n,e.parent(n))}),r.forEach(e.edges(),function(n){var i=O(e.edge(n));t.setEdge(n,r.merge({},E,P(i,C),r.pick(i,S)))}),t}(e)});n(" runLayout",function(){(function(e,t){t(" makeSpaceForEdgeLabels",function(){(function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})})(e)}),t(" removeSelfEdges",function(){(function(e){r.forEach(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);!n.selfEdges&&(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})})(e)}),t(" acyclic",function(){i.run(e)}),t(" nestingGraph.run",function(){c.run(e)}),t(" rank",function(){s(g.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){(function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}})})(e)}),t(" removeEmptyRanks",function(){u(e)}),t(" nestingGraph.cleanup",function(){c.cleanup(e)}),t(" normalizeRanks",function(){l(e)}),t(" assignRankMinMax",function(){(function(e){var t=0;r.forEach(e.nodes(),function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))}),e.graph().maxRank=t})(e)}),t(" removeEdgeLabelProxies",function(){(function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})})(e)}),t(" normalize.run",function(){o.run(e)}),t(" parentDummyChains",function(){a(e)}),t(" addBorderSegments",function(){h(e)}),t(" order",function(){f(e)}),t(" insertSelfEdges",function(){(function(e){var t=g.buildLayerMatrix(e);r.forEach(t,function(t){var n=0;r.forEach(t,function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})})(e)}),t(" adjustCoordinateSystem",function(){d.adjust(e)}),t(" position",function(){p(e)}),t(" positionSelfEdges",function(){(function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,s=n.x-i,l=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*s/3,y:o-l},{x:i+5*s/6,y:o-l},{x:i+s,y:o},{x:i+5*s/6,y:o+l},{x:i+2*s/3,y:o+l}],n.label.x=n.x,n.label.y=n.y}})})(e)}),t(" removeBorderNodes",function(){(function(e){r.forEach(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),s=e.node(r.last(n.borderLeft)),l=e.node(r.last(n.borderRight));n.width=Math.abs(l.x-s.x),n.height=Math.abs(o.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),r.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})})(e)}),t(" normalize.undo",function(){o.undo(e)}),t(" fixupEdgeLabelCoords",function(){(function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(r.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})})(e)}),t(" undoCoordinateSystem",function(){d.undo(e)}),t(" translateGraph",function(){(function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,s=e.graph(),l=s.marginx||0,a=s.marginy||0;function u(e){var r=e.x,s=e.y,l=e.width,a=e.height;t=Math.min(t,r-l/2),n=Math.max(n,r+l/2),i=Math.min(i,s-a/2),o=Math.max(o,s+a/2)}r.forEach(e.nodes(),function(t){u(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.has(n,"x")&&u(n)}),t-=l,i-=a,r.forEach(e.nodes(),function(n){var r=e.node(n);r.x-=t,r.y-=i}),r.forEach(e.edges(),function(n){var o=e.edge(n);r.forEach(o.points,function(e){e.x-=t,e.y-=i}),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)}),s.width=n-t+l,s.height=o-i+a})(e)}),t(" assignNodeIntersects",function(){(function(e){r.forEach(e.edges(),function(t){var n,r,i=e.edge(t),o=e.node(t.v),s=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(s,r))})})(e)}),t(" reversePoints",function(){(function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})})(e)}),t(" acyclic.undo",function(){i.undo(e)})})(t,n)}),n(" updateInputGraph",function(){(function(e,t){r.forEach(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),r.forEach(e.edges(),function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height})(e,t)})})};var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},v=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},C=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},S=["labelpos"];function P(e,t){return r.mapValues(r.pick(e,t),Number)}function O(e){var t={};return r.forEach(e,function(e,n){t[n.toLowerCase()]=e}),t}},5577:function(e,t,n){var r;try{r={cloneDeep:n(9007),constant:n(6710),defaults:n(6342),each:n(4500),filter:n(786),find:n(2756),flatten:n(3219),forEach:n(553),forIn:n(7694),has:n(7962),isUndefined:n(678),last:n(9921),map:n(3275),mapValues:n(2233),max:n(5570),merge:n(9782),min:n(4183),minBy:n(7e3),now:n(6860),pick:n(5773),range:n(4178),reduce:n(7936),sortBy:n(5998),uniqueId:n(8839),values:n(5514),zipObject:n(4028)}}catch(e){}!r&&(r=window._),e.exports=r},1913:function(e,t,n){var r=n(5577),i=n(1373);e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};return r.forEach(e.children(),function(n){!function n(i,o){var s=e.children(i);s&&s.length&&r.forEach(s,function(e){n(e,o+1)}),t[i]=o}(n,1)}),t}(e),o=r.max(r.values(n))-1,s=2*o+1;e.graph().nestingRoot=t,r.forEach(e.edges(),function(t){e.edge(t).minlen*=s});var l=function(e){return r.reduce(e.edges(),function(t,n){return t+e.edge(n).weight},0)}(e)+1;r.forEach(e.children(),function(a){(function e(t,n,o,s,l,a,u){var c=t.children(u);if(!c.length){u!==n&&t.setEdge(n,u,{weight:0,minlen:o});return}var h=i.addBorderNode(t,"_bt"),d=i.addBorderNode(t,"_bb"),f=t.node(u);t.setParent(h,u),f.borderTop=h,t.setParent(d,u),f.borderBottom=d,r.forEach(c,function(r){e(t,n,o,s,l,a,r);var i=t.node(r),c=i.borderTop?i.borderTop:r,f=i.borderBottom?i.borderBottom:r,p=i.borderTop?s:2*s,g=c!==f?1:l-a[u]+1;t.setEdge(h,c,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})}),!t.parent(u)&&t.setEdge(n,h,{weight:0,minlen:l+a[u]})})(e,t,s,l,o,n,a)}),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}}},8791:function(e,t,n){"use strict";var r=n(5577),i=n(1373);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),function(t){(function(e,t){var n,r,o,s=t.v,l=e.node(s).rank,a=t.w,u=e.node(a).rank,c=t.name,h=e.edge(t),d=h.labelRank;if(u!==l+1){for(e.removeEdge(t),o=0,++l;l<u;++o,++l)h.points=[],r={width:0,height:0,edgeLabel:h,edgeObj:t,rank:l},n=i.addDummyNode(e,"edge",r,"_d"),l===d&&(r.width=h.width,r.height=h.height,r.dummy="edge-label",r.labelpos=h.labelpos),e.setEdge(s,n,{weight:h.weight},c),0===o&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,a,{weight:h.weight},c)}})(e,t)})},undo:function(e){r.forEach(e.graph().dummyChains,function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)})}}},3998:function(e,t,n){var r=n(5577);e.exports=function(e,t,n){var i,o={};r.forEach(n,function(n){for(var r,s,l=e.parent(n);l;){if((r=e.parent(l))?(s=o[r],o[r]=l):(s=i,i=l),s&&s!==l){t.setEdge(s,l);return}l=r}})}},3750:function(e,t,n){var r=n(5577);e.exports=function(e,t){return r.map(t,function(t){var n=e.inEdges(t);if(!n.length)return{v:t};var i=r.reduce(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}})}},1231:function(e,t,n){var r=n(5577),i=n(3874).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),s=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(t){return e.node(t)});return r.forEach(e.nodes(),function(i){var l=e.node(i),a=e.parent(i);(l.rank===t||l.minRank<=t&&t<=l.maxRank)&&(s.setNode(i),s.setParent(i,a||o),r.forEach(e[n](i),function(t){var n=t.v===i?t.w:t.v,o=s.edge(n,i),l=r.isUndefined(o)?0:o.weight;s.setEdge(n,i,{weight:e.edge(t).weight+l})}),r.has(l,"minRank")&&s.setNode(i,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]}))}),s}},6951:function(e,t,n){"use strict";var r=n(5577);e.exports=function(e,t){for(var n=0,i=1;i<t.length;++i)n+=function(e,t,n){for(var i=r.zipObject(n,r.map(n,function(e,t){return t})),o=r.flatten(r.map(t,function(t){return r.sortBy(r.map(e.outEdges(t),function(t){return{pos:i[t.w],weight:e.edge(t).weight}}),"pos")}),!0),s=1;s<n.length;)s<<=1;var l=2*s-1;s-=1;var a=r.map(Array(l),function(){return 0}),u=0;return r.forEach(o.forEach(function(e){var t=e.pos+s;a[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=a[t+1]),t=t-1>>1,a[t]+=e.weight;u+=e.weight*n})),u}(e,t[i-1],t[i]);return n}},4661:function(e,t,n){"use strict";var r=n(5577),i=n(9047),o=n(6951),s=n(554),l=n(1231),a=n(3998),u=n(3874).Graph,c=n(1373);e.exports=function(e){var t=c.maxRank(e),n=h(e,r.range(1,t+1),"inEdges"),l=h(e,r.range(t-1,-1,-1),"outEdges"),f=i(e);d(e,f);for(var p,g=Number.POSITIVE_INFINITY,m=0,y=0;y<4;++m,++y){(function(e,t){var n=new u;r.forEach(e,function(e){var i=e.graph().root,o=s(e,i,n,t);r.forEach(o.vs,function(t,n){e.node(t).order=n}),a(e,n,o.vs)})})(m%2?n:l,m%4>=2),f=c.buildLayerMatrix(e);var b=o(e,f);b<g&&(y=0,p=r.cloneDeep(f),g=b)}d(e,p)};function h(e,t,n){return r.map(t,function(t){return l(e,t,n)})}function d(e,t){r.forEach(t,function(t){r.forEach(t,function(t,n){e.node(t).order=n})})}},9047:function(e,t,n){"use strict";var r=n(5577);e.exports=function(e){var t={},n=r.filter(e.nodes(),function(t){return!e.children(t).length}),i=r.max(r.map(n,function(t){return e.node(t).rank})),o=r.map(r.range(i+1),function(){return[]}),s=r.sortBy(n,function(t){return e.node(t).rank});return r.forEach(s,function n(i){!r.has(t,i)&&(t[i]=!0,o[e.node(i).rank].push(i),r.forEach(e.successors(i),n))}),o}},1538:function(e,t,n){"use strict";var r=n(5577);e.exports=function(e,t){var n={};return r.forEach(e,function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};!r.isUndefined(e.barycenter)&&(i.barycenter=e.barycenter,i.weight=e.weight)}),r.forEach(t.edges(),function(e){var t=n[e.v],i=n[e.w];!r.isUndefined(t)&&!r.isUndefined(i)&&(i.indegree++,t.out.push(n[e.w]))}),function(e){for(var t=[];e.length;){var n=e.pop();t.push(n),r.forEach(n.in.reverse(),function(e){return function(t){if(!t.merged)(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(n)),r.forEach(n.out,function(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}(n))}return r.map(r.filter(t,function(e){return!e.merged}),function(e){return r.pick(e,["vs","i","barycenter","weight"])})}(r.filter(n,function(e){return!e.indegree}))}},554:function(e,t,n){var r=n(5577),i=n(3750),o=n(1538),s=n(2096);e.exports=function e(t,n,l,a){var u=t.children(n),c=t.node(n),h=c?c.borderLeft:void 0,d=c?c.borderRight:void 0,f={};h&&(u=r.filter(u,function(e){return e!==h&&e!==d}));var p=i(t,u);r.forEach(p,function(n){if(t.children(n.v).length){var i=e(t,n.v,l,a);f[n.v]=i,r.has(i,"barycenter")&&function(e,t){r.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}(n,i)}});var g=o(p,l);(function(e,t){r.forEach(e,function(e){e.vs=r.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})})(g,f);var m=s(g,a);if(h&&(m.vs=r.flatten([h,m.vs,d],!0),t.predecessors(h).length)){var y=t.node(t.predecessors(h)[0]),b=t.node(t.predecessors(d)[0]);!r.has(m,"barycenter")&&(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+y.order+b.order)/(m.weight+2),m.weight+=2}return m}},2096:function(e,t,n){var r=n(5577),i=n(1373);e.exports=function(e,t){var n=i.partition(e,function(e){return r.has(e,"barycenter")}),s=n.lhs,l=r.sortBy(n.rhs,function(e){return-e.i}),a=[],u=0,c=0,h=0;s.sort(function(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}(!!t)),h=o(a,l,h),r.forEach(s,function(e){h+=e.vs.length,a.push(e.vs),u+=e.barycenter*e.weight,c+=e.weight,h=o(a,l,h)});var d={vs:r.flatten(a,!0)};return c&&(d.barycenter=u/c,d.weight=c),d};function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}},9996:function(e,t,n){var r=n(5577);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),function i(o){var s=n;r.forEach(e.children(o),i),t[o]={low:s,lim:n++}}),t}(e);r.forEach(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,s=[],l=[],a=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do i=e.parent(i),s.push(i);while(i&&(t[i].low>a||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)l.push(i);return{path:s.concat(l.reverse()),lca:o}}(e,t,i.v,i.w),s=o.path,l=o.lca,a=0,u=s[0],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=s[a])!==l&&e.node(u).maxRank<r.rank;)a++;u===l&&(c=!1)}if(!c){for(;a<s.length-1&&e.node(u=s[a+1]).minRank<=r.rank;)a++;u=s[a]}e.setParent(n,u),n=e.successors(n)[0]}})}},9689:function(e,t,n){"use strict";var r=n(5577),i=n(3874).Graph,o=n(1373);function s(e,t){var n={};return r.reduce(t,function(t,i){var o=0,s=0,l=t.length,u=r.last(i);return r.forEach(i,function(t,c){var h=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),d=h?e.node(h).order:l;(h||t===u)&&(r.forEach(i.slice(s,c+1),function(t){r.forEach(e.predecessors(t),function(r){var i=e.node(r),s=i.order;(s<o||d<s)&&!(i.dummy&&e.node(t).dummy)&&a(n,r,t)})}),s=c+1,o=d)}),i}),n}function l(e,t){var n={};function i(t,i,o,s,l){var u;r.forEach(r.range(i,o),function(i){u=t[i],e.node(u).dummy&&r.forEach(e.predecessors(u),function(t){var r=e.node(t);r.dummy&&(r.order<s||r.order>l)&&a(n,t,u)})})}return r.reduce(t,function(t,n){var o,s=-1,l=0;return r.forEach(n,function(r,a){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,l,a,s,o),l=a,s=o)}i(n,l,n.length,o,t.length)}),n}),n}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),i=r.merge(s(e,n),l(e,n)),a={};r.forEach(["u","d"],function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],function(n){"r"===n&&(t=r.map(t,function(e){return r.values(e).reverse()}));var s=("u"===o?e.predecessors:e.successors).bind(e),l=c(e,t,i,s),u=h(e,t,l.root,l.align,"r"===n);"r"===n&&(u=r.mapValues(u,function(e){return-e})),a[o+n]=u})});var u=d(e,a);return f(a,u),p(a,e.graph().align)},findType1Conflicts:s,findType2Conflicts:l,addConflict:a,hasConflict:u,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:f,findSmallestWidthAlignment:d,balance:p};function a(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];!i&&(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},s={},l={};return r.forEach(t,function(e){r.forEach(e,function(e,t){o[e]=e,s[e]=e,l[e]=t})}),r.forEach(t,function(e){var t=-1;r.forEach(e,function(e){var a=i(e);if(a.length){for(var c=((a=r.sortBy(a,function(e){return l[e]})).length-1)/2,h=Math.floor(c),d=Math.ceil(c);h<=d;++h){var f=a[h];s[e]===e&&t<l[f]&&!u(n,e,f)&&(s[f]=e,s[e]=o[e]=o[f],t=l[f])}}})}),{root:o,align:s}}function h(e,t,n,o,s){var l={},a=function(e,t,n,o){var s=new i,l=e.graph(),a=function(e,t,n){return function(i,o,s){var l,a,u=i.node(o),c=i.node(s);if(l=0+u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(l+=n?a:-a),a=0,l+=(u.dummy?t:e)/2+(c.dummy?t:e)/2+c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":a=c.width/2;break;case"r":a=-c.width/2}return a&&(l+=n?a:-a),a=0,l}}(l.nodesep,l.edgesep,o);return r.forEach(t,function(t){var i;r.forEach(t,function(t){var r=n[t];if(s.setNode(r),i){var o=n[i],l=s.edge(o,r);s.setEdge(o,r,Math.max(a(e,t,i),l||0))}i=t})}),s}(e,t,n,s),u=s?"borderLeft":"borderRight";function c(e,t){for(var n=a.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return c(function(e){l[e]=a.inEdges(e).reduce(function(e,t){return Math.max(e,l[t.v]+a.edge(t))},0)},a.predecessors.bind(a)),c(function(t){var n=a.outEdges(t).reduce(function(e,t){return Math.min(e,l[t.w]-a.edge(t))},Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(l[t]=Math.max(l[t],n))},a.successors.bind(a)),r.forEach(o,function(e){l[e]=l[n[e]]}),l}function d(e,t){return r.minBy(r.values(t),function(t){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(t,function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),i=Math.min(t-o,i)}),n-i})}function f(e,t){var n=r.values(t),i=r.min(n),o=r.max(n);r.forEach(["u","d"],function(n){r.forEach(["l","r"],function(s){var l,a=n+s,u=e[a];if(u!==t){var c=r.values(u);(l="l"===s?i-r.min(c):o-r.max(c))&&(e[a]=r.mapValues(u,function(e){return e+l}))}})})}function p(e,t){return r.mapValues(e.ul,function(n,i){if(t)return e[t.toLowerCase()][i];var o=r.sortBy(r.map(e,i));return(o[1]+o[2])/2})}},40:function(e,t,n){"use strict";var r=n(5577),i=n(1373),o=n(9689).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,function(t){var i=r.max(r.map(t,function(t){return e.node(t).height}));r.forEach(t,function(t){e.node(t).y=o+i/2}),o+=i+n})})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),function(t,n){e.node(n).x=t})}},6767:function(e,t,n){"use strict";var r=n(5577),i=n(3874).Graph,o=n(7957).slack;e.exports=function(e){var t,n,s=new i({directed:!1}),l=e.nodes()[0],a=e.nodeCount();for(s.setNode(l,{});function(e,t){return r.forEach(e.nodes(),function n(i){r.forEach(t.nodeEdges(i),function(r){var s=r.v,l=i===s?r.w:s;!e.hasNode(l)&&!o(t,r)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}),e.nodeCount()}(s,e)<a;)t=function(e,t){return r.minBy(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)})}(s,e),n=s.hasNode(t.v)?o(e,t):-o(e,t),function(e,t,n){r.forEach(e.nodes(),function(e){t.node(e).rank+=n})}(s,e,n);return s}},1530:function(e,t,n){"use strict";var r=n(7957).longestPath,i=n(6767),o=n(263);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:(function(e){o(e)})(e);break;case"tight-tree":(function(e){r(e),i(e)})(e);break;case"longest-path":s(e)}};var s=r;function l(e){o(e)}},263:function(e,t,n){"use strict";var r=n(5577),i=n(6767),o=n(7957).slack,s=n(7957).longestPath,l=n(3874).alg.preorder,a=n(3874).alg.postorder,u=n(1373).simplify;function c(e){s(e=u(e));var t,n,r=i(e);for(f(r),h(r,e);t=p(r);)n=g(r,e,t),m(r,e,t,n)}function h(e,t){var n=a(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,function(n){(function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=d(e,t,n)})(e,t,n)})}e.exports=c,c.initLowLimValues=f,c.initCutValues=h,c.calcCutValue=d,c.leaveEdge=p,c.enterEdge=g,c.exchangeEdges=m;function d(e,t,n){var i=e.node(n).parent,o=!0,s=t.edge(n,i),l=0;return!s&&(o=!1,s=t.edge(i,n)),l=s.weight,r.forEach(t.nodeEdges(n),function(r){var s=r.v===n,a=s?r.w:r.v;if(a!==i){var u=s===o,c=t.edge(r).weight;if(l+=u?c:-c,function(e,t,n){return e.hasEdge(t,n)}(e,n,a)){var h=e.edge(n,a).cutvalue;l+=u?-h:h}}}),l}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,n,i,o,s){var l=i,a=t.node(o);return n[o]=!0,r.forEach(t.neighbors(o),function(s){!r.has(n,s)&&(i=e(t,n,i,s,o))}),a.low=l,a.lim=i++,s?a.parent=s:delete a.parent,i}(e,{},1,t)}function p(e){return r.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function g(e,t,n){var i=n.v,s=n.w;!t.hasEdge(i,s)&&(i=n.w,s=n.v);var l=e.node(i),a=e.node(s),u=l,c=!1;l.lim>a.lim&&(u=a,c=!0);var h=r.filter(t.edges(),function(t){return c===y(e,e.node(t.v),u)&&c!==y(e,e.node(t.w),u)});return r.minBy(h,function(e){return o(t,e)})}function m(e,t,n,i){var o=n.v,s=n.w;e.removeEdge(o,s),e.setEdge(i.v,i.w,{}),f(e),h(e,t),function(e,t){var n=r.find(e.nodes(),function(e){return!t.node(e).parent}),i=l(e,n);i=i.slice(1),r.forEach(i,function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;!i&&(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)})}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}},7957:function(e,t,n){"use strict";var r=n(5577);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var s=r.min(r.map(e.outEdges(i),function(t){return n(t.w)-e.edge(t).minlen}));return(s===Number.POSITIVE_INFINITY||null==s)&&(s=0),o.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},1373:function(e,t,n){"use strict";var r=n(5577),i=n(3874).Graph;function o(e,t,n,i){var o;do o=r.uniqueId(i);while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}e.exports={addDummyNode:o,simplify:function(e){var t=new i().setGraph(e.graph());return r.forEach(e.nodes(),function(n){t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),function(n){!e.children(n).length&&t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t},successorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.outEdges(t),function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.inEdges(t),function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,s=t.x-i,l=t.y-o,a=e.width/2,u=e.height/2;if(!s&&!l)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(l)*a>Math.abs(s)*u?(l<0&&(u=-u),n=u*s/l,r=u):(s<0&&(a=-a),n=a,r=a*l/s),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(s(e)+1),function(){return[]});return r.forEach(e.nodes(),function(n){var i=e.node(n),o=i.rank;!r.isUndefined(o)&&(t[o][i.order]=n)}),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank}));r.forEach(e.nodes(),function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)})},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank})),n=[];r.forEach(e.nodes(),function(r){var i=e.node(r).rank-t;!n[i]&&(n[i]=[]),n[i].push(r)});var i=0,o=e.graph().nodeRankFactor;r.forEach(n,function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,function(t){e.node(t).rank+=i})})},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:s,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}};function s(e){return r.max(r.map(e.nodes(),function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n}))}},7235:function(e){e.exports="0.8.5"},6076:function(e,t,n){var r=n(9592);e.exports={Graph:r.Graph,json:n(981),alg:n(8362),version:r.version}},1996:function(e,t,n){var r=n(5695);e.exports=function(e){var t,n={},i=[];return r.each(e.nodes(),function(o){t=[],!function i(o){!r.has(n,o)&&(n[o]=!0,t.push(o),r.each(e.successors(o),i),r.each(e.predecessors(o),i))}(o),t.length&&i.push(t)}),i}},6985:function(e,t,n){var r=n(5695);e.exports=function(e,t,n){!r.isArray(t)&&(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],s={};return r.each(t,function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);(function e(t,n,i,o,s,l){!r.has(o,n)&&(o[n]=!0,!i&&l.push(n),r.each(s(n),function(n){e(t,n,i,o,s,l)}),i&&l.push(n))})(e,t,"post"===n,s,i,o)}),o}},3307:function(e,t,n){var r=n(6027),i=n(5695);e.exports=function(e,t,n){return i.transform(e.nodes(),function(i,o){i[o]=r(e,o,t,n)},{})}},6027:function(e,t,n){var r=n(5695),i=n(7860);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,s,l={},a=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=l[t],i=n(e),u=s.distance+i;if(i<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u<r.distance&&(r.distance=u,r.predecessor=o,a.decrease(t,u))};for(e.nodes().forEach(function(e){var n=e===t?0:Number.POSITIVE_INFINITY;l[e]={distance:n},a.add(e,n)});a.size()>0&&(s=l[o=a.removeMin()]).distance!==Number.POSITIVE_INFINITY;){;r(o).forEach(u)}return l}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},723:function(e,t,n){var r=n(5695),i=n(6489);e.exports=function(e){return r.filter(i(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},2386:function(e,t,n){var r=n(5695);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0},i.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}})}),i.forEach(function(e){var t=r[e];i.forEach(function(n){var o=r[n];i.forEach(function(n){var r=o[e],i=t[n],s=o[n],l=r.distance+i.distance;l<s.distance&&(s.distance=l,s.predecessor=i.predecessor)})})}),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},8362:function(e,t,n){e.exports={components:n(1996),dijkstra:n(6027),dijkstraAll:n(3307),findCycles:n(723),floydWarshall:n(2386),isAcyclic:n(964),postorder:n(4720),preorder:n(2609),prim:n(7602),tarjan:n(6489),topsort:n(2736)}},964:function(e,t,n){var r=n(2736);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},4720:function(e,t,n){var r=n(6985);e.exports=function(e,t){return r(e,t,"post")}},2609:function(e,t,n){var r=n(6985);e.exports=function(e,t){return r(e,t,"pre")}},7602:function(e,t,n){var r=n(5695),i=n(5718),o=n(7860);e.exports=function(e,t){var n,s=new i,l={},a=new o;function u(e){var r=e.v===n?e.w:e.v,i=a.priority(r);if(void 0!==i){var o=t(e);o<i&&(l[r]=n,a.decrease(r,o))}}if(0===e.nodeCount())return s;r.each(e.nodes(),function(e){a.add(e,Number.POSITIVE_INFINITY),s.setNode(e)}),a.decrease(e.nodes()[0],0);for(var c=!1;a.size()>0;){if(n=a.removeMin(),r.has(l,n))s.setEdge(n,l[n]);else if(c)throw Error("Input graph is not connected: "+e);else c=!0;e.nodeEdges(n).forEach(u)}return s}},6489:function(e,t,n){var r=n(5695);e.exports=function(e){var t=0,n=[],i={},o=[];return e.nodes().forEach(function(s){!r.has(i,s)&&!function s(l){var a=i[l]={onStack:!0,lowlink:t,index:t++};if(n.push(l),e.successors(l).forEach(function(e){r.has(i,e)?i[e].onStack&&(a.lowlink=Math.min(a.lowlink,i[e].index)):(s(e),a.lowlink=Math.min(a.lowlink,i[e].lowlink))}),a.lowlink===a.index){var u,c=[];do i[u=n.pop()].onStack=!1,c.push(u);while(l!==u);o.push(c)}}(s)}),o}},2736:function(e,t,n){var r=n(5695);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),function s(l){if(r.has(n,l))throw new o;!r.has(t,l)&&(n[l]=!0,t[l]=!0,r.each(e.predecessors(l),s),delete n[l],i.push(l))}),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=Error()},7860:function(e,t,n){var r=n(5695);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map(function(e){return e.key})},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))},i.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);){;this._swap(e,t),e=t}},i.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}},5718:function(e,t,n){"use strict";var r=n(5695);e.exports=i;function i(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.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 o(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){!--e[t]&&delete e[t]}function l(e,t,n,i){var o=""+t,s=""+n;if(!e&&o>s){var l=o;o=s,s=l}return o+"\x01"+s+"\x01"+(r.isUndefined(i)?"\0":i)}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(e){return this._label=e,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(e){return!r.isFunction(e)&&(e=r.constant(e)),this._defaultNodeLabelFn=e,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return r.keys(this._nodes)},i.prototype.sources=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})},i.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})},i.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,function(e){n.length>1?i.setNode(e,t):i.setNode(e)}),this},i.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},i.prototype.node=function(e){return this._nodes[e]},i.prototype.hasNode=function(e){return r.has(this._nodes,e)},i.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},i.prototype.setParent=function(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t="\0";else{t+="";for(var n=t;!r.isUndefined(n);n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},i.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},i.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}},i.prototype.children=function(e){if(r.isUndefined(e)&&(e="\0"),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else if("\0"===e)return this.nodes();else if(this.hasNode(e))return[]},i.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},i.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},i.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},i.prototype.isLeaf=function(e){var t;return 0===(t=this.isDirected()?this.successors(e):this.neighbors(e)).length},i.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),r.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var i={};return this._isCompound&&r.each(t.nodes(),function(e){t.setParent(e,function e(r){var o=n.parent(r);return void 0===o||t.hasNode(o)?(i[r]=o,o):o in i?i[o]:e(o)}(e))}),t},i.prototype.setDefaultEdgeLabel=function(e){return!r.isFunction(e)&&(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return r.values(this._edgeObjs)},i.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r}),this},i.prototype.setEdge=function(){var e,t,n,i,s=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2==arguments.length&&(i=arguments[1],s=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),e=""+e,t=""+t,!r.isUndefined(n)&&(n=""+n);var u=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,u))return s&&(this._edgeLabels[u]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[u]=s?i:this._defaultEdgeLabelFn(e,t,n);var c=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}var l={v:i,w:o};return r&&(l.name=r),l}(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[u]=c,o(this._preds[t],e),o(this._sucs[e],t),this._in[t][u]=c,this._out[e][u]=c,this._edgeCount++,this},i.prototype.edge=function(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},i.prototype.hasEdge=function(e,t,n){var i=1==arguments.length?a(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},i.prototype.removeEdge=function(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},i.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,function(e){return e.v===t}):i}},i.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,function(e){return e.w===t}):i}},i.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))};function a(e,t){return l(e,t.v,t.w,t.name)}},9592:function(e,t,n){e.exports={Graph:n(5718),version:n(4918)}},981:function(e,t,n){var r=n(5695),i=n(5718);e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:function(e){return r.map(e.nodes(),function(t){var n=e.node(t),i=e.parent(t),o={v:t};return!r.isUndefined(n)&&(o.value=n),!r.isUndefined(i)&&(o.parent=i),o})}(e),edges:function(e){return r.map(e.edges(),function(t){var n=e.edge(t),i={v:t.v,w:t.w};return!r.isUndefined(t.name)&&(i.name=t.name),!r.isUndefined(n)&&(i.value=n),i})}(e)};return!r.isUndefined(e.graph())&&(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),r.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}},5695:function(e,t,n){var r;try{r={clone:n(7654),constant:n(6710),each:n(4500),filter:n(786),has:n(7962),isArray:n(6227),isEmpty:n(353),isFunction:n(3098),isUndefined:n(678),keys:n(5334),map:n(3275),reduce:n(7936),size:n(691),transform:n(3216),union:n(3475),values:n(5514)}}catch(e){}!r&&(r=window._),e.exports=r},4918:function(e){e.exports="2.1.8"},2622:function(e,t,n){var r=n(6369)(n(5031),"DataView");e.exports=r},7973:function(e,t,n){var r=n(1783),i=n(1012),o=n(9900),s=n(6691),l=n(2018);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=l,e.exports=a},2768:function(e,t,n){var r=n(9896),i=n(2473),o=n(4678),s=n(1240),l=n(4296);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=l,e.exports=a},1725:function(e,t,n){var r=n(6369)(n(5031),"Map");e.exports=r},736:function(e,t,n){var r=n(6660),i=n(8472),o=n(5637),s=n(9389),l=n(9804);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=l,e.exports=a},4575:function(e,t,n){var r=n(6369)(n(5031),"Promise");e.exports=r},8995:function(e,t,n){var r=n(6369)(n(5031),"Set");e.exports=r},5106:function(e,t,n){var r=n(736),i=n(4867),o=n(9428);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=i,s.prototype.has=o,e.exports=s},5382:function(e,t,n){var r=n(2768),i=n(3533),o=n(7064),s=n(9955),l=n(6087),a=n(3990);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=s,u.prototype.has=l,u.prototype.set=a,e.exports=u},5869:function(e,t,n){var r=n(5031).Symbol;e.exports=r},8930:function(e,t,n){var r=n(5031).Uint8Array;e.exports=r},8110:function(e,t,n){var r=n(6369)(n(5031),"WeakMap");e.exports=r},7485:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},7510:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},8353:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}},9360:function(e,t,n){var r=n(7667);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},5987:function(e){e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},4505:function(e,t,n){var r=n(1650),i=n(8497),o=n(6227),s=n(939),l=n(3501),a=n(2855),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),h=!n&&!c&&s(e),d=!n&&!c&&!h&&a(e),f=n||c||h||d,p=f?r(e.length,String):[],g=p.length;for(var m in e)(t||u.call(e,m))&&!(f&&("length"==m||h&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||l(m,g)))&&p.push(m);return p}},2467:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},3571:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},83:function(e){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},9618:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},3327:function(e,t,n){var r=n(9511)("length");e.exports=r},3153:function(e,t,n){var r=n(2544),i=n(3947);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},5699:function(e,t,n){var r=n(2544),i=n(3947),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var s=e[t];(!(o.call(e,t)&&i(s,n))||void 0===n&&!(t in e))&&r(e,t,n)}},8746:function(e,t,n){var r=n(3947);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},4968:function(e,t,n){var r=n(6734),i=n(5334);e.exports=function(e,t){return e&&r(t,i(t),e)}},6e3:function(e,t,n){var r=n(6734),i=n(9403);e.exports=function(e,t){return e&&r(t,i(t),e)}},2544:function(e,t,n){var r=n(6554);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},1016:function(e,t,n){var r=n(5382),i=n(7510),o=n(5699),s=n(4968),l=n(6e3),a=n(6550),u=n(3096),c=n(5879),h=n(5705),d=n(6498),f=n(2179),p=n(8943),g=n(5959),m=n(2206),y=n(1931),b=n(6227),v=n(939),x=n(2394),w=n(2917),C=n(6658),E=n(5334),S=n(9403),P="[object Arguments]",O="[object Function]",k="[object Object]",A={};A[P]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[k]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[O]=A["[object WeakMap]"]=!1;e.exports=function e(t,n,M,T,N,j){var I,L=1&n,R=2&n,_=4&n;if(M&&(I=N?M(t,T,N,j):M(t)),void 0!==I)return I;if(!w(t))return t;var B=b(t);if(B){if(I=g(t),!L)return u(t,I)}else{var D=p(t),z=D==O||"[object GeneratorFunction]"==D;if(v(t))return a(t,L);if(D==k||D==P||z&&!N){if(I=R||z?{}:y(t),!L)return R?h(t,l(I,t)):c(t,s(I,t))}else{if(!A[D])return N?t:{};I=m(t,D,L)}}j||(j=new r);var F=j.get(t);if(F)return F;j.set(t,I),C(t)?t.forEach(function(r){I.add(e(r,n,M,r,t,j))}):x(t)&&t.forEach(function(r,i){I.set(i,e(r,n,M,i,t,j))});var V=_?R?f:d:R?S:E,$=B?void 0:V(t);return i($||t,function(r,i){$&&(r=t[i=r]),o(I,i,e(r,n,M,i,t,j))}),I}},1315:function(e,t,n){var r=n(2917),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},3883:function(e,t,n){var r=n(7228),i=n(2159)(r);e.exports=i},6746:function(e,t,n){var r=n(9528);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var s=e[i],l=t(s);if(null!=l&&(void 0===a?l==l&&!r(l):n(l,a)))var a=l,u=s}return u}},4693:function(e,t,n){var r=n(3883);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},9443:function(e){e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return -1}},6195:function(e,t,n){var r=n(3571),i=n(1449);e.exports=function e(t,n,o,s,l){var a=-1,u=t.length;for(o||(o=i),l||(l=[]);++a<u;){var c=t[a];n>0&&o(c)?n>1?e(c,n-1,o,s,l):r(l,c):!s&&(l[l.length]=c)}return l}},3627:function(e,t,n){var r=n(3179)();e.exports=r},7228:function(e,t,n){var r=n(3627),i=n(5334);e.exports=function(e,t){return e&&r(e,t,i)}},304:function(e,t,n){var r=n(322),i=n(5107);e.exports=function(e,t){t=r(t,e);for(var n=0,o=t.length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},2481:function(e,t,n){var r=n(3571),i=n(6227);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},4365:function(e,t,n){var r=n(5869),i=n(7043),o=n(5283),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},930:function(e){e.exports=function(e,t){return e>t}},6925:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},1547:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},7667:function(e,t,n){var r=n(9443),i=n(1222),o=n(3691);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},8719:function(e,t,n){var r=n(4365),i=n(5620);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},4826:function(e,t,n){var r=n(1177),i=n(5620);e.exports=function e(t,n,o,s,l){return t===n||(null!=t&&null!=n&&(i(t)||i(n))?r(t,n,o,s,e,l):t!=t&&n!=n)}},1177:function(e,t,n){var r=n(5382),i=n(8055),o=n(6551),s=n(8700),l=n(8943),a=n(6227),u=n(939),c=n(2855),h="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,y){var b=a(e),v=a(t),x=b?d:l(e),w=v?d:l(t);x=x==h?f:x,w=w==h?f:w;var C=x==f,E=w==f,S=x==w;if(S&&u(e)){if(!u(t))return!1;b=!0,C=!1}if(S&&!C)return y||(y=new r),b||c(e)?i(e,t,n,g,m,y):o(e,t,x,n,g,m,y);if(!(1&n)){var P=C&&p.call(e,"__wrapped__"),O=E&&p.call(t,"__wrapped__");if(P||O){var k=P?e.value():e,A=O?t.value():t;return y||(y=new r),m(k,A,n,g,y)}}return!!S&&(y||(y=new r),s(e,t,n,g,m,y))}},3820:function(e,t,n){var r=n(8943),i=n(5620);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},3762:function(e,t,n){var r=n(5382),i=n(4826);e.exports=function(e,t,n,o){var s=n.length,l=s,a=!o;if(null==e)return!l;for(e=Object(e);s--;){var u=n[s];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<l;){var c=(u=n[s])[0],h=e[c],d=u[1];if(a&&u[2]){if(void 0===h&&!(c in e))return!1}else{var f=new r;if(o)var p=o(h,d,c,e,t,f);if(!(void 0===p?i(d,h,3,o,f):p))return!1}}return!0}},1222:function(e){e.exports=function(e){return e!=e}},9930:function(e,t,n){var r=n(3098),i=n(8754),o=n(2917),s=n(1304),l=/^\[object .+?Constructor\]$/,a=Object.prototype,u=Function.prototype.toString,c=a.hasOwnProperty,h=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:l).test(s(e))}},8036:function(e,t,n){var r=n(8943),i=n(5620);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},7707:function(e,t,n){var r=n(4365),i=n(6613),o=n(5620),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},3526:function(e,t,n){var r=n(5159),i=n(4548),o=n(9974),s=n(6227),l=n(7091);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?s(e)?i(e[0],e[1]):r(e):l(e)}},9849:function(e,t,n){var r=n(2947),i=n(6789),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},3352:function(e,t,n){var r=n(2917),i=n(2947),o=n(5753),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var l in e)!("constructor"==l&&(t||!s.call(e,l)))&&n.push(l);return n}},8409:function(e){e.exports=function(e,t){return e<t}},9776:function(e,t,n){var r=n(3883),i=n(654);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,function(e,r,i){o[++n]=t(e,r,i)}),o}},5159:function(e,t,n){var r=n(3762),i=n(9812),o=n(7113);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},4548:function(e,t,n){var r=n(4826),i=n(557),o=n(9459),s=n(8447),l=n(8546),a=n(7113),u=n(5107);e.exports=function(e,t){return s(e)&&l(t)?a(u(e),t):function(n){var s=i(n,e);return void 0===s&&s===t?o(n,e):r(t,s,3)}}},5580:function(e,t,n){var r=n(5382),i=n(3153),o=n(3627),s=n(2669),l=n(2917),a=n(9403),u=n(9341);e.exports=function e(t,n,c,h,d){if(t!==n)o(n,function(o,a){if(d||(d=new r),l(o))s(t,n,a,c,e,h,d);else{var f=h?h(u(t,a),o,a+"",t,n,d):void 0;void 0===f&&(f=o),i(t,a,f)}},a)}},2669:function(e,t,n){var r=n(3153),i=n(6550),o=n(7173),s=n(3096),l=n(1931),a=n(8497),u=n(6227),c=n(5559),h=n(939),d=n(3098),f=n(2917),p=n(4087),g=n(2855),m=n(9341),y=n(5079);e.exports=function(e,t,n,b,v,x,w){var C=m(e,n),E=m(t,n),S=w.get(E);if(S){r(e,n,S);return}var P=x?x(C,E,n+"",e,t,w):void 0,O=void 0===P;if(O){var k=u(E),A=!k&&h(E),M=!k&&!A&&g(E);P=E,k||A||M?u(C)?P=C:c(C)?P=s(C):A?(O=!1,P=i(E,!0)):M?(O=!1,P=o(E,!0)):P=[]:p(E)||a(E)?(P=C,a(C)?P=y(C):(!f(C)||d(C))&&(P=l(E))):O=!1}O&&(w.set(E,P),v(P,E,b,x,w),w.delete(E)),r(e,n,P)}},8034:function(e,t,n){var r=n(2467),i=n(304),o=n(3526),s=n(9776),l=n(1467),a=n(8611),u=n(4988),c=n(9974),h=n(6227);e.exports=function(e,t,n){t=t.length?r(t,function(e){return h(e)?function(t){return i(t,1===e.length?e[0]:e)}:e}):[c];var d=-1;return t=r(t,a(o)),l(s(e,function(e,n,i){return{criteria:r(t,function(t){return t(e)}),index:++d,value:e}}),function(e,t){return u(e,t,n)})}},3897:function(e,t,n){var r=n(3405),i=n(9459);e.exports=function(e,t){return r(e,t,function(t,n){return i(e,n)})}},3405:function(e,t,n){var r=n(304),i=n(2773),o=n(322);e.exports=function(e,t,n){for(var s=-1,l=t.length,a={};++s<l;){var u=t[s],c=r(e,u);n(c,u)&&i(a,o(u,e),c)}return a}},9511:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},8052:function(e,t,n){var r=n(304);e.exports=function(e){return function(t){return r(t,e)}}},7757:function(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var s=-1,l=n(t((r-e)/(i||1)),0),a=Array(l);l--;)a[o?l:++s]=e,e+=i;return a}},1585:function(e){e.exports=function(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}},1229:function(e,t,n){var r=n(9974),i=n(2478),o=n(8286);e.exports=function(e,t){return o(i(e,t,r),e+"")}},2773:function(e,t,n){var r=n(5699),i=n(322),o=n(3501),s=n(2917),l=n(5107);e.exports=function(e,t,n,a){if(!s(e))return e;t=i(t,e);for(var u=-1,c=t.length,h=c-1,d=e;null!=d&&++u<c;){var f=l(t[u]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)break;if(u!=h){var g=d[f];void 0===(p=a?a(g,f,d):void 0)&&(p=s(g)?g:o(t[u+1])?[]:{})}r(d,f,p),d=d[f]}return e}},1792:function(e,t,n){var r=n(6710),i=n(6554),o=n(9974),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=s},1467:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},1650:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},4200:function(e,t,n){var r=n(5869),i=n(2467),o=n(6227),s=n(9528),l=1/0,a=r?r.prototype:void 0,u=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-l?"-0":n}},7527:function(e,t,n){var r=n(2670),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},8611:function(e){e.exports=function(e){return function(t){return e(t)}}},1826:function(e,t,n){var r=n(5106),i=n(9360),o=n(5987),s=n(8342),l=n(4248),a=n(735);e.exports=function(e,t,n){var u=-1,c=i,h=e.length,d=!0,f=[],p=f;if(n)d=!1,c=o;else if(h>=200){var g=t?null:l(e);if(g)return a(g);d=!1,c=s,p=new r}else p=t?[]:f;e:for(;++u<h;){var m=e[u],y=t?t(m):m;if(m=n||0!==m?m:0,d&&y==y){for(var b=p.length;b--;)if(p[b]===y)continue e;t&&p.push(y),f.push(m)}else!c(p,y,n)&&(p!==f&&p.push(y),f.push(m))}return f}},8737:function(e,t,n){var r=n(2467);e.exports=function(e,t){return r(t,function(t){return e[t]})}},3329:function(e){e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,s={};++r<i;){var l=r<o?t[r]:void 0;n(s,e[r],l)}return s}},8342:function(e){e.exports=function(e,t){return e.has(t)}},5444:function(e,t,n){var r=n(9974);e.exports=function(e){return"function"==typeof e?e:r}},322:function(e,t,n){var r=n(6227),i=n(8447),o=n(9765),s=n(2954);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},2658:function(e,t,n){var r=n(8930);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},6550:function(e,t,n){e=n.nmd(e);var r=n(5031),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?r.Buffer:void 0,l=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}},9796:function(e,t,n){var r=n(2658);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3714:function(e){var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},1887:function(e,t,n){var r=n(5869),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},7173:function(e,t,n){var r=n(2658);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},2590:function(e,t,n){var r=n(9528);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,s=r(e),l=void 0!==t,a=null===t,u=t==t,c=r(t);if(!a&&!c&&!s&&e>t||s&&l&&u&&!a&&!c||i&&l&&u||!n&&u||!o)return 1;if(!i&&!s&&!c&&e<t||c&&n&&o&&!i&&!s||a&&n&&o||!l&&o||!u)return -1}return 0}},4988:function(e,t,n){var r=n(2590);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,s=t.criteria,l=o.length,a=n.length;++i<l;){var u=r(o[i],s[i]);if(u){if(i>=a)return u;return u*("desc"==n[i]?-1:1)}}return e.index-t.index}},3096:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},6734:function(e,t,n){var r=n(5699),i=n(2544);e.exports=function(e,t,n,o){var s=!n;n||(n={});for(var l=-1,a=t.length;++l<a;){var u=t[l],c=o?o(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),s?i(n,u,c):r(n,u,c)}return n}},5879:function(e,t,n){var r=n(6734),i=n(5940);e.exports=function(e,t){return r(e,i(e),t)}},5705:function(e,t,n){var r=n(6734),i=n(4780);e.exports=function(e,t){return r(e,i(e),t)}},3823:function(e,t,n){var r=n(5031)["__core-js_shared__"];e.exports=r},9354:function(e,t,n){var r=n(1229),i=n(9131);e.exports=function(e){return r(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,l=o>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,l&&i(n[0],n[1],l)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var a=n[r];a&&e(t,a,r,s)}return t})}},2159:function(e,t,n){var r=n(654);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,s=t?o:-1,l=Object(n);(t?s--:++s<o)&&!1!==i(l[s],s,l););return n}}},3179:function(e){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),l=s.length;l--;){var a=s[e?l:++i];if(!1===n(o[a],a,o))break}return t}}},6502:function(e,t,n){var r=n(3526),i=n(654),o=n(5334);e.exports=function(e){return function(t,n,s){var l=Object(t);if(!i(t)){var a=r(n,3);t=o(t),n=function(e){return a(l[e],e,l)}}var u=e(t,n,s);return u>-1?l[a?t[u]:u]:void 0}}},1770:function(e,t,n){var r=n(7757),i=n(9131),o=n(3555);e.exports=function(e){return function(t,n,s){return s&&"number"!=typeof s&&i(t,n,s)&&(n=s=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),s=void 0===s?t<n?1:-1:o(s),r(t,n,s,e)}}},4248:function(e,t,n){var r=n(8995),i=n(555),o=n(735),s=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=s},6554:function(e,t,n){var r=n(6369),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},8055:function(e,t,n){var r=n(5106),i=n(9618),o=n(8342);e.exports=function(e,t,n,s,l,a){var u=1&n,c=e.length,h=t.length;if(c!=h&&!(u&&h>c))return!1;var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=-1,g=!0,m=2&n?new r:void 0;for(a.set(e,t),a.set(t,e);++p<c;){var y=e[p],b=t[p];if(s)var v=u?s(b,y,p,t,e,a):s(y,b,p,e,t,a);if(void 0!==v){if(v)continue;g=!1;break}if(m){if(!i(t,function(e,t){if(!o(m,t)&&(y===e||l(y,e,n,s,a)))return m.push(t)})){g=!1;break}}else if(!(y===b||l(y,b,n,s,a))){g=!1;break}}return a.delete(e),a.delete(t),g}},6551:function(e,t,n){var r=n(5869),i=n(8930),o=n(3947),s=n(8055),l=n(7305),a=n(735),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!h(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=l;case"[object Set]":var p=1&r;if(f||(f=a),e.size!=t.size&&!p)break;var g=d.get(e);if(g)return g==t;r|=2,d.set(e,t);var m=s(f(e),f(t),r,u,h,d);return d.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},8700:function(e,t,n){var r=n(6498),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,l){var a=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!a)return!1;for(var h=c;h--;){var d=u[h];if(!(a?d in t:i.call(t,d)))return!1}var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var g=!0;l.set(e,t),l.set(t,e);for(var m=a;++h<c;){var y=e[d=u[h]],b=t[d];if(o)var v=a?o(b,y,d,t,e,l):o(y,b,d,e,t,l);if(!(void 0===v?y===b||s(y,b,n,o,l):v)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(g=!1)}return l.delete(e),l.delete(t),g}},794:function(e,t,n){var r=n(3219),i=n(2478),o=n(8286);e.exports=function(e){return o(i(e,void 0,r),e+"")}},5274:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},6498:function(e,t,n){var r=n(2481),i=n(5940),o=n(5334);e.exports=function(e){return r(e,o,i)}},2179:function(e,t,n){var r=n(2481),i=n(4780),o=n(9403);e.exports=function(e){return r(e,o,i)}},9623:function(e,t,n){var r=n(9005);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},9812:function(e,t,n){var r=n(8546),i=n(5334);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,r(s)]}return t}},6369:function(e,t,n){var r=n(9930),i=n(4502);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},5918:function(e,t,n){var r=n(6942)(Object.getPrototypeOf,Object);e.exports=r},7043:function(e,t,n){var r=n(5869),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[l]=n:delete e[l]),i}},5940:function(e,t,n){var r=n(8353),i=n(3249),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,l=s?function(e){return null==e?[]:r(s(e=Object(e)),function(t){return o.call(e,t)})}:i;e.exports=l},4780:function(e,t,n){var r=n(3571),i=n(5918),o=n(5940),s=n(3249),l=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:s;e.exports=l},8943:function(e,t,n){var r=n(2622),i=n(1725),o=n(4575),s=n(8995),l=n(8110),a=n(4365),u=n(1304),c="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",g=u(r),m=u(i),y=u(o),b=u(s),v=u(l),x=a;(r&&x(new r(new ArrayBuffer(1)))!=p||i&&x(new i)!=c||o&&x(o.resolve())!=h||s&&x(new s)!=d||l&&x(new l)!=f)&&(x=function(e){var t=a(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return p;case m:return c;case y:return h;case b:return d;case v:return f}return t}),e.exports=x},4502:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},6953:function(e,t,n){var r=n(322),i=n(8497),o=n(6227),s=n(3501),l=n(6613),a=n(5107);e.exports=function(e,t,n){t=r(t,e);for(var u=-1,c=t.length,h=!1;++u<c;){var d=a(t[u]);if(!(h=null!=e&&n(e,d)))break;e=e[d]}return h||++u!=c?h:!!(c=null==e?0:e.length)&&l(c)&&s(d,c)&&(o(e)||i(e))}},2552:function(e){var t=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},1783:function(e,t,n){var r=n(8163);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},1012:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},9900:function(e,t,n){var r=n(8163),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},6691:function(e,t,n){var r=n(8163),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},2018:function(e,t,n){var r=n(8163);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},5959:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},2206:function(e,t,n){var r=n(2658),i=n(9796),o=n(3714),s=n(1887),l=n(7173);e.exports=function(e,t,n){var a=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return i(e,n);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 l(e,n);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return o(e);case"[object Symbol]":return s(e)}}},1931:function(e,t,n){var r=n(1315),i=n(5918),o=n(2947);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},1449:function(e,t,n){var r=n(5869),i=n(8497),o=n(6227),s=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(s&&e&&e[s])}},3501:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?0x1fffffffffffff:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},9131:function(e,t,n){var r=n(3947),i=n(654),o=n(3501),s=n(2917);e.exports=function(e,t,n){if(!s(n))return!1;var l=typeof t;return("number"==l?!!(i(n)&&o(t,n.length)):"string"==l&&t in n)&&r(n[t],e)}},8447:function(e,t,n){var r=n(6227),i=n(9528),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||i(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}},9005:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},8754:function(e,t,n){var r,i=n(3823);var o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},2947:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},8546:function(e,t,n){var r=n(2917);e.exports=function(e){return e==e&&!r(e)}},9896:function(e){e.exports=function(){this.__data__=[],this.size=0}},2473:function(e,t,n){var r=n(8746),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},4678:function(e,t,n){var r=n(8746);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},1240:function(e,t,n){var r=n(8746);e.exports=function(e){return r(this.__data__,e)>-1}},4296:function(e,t,n){var r=n(8746);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},6660:function(e,t,n){var r=n(7973),i=n(2768),o=n(1725);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},8472:function(e,t,n){var r=n(9623);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},5637:function(e,t,n){var r=n(9623);e.exports=function(e){return r(this,e).get(e)}},9389:function(e,t,n){var r=n(9623);e.exports=function(e){return r(this,e).has(e)}},9804:function(e,t,n){var r=n(9623);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},7305:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},7113:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},662:function(e,t,n){var r=n(6983);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},8163:function(e,t,n){var r=n(6369)(Object,"create");e.exports=r},6789:function(e,t,n){var r=n(6942)(Object.keys,Object);e.exports=r},5753:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},1378:function(e,t,n){e=n.nmd(e);var r=n(5274),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,l=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=l},5283:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},6942:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},2478:function(e,t,n){var r=n(7485),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,l=i(o.length-t,0),a=Array(l);++s<l;)a[s]=o[t+s];s=-1;for(var u=Array(t+1);++s<t;)u[s]=o[s];return u[t]=n(a),r(e,this,u)}}},5031:function(e,t,n){var r=n(5274),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},9341:function(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},4867:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},9428:function(e){e.exports=function(e){return this.__data__.has(e)}},735:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},8286:function(e,t,n){var r=n(1792),i=n(1358)(r);e.exports=i},1358:function(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},3533:function(e,t,n){var r=n(2768);e.exports=function(){this.__data__=new r,this.size=0}},7064:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},9955:function(e){e.exports=function(e){return this.__data__.get(e)}},6087:function(e){e.exports=function(e){return this.__data__.has(e)}},3990:function(e,t,n){var r=n(2768),i=n(1725),o=n(736);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},3691:function(e){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1}},216:function(e,t,n){var r=n(3327),i=n(2552),o=n(5890);e.exports=function(e){return i(e)?o(e):r(e)}},9765:function(e,t,n){var r=n(662),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)}),t});e.exports=s},5107:function(e,t,n){var r=n(9528),i=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},1304:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2670:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},5890:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",i="[^"+t+"]",o="(?:\ud83c[\udde6-\uddff]){2}",s="[\ud800-\udbff][\udc00-\udfff]",l="(?:"+n+"|"+r+")?",a="[\\ufe0e\\ufe0f]?",u="(?:\\u200d(?:"+[i,o,s].join("|")+")"+a+l+")*",c=RegExp(r+"(?="+r+")|"+("(?:"+[i+n+"?",n,o,s,"["+t+"]"].join("|")+")")+(a+l+u),"g");e.exports=function(e){for(var t=c.lastIndex=0;c.test(e);)++t;return t}},7654:function(e,t,n){var r=n(1016);e.exports=function(e){return r(e,4)}},9007:function(e,t,n){var r=n(1016);e.exports=function(e){return r(e,5)}},6710:function(e){e.exports=function(e){return function(){return e}}},6342:function(e,t,n){var r=n(1229),i=n(3947),o=n(9131),s=n(9403),l=Object.prototype,a=l.hasOwnProperty,u=r(function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n<r;){for(var c=t[n],h=s(c),d=-1,f=h.length;++d<f;){var p=h[d],g=e[p];(void 0===g||i(g,l[p])&&!a.call(e,p))&&(e[p]=c[p])}}return e});e.exports=u},4500:function(e,t,n){e.exports=n(553)},3947:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},786:function(e,t,n){var r=n(8353),i=n(4693),o=n(3526),s=n(6227);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},2756:function(e,t,n){var r=n(6502)(n(6336));e.exports=r},6336:function(e,t,n){var r=n(9443),i=n(3526),o=n(4848),s=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return -1;var a=null==n?0:o(n);return a<0&&(a=s(l+a,0)),r(e,i(t,3),a)}},3219:function(e,t,n){var r=n(6195);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},553:function(e,t,n){var r=n(7510),i=n(3883),o=n(5444),s=n(6227);e.exports=function(e,t){return(s(e)?r:i)(e,o(t))}},7694:function(e,t,n){var r=n(3627),i=n(5444),o=n(9403);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},557:function(e,t,n){var r=n(304);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},7962:function(e,t,n){var r=n(6925),i=n(6953);e.exports=function(e,t){return null!=e&&i(e,t,r)}},9459:function(e,t,n){var r=n(1547),i=n(6953);e.exports=function(e,t){return null!=e&&i(e,t,r)}},9974:function(e){e.exports=function(e){return e}},8497:function(e,t,n){var r=n(8719),i=n(5620),o=Object.prototype,s=o.hasOwnProperty,l=o.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!l.call(e,"callee")};e.exports=a},6227:function(e){var t=Array.isArray;e.exports=t},654:function(e,t,n){var r=n(3098),i=n(6613);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},5559:function(e,t,n){var r=n(654),i=n(5620);e.exports=function(e){return i(e)&&r(e)}},939:function(e,t,n){e=n.nmd(e);var r=n(5031),i=n(3863),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,l=s&&s.exports===o?r.Buffer:void 0,a=l?l.isBuffer:void 0;e.exports=a||i},353:function(e,t,n){var r=n(9849),i=n(8943),o=n(8497),s=n(6227),l=n(654),a=n(939),u=n(2947),c=n(2855),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||a(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(h.call(e,n))return!1;return!0}},3098:function(e,t,n){var r=n(4365),i=n(2917);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},6613:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},2394:function(e,t,n){var r=n(3820),i=n(8611),o=n(1378),s=o&&o.isMap,l=s?i(s):r;e.exports=l},2917:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5620:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4087:function(e,t,n){var r=n(4365),i=n(5918),o=n(5620),s=Object.prototype,l=Function.prototype.toString,a=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=a.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},6658:function(e,t,n){var r=n(8036),i=n(8611),o=n(1378),s=o&&o.isSet,l=s?i(s):r;e.exports=l},5078:function(e,t,n){var r=n(4365),i=n(6227),o=n(5620);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},9528:function(e,t,n){var r=n(4365),i=n(5620);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},2855:function(e,t,n){var r=n(7707),i=n(8611),o=n(1378),s=o&&o.isTypedArray,l=s?i(s):r;e.exports=l},678:function(e){e.exports=function(e){return void 0===e}},5334:function(e,t,n){var r=n(4505),i=n(9849),o=n(654);e.exports=function(e){return o(e)?r(e):i(e)}},9403:function(e,t,n){var r=n(4505),i=n(3352),o=n(654);e.exports=function(e){return o(e)?r(e,!0):i(e)}},9921:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},3275:function(e,t,n){var r=n(2467),i=n(3526),o=n(9776),s=n(6227);e.exports=function(e,t){return(s(e)?r:o)(e,i(t,3))}},2233:function(e,t,n){var r=n(2544),i=n(7228),o=n(3526);e.exports=function(e,t){var n={};return t=o(t,3),i(e,function(e,i,o){r(n,i,t(e,i,o))}),n}},5570:function(e,t,n){var r=n(6746),i=n(930),o=n(9974);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6983:function(e,t,n){var r=n(736);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},9782:function(e,t,n){var r=n(5580),i=n(9354)(function(e,t,n){r(e,t,n)});e.exports=i},4183:function(e,t,n){var r=n(6746),i=n(8409),o=n(9974);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},7e3:function(e,t,n){var r=n(6746),i=n(3526),o=n(8409);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},555:function(e){e.exports=function(){}},6860:function(e,t,n){var r=n(5031);e.exports=function(){return r.Date.now()}},5773:function(e,t,n){var r=n(3897),i=n(794)(function(e,t){return null==e?{}:r(e,t)});e.exports=i},7091:function(e,t,n){var r=n(9511),i=n(8052),o=n(8447),s=n(5107);e.exports=function(e){return o(e)?r(s(e)):i(e)}},4178:function(e,t,n){var r=n(1770)();e.exports=r},7936:function(e,t,n){var r=n(83),i=n(3883),o=n(3526),s=n(1585),l=n(6227);e.exports=function(e,t,n){var a=l(e)?r:s,u=arguments.length<3;return a(e,o(t,4),n,u,i)}},691:function(e,t,n){var r=n(9849),i=n(8943),o=n(654),s=n(5078),l=n(216);e.exports=function(e){if(null==e)return 0;if(o(e))return s(e)?l(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},5998:function(e,t,n){var r=n(6195),i=n(8034),o=n(1229),s=n(9131),l=o(function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])});e.exports=l},3249:function(e){e.exports=function(){return[]}},3863:function(e){e.exports=function(){return!1}},3555:function(e,t,n){var r=n(9640),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-i?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},4848:function(e,t,n){var r=n(3555);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9640:function(e,t,n){var r=n(7527),i=n(2917),o=n(9528),s=0/0,l=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):l.test(e)?s:+e}},5079:function(e,t,n){var r=n(6734),i=n(9403);e.exports=function(e){return r(e,i(e))}},2954:function(e,t,n){var r=n(4200);e.exports=function(e){return null==e?"":r(e)}},3216:function(e,t,n){var r=n(7510),i=n(1315),o=n(7228),s=n(3526),l=n(5918),a=n(6227),u=n(939),c=n(3098),h=n(2917),d=n(2855);e.exports=function(e,t,n){var f=a(e),p=f||u(e)||d(e);if(t=s(t,4),null==n){var g=e&&e.constructor;n=p?f?new g:[]:h(e)?c(g)?i(l(e)):{}:{}}return(p?r:o)(e,function(e,r,i){return t(n,e,r,i)}),n}},3475:function(e,t,n){var r=n(6195),i=n(1229),o=n(1826),s=n(5559),l=i(function(e){return o(r(e,1,s,!0))});e.exports=l},8839:function(e,t,n){var r=n(2954),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5514:function(e,t,n){var r=n(8737),i=n(5334);e.exports=function(e){return null==e?[]:r(e,i(e))}},4028:function(e,t,n){var r=n(5699),i=n(3329);e.exports=function(e,t){return i(e||[],t||[],r)}},6590:function(e,t,n){"use strict";var r,i,o,s,l,a,u=n(8156),c=n(7881);function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var d=new Set,f={};function p(e,t){g(e,t),g(e+"Capture",t)}function g(e,t){for(f[e]=t,e=0;e<t.length;e++)d.add(t[e])}var m=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),y=Object.prototype.hasOwnProperty,b=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},x={};function w(e,t,n,r,i,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){C[e]=new w(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];C[t]=new w(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){C[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){C[e]=new w(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){C[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){C[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){C[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){C[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){C[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function S(e){return e[1].toUpperCase()}function P(e,t,n,r){var i,o=C.hasOwnProperty(t)?C[t]:null;if(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1]){;(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":if(r)return!1;if(null!==n)return!n.acceptsBooleans;return"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e;default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1})(t,n,o,r)&&(n=null),r||null===o?(i=t,(!!y.call(x,i)||!y.call(v,i)&&(b.test(i)?x[i]=!0:(v[i]=!0,!1)))&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n))):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n)))}}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(E,S);C[t]=new w(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(E,S);C[t]=new w(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(E,S);C[t]=new w(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){C[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){C[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});var O=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),A=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),I=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),D=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var z=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var F=Symbol.iterator;function V(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=F&&e[F]||e["@@iterator"])?e:null}var $,U=Object.assign;function G(e){if(void 0===$)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);$=t&&t[1]||""}return"\n"+$+e}var H=!1;function q(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),o=r.stack.split("\n"),s=i.length-1,l=o.length-1;1<=s&&0<=l&&i[s]!==o[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==o[l]){if(1!==s||1!==l)do if(s--,0>--l||i[s]!==o[l]){var a="\n"+i[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?G(e):""}function W(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function X(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Y(e){e._valueTracker||(e._valueTracker=function(e){var t=X(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function J(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=X(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Q(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return U({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Z(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=W(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function ee(e,t){null!=(t=t.checked)&&P(e,"checked",t,!1)}function et(e,t){ee(e,t);var n=W(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r){e.removeAttribute("value");return}t.hasOwnProperty("value")?er(e,t.type,n):t.hasOwnProperty("defaultValue")&&er(e,t.type,W(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function en(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function er(e,t,n){("number"!==t||Q(e.ownerDocument)!==e)&&(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ei=Array.isArray;function eo(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(i=0,n=""+W(n),t=null;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function es(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(h(91));return U({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function el(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(h(92));if(ei(n)){if(1<n.length)throw Error(h(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:W(n)}}function ea(e,t){var n=W(t.value),r=W(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function eu(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ec(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function eh(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ec(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ed,ef,ep=(ed=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ef=ef||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ef.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return ed(e,t,n,r)})}:ed);function eg(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var em={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ey=["Webkit","ms","Moz","O"];function eb(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||em.hasOwnProperty(e)&&em[e]?(""+t).trim():t+"px"}function ev(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=eb(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(em).forEach(function(e){ey.forEach(function(t){em[t=t+e.charAt(0).toUpperCase()+e.substring(1)]=em[e]})});var ex=U({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ew(e,t){if(t){if(ex[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(h(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(h(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(h(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(h(62))}}function eC(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var eE=null;function eS(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var eP=null,eO=null,ek=null;function eA(e){if(e=r_(e)){if("function"!=typeof eP)throw Error(h(280));var t=e.stateNode;t&&(t=rD(t),eP(e.stateNode,e.type,t))}}function eM(e){eO?ek?ek.push(e):ek=[e]:eO=e}function eT(){if(eO){var e=eO,t=ek;if(ek=eO=null,eA(e),t)for(e=0;e<t.length;e++)eA(t[e])}}function eN(e,t){return e(t)}function ej(){}var eI=!1;function eL(e,t,n){if(eI)return e(t,n);eI=!0;try{return eN(e,t,n)}finally{eI=!1,(null!==eO||null!==ek)&&(ej(),eT())}}function eR(e,t){var n=e.stateNode;if(null===n)return null;var r=rD(n);if(null===r)return null;switch(n=r[t],t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(h(231,t,typeof n));return n}var e_=!1;if(m)try{var eB={};Object.defineProperty(eB,"passive",{get:function(){e_=!0}}),window.addEventListener("test",eB,eB),window.removeEventListener("test",eB,eB)}catch(e){e_=!1}function eD(e,t,n,r,i,o,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var ez=!1,eF=null,eV=!1,e$=null,eU={onError:function(e){ez=!0,eF=e}};function eG(e,t,n,r,i,o,s,l,a){ez=!1,eF=null,eD.apply(eU,arguments)}function eH(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(4098&(t=e).flags)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function eq(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function eW(e){if(eH(e)!==e)throw Error(h(188))}function eX(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=eH(e)))throw Error(h(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return eW(i),e;if(o===r)return eW(i),t;o=o.sibling}throw Error(h(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(h(189))}}if(n.alternate!==r)throw Error(h(190))}if(3!==n.tag)throw Error(h(188));return n.stateNode.current===n?e:t}(e))?function e(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var n=e(t);if(null!==n)return n;t=t.sibling}return null}(e):null}var eY=c.unstable_scheduleCallback,eJ=c.unstable_cancelCallback,eQ=c.unstable_shouldYield,eK=c.unstable_requestPaint,eZ=c.unstable_now,e0=c.unstable_getCurrentPriorityLevel,e1=c.unstable_ImmediatePriority,e2=c.unstable_UserBlockingPriority,e3=c.unstable_NormalPriority,e5=c.unstable_LowPriority,e6=c.unstable_IdlePriority,e4=null,e8=null,e9=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(e7(e)/te|0)|0},e7=Math.log,te=Math.LN2,tt=64,tn=4194304;function tr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:case 0x4000000:return 0x7c00000&e;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0x40000000;default:return e}}function ti(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=0xfffffff&n;if(0!==s){var l=s&~i;0!==l?r=tr(l):0!=(o&=s)&&(r=tr(o))}else 0!=(s=n&~i)?r=tr(s):0!==o&&(r=tr(o));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&0!=(4194240&o)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-e9(t)),r|=e[n],t&=~i;return r}function to(e){return 0!=(e=-0x40000001&e.pendingLanes)?e:0x40000000&e?0x40000000:0}function ts(){var e=tt;return 0==(4194240&(tt<<=1))&&(tt=64),e}function tl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ta(e,t,n){e.pendingLanes|=t,0x20000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,e[t=31-e9(t)]=n}function tu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-e9(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var tc=0;function th(e){return 1<(e&=-e)?4<e?0!=(0xfffffff&e)?16:0x20000000:4:1}var td,tf,tp,tg,tm,ty=!1,tb=[],tv=null,tx=null,tw=null,tC=new Map,tE=new Map,tS=[],tP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function tO(e,t){switch(e){case"focusin":case"focusout":tv=null;break;case"dragenter":case"dragleave":tx=null;break;case"mouseover":case"mouseout":tw=null;break;case"pointerover":case"pointerout":tC.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tE.delete(t.pointerId)}}function tk(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&null!==(t=r_(t))&&tf(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function tA(e){var t=rR(e.target);if(null!==t){var n=eH(t);if(null!==n){if(13===(t=n.tag)){if(null!==(t=eq(n))){e.blockedOn=t,tm(e.priority,function(){tp(n)});return}}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=3===n.tag?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tM(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=tF(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=r_(n))&&tf(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);eE=r,n.target.dispatchEvent(r),eE=null;t.shift()}return!0}function tT(e,t,n){tM(e)&&n.delete(t)}function tN(){ty=!1,null!==tv&&tM(tv)&&(tv=null),null!==tx&&tM(tx)&&(tx=null),null!==tw&&tM(tw)&&(tw=null),tC.forEach(tT),tE.forEach(tT)}function tj(e,t){e.blockedOn===t&&(e.blockedOn=null,ty||(ty=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,tN)))}function tI(e){function t(t){return tj(t,e)}if(0<tb.length){tj(tb[0],e);for(var n=1;n<tb.length;n++){var r=tb[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==tv&&tj(tv,e),null!==tx&&tj(tx,e),null!==tw&&tj(tw,e),tC.forEach(t),tE.forEach(t),n=0;n<tS.length;n++)(r=tS[n]).blockedOn===e&&(r.blockedOn=null);for(;0<tS.length&&null===(n=tS[0]).blockedOn;)tA(n),null===n.blockedOn&&tS.shift()}var tL=O.ReactCurrentBatchConfig,tR=!0;function t_(e,t,n,r){var i=tc,o=tL.transition;tL.transition=null;try{tc=1,tD(e,t,n,r)}finally{tc=i,tL.transition=o}}function tB(e,t,n,r){var i=tc,o=tL.transition;tL.transition=null;try{tc=4,tD(e,t,n,r)}finally{tc=i,tL.transition=o}}function tD(e,t,n,r){if(tR){var i=tF(e,t,n,r);if(null===i)rl(e,t,r,tz,n),tO(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return tv=tk(tv,e,t,n,r,i),!0;case"dragenter":return tx=tk(tx,e,t,n,r,i),!0;case"mouseover":return tw=tk(tw,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return tC.set(o,tk(tC.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,tE.set(o,tk(tE.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(tO(e,r),4&t&&-1<tP.indexOf(e)){for(;null!==i;){var o=r_(i);if(null!==o&&td(o),null===(o=tF(e,t,n,r))&&rl(e,t,r,tz,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else rl(e,t,r,null,n)}}var tz=null;function tF(e,t,n,r){if(tz=null,null!==(e=rR(e=eS(r)))){if(null===(t=eH(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=eq(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}return tz=e,null}function tV(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(e0()){case e1:return 1;case e2:return 4;case e3:case e5:return 16;case e6:return 0x20000000;default:return 16}default:return 16}}var t$=null,tU=null,tG=null;function tH(){if(tG)return tG;var e,t,n=tU,r=n.length,i="value"in t$?t$.value:t$.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var s=r-e;for(t=1;t<=s&&n[r-t]===i[o-t];t++);return tG=i.slice(e,1<t?1-t:void 0)}function tq(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function tW(){return!0}function tX(){return!1}function tY(e){function t(t,n,r,i,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?tW:tX,this.isPropagationStopped=tX,this}return U(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=tW)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=tW)},persist:function(){},isPersistent:tW}),t}var tJ,tQ,tK,tZ={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},t0=tY(tZ),t1=U({},tZ,{view:0,detail:0}),t2=tY(t1),t3=U({},t1,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ni,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==tK&&(tK&&"mousemove"===e.type?(tJ=e.screenX-tK.screenX,tQ=e.screenY-tK.screenY):tQ=tJ=0,tK=e),tJ)},movementY:function(e){return"movementY"in e?e.movementY:tQ}}),t5=tY(t3),t6=tY(U({},t3,{dataTransfer:0})),t4=tY(U({},t1,{relatedTarget:0})),t8=tY(U({},tZ,{animationName:0,elapsedTime:0,pseudoElement:0})),t9=tY(U({},tZ,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),t7=tY(U({},tZ,{data:0})),ne={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nt={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},nn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=nn[e])&&!!t[e]}function ni(){return nr}var no=tY(U({},t1,{key:function(e){if(e.key){var t=ne[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tq(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?nt[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ni,charCode:function(e){return"keypress"===e.type?tq(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tq(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),ns=tY(U({},t3,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nl=tY(U({},t1,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ni})),na=tY(U({},tZ,{propertyName:0,elapsedTime:0,pseudoElement:0})),nu=tY(U({},t3,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),nc=[9,13,27,32],nh=m&&"CompositionEvent"in window,nd=null;m&&"documentMode"in document&&(nd=document.documentMode);var nf=m&&"TextEvent"in window&&!nd,np=m&&(!nh||nd&&8<nd&&11>=nd),ng=!1;function nm(e,t){switch(e){case"keyup":return -1!==nc.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ny(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var nb=!1,nv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!nv[e.type]:"textarea"===t}function nw(e,t,n,r){eM(r),0<(t=ru(t,"onChange")).length&&(n=new t0("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var nC=null,nE=null;function nS(e){rt(e,0)}function nP(e){if(J(rB(e)))return e}function nO(e,t){if("change"===e)return t}var nk=!1;if(m){if(m){var nA="oninput"in document;if(!nA){var nM=document.createElement("div");nM.setAttribute("oninput","return;"),nA="function"==typeof nM.oninput}r=nA}else r=!1;nk=r&&(!document.documentMode||9<document.documentMode)}function nT(){nC&&(nC.detachEvent("onpropertychange",nN),nE=nC=null)}function nN(e){if("value"===e.propertyName&&nP(nE)){var t=[];nw(t,nE,e,eS(e)),eL(nS,t)}}function nj(e,t,n){"focusin"===e?(nT(),nC=t,nE=n,nC.attachEvent("onpropertychange",nN)):"focusout"===e&&nT()}function nI(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return nP(nE)}function nL(e,t){if("click"===e)return nP(t)}function nR(e,t){if("input"===e||"change"===e)return nP(t)}var n_="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function nB(e,t){if(n_(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!y.call(t,i)||!n_(e[i],t[i]))return!1}return!0}function nD(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nz(e,t){var n,r=nD(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=nD(r)}}function nF(){for(var e=window,t=Q();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=Q(e.document)}return t}function nV(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var n$=m&&"documentMode"in document&&11>=document.documentMode,nU=null,nG=null,nH=null,nq=!1;function nW(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;nq||null==nU||nU!==Q(r)||(r="selectionStart"in(r=nU)&&nV(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},nH&&nB(nH,r)||(nH=r,0<(r=ru(nG,"onSelect")).length&&(t=new t0("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=nU)))}function nX(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var nY={animationend:nX("Animation","AnimationEnd"),animationiteration:nX("Animation","AnimationIteration"),animationstart:nX("Animation","AnimationStart"),transitionend:nX("Transition","TransitionEnd")},nJ={},nQ={};function nK(e){if(nJ[e])return nJ[e];if(!nY[e])return e;var t,n=nY[e];for(t in n)if(n.hasOwnProperty(t)&&t in nQ)return nJ[e]=n[t];return e}m&&(nQ=document.createElement("div").style,"AnimationEvent"in window||(delete nY.animationend.animation,delete nY.animationiteration.animation,delete nY.animationstart.animation),"TransitionEvent"in window||delete nY.transitionend.transition);var nZ=nK("animationend"),n0=nK("animationiteration"),n1=nK("animationstart"),n2=nK("transitionend"),n3=new Map,n5="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function n6(e,t){n3.set(e,t),p(t,[e])}for(var n4=0;n4<n5.length;n4++){var n8=n5[n4];n6(n8.toLowerCase(),"on"+(n8[0].toUpperCase()+n8.slice(1)))}n6(nZ,"onAnimationEnd"),n6(n0,"onAnimationIteration"),n6(n1,"onAnimationStart"),n6("dblclick","onDoubleClick"),n6("focusin","onFocus"),n6("focusout","onBlur"),n6(n2,"onTransitionEnd"),g("onMouseEnter",["mouseout","mouseover"]),g("onMouseLeave",["mouseout","mouseover"]),g("onPointerEnter",["pointerout","pointerover"]),g("onPointerLeave",["pointerout","pointerover"]),p("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),p("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),p("onBeforeInput",["compositionend","keypress","textInput","paste"]),p("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),p("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),p("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var n9="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),n7=new Set("cancel close invalid load scroll toggle".split(" ").concat(n9));function re(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,!function(e,t,n,r,i,o,s,l,a){if(eG.apply(this,arguments),ez){if(ez){var u=eF;ez=!1,eF=null}else throw Error(h(198));eV||(eV=!0,e$=u)}}(r,t,void 0,e),e.currentTarget=null}function rt(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;t:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==o&&i.isPropagationStopped())break t;re(i,l,u),o=a}else for(s=0;s<r.length;s++){if(a=(l=r[s]).instance,u=l.currentTarget,l=l.listener,a!==o&&i.isPropagationStopped())break t;re(i,l,u),o=a}}}if(eV)throw e=e$,eV=!1,e$=null,e}function rn(e,t){var n=t[rj];void 0===n&&(n=t[rj]=new Set);var r=e+"__bubble";n.has(r)||(rs(t,e,2,!1),n.add(r))}function rr(e,t,n){var r=0;t&&(r|=4),rs(n,e,r,t)}var ri="_reactListening"+Math.random().toString(36).slice(2);function ro(e){if(!e[ri]){e[ri]=!0,d.forEach(function(t){"selectionchange"!==t&&(n7.has(t)||rr(t,!1,e),rr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[ri]||(t[ri]=!0,rr("selectionchange",!1,t))}}function rs(e,t,n,r){switch(tV(t)){case 1:var i=t_;break;case 4:i=tB;break;default:i=tD}n=i.bind(null,t,n,e),i=void 0,e_&&("touchstart"===t||"touchmove"===t||"wheel"===t)&&(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function rl(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)t:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var l=r.stateNode.containerInfo;if(l===i||8===l.nodeType&&l.parentNode===i)break;if(4===s)for(s=r.return;null!==s;){var a=s.tag;if((3===a||4===a)&&((a=s.stateNode.containerInfo)===i||8===a.nodeType&&a.parentNode===i))return;s=s.return}for(;null!==l;){if(null===(s=rR(l)))return;if(5===(a=s.tag)||6===a){r=o=s;continue t}l=l.parentNode}}r=r.return}eL(function(){var r=o,i=eS(n),s=[];t:{var l=n3.get(e);if(void 0!==l){var a=t0,u=e;switch(e){case"keypress":if(0===tq(n))break t;case"keydown":case"keyup":a=no;break;case"focusin":u="focus",a=t4;break;case"focusout":u="blur",a=t4;break;case"beforeblur":case"afterblur":a=t4;break;case"click":if(2===n.button)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":a=t5;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":a=t6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":a=nl;break;case nZ:case n0:case n1:a=t8;break;case n2:a=na;break;case"scroll":a=t2;break;case"wheel":a=nu;break;case"copy":case"cut":case"paste":a=t9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":a=ns}var c=0!=(4&t),h=!c&&"scroll"===e,d=c?null!==l?l+"Capture":null:l;c=[];for(var f,p=r;null!==p;){var g=(f=p).stateNode;if(5===f.tag&&null!==g&&(f=g,null!==d&&null!=(g=eR(p,d))&&c.push(ra(p,g,f))),h)break;p=p.return}0<c.length&&(l=new a(l,u,null,n,i),s.push({event:l,listeners:c}))}}if(0==(7&t)){t:if(l="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e,!(l&&n!==eE&&(u=n.relatedTarget||n.fromElement)&&(rR(u)||u[rN]))){if((a||l)&&(l=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,a?(u=n.relatedTarget||n.toElement,a=r,null!==(u=u?rR(u):null)&&(h=eH(u),u!==h||5!==u.tag&&6!==u.tag)&&(u=null)):(a=null,u=r),a!==u)){if(c=t5,g="onMouseLeave",d="onMouseEnter",p="mouse",("pointerout"===e||"pointerover"===e)&&(c=ns,g="onPointerLeave",d="onPointerEnter",p="pointer"),h=null==a?l:rB(a),f=null==u?l:rB(u),(l=new c(g,p+"leave",a,n,i)).target=h,l.relatedTarget=f,g=null,rR(i)===r&&((c=new c(d,p+"enter",u,n,i)).target=f,c.relatedTarget=h,g=c),h=g,a&&u)n:{for(c=a,d=u,p=0,f=c;f;f=rc(f))p++;for(f=0,g=d;g;g=rc(g))f++;for(;0<p-f;)c=rc(c),p--;for(;0<f-p;)d=rc(d),f--;for(;p--;){if(c===d||null!==d&&c===d.alternate)break n;c=rc(c),d=rc(d)}c=null}else c=null;null!==a&&rh(s,l,a,c,!1),null!==u&&null!==h&&rh(s,h,u,c,!0)}}t:{if("select"===(a=(l=r?rB(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===a&&"file"===l.type)var m,y=nO;else if(nx(l)){if(nk)y=nR;else{y=nI;var b=nj}}else(a=l.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(y=nL);if(y&&(y=y(e,r))){nw(s,y,n,i);break t}b&&b(e,l,r),"focusout"===e&&(b=l._wrapperState)&&b.controlled&&"number"===l.type&&er(l,"number",l.value)}switch(b=r?rB(r):window,e){case"focusin":(nx(b)||"true"===b.contentEditable)&&(nU=b,nG=r,nH=null);break;case"focusout":nH=nG=nU=null;break;case"mousedown":nq=!0;break;case"contextmenu":case"mouseup":case"dragend":nq=!1,nW(s,n,i);break;case"selectionchange":if(n$)break;case"keydown":case"keyup":nW(s,n,i)}if(nh)n:{switch(e){case"compositionstart":var v="onCompositionStart";break n;case"compositionend":v="onCompositionEnd";break n;case"compositionupdate":v="onCompositionUpdate";break n}v=void 0}else nb?nm(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(np&&"ko"!==n.locale&&(nb||"onCompositionStart"!==v?"onCompositionEnd"===v&&nb&&(m=tH()):(tU="value"in(t$=i)?t$.value:t$.textContent,nb=!0)),0<(b=ru(r,v)).length&&(v=new t7(v,e,null,n,i),s.push({event:v,listeners:b}),m?v.data=m:null!==(m=ny(n))&&(v.data=m))),(m=nf?function(e,t){switch(e){case"compositionend":return ny(t);case"keypress":if(32!==t.which)return null;return ng=!0," ";case"textInput":return" "===(e=t.data)&&ng?null:e;default:return null}}(e,n):function(e,t){if(nb)return"compositionend"===e||!nh&&nm(e,t)?(e=tH(),tG=tU=t$=null,nb=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return np&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=ru(r,"onBeforeInput")).length&&(i=new t7("onBeforeInput","beforeinput",null,n,i),s.push({event:i,listeners:r}),i.data=m)}rt(s,t)})}function ra(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ru(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=eR(e,n))&&r.unshift(ra(e,o,i)),null!=(o=eR(e,t))&&r.push(ra(e,o,i))),e=e.return}return r}function rc(e){if(null===e)return null;do e=e.return;while(e&&5!==e.tag);return e||null}function rh(e,t,n,r,i){for(var o=t._reactName,s=[];null!==n&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(null!==a&&a===r)break;5===l.tag&&null!==u&&(l=u,i?null!=(a=eR(n,o))&&s.unshift(ra(n,a,l)):i||null!=(a=eR(n,o))&&s.push(ra(n,a,l))),n=n.return}0!==s.length&&e.push({event:t,listeners:s})}var rd=/\r\n?/g,rf=/\u0000|\uFFFD/g;function rp(e){return("string"==typeof e?e:""+e).replace(rd,"\n").replace(rf,"")}function rg(e,t,n){if(t=rp(t),rp(e)!==t&&n)throw Error(h(425))}function rm(){}var ry=null,rb=null;function rv(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var rx="function"==typeof setTimeout?setTimeout:void 0,rw="function"==typeof clearTimeout?clearTimeout:void 0,rC="function"==typeof Promise?Promise:void 0,rE="function"==typeof queueMicrotask?queueMicrotask:void 0!==rC?function(e){return rC.resolve(null).then(e).catch(rS)}:rx;function rS(e){setTimeout(function(){throw e})}function rP(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType){if("/$"===(n=i.data)){if(0===r){e.removeChild(i),tI(t);return}r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++}n=i}while(n);tI(t)}function rO(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function rk(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var rA=Math.random().toString(36).slice(2),rM="__reactFiber$"+rA,rT="__reactProps$"+rA,rN="__reactContainer$"+rA,rj="__reactEvents$"+rA,rI="__reactListeners$"+rA,rL="__reactHandles$"+rA;function rR(e){var t=e[rM];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rN]||n[rM]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=rk(e);null!==e;){if(n=e[rM])return n;e=rk(e)}return t}n=(e=n).parentNode}return null}function r_(e){return(e=e[rM]||e[rN])&&(5===e.tag||6===e.tag||13===e.tag||3===e.tag)?e:null}function rB(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(h(33))}function rD(e){return e[rT]||null}var rz=[],rF=-1;function rV(e){return{current:e}}function r$(e){0>rF||(e.current=rz[rF],rz[rF]=null,rF--)}function rU(e,t){rz[++rF]=e.current,e.current=t}var rG={},rH=rV(rG),rq=rV(!1),rW=rG;function rX(e,t){var n=e.type.contextTypes;if(!n)return rG;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rY(e){return null!=(e=e.childContextTypes)}function rJ(){r$(rq),r$(rH)}function rQ(e,t,n){if(rH.current!==rG)throw Error(h(168));rU(rH,t),rU(rq,n)}function rK(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(h(108,function(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return function e(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case M:return"Fragment";case A:return"Portal";case N:return"Profiler";case T:return"StrictMode";case R:return"Suspense";case _:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case I:return(t.displayName||"Context")+".Consumer";case j:return(t._context.displayName||"Context")+".Provider";case L:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case B:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case D:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}(t);case 8:return t===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}(e)||"Unknown",i));return U({},n,r)}function rZ(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rG,rW=rH.current,rU(rH,e),rU(rq,rq.current),!0}function r0(e,t,n){var r=e.stateNode;if(!r)throw Error(h(169));n?(e=rK(e,t,rW),r.__reactInternalMemoizedMergedChildContext=e,r$(rq),r$(rH),rU(rH,e)):r$(rq),rU(rq,n)}var r1=null,r2=!1,r3=!1;function r5(e){null===r1?r1=[e]:r1.push(e)}function r6(){if(!r3&&null!==r1){r3=!0;var e=0,t=tc;try{var n=r1;for(tc=1;e<n.length;e++){var r=n[e];do r=r(!0);while(null!==r)}r1=null,r2=!1}catch(t){throw null!==r1&&(r1=r1.slice(e+1)),eY(e1,r6),t}finally{tc=t,r3=!1}}return null}var r4=[],r8=0,r9=null,r7=0,ie=[],it=0,ir=null,ii=1,io="";function is(e,t){r4[r8++]=r7,r4[r8++]=r9,r9=e,r7=t}function il(e,t,n){ie[it++]=ii,ie[it++]=io,ie[it++]=ir,ir=e;var r=ii;e=io;var i=32-e9(r)-1;r&=~(1<<i),n+=1;var o=32-e9(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,ii=1<<32-e9(t)+i|n<<i|r,io=o+e}else ii=1<<o|n<<i|r,io=e}function ia(e){null!==e.return&&(is(e,1),il(e,1,0))}function iu(e){for(;e===r9;)r9=r4[--r8],r4[r8]=null,r7=r4[--r8],r4[r8]=null;for(;e===ir;)ir=ie[--it],ie[it]=null,io=ie[--it],ie[it]=null,ii=ie[--it],ie[it]=null}var ic=null,ih=null,id=!1,ip=null;function ig(e,t){var n=lJ(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function im(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ic=e,ih=rO(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ic=e,ih=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==ir?{id:ii,overflow:io}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:0x40000000},(n=lJ(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ic=e,ih=null,!0);default:return!1}}function iy(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function ib(e){if(id){var t=ih;if(t){var n=t;if(!im(e,t)){if(iy(e))throw Error(h(418));t=rO(n.nextSibling);var r=ic;t&&im(e,t)?ig(r,n):(e.flags=-4097&e.flags|2,id=!1,ic=e)}}else{if(iy(e))throw Error(h(418));e.flags=-4097&e.flags|2,id=!1,ic=e}}}function iv(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ic=e}function ix(e){if(e!==ic)return!1;if(!id)return iv(e),id=!0,!1;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!rv(e.type,e.memoizedProps)),t&&(t=ih)){if(iy(e))throw iw(),Error(h(418));for(;t;)ig(e,t),t=rO(t.nextSibling)}if(iv(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(h(317));t:{for(t=0,e=e.nextSibling;e;){if(8===e.nodeType){var t,n=e.data;if("/$"===n){if(0===t){ih=rO(e.nextSibling);break t}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ih=null}}else ih=ic?rO(e.stateNode.nextSibling):null;return!0}function iw(){for(var e=ih;e;)e=rO(e.nextSibling)}function iC(){ih=ic=null,id=!1}function iE(e){null===ip?ip=[e]:ip.push(e)}var iS=O.ReactCurrentBatchConfig;function iP(e,t){if(e&&e.defaultProps)for(var n in t=U({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var iO=rV(null),ik=null,iA=null,iM=null;function iT(){iM=iA=ik=null}function iN(e){var t=iO.current;r$(iO),e._currentValue=t}function ij(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function iI(e,t){ik=e,iM=iA=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(sa=!0),e.firstContext=null)}function iL(e){var t=e._currentValue;if(iM!==e){if(e={context:e,memoizedValue:t,next:null},null===iA){if(null===ik)throw Error(h(308));iA=e,ik.dependencies={lanes:0,firstContext:e}}else iA=iA.next=e}return t}var iR=null;function i_(e){null===iR?iR=[e]:iR.push(e)}function iB(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,i_(t)):(n.next=i.next,i.next=n),t.interleaved=n,iD(e,r)}function iD(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var iz=!1;function iF(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iV(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function i$(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function iU(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&s6)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,iD(e,n)}return null===(i=r.interleaved)?(t.next=t,i_(r)):(t.next=i.next,i.next=t),r.interleaved=t,iD(e,n)}function iG(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tu(e,n)}}function iH(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=s:o=o.next=s,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function iq(e,t,n,r){var i=e.updateQueue;iz=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(null!==l){i.shared.pending=null;var a=l,u=a.next;a.next=null,null===s?o=u:s.next=u,s=a;var c=e.alternate;null!==c&&(l=(c=c.updateQueue).lastBaseUpdate)!==s&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a)}if(null!==o){var h=i.baseState;for(s=0,c=u=a=null,l=o;;){var d=l.lane,f=l.eventTime;if((r&d)===d){null!==c&&(c=c.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var p=e,g=l;switch(d=t,f=n,g.tag){case 1:if("function"==typeof(p=g.payload)){h=p.call(f,h,d);break t}h=p;break t;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(d="function"==typeof(p=g.payload)?p.call(f,h,d):p))break t;h=U({},h,d);break t;case 2:iz=!0}}null!==l.callback&&0!==l.lane&&(e.flags|=64,null===(d=i.effects)?i.effects=[l]:d.push(l))}else f={eventTime:f,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=f,a=h):c=c.next=f,s|=d;if(null===(l=l.next)){if(null===(l=i.shared.pending))break;else l=(d=l).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}if(null===c&&(a=h),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do s|=i.lane,i=i.next;while(i!==t)}else null===o&&(i.shared.lanes=0);lr|=s,e.lanes=s,e.memoizedState=h}}function iW(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(h(191,i));i.call(r)}}}var iX=(new u.Component).refs;function iY(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:U({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var iJ={isMounted:function(e){return!!(e=e._reactInternals)&&eH(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=lw(),i=lC(e),o=i$(r,i);o.payload=t,null!=n&&(o.callback=n),null!==(t=iU(e,o,i))&&(lE(t,e,i,r),iG(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=lw(),i=lC(e),o=i$(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=iU(e,o,i))&&(lE(t,e,i,r),iG(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=lw(),r=lC(e),i=i$(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=iU(e,i,r))&&(lE(t,e,r,n),iG(t,e,r))}};function iQ(e,t,n,r,i,o,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,s):!t.prototype||!t.prototype.isPureReactComponent||!nB(n,r)||!nB(i,o)}function iK(e,t,n){var r=!1,i=rG,o=t.contextType;return"object"==typeof o&&null!==o?o=iL(o):(i=rY(t)?rW:rH.current,o=(r=null!=(r=t.contextTypes))?rX(e,i):rG),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=iJ,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function iZ(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&iJ.enqueueReplaceState(t,t.state,null)}function i0(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=iX,iF(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=iL(o):(o=rY(t)?rW:rH.current,i.context=rX(e,o)),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(iY(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&iJ.enqueueReplaceState(i,i.state,null),iq(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function i1(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(h(309));var r=n.stateNode}if(!r)throw Error(h(147,e));var i=r,o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:((t=function(e){var t=i.refs;t===iX&&(t=i.refs={}),null===e?delete t[o]:t[o]=e})._stringRef=o,t)}if("string"!=typeof e)throw Error(h(284));if(!n._owner)throw Error(h(290,e))}return e}function i2(e,t){throw Error(h(31,"[object Object]"===(e=Object.prototype.toString.call(t))?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function i3(e){return(0,e._init)(e._payload)}function i5(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=lK(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return(t.index=r,e)?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=l2(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function a(e,t,n,r){var o=n.type;return o===M?c(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===D&&i3(o)===t.type)?((r=i(t,n.props)).ref=i1(e,t,n),r.return=e,r):((r=lZ(n.type,n.key,n.props,null,e.mode,r)).ref=i1(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=l3(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function c(e,t,n,r,o){return null===t||7!==t.tag?((t=l0(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=l2(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return(n=lZ(t.type,t.key,t.props,null,e.mode,n)).ref=i1(e,null,t),n.return=e,n;case A:return(t=l3(t,e.mode,n)).return=e,t;case D:return d(e,(0,t._init)(t._payload),n)}if(ei(t)||V(t))return(t=l0(t,e.mode,n,null)).return=e,t;i2(e,t)}return null}function f(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===i?a(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case D:return f(e,t,(i=n._init)(n._payload),r)}if(ei(n)||V(n))return null!==i?null:c(e,t,n,r,null);i2(e,n)}return null}function p(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return a(t,e=e.get(null===r.key?n:r.key)||null,r,i);case A:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case D:return p(e,t,n,(0,r._init)(r._payload),i)}if(ei(r)||V(r))return c(t,e=e.get(n)||null,r,i,null);i2(t,r)}return null}return function l(a,u,c,g){if("object"==typeof c&&null!==c&&c.type===M&&null===c.key&&(c=c.props.children),"object"==typeof c&&null!==c){switch(c.$$typeof){case k:t:{for(var m=c.key,y=u;null!==y;){if(y.key===m){if((m=c.type)===M){if(7===y.tag){n(a,y.sibling),(u=i(y,c.props.children)).return=a,a=u;break t}}else if(y.elementType===m||"object"==typeof m&&null!==m&&m.$$typeof===D&&i3(m)===y.type){n(a,y.sibling),(u=i(y,c.props)).ref=i1(a,y,c),u.return=a,a=u;break t}n(a,y);break}t(a,y);y=y.sibling}c.type===M?((u=l0(c.props.children,a.mode,g,c.key)).return=a,a=u):((g=lZ(c.type,c.key,c.props,null,a.mode,g)).ref=i1(a,u,c),g.return=a,a=g)}return s(a);case A:t:{for(y=c.key;null!==u;){if(u.key===y){if(4===u.tag&&u.stateNode.containerInfo===c.containerInfo&&u.stateNode.implementation===c.implementation){n(a,u.sibling),(u=i(u,c.children||[])).return=a,a=u;break t}else{n(a,u);break}}t(a,u);u=u.sibling}(u=l3(c,a.mode,g)).return=a,a=u}return s(a);case D:return l(a,u,(y=c._init)(c._payload),g)}if(ei(c))return function(i,s,l,a){for(var u=null,c=null,h=s,g=s=0,m=null;null!==h&&g<l.length;g++){h.index>g?(m=h,h=null):m=h.sibling;var y=f(i,h,l[g],a);if(null===y){null===h&&(h=m);break}e&&h&&null===y.alternate&&t(i,h),s=o(y,s,g),null===c?u=y:c.sibling=y,c=y,h=m}if(g===l.length)return n(i,h),id&&is(i,g),u;if(null===h){for(;g<l.length;g++)null!==(h=d(i,l[g],a))&&(s=o(h,s,g),null===c?u=h:c.sibling=h,c=h);return id&&is(i,g),u}for(h=r(i,h);g<l.length;g++)null!==(m=p(h,i,g,l[g],a))&&(e&&null!==m.alternate&&h.delete(null===m.key?g:m.key),s=o(m,s,g),null===c?u=m:c.sibling=m,c=m);return e&&h.forEach(function(e){return t(i,e)}),id&&is(i,g),u}(a,u,c,g);if(V(c))return function(i,s,l,a){var u=V(l);if("function"!=typeof u)throw Error(h(150));if(null==(l=u.call(l)))throw Error(h(151));for(var c=u=null,g=s,m=s=0,y=null,b=l.next();null!==g&&!b.done;m++,b=l.next()){g.index>m?(y=g,g=null):y=g.sibling;var v=f(i,g,b.value,a);if(null===v){null===g&&(g=y);break}e&&g&&null===v.alternate&&t(i,g),s=o(v,s,m),null===c?u=v:c.sibling=v,c=v,g=y}if(b.done)return n(i,g),id&&is(i,m),u;if(null===g){for(;!b.done;m++,b=l.next())null!==(b=d(i,b.value,a))&&(s=o(b,s,m),null===c?u=b:c.sibling=b,c=b);return id&&is(i,m),u}for(g=r(i,g);!b.done;m++,b=l.next())null!==(b=p(g,i,m,b.value,a))&&(e&&null!==b.alternate&&g.delete(null===b.key?m:b.key),s=o(b,s,m),null===c?u=b:c.sibling=b,c=b);return e&&g.forEach(function(e){return t(i,e)}),id&&is(i,m),u}(a,u,c,g);i2(a,c)}return"string"==typeof c&&""!==c||"number"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(a,u.sibling),(u=i(u,c)).return=a):(n(a,u),(u=l2(c,a.mode,g)).return=a),s(a=u)):n(a,u)}}var i6=i5(!0),i4=i5(!1),i8={},i9=rV(i8),i7=rV(i8),oe=rV(i8);function ot(e){if(e===i8)throw Error(h(174));return e}function on(e,t){switch(rU(oe,t),rU(i7,e),rU(i9,i8),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:eh(null,"");break;default:t=(e=8===e?t.parentNode:t).namespaceURI||null,t=eh(t,e=e.tagName)}r$(i9),rU(i9,t)}function or(){r$(i9),r$(i7),r$(oe)}function oi(e){ot(oe.current);var t=ot(i9.current),n=eh(t,e.type);t!==n&&(rU(i7,e),rU(i9,n))}function oo(e){i7.current===e&&(r$(i9),r$(i7))}var os=rV(0);function ol(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oa=[];function ou(){for(var e=0;e<oa.length;e++)oa[e]._workInProgressVersionPrimary=null;oa.length=0}var oc=O.ReactCurrentDispatcher,oh=O.ReactCurrentBatchConfig,od=0,of=null,op=null,og=null,om=!1,oy=!1,ob=0,ov=0;function ox(){throw Error(h(321))}function ow(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!n_(e[n],t[n]))return!1;return!0}function oC(e,t,n,r,i,o){if(od=o,of=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oc.current=null===e||null===e.memoizedState?o6:o4,e=n(r,i),oy){o=0;do{if(oy=!1,ob=0,25<=o)throw Error(h(301));o+=1,og=op=null,t.updateQueue=null,oc.current=o8,e=n(r,i)}while(oy)}if(oc.current=o5,t=null!==op&&null!==op.next,od=0,og=op=of=null,om=!1,t)throw Error(h(300));return e}function oE(){var e=0!==ob;return ob=0,e}function oS(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===og?of.memoizedState=og=e:og=og.next=e,og}function oP(){if(null===op){var e=of.alternate;e=null!==e?e.memoizedState:null}else e=op.next;var t=null===og?of.memoizedState:og.next;if(null!==t)og=t,op=e;else{if(null===e)throw Error(h(310));e={memoizedState:(op=e).memoizedState,baseState:op.baseState,baseQueue:op.baseQueue,queue:op.queue,next:null},null===og?of.memoizedState=og=e:og=og.next=e}return og}function oO(e,t){return"function"==typeof t?t(e):t}function ok(e){var t=oP(),n=t.queue;if(null===n)throw Error(h(311));n.lastRenderedReducer=e;var r=op,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){o=i.next,r=r.baseState;var l=s=null,a=null,u=o;do{var c=u.lane;if((od&c)===c)null!==a&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===a?(l=a=d,s=r):a=a.next=d,of.lanes|=c,lr|=c}u=u.next}while(null!==u&&u!==o);null===a?s=r:a.next=l,n_(r,t.memoizedState)||(sa=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do o=i.lane,of.lanes|=o,lr|=o,i=i.next;while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function oA(e){var t=oP(),n=t.queue;if(null===n)throw Error(h(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);n_(o,t.memoizedState)||(sa=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function oM(){}function oT(e,t){var n=of,r=oP(),i=t(),o=!n_(r.memoizedState,i);if(o&&(r.memoizedState=i,sa=!0),r=r.queue,o$(oI.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==og&&1&og.memoizedState.tag){if(n.flags|=2048,oB(9,oj.bind(null,n,r,i,t),void 0,null),null===s4)throw Error(h(349));0!=(30&od)||oN(n,t,i)}return i}function oN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=of.updateQueue)?(t={lastEffect:null,stores:null},of.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function oj(e,t,n,r){t.value=n,t.getSnapshot=r,oL(t)&&oR(e)}function oI(e,t,n){return n(function(){oL(t)&&oR(e)})}function oL(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!n_(e,n)}catch(e){return!0}}function oR(e){var t=iD(e,1);null!==t&&lE(t,e,1,-1)}function o_(e){var t=oS();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:oO,lastRenderedState:e},t.queue=e,e=e.dispatch=o0.bind(null,of,e),[t.memoizedState,e]}function oB(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=of.updateQueue)?(t={lastEffect:null,stores:null},of.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function oD(){return oP().memoizedState}function oz(e,t,n,r){var i=oS();of.flags|=e,i.memoizedState=oB(1|t,n,void 0,void 0===r?null:r)}function oF(e,t,n,r){var i=oP();r=void 0===r?null:r;var o=void 0;if(null!==op){var s=op.memoizedState;if(o=s.destroy,null!==r&&ow(r,s.deps)){i.memoizedState=oB(t,n,o,r);return}}of.flags|=e,i.memoizedState=oB(1|t,n,o,r)}function oV(e,t){return oz(8390656,8,e,t)}function o$(e,t){return oF(2048,8,e,t)}function oU(e,t){return oF(4,2,e,t)}function oG(e,t){return oF(4,4,e,t)}function oH(e,t){return"function"==typeof t?(t(e=e()),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function oq(e,t,n){return n=null!=n?n.concat([e]):null,oF(4,4,oH.bind(null,t,e),n)}function oW(){}function oX(e,t){var n=oP();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ow(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function oY(e,t){var n=oP();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ow(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function oJ(e,t,n){return 0==(21&od)?(e.baseState&&(e.baseState=!1,sa=!0),e.memoizedState=n):(n_(n,t)||(n=ts(),of.lanes|=n,lr|=n,e.baseState=!0),t)}function oQ(e,t){var n=tc;tc=0!==n&&4>n?n:4,e(!0);var r=oh.transition;oh.transition={};try{e(!1),t()}finally{tc=n,oh.transition=r}}function oK(){return oP().memoizedState}function oZ(e,t,n){var r=lC(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},o1(e)?o2(t,n):null!==(n=iB(e,t,n,r))&&(lE(n,e,r,lw()),o3(n,t,r))}function o0(e,t,n){var r=lC(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(o1(e))o2(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,n_(l,s)){var a=t.interleaved;null===a?(i.next=i,i_(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch(e){}finally{}null!==(n=iB(e,t,i,r))&&(lE(n,e,r,i=lw()),o3(n,t,r))}}function o1(e){var t=e.alternate;return e===of||null!==t&&t===of}function o2(e,t){oy=om=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function o3(e,t,n){if(0!=(4194240&n)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tu(e,n)}}var o5={readContext:iL,useCallback:ox,useContext:ox,useEffect:ox,useImperativeHandle:ox,useInsertionEffect:ox,useLayoutEffect:ox,useMemo:ox,useReducer:ox,useRef:ox,useState:ox,useDebugValue:ox,useDeferredValue:ox,useTransition:ox,useMutableSource:ox,useSyncExternalStore:ox,useId:ox,unstable_isNewReconciler:!1},o6={readContext:iL,useCallback:function(e,t){return oS().memoizedState=[e,void 0===t?null:t],e},useContext:iL,useEffect:oV,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,oz(4194308,4,oH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return oz(4194308,4,e,t)},useInsertionEffect:function(e,t){return oz(4,2,e,t)},useMemo:function(e,t){var n=oS();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=oS();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=oZ.bind(null,of,e),[r.memoizedState,e]},useRef:function(e){var t=oS();return e={current:e},t.memoizedState=e},useState:o_,useDebugValue:oW,useDeferredValue:function(e){return oS().memoizedState=e},useTransition:function(){var e=o_(!1),t=e[0];return e=oQ.bind(null,e[1]),oS().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=of,i=oS();if(id){if(void 0===n)throw Error(h(407));n=n()}else{if(n=t(),null===s4)throw Error(h(349));0!=(30&od)||oN(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,oV(oI.bind(null,r,o,e),[e]),r.flags|=2048,oB(9,oj.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=oS(),t=s4.identifierPrefix;if(id){var n=io,r=ii;t=":"+t+"R"+(n=(r&~(1<<32-e9(r)-1)).toString(32)+n),0<(n=ob++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ov++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},o4={readContext:iL,useCallback:oX,useContext:iL,useEffect:o$,useImperativeHandle:oq,useInsertionEffect:oU,useLayoutEffect:oG,useMemo:oY,useReducer:ok,useRef:oD,useState:function(){return ok(oO)},useDebugValue:oW,useDeferredValue:function(e){return oJ(oP(),op.memoizedState,e)},useTransition:function(){return[ok(oO)[0],oP().memoizedState]},useMutableSource:oM,useSyncExternalStore:oT,useId:oK,unstable_isNewReconciler:!1},o8={readContext:iL,useCallback:oX,useContext:iL,useEffect:o$,useImperativeHandle:oq,useInsertionEffect:oU,useLayoutEffect:oG,useMemo:oY,useReducer:oA,useRef:oD,useState:function(){return oA(oO)},useDebugValue:oW,useDeferredValue:function(e){var t=oP();return null===op?t.memoizedState=e:oJ(t,op.memoizedState,e)},useTransition:function(){return[oA(oO)[0],oP().memoizedState]},useMutableSource:oM,useSyncExternalStore:oT,useId:oK,unstable_isNewReconciler:!1};function o9(e,t){try{var n="",r=t;do n+=function(e){switch(e.tag){case 5:return G(e.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1);case 11:return e=q(e.type.render,!1);case 1:return e=q(e.type,!0);default:return""}}(r),r=r.return;while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function o7(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function se(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var st="function"==typeof WeakMap?WeakMap:Map;function sn(e,t,n){(n=i$(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){lh||(lh=!0,ld=r),se(e,t)},n}function sr(e,t,n){(n=i$(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){se(e,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){se(e,t),"function"!=typeof r&&(null===lf?lf=new Set([this]):lf.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}function si(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new st;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=lG.bind(null,e,t,n),t.then(e,e))}function so(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ss(e,t,n,r,i){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=i$(-1,1)).tag=2,iU(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var sl=O.ReactCurrentOwner,sa=!1;function su(e,t,n,r){t.child=null===e?i4(t,null,n,r):i6(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var o=t.ref;return(iI(t,i),r=oC(e,t,n,r,o,i),n=oE(),null===e||sa)?(id&&n&&ia(t),t.flags|=1,su(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,sM(e,t,i))}function sh(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||lQ(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=lZ(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,sd(e,t,o,r,i))}if(o=e.child,0==(e.lanes&i)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:nB)(s,r)&&e.ref===t.ref)return sM(e,t,i)}return t.flags|=1,(e=lK(o,r)).ref=t.ref,e.return=t,t.child=e}function sd(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(nB(o,r)&&e.ref===t.ref){if(sa=!1,t.pendingProps=r=o,0==(e.lanes&i))return t.lanes=e.lanes,sM(e,t,i);else 0!=(131072&e.flags)&&(sa=!0)}}return sg(e,t,n,r,i)}function sf(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode){if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},rU(le,s7),s7|=n;else{if(0==(0x40000000&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=0x40000000,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,rU(le,s7),s7|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,rU(le,s7),s7|=r}}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,rU(le,s7),s7|=r;return su(e,t,i,n),t.child}function sp(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function sg(e,t,n,r,i){var o=rY(n)?rW:rH.current;return(o=rX(t,o),iI(t,i),n=oC(e,t,n,r,o,i),r=oE(),null===e||sa)?(id&&r&&ia(t),t.flags|=1,su(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,sM(e,t,i))}function sm(e,t,n,r,i){if(rY(n)){var o=!0;rZ(t)}else o=!1;if(iI(t,i),null===t.stateNode)sA(e,t),iK(t,n,r),i0(t,n,r,i),r=!0;else if(null===e){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;u="object"==typeof u&&null!==u?iL(u):rX(t,u=rY(n)?rW:rH.current);var c=n.getDerivedStateFromProps,h="function"==typeof c||"function"==typeof s.getSnapshotBeforeUpdate;h||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(l!==r||a!==u)&&iZ(t,s,r,u),iz=!1;var d=t.memoizedState;s.state=d,iq(t,r,s,i),a=t.memoizedState,l!==r||d!==a||rq.current||iz?("function"==typeof c&&(iY(t,n,c,r),a=t.memoizedState),(l=iz||iQ(t,n,l,r,d,a,u))?(h||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):("function"==typeof s.componentDidMount&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,iV(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:iP(t.type,l),s.props=u,h=t.pendingProps,d=s.context,a="object"==typeof(a=n.contextType)&&null!==a?iL(a):rX(t,a=rY(n)?rW:rH.current);var f=n.getDerivedStateFromProps;(c="function"==typeof f||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(l!==h||d!==a)&&iZ(t,s,r,a),iz=!1,d=t.memoizedState,s.state=d,iq(t,r,s,i);var p=t.memoizedState;l!==h||d!==p||rq.current||iz?("function"==typeof f&&(iY(t,n,f,r),p=t.memoizedState),(u=iz||iQ(t,n,u,r,d,p,a)||!1)?(c||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(r,p,a),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,p,a)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=a,r=u):("function"!=typeof s.componentDidUpdate||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return sy(e,t,n,r,o,i)}function sy(e,t,n,r,i,o){sp(e,t);var s=0!=(128&t.flags);if(!r&&!s)return i&&r0(t,n,!1),sM(e,t,o);r=t.stateNode,sl.current=t;var l=s&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&s?(t.child=i6(t,e.child,null,o),t.child=i6(t,null,l,o)):su(e,t,l,o),t.memoizedState=r.state,i&&r0(t,n,!0),t.child}function sb(e){var t=e.stateNode;t.pendingContext?rQ(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rQ(e,t.context,!1),on(e,t.containerInfo)}function sv(e,t,n,r,i){return iC(),iE(i),t.flags|=256,su(e,t,n,r),t.child}var sx={dehydrated:null,treeContext:null,retryLane:0};function sw(e){return{baseLanes:e,cachePool:null,transitions:null}}function sC(e,t,n){var r,i=t.pendingProps,o=os.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(s=!0,t.flags&=-129):(null===e||null!==e.memoizedState)&&(o|=1),rU(os,1&o),null===e)return(ib(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated))?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=0x40000000,null):(l=i.children,e=i.fallback,s?(i=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=l1(l,i,0,null),e=l0(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=sw(n),t.memoizedState=sx,e):sE(t,l));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,i,o,s){if(n)return 256&t.flags?(t.flags&=-257,sS(e,t,s,r=o7(Error(h(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=l1({mode:"visible",children:r.children},i,0,null),o=l0(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,0!=(1&t.mode)&&i6(t,e.child,null,s),t.child.memoizedState=sw(s),t.memoizedState=sx,o);if(0==(1&t.mode))return sS(e,t,s,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var l=r.dgst;return r=l,sS(e,t,s,r=o7(o=Error(h(419)),r,void 0))}if(l=0!=(s&e.childLanes),sa||l){if(null!==(r=s4)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 0x1000000:case 0x2000000:case 0x4000000:i=32;break;case 0x20000000:i=0x10000000;break;default:i=0}0!==(i=0!=(i&(r.suspendedLanes|s))?0:i)&&i!==o.retryLane&&(o.retryLane=i,iD(e,i),lE(r,e,i,-1))}return l_(),sS(e,t,s,r=o7(Error(h(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=lq.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ih=rO(i.nextSibling),ic=t,id=!0,ip=null,null!==e&&(ie[it++]=ii,ie[it++]=io,ie[it++]=ir,ii=e.id,io=e.overflow,ir=t),t=sE(t,r.children),t.flags|=4096,t)}(e,t,l,i,r,o,n);if(s){s=i.fallback,l=t.mode,r=(o=e.child).sibling;var a={mode:"hidden",children:i.children};return 0==(1&l)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=a,t.deletions=null):(i=lK(o,a)).subtreeFlags=0xe00000&o.subtreeFlags,null!==r?s=lK(r,s):(s=l0(s,l,n,null),s.flags|=2),s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,l=null===(l=e.child.memoizedState)?sw(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=sx,i}return e=(s=e.child).sibling,i=lK(s,{mode:"visible",children:i.children}),0==(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function sE(e,t){return(t=l1({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function sS(e,t,n,r){return null!==r&&iE(r),i6(t,e.child,null,n),e=sE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sP(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ij(e.return,t,n)}function sO(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function sk(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(su(e,t,r.children,n),0!=(2&(r=os.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))t:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&sP(e,n,t);else if(19===e.tag)sP(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(rU(os,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(i=null,n=t.child;null!==n;)null!==(e=n.alternate)&&null===ol(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sO(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ol(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sO(t,!0,n,null,o);break;case"together":sO(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sA(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sM(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),lr|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(h(153));if(null!==t.child){for(n=lK(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=lK(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function sT(e,t){if(!id)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function sN(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=0xe00000&i.subtreeFlags,r|=0xe00000&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}i=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},o=function(){},s=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ot(i9.current);var o,s=null;switch(n){case"input":i=K(e,i),r=K(e,r),s=[];break;case"select":i=U({},i,{value:void 0}),r=U({},r,{value:void 0}),s=[];break;case"textarea":i=es(e,i),r=es(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=rm)}for(u in ew(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u]){if("style"===u){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(f.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null))}for(u in r){var a=r[u];if(l=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(null!=a||null!=l)){if("style"===u){if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(s||(s=[]),s.push(u,n)),n=a}else"dangerouslySetInnerHTML"===u?(a=a?a.__html:void 0,l=l?l.__html:void 0,null!=a&&l!==a&&(s=s||[]).push(u,a)):"children"===u?"string"!=typeof a&&"number"!=typeof a||(s=s||[]).push(u,""+a):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(f.hasOwnProperty(u)?(null!=a&&"onScroll"===u&&rn("scroll",e),s||l===a||(s=[])):(s=s||[]).push(u,a))}}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},l=function(e,t,n,r){n!==r&&(t.flags|=4)};var sj=!1,sI=!1,sL="function"==typeof WeakSet?WeakSet:Set,sR=null;function s_(e,t){var n=e.ref;if(null!==n){if("function"==typeof n)try{n(null)}catch(n){lU(e,t,n)}else n.current=null}}function sB(e,t,n){try{n()}catch(n){lU(e,t,n)}}var sD=!1;function sz(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&sB(t,n,o)}i=i.next}while(i!==r)}}function sF(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sV(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag;e=n;"function"==typeof t?t(e):t.current=e}}function s$(e){return 5===e.tag||3===e.tag||4===e.tag}function sU(e){t:for(;;){for(;null===e.sibling;){if(null===e.return||s$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue t;if(null===e.child||4===e.tag)continue t;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}var sG=null,sH=!1;function sq(e,t,n){for(n=n.child;null!==n;)sW(e,t,n),n=n.sibling}function sW(e,t,n){if(e8&&"function"==typeof e8.onCommitFiberUnmount)try{e8.onCommitFiberUnmount(e4,n)}catch(e){}switch(n.tag){case 5:sI||s_(n,t);case 6:var r=sG,i=sH;sG=null,sq(e,t,n),sG=r,sH=i,null!==sG&&(sH?(e=sG,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):sG.removeChild(n.stateNode));break;case 18:null!==sG&&(sH?(e=sG,n=n.stateNode,8===e.nodeType?rP(e.parentNode,n):1===e.nodeType&&rP(e,n),tI(e)):rP(sG,n.stateNode));break;case 4:r=sG,i=sH,sG=n.stateNode.containerInfo,sH=!0,sq(e,t,n),sG=r,sH=i;break;case 0:case 11:case 14:case 15:if(!sI&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,void 0!==s&&(0!=(2&o)?sB(n,t,s):0!=(4&o)&&sB(n,t,s)),i=i.next}while(i!==r)}sq(e,t,n);break;case 1:if(!sI&&(s_(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){lU(n,t,e)}sq(e,t,n);break;case 21:default:sq(e,t,n);break;case 22:1&n.mode?(sI=(r=sI)||null!==n.memoizedState,sq(e,t,n),sI=r):sq(e,t,n)}}function sX(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new sL),t.forEach(function(t){var r=lW.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function sY(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,s=o;t:for(;null!==s;){switch(s.tag){case 5:sG=s.stateNode,sH=!1;break t;case 3:case 4:sG=s.stateNode.containerInfo,sH=!0;break t}s=s.return}if(null===sG)throw Error(h(160));sW(e,o,i),sG=null,sH=!1;var l=i.alternate;null!==l&&(l.return=null),i.return=null}catch(e){lU(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)sJ(t,e),t=t.sibling}function sJ(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sY(t,e),sQ(e),4&r){try{sz(3,e,e.return),sF(3,e)}catch(t){lU(e,e.return,t)}try{sz(5,e,e.return)}catch(t){lU(e,e.return,t)}}break;case 1:sY(t,e),sQ(e),512&r&&null!==n&&s_(n,n.return);break;case 5:if(sY(t,e),sQ(e),512&r&&null!==n&&s_(n,n.return),32&e.flags){var i=e.stateNode;try{eg(i,"")}catch(t){lU(e,e.return,t)}}if(4&r&&null!=(i=e.stateNode)){var o=e.memoizedProps,s=null!==n?n.memoizedProps:o,l=e.type,a=e.updateQueue;if(e.updateQueue=null,null!==a)try{"input"===l&&"radio"===o.type&&null!=o.name&&ee(i,o),eC(l,s);var u=eC(l,o);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];"style"===c?ev(i,d):"dangerouslySetInnerHTML"===c?ep(i,d):"children"===c?eg(i,d):P(i,c,d,u)}switch(l){case"input":et(i,o);break;case"textarea":ea(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var p=o.value;null!=p?eo(i,!!o.multiple,p,!1):!!o.multiple!==f&&(null!=o.defaultValue?eo(i,!!o.multiple,o.defaultValue,!0):eo(i,!!o.multiple,o.multiple?[]:"",!1))}i[rT]=o}catch(t){lU(e,e.return,t)}}break;case 6:if(sY(t,e),sQ(e),4&r){if(null===e.stateNode)throw Error(h(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(t){lU(e,e.return,t)}}break;case 3:if(sY(t,e),sQ(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{tI(t.containerInfo)}catch(t){lU(e,e.return,t)}break;case 4:default:sY(t,e),sQ(e);break;case 13:sY(t,e),sQ(e),8192&(i=e.child).flags&&(o=null!==i.memoizedState,i.stateNode.isHidden=o,o&&(null===i.alternate||null===i.alternate.memoizedState)&&(la=eZ())),4&r&&sX(e);break;case 22:if(c=null!==n&&null!==n.memoizedState,1&e.mode?(sI=(u=sI)||c,sY(t,e),sI=u):sY(t,e),sQ(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!c&&0!=(1&e.mode))for(sR=e,c=e.child;null!==c;){for(d=sR=c;null!==sR;){switch(p=(f=sR).child,f.tag){case 0:case 11:case 14:case 15:sz(4,f,f.return);break;case 1:s_(f,f.return);var g=f.stateNode;if("function"==typeof g.componentWillUnmount){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){lU(r,n,e)}}break;case 5:s_(f,f.return);break;case 22:if(null!==f.memoizedState){sZ(d);continue}}null!==p?(p.return=f,sR=p):sZ(d)}c=c.sibling}t:for(c=null,d=e;;){if(5===d.tag){if(null===c){c=d;try{i=d.stateNode,u?(o=i.style,"function"==typeof o.setProperty?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,s=null!=(a=d.memoizedProps.style)&&a.hasOwnProperty("display")?a.display:null,l.style.display=eb("display",s))}catch(t){lU(e,e.return,t)}}}else if(6===d.tag){if(null===c)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(t){lU(e,e.return,t)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break;for(;null===d.sibling;){if(null===d.return||d.return===e)break t;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:sY(t,e),sQ(e),4&r&&sX(e);case 21:}}function sQ(e){var t=e.flags;if(2&t){try{t:{for(var n=e.return;null!==n;){if(s$(n)){var r=n;break t}n=n.return}throw Error(h(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(eg(i,""),r.flags&=-33);var o=sU(e);!function e(t,n,r){var i=t.tag;if(5===i||6===i)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==i&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=sU(e);!function e(t,n,r){var i=t.tag;if(5===i||6===i)t=t.stateNode,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!=(r=r._reactRootContainer)||null!==n.onclick||(n.onclick=rm));else if(4!==i&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,l,s);break;default:throw Error(h(161))}}catch(t){lU(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function sK(e){for(;null!==sR;){var t=sR;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:sI||sF(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!sI){if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:iP(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;null!==o&&iW(t,o,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}iW(t,s,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var c=u.memoizedState;if(null!==c){var d=c.dehydrated;null!==d&&tI(d)}}}break;default:throw Error(h(163))}sI||512&t.flags&&sV(t)}catch(e){lU(t,t.return,e)}}if(t===e){sR=null;break}if(null!==(n=t.sibling)){n.return=t.return,sR=n;break}sR=t.return}}function sZ(e){for(;null!==sR;){var t=sR;if(t===e){sR=null;break}var n=t.sibling;if(null!==n){n.return=t.return,sR=n;break}sR=t.return}}function s0(e){for(;null!==sR;){var t=sR;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{sF(4,t)}catch(e){lU(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){lU(t,i,e)}}var o=t.return;try{sV(t)}catch(e){lU(t,o,e)}break;case 5:var s=t.return;try{sV(t)}catch(e){lU(t,s,e)}}}catch(e){lU(t,t.return,e)}if(t===e){sR=null;break}var l=t.sibling;if(null!==l){l.return=t.return,sR=l;break}sR=t.return}}var s1=Math.ceil,s2=O.ReactCurrentDispatcher,s3=O.ReactCurrentOwner,s5=O.ReactCurrentBatchConfig,s6=0,s4=null,s8=null,s9=0,s7=0,le=rV(0),lt=0,ln=null,lr=0,li=0,lo=0,ls=null,ll=null,la=0,lu=1/0,lc=null,lh=!1,ld=null,lf=null,lp=!1,lg=null,lm=0,ly=0,lb=null,lv=-1,lx=0;function lw(){return 0!=(6&s6)?eZ():-1!==lv?lv:lv=eZ()}function lC(e){return 0==(1&e.mode)?1:0!=(2&s6)&&0!==s9?s9&-s9:null!==iS.transition?(0===lx&&(lx=ts()),lx):0!==(e=tc)?e:e=void 0===(e=window.event)?16:tV(e.type)}function lE(e,t,n,r){if(50<ly)throw ly=0,lb=null,Error(h(185));ta(e,n,r),(0==(2&s6)||e!==s4)&&(e===s4&&(0==(2&s6)&&(li|=n),4===lt&&lA(e,s9)),lS(e,r),1===n&&0===s6&&0==(1&t.mode)&&(lu=eZ()+500,r2&&r6()))}function lS(e,t){var n,r=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-e9(o),l=1<<s,a=i[s];-1===a?(0==(l&n)||0!=(l&r))&&(i[s]=function(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return -1}}(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}(e,t);var i=ti(e,e===s4?s9:0);if(0===i)null!==r&&eJ(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(null!=r&&eJ(r),1===t){;0===e.tag?(n=lM.bind(null,e),r2=!0,r5(n)):r5(lM.bind(null,e)),rE(function(){0==(6&s6)&&r6()}),r=null}else{switch(th(i)){case 1:r=e1;break;case 4:r=e2;break;case 16:default:r=e3;break;case 0x20000000:r=e6}r=function(e,t){return eY(e,t)}(r,lP.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function lP(e,t){if(lv=-1,lx=0,0!=(6&s6))throw Error(h(327));var n=e.callbackNode;if(lV()&&e.callbackNode!==n)return null;var r=ti(e,e===s4?s9:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=lB(e,r);else{t=r;var i=s6;s6|=2;var o=lR();for((s4!==e||s9!==t)&&(lc=null,lu=eZ()+500,lI(e,t));;)try{(function(){for(;null!==s8&&!eQ();)lD(s8)})();break}catch(t){lL(e,t)}iT(),s2.current=o,s6=i,null!==s8?t=0:(s4=null,s9=0,t=lt)}if(0!==t){if(2===t&&0!==(i=to(e))&&(r=i,t=lO(e,i)),1===t)throw n=ln,lI(e,0),lA(e,r),lS(e,eZ()),n;if(6===t)lA(e,r);else{if(i=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!n_(o(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=lB(e,r))&&0!==(o=to(e))&&(r=o,t=lO(e,o)),1===t))throw n=ln,lI(e,0),lA(e,r),lS(e,eZ()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(h(345));case 2:case 5:lF(e,ll,lc);break;case 3:if(lA(e,r),(0x7c00000&r)===r&&10<(t=la+500-eZ())){if(0!==ti(e,0))break;if(((i=e.suspendedLanes)&r)!==r){lw(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=rx(lF.bind(null,e,ll,lc),t);break}lF(e,ll,lc);break;case 4:if(lA(e,r),(4194240&r)===r)break;for(i=-1,t=e.eventTimes;0<r;){var s=31-e9(r);o=1<<s,(s=t[s])>i&&(i=s),r&=~o}if(r=i,10<(r=(120>(r=eZ()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*s1(r/1960))-r)){e.timeoutHandle=rx(lF.bind(null,e,ll,lc),r);break}lF(e,ll,lc);break;default:throw Error(h(329))}}}return lS(e,eZ()),e.callbackNode===n?lP.bind(null,e):null}function lO(e,t){var n=ls;return e.current.memoizedState.isDehydrated&&(lI(e,t).flags|=256),2!==(e=lB(e,t))&&(t=ll,ll=n,null!==t&&lk(t)),e}function lk(e){null===ll?ll=e:ll.push.apply(ll,e)}function lA(e,t){for(t&=~lo,t&=~li,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-e9(t),r=1<<n;e[n]=-1,t&=~r}}function lM(e){if(0!=(6&s6))throw Error(h(327));lV();var t=ti(e,0);if(0==(1&t))return lS(e,eZ()),null;var n=lB(e,t);if(0!==e.tag&&2===n){var r=to(e);0!==r&&(t=r,n=lO(e,r))}if(1===n)throw n=ln,lI(e,0),lA(e,t),lS(e,eZ()),n;if(6===n)throw Error(h(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,lF(e,ll,lc),lS(e,eZ()),null}function lT(e,t){var n=s6;s6|=1;try{return e(t)}finally{0===(s6=n)&&(lu=eZ()+500,r2&&r6())}}function lN(e){null!==lg&&0===lg.tag&&0==(6&s6)&&lV();var t=s6;s6|=1;var n=s5.transition,r=tc;try{if(s5.transition=null,tc=1,e)return e()}finally{tc=r,s5.transition=n,0==(6&(s6=t))&&r6()}}function lj(){s7=le.current,r$(le)}function lI(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,rw(n)),null!==s8)for(n=s8.return;null!==n;){var r=n;switch(iu(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&rJ();break;case 3:or(),r$(rq),r$(rH),ou();break;case 5:oo(r);break;case 4:or();break;case 13:case 19:r$(os);break;case 10:iN(r.type._context);break;case 22:case 23:lj()}n=n.return}if(s4=e,s8=e=lK(e.current,null),s9=s7=t,lt=0,ln=null,lo=li=lr=0,ll=ls=null,null!==iR){for(t=0;t<iR.length;t++)if(null!==(r=(n=iR[t]).interleaved)){n.interleaved=null;var i=r.next,o=n.pending;if(null!==o){var s=o.next;o.next=i,r.next=s}n.pending=r}iR=null}return e}function lL(e,t){for(;;){var n=s8;try{if(iT(),oc.current=o5,om){for(var r=of.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}om=!1}if(od=0,og=op=of=null,oy=!1,ob=0,s3.current=null,null===n||null===n.return){lt=1,ln=t,s8=null;break}t:{var o=e,s=n.return,l=n,a=t;if(t=s9,l.flags|=32768,null!==a&&"object"==typeof a&&"function"==typeof a.then){var u=a,c=l,d=c.tag;if(0==(1&c.mode)&&(0===d||11===d||15===d)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=so(s);if(null!==p){p.flags&=-257,ss(p,s,l,o,t),1&p.mode&&si(o,u,t),t=p,a=u;var g=t.updateQueue;if(null===g){var m=new Set;m.add(a),t.updateQueue=m}else g.add(a);break t}if(0==(1&t)){si(o,u,t),l_();break t}a=Error(h(426))}else if(id&&1&l.mode){var y=so(s);if(null!==y){0==(65536&y.flags)&&(y.flags|=256),ss(y,s,l,o,t),iE(o9(a,l));break t}}o=a=o9(a,l),4!==lt&&(lt=2),null===ls?ls=[o]:ls.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var b=sn(o,a,t);iH(o,b);break t;case 1:l=a;var v=o.type,x=o.stateNode;if(0==(128&o.flags)&&("function"==typeof v.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===lf||!lf.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=sr(o,l,t);iH(o,w);break t}}o=o.return}while(null!==o)}lz(n)}catch(e){t=e,s8===n&&null!==n&&(s8=n=n.return);continue}break}}function lR(){var e=s2.current;return s2.current=o5,null===e?o5:e}function l_(){(0===lt||3===lt||2===lt)&&(lt=4),null===s4||0==(0xfffffff&lr)&&0==(0xfffffff&li)||lA(s4,s9)}function lB(e,t){var n=s6;s6|=2;var r=lR();for((s4!==e||s9!==t)&&(lc=null,lI(e,t));;)try{(function(){for(;null!==s8;)lD(s8)})();break}catch(t){lL(e,t)}if(iT(),s6=n,s2.current=r,null!==s8)throw Error(h(261));return s4=null,s9=0,lt}function lD(e){var t=a(e.alternate,e,s7);e.memoizedProps=e.pendingProps,null===t?lz(e):s8=t,s3.current=null}function lz(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=function(e,t,n){var r=t.pendingProps;switch(iu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sN(t),null;case 1:case 17:return rY(t.type)&&rJ(),sN(t),null;case 3:return r=t.stateNode,or(),r$(rq),r$(rH),ou(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(null===e||null===e.child)&&(ix(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==ip&&(lk(ip),ip=null))),o(e,t),sN(t),null;case 5:oo(t);var a=ot(oe.current);if(n=t.type,null!==e&&null!=t.stateNode)s(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(h(166));return sN(t),null}if(e=ot(i9.current),ix(t)){r=t.stateNode,n=t.type;var u=t.memoizedProps;switch(r[rM]=t,r[rT]=u,e=0!=(1&t.mode),n){case"dialog":rn("cancel",r),rn("close",r);break;case"iframe":case"object":case"embed":rn("load",r);break;case"video":case"audio":for(a=0;a<n9.length;a++)rn(n9[a],r);break;case"source":rn("error",r);break;case"img":case"image":case"link":rn("error",r),rn("load",r);break;case"details":rn("toggle",r);break;case"input":Z(r,u),rn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!u.multiple},rn("invalid",r);break;case"textarea":el(r,u),rn("invalid",r)}for(var c in ew(n,u),a=null,u)if(u.hasOwnProperty(c)){var d=u[c];"children"===c?"string"==typeof d?r.textContent!==d&&(!0!==u.suppressHydrationWarning&&rg(r.textContent,d,e),a=["children",d]):"number"==typeof d&&r.textContent!==""+d&&(!0!==u.suppressHydrationWarning&&rg(r.textContent,d,e),a=["children",""+d]):f.hasOwnProperty(c)&&null!=d&&"onScroll"===c&&rn("scroll",r)}switch(n){case"input":Y(r),en(r,u,!0);break;case"textarea":Y(r),eu(r);break;case"select":case"option":break;default:"function"==typeof u.onClick&&(r.onclick=rm)}r=a,t.updateQueue=r,null!==r&&(t.flags|=4)}else{c=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ec(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[rM]=t,e[rT]=r,i(e,t,!1,!1),t.stateNode=e;t:{switch(c=eC(n,r),n){case"dialog":rn("cancel",e),rn("close",e),a=r;break;case"iframe":case"object":case"embed":rn("load",e),a=r;break;case"video":case"audio":for(a=0;a<n9.length;a++)rn(n9[a],e);a=r;break;case"source":rn("error",e),a=r;break;case"img":case"image":case"link":rn("error",e),rn("load",e),a=r;break;case"details":rn("toggle",e),a=r;break;case"input":Z(e,r),a=K(e,r),rn("invalid",e);break;case"option":default:a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=U({},r,{value:void 0}),rn("invalid",e);break;case"textarea":el(e,r),a=es(e,r),rn("invalid",e)}for(u in ew(n,a),d=a)if(d.hasOwnProperty(u)){var p=d[u];"style"===u?ev(e,p):"dangerouslySetInnerHTML"===u?null!=(p=p?p.__html:void 0)&&ep(e,p):"children"===u?"string"==typeof p?("textarea"!==n||""!==p)&&eg(e,p):"number"==typeof p&&eg(e,""+p):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(f.hasOwnProperty(u)?null!=p&&"onScroll"===u&&rn("scroll",e):null!=p&&P(e,u,p,c))}switch(n){case"input":Y(e),en(e,r,!1);break;case"textarea":Y(e),eu(e);break;case"option":null!=r.value&&e.setAttribute("value",""+W(r.value));break;case"select":e.multiple=!!r.multiple,null!=(u=r.value)?eo(e,!!r.multiple,u,!1):null!=r.defaultValue&&eo(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=rm)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break t;case"img":r=!0;break t;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return sN(t),null;case 6:if(e&&null!=t.stateNode)l(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(h(166));if(n=ot(oe.current),ot(i9.current),ix(t)){if(r=t.stateNode,n=t.memoizedProps,r[rM]=t,(u=r.nodeValue!==n)&&null!==(e=ic))switch(e.tag){case 3:rg(r.nodeValue,n,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&rg(r.nodeValue,n,0!=(1&e.mode))}u&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[rM]=t,t.stateNode=r}return sN(t),null;case 13:if(r$(os),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(id&&null!==ih&&0!=(1&t.mode)&&0==(128&t.flags))iw(),iC(),t.flags|=98560,u=!1;else if(u=ix(t),null!==r&&null!==r.dehydrated){if(null===e){if(!u)throw Error(h(318));if(!(u=null!==(u=t.memoizedState)?u.dehydrated:null))throw Error(h(317));u[rM]=t}else iC(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;sN(t),u=!1}else null!==ip&&(lk(ip),ip=null),u=!0;if(!u)return 65536&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return(r=null!==r)!=(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&os.current)?0===lt&&(lt=3):l_())),null!==t.updateQueue&&(t.flags|=4),sN(t),null;case 4:return or(),o(e,t),null===e&&ro(t.stateNode.containerInfo),sN(t),null;case 10:return iN(t.type._context),sN(t),null;case 19:if(r$(os),null===(u=t.memoizedState))return sN(t),null;if(r=0!=(128&t.flags),null===(c=u.rendering)){if(r)sT(u,!1);else{if(0!==lt||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(c=ol(e))){for(t.flags|=128,sT(u,!1),null!==(r=c.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)u=n,e=r,u.flags&=0xe00002,null===(c=u.alternate)?(u.childLanes=0,u.lanes=e,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=c.childLanes,u.lanes=c.lanes,u.child=c.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=c.memoizedProps,u.memoizedState=c.memoizedState,u.updateQueue=c.updateQueue,u.type=c.type,e=c.dependencies,u.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return rU(os,1&os.current|2),t.child}e=e.sibling}null!==u.tail&&eZ()>lu&&(t.flags|=128,r=!0,sT(u,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=ol(c))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),sT(u,!0),null===u.tail&&"hidden"===u.tailMode&&!c.alternate&&!id)return sN(t),null}else 2*eZ()-u.renderingStartTime>lu&&0x40000000!==n&&(t.flags|=128,r=!0,sT(u,!1),t.lanes=4194304)}u.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=u.last)?n.sibling=c:t.child=c,u.last=c)}if(null!==u.tail)return t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=eZ(),t.sibling=null,n=os.current,rU(os,r?1&n|2:1&n),t;return sN(t),null;case 22:case 23:return lj(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(0x40000000&s7)&&(sN(t),6&t.subtreeFlags&&(t.flags|=8192)):sN(t),null;case 24:case 25:return null}throw Error(h(156,t.tag))}(n,t,s7))){s8=n;return}}else{if(null!==(n=function(e,t){switch(iu(t),t.tag){case 1:return rY(t.type)&&rJ(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return or(),r$(rq),r$(rH),ou(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return oo(t),null;case 13:if(r$(os),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(h(340));iC()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return r$(os),null;case 4:return or(),null;case 10:return iN(t.type._context),null;case 22:case 23:return lj(),null;default:return null}}(n,t))){n.flags&=32767,s8=n;return}if(null!==e)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{lt=6,s8=null;return}}if(null!==(t=t.sibling)){s8=t;return}s8=t=e}while(null!==t);0===lt&&(lt=5)}function lF(e,t,n){var r=tc,i=s5.transition;try{s5.transition=null,tc=1,function(e,t,n,r){do lV();while(null!==lg);if(0!=(6&s6))throw Error(h(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(h(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(!function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-e9(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}(e,o),e===s4&&(s8=s4=null,s9=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||lp||(lp=!0,function(e,t){eY(e,t)}(e3,function(){return lV(),null})),o=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||o){o=s5.transition,s5.transition=null;var s,l,a,u=tc;tc=1;var c=s6;s6|=4,s3.current=null,!function(e,t){if(ry=tR,nV(e=nF())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i,o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch(e){n=null;break t}var l=0,a=-1,u=-1,c=0,d=0,f=e,p=null;n:for(;;){for(;f!==n||0!==o&&3!==f.nodeType||(a=l+o),f!==s||0!==r&&3!==f.nodeType||(u=l+r),3===f.nodeType&&(l+=f.nodeValue.length),null!==(i=f.firstChild);){;p=f,f=i}for(;;){if(f===e)break n;if(p===n&&++c===o&&(a=l),p===s&&++d===r&&(u=l),null!==(i=f.nextSibling))break;p=(f=p).parentNode}f=i}n=-1===a||-1===u?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(rb={focusedElem:e,selectionRange:n},tR=!1,sR=t;null!==sR;)if(e=(t=sR).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,sR=e;else for(;null!==sR;){t=sR;try{var g=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,y=g.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:iP(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(h(163))}}catch(e){lU(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,sR=e;break}sR=t.return}g=sD,sD=!1}(e,n),sJ(n,e),!function(e){var t=nF(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&function e(t,n){return!!t&&!!n&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(n.ownerDocument.documentElement,n)){if(null!==r&&nV(n)){if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=nz(n,o);var s=nz(n,r);i&&s&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}(rb),tR=!!ry,rb=ry=null,e.current=n,s=n,l=e,a=i,sR=s,function e(t,n,r){for(var i=0!=(1&t.mode);null!==sR;){var o=sR,s=o.child;if(22===o.tag&&i){var l=null!==o.memoizedState||sj;if(!l){var a=o.alternate,u=null!==a&&null!==a.memoizedState||sI;a=sj;var c=sI;if(sj=l,(sI=u)&&!c)for(sR=o;null!==sR;)u=(l=sR).child,22===l.tag&&null!==l.memoizedState?s0(o):null!==u?(u.return=l,sR=u):s0(o);for(;null!==s;)sR=s,e(s,n,r),s=s.sibling;sR=o,sj=a,sI=c}sK(t,n,r)}else 0!=(8772&o.subtreeFlags)&&null!==s?(s.return=o,sR=s):sK(t,n,r)}}(s,l,a),eK(),s6=c,tc=u,s5.transition=o}else e.current=n;if(lp&&(lp=!1,lg=e,lm=i),0===(o=e.pendingLanes)&&(lf=null),!function(e){if(e8&&"function"==typeof e8.onCommitFiberRoot)try{e8.onCommitFiberRoot(e4,e,void 0,128==(128&e.current.flags))}catch(e){}}(n.stateNode,r),lS(e,eZ()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)r((i=t[n]).value,{componentStack:i.stack,digest:i.digest});if(lh)throw lh=!1,e=ld,ld=null,e;0!=(1&lm)&&0!==e.tag&&lV(),0!=(1&(o=e.pendingLanes))?e===lb?ly++:(ly=0,lb=e):ly=0,r6()}(e,t,n,r)}finally{s5.transition=i,tc=r}return null}function lV(){if(null!==lg){var e=th(lm),t=s5.transition,n=tc;try{if(s5.transition=null,tc=16>e?16:e,null===lg)var r=!1;else{if(e=lg,lg=null,lm=0,0!=(6&s6))throw Error(h(331));var i=s6;for(s6|=4,sR=e.current;null!==sR;){var o=sR,s=o.child;if(0!=(16&sR.flags)){var l=o.deletions;if(null!==l){for(var a=0;a<l.length;a++){var u=l[a];for(sR=u;null!==sR;){var c=sR;switch(c.tag){case 0:case 11:case 15:sz(8,c,o)}var d=c.child;if(null!==d)d.return=c,sR=d;else for(;null!==sR;){var f=(c=sR).sibling,p=c.return;if(!function e(t){var n=t.alternate;null!==n&&(t.alternate=null,e(n)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(n=t.stateNode)&&(delete n[rM],delete n[rT],delete n[rj],delete n[rI],delete n[rL]),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}(c),c===u){sR=null;break}if(null!==f){f.return=p,sR=f;break}sR=p}}}var g=o.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}sR=o}}if(0!=(2064&o.subtreeFlags)&&null!==s)s.return=o,sR=s;else for(;null!==sR;){if(o=sR,0!=(2048&o.flags))switch(o.tag){case 0:case 11:case 15:sz(9,o,o.return)}var b=o.sibling;if(null!==b){b.return=o.return,sR=b;break}sR=o.return}}var v=e.current;for(sR=v;null!==sR;){var x=(s=sR).child;if(0!=(2064&s.subtreeFlags)&&null!==x)x.return=s,sR=x;else for(s=v;null!==sR;){if(l=sR,0!=(2048&l.flags))try{switch(l.tag){case 0:case 11:case 15:sF(9,l)}}catch(e){lU(l,l.return,e)}if(l===s){sR=null;break}var w=l.sibling;if(null!==w){w.return=l.return,sR=w;break}sR=l.return}}if(s6=i,r6(),e8&&"function"==typeof e8.onPostCommitFiberRoot)try{e8.onPostCommitFiberRoot(e4,e)}catch(e){}r=!0}return r}finally{tc=n,s5.transition=t}}return!1}function l$(e,t,n){t=sn(e,t=o9(n,t),1),e=iU(e,t,1),t=lw(),null!==e&&(ta(e,1,t),lS(e,t))}function lU(e,t,n){if(3===e.tag)l$(e,e,n);else for(;null!==t;){if(3===t.tag){l$(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===lf||!lf.has(r))){e=sr(t,e=o9(n,e),1),t=iU(t,e,1),e=lw(),null!==t&&(ta(t,1,e),lS(t,e));break}}t=t.return}}function lG(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=lw(),e.pingedLanes|=e.suspendedLanes&n,s4===e&&(s9&n)===n&&(4===lt||3===lt&&(0x7c00000&s9)===s9&&500>eZ()-la?lI(e,0):lo|=n),lS(e,t)}function lH(e,t){0===t&&(0==(1&e.mode)?t=1:(t=tn,0==(0x7c00000&(tn<<=1))&&(tn=4194304)));var n=lw();null!==(e=iD(e,t))&&(ta(e,t,n),lS(e,n))}function lq(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),lH(e,n)}function lW(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(h(314))}null!==r&&r.delete(t),lH(e,n)}function lX(e,t){return eY(e,t)}function lY(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lJ(e,t,n,r){return new lY(e,t,n,r)}function lQ(e){return!(!(e=e.prototype)||!e.isReactComponent)}a=function(e,t,n){if(null!==e){if(e.memoizedProps!==t.pendingProps||rq.current)sa=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return sa=!1,function(e,t,n){switch(t.tag){case 3:sb(t),iC();break;case 5:oi(t);break;case 1:rY(t.type)&&rZ(t);break;case 4:on(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;rU(iO,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState)){if(null!==r.dehydrated)return rU(os,1&os.current),t.flags|=128,null;if(0!=(n&t.child.childLanes))return sC(e,t,n);return rU(os,1&os.current),null!==(e=sM(e,t,n))?e.sibling:null}rU(os,1&os.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return sk(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),rU(os,os.current),!r)return null;break;case 22:case 23:return t.lanes=0,sf(e,t,n)}return sM(e,t,n)}(e,t,n);sa=0!=(131072&e.flags)}}else sa=!1,id&&0!=(1048576&t.flags)&&il(t,r7,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;sA(e,t),e=t.pendingProps;var i=rX(t,rH.current);iI(t,n),i=oC(null,t,r,e,i,n);var o=oE();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rY(r)?(o=!0,rZ(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,iF(t),i.updater=iJ,t.stateNode=i,i._reactInternals=t,i0(t,r,e,n),t=sy(null,t,r,!0,o,n)):(t.tag=0,id&&o&&ia(t),su(null,t,i,n),t=t.child),t;case 16:r=t.elementType;t:{switch(sA(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return lQ(e)?1:0;if(null!=e){if((e=e.$$typeof)===L)return 11;if(e===B)return 14}return 2}(r),e=iP(r,e),i){case 0:t=sg(null,t,r,e,n);break t;case 1:t=sm(null,t,r,e,n);break t;case 11:t=sc(null,t,r,e,n);break t;case 14:t=sh(null,t,r,iP(r.type,e),n);break t}throw Error(h(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:iP(r,i),sg(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:iP(r,i),sm(e,t,r,i,n);case 3:t:{if(sb(t),null===e)throw Error(h(387));r=t.pendingProps,i=(o=t.memoizedState).element,iV(e,t),iq(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){i=o9(Error(h(423)),t),t=sv(e,t,r,n,i);break t}else if(r!==i){i=o9(Error(h(424)),t),t=sv(e,t,r,n,i);break t}else for(ih=rO(t.stateNode.containerInfo.firstChild),ic=t,id=!0,ip=null,n=i4(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(iC(),r===i){t=sM(e,t,n);break t}su(e,t,r,n)}t=t.child}return t;case 5:return oi(t),null===e&&ib(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,rv(r,i)?s=null:null!==o&&rv(r,o)&&(t.flags|=32),sp(e,t),su(e,t,s,n),t.child;case 6:return null===e&&ib(t),null;case 13:return sC(e,t,n);case 4:return on(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=i6(t,null,r,n):su(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:iP(r,i),sc(e,t,r,i,n);case 7:return su(e,t,t.pendingProps,n),t.child;case 8:case 12:return su(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,rU(iO,r._currentValue),r._currentValue=s,null!==o){if(n_(o.value,s)){if(o.children===i.children&&!rq.current){t=sM(e,t,n);break t}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var l=o.dependencies;if(null!==l){s=o.child;for(var a=l.firstContext;null!==a;){if(a.context===r){if(1===o.tag){(a=i$(-1,n&-n)).tag=2;var u=o.updateQueue;if(null!==u){var c=(u=u.shared).pending;null===c?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,null!==(a=o.alternate)&&(a.lanes|=n),ij(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(10===o.tag)s=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(s=o.return))throw Error(h(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),ij(s,n,t),s=o.sibling}else s=o.child;if(null!==s)s.return=o;else for(s=o;null!==s;){if(s===t){s=null;break}if(null!==(o=s.sibling)){o.return=s.return,s=o;break}s=s.return}o=s}}su(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,iI(t,n),r=r(i=iL(i)),t.flags|=1,su(e,t,r,n),t.child;case 14:return i=iP(r=t.type,t.pendingProps),i=iP(r.type,i),sh(e,t,r,i,n);case 15:return sd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:iP(r,i),sA(e,t),t.tag=1,rY(r)?(e=!0,rZ(t)):e=!1,iI(t,n),iK(t,r,i),i0(t,r,i,n),sy(null,t,r,!0,e,n);case 19:return sk(e,t,n);case 22:return sf(e,t,n)}throw Error(h(156,t.tag))};function lK(e,t){var n=e.alternate;return null===n?((n=lJ(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=0xe00000&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function lZ(e,t,n,r,i,o){var s=2;if(r=e,"function"==typeof e)lQ(e)&&(s=1);else if("string"==typeof e)s=5;else t:switch(e){case M:return l0(n.children,i,o,t);case T:s=8,i|=8;break;case N:return(e=lJ(12,n,t,2|i)).elementType=N,e.lanes=o,e;case R:return(e=lJ(13,n,t,i)).elementType=R,e.lanes=o,e;case _:return(e=lJ(19,n,t,i)).elementType=_,e.lanes=o,e;case z:return l1(n,i,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case j:s=10;break t;case I:s=9;break t;case L:s=11;break t;case B:s=14;break t;case D:s=16,r=null;break t}throw Error(h(130,null==e?e:typeof e,""))}return(t=lJ(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function l0(e,t,n,r){return(e=lJ(7,e,r,t)).lanes=n,e}function l1(e,t,n,r){return(e=lJ(22,e,r,t)).elementType=z,e.lanes=n,e.stateNode={isHidden:!1},e}function l2(e,t,n){return(e=lJ(6,e,null,t)).lanes=n,e}function l3(e,t,n){return(t=lJ(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function l5(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tl(0),this.expirationTimes=tl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function l6(e,t,n,r,i,o,s,l,a){return e=new l5(e,t,n,l,a),1===t?(t=1,!0===o&&(t|=8)):t=0,o=lJ(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},iF(o),e}function l4(e){if(!e)return rG;e=e._reactInternals;t:{if(eH(e)!==e||1!==e.tag)throw Error(h(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break t;case 1:if(rY(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break t}}t=t.return}while(null!==t);throw Error(h(171))}if(1===e.tag){var n=e.type;if(rY(n))return rK(e,n,t)}return t}function l8(e,t,n,r,i,o,s,l,a){return(e=l6(n,r,!0,e,i,o,s,l,a)).context=l4(null),n=e.current,r=lw(),(o=i$(r,i=lC(n))).callback=null!=t?t:null,iU(n,o,i),e.current.lanes=i,ta(e,i,r),lS(e,r),e}function l9(e,t,n,r){var i=t.current,o=lw(),s=lC(i);return n=l4(n),null===t.context?t.context=n:t.pendingContext=n,(t=i$(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=iU(i,t,s))&&(lE(e,i,s,o),iG(e,i,s)),s}function l7(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function ae(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function at(e,t){ae(e,t),(e=e.alternate)&&ae(e,t)}var an="function"==typeof reportError?reportError:function(e){console.error(e)};function ar(e){this._internalRoot=e}function ai(e){this._internalRoot=e}function ao(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function as(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function al(){}ai.prototype.render=ar.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(h(409));l9(e,t,null,null)},ai.prototype.unmount=ar.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;lN(function(){l9(null,e,null,null)}),t[rN]=null}},ai.prototype.unstable_scheduleHydration=function(e){if(e){var t=tg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<tS.length&&0!==t&&t<tS[n].priority;n++);tS.splice(n,0,e),0===n&&tA(e)}};function aa(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if("function"==typeof i){var l=i;i=function(){var e=l7(s);l.call(e)}}l9(t,s,e,i)}else s=function(e,t,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var e=l7(s);o.call(e)}}var s=l8(t,r,e,0,null,!1,!1,"",al);return e._reactRootContainer=s,e[rN]=s.current,ro(8===e.nodeType?e.parentNode:e),lN(),s}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var l=r;r=function(){var e=l7(a);l.call(e)}}var a=l6(e,0,!1,null,null,!1,!1,"",al);return e._reactRootContainer=a,e[rN]=a.current,ro(8===e.nodeType?e.parentNode:e),lN(function(){l9(t,a,n,r)}),a}(n,t,e,i,r);return l7(s)}td=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=tr(t.pendingLanes);0!==n&&(tu(t,1|n),lS(t,eZ()),0==(6&s6)&&(lu=eZ()+500,r6()))}break;case 13:lN(function(){var t=iD(e,1);null!==t&&lE(t,e,1,lw())}),at(e,1)}},tf=function(e){if(13===e.tag){var t=iD(e,0x8000000);null!==t&&lE(t,e,0x8000000,lw()),at(e,0x8000000)}},tp=function(e){if(13===e.tag){var t=lC(e),n=iD(e,t);null!==n&&lE(n,e,t,lw()),at(e,t)}},tg=function(){return tc},tm=function(e,t){var n=tc;try{return tc=e,t()}finally{tc=n}},eP=function(e,t,n){switch(t){case"input":if(et(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=rD(r);if(!i)throw Error(h(90));J(r),et(r,i)}}}break;case"textarea":ea(e,n);break;case"select":null!=(t=n.value)&&eo(e,!!n.multiple,t,!1)}},eN=lT,ej=lN;var au={findFiberByHostInstance:rR,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},ac={bundleType:au.bundleType,version:au.version,rendererPackageName:au.rendererPackageName,rendererConfig:au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=eX(e))?null:e.stateNode},findFiberByHostInstance:au.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ah=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ah.isDisabled&&ah.supportsFiber)try{e4=ah.inject(ac),e8=ah}catch(e){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED={usingClientEntryPoint:!1,Events:[r_,rB,rD,eM,eT,lT]},t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ao(t))throw Error(h(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:A,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!ao(e))throw Error(h(299));var n=!1,r="",i=an;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=l6(e,1,!1,null,null,n,!1,r,i),e[rN]=t.current,ro(8===e.nodeType?e.parentNode:e),new ar(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(h(188));throw Error(h(268,e=Object.keys(e).join(",")))}return e=null===(e=eX(t))?null:e.stateNode},t.flushSync=function(e){return lN(e)},t.hydrate=function(e,t,n){if(!as(t))throw Error(h(200));return aa(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!ao(e))throw Error(h(405));var r=null!=n&&n.hydratedSources||null,i=!1,o="",s=an;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=l8(t,null,e,1,null!=n?n:null,i,!1,o,s),e[rN]=t.current,ro(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new ai(t)},t.render=function(e,t,n){if(!as(t))throw Error(h(200));return aa(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!as(e))throw Error(h(40));return!!e._reactRootContainer&&(lN(function(){aa(null,null,e,!1,function(){e._reactRootContainer=null,e[rN]=null})}),!0)},t.unstable_batchedUpdates=lT,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!as(n))throw Error(h(200));if(null==e||void 0===e._reactInternals)throw Error(h(38));return aa(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},9195:function(e,t,n){"use strict";var r,i=n(5350);t.createRoot=i.createRoot,i.hydrateRoot},5350:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(6590)},4392:function(e,t){"use strict";function n(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,i=e[r];if(0<o(i,t))e[r]=t,e[n]=i,n=r;else break}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,i=e.length,s=i>>>1;r<s;){var l=2*(r+1)-1,a=e[l],u=l+1,c=e[u];if(0>o(a,n))u<i&&0>o(c,a)?(e[r]=c,e[u]=n,r=u):(e[r]=a,e[l]=n,r=l);else if(u<i&&0>o(c,n))e[r]=c,e[u]=n,r=u;else break}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var s,l=performance;t.unstable_now=function(){return l.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],h=[],d=1,f=null,p=3,g=!1,m=!1,y=!1,b="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,x="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=r(h);null!==t;){if(null===t.callback)i(h);else if(t.startTime<=e)i(h),t.sortIndex=t.expirationTime,n(c,t);else break;t=r(h)}}function C(e){if(y=!1,w(e),!m){if(null!==r(c))m=!0,I(E);else{var t=r(h);null!==t&&L(C,t.startTime-e)}}}function E(e,n){m=!1,y&&(y=!1,v(O),O=-1),g=!0;var o=p;try{for(w(n),f=r(c);null!==f&&(!(f.expirationTime>n)||e&&!M());){var s=f.callback;if("function"==typeof s){f.callback=null,p=f.priorityLevel;var l=s(f.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?f.callback=l:f===r(c)&&i(c),w(n)}else i(c);f=r(c)}if(null!==f)var a=!0;else{var u=r(h);null!==u&&L(C,u.startTime-n),a=!1}return a}finally{f=null,p=o,g=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S=!1,P=null,O=-1,k=5,A=-1;function M(){return!(t.unstable_now()-A<k)}function T(){if(null!==P){var e=t.unstable_now();A=e;var n=!0;try{n=P(!0,e)}finally{n?s():(S=!1,P=null)}}else S=!1}if("function"==typeof x)s=function(){x(T)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,j=N.port2;N.port1.onmessage=T,s=function(){j.postMessage(null)}}else s=function(){b(T,0)};function I(e){P=e,S||(S=!0,s())}function L(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||g||(m=!0,I(E))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,o){var s=t.unstable_now();switch(o="object"==typeof o&&null!==o?"number"==typeof(o=o.delay)&&0<o?s+o:s:s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=0x3fffffff;break;case 4:l=1e4;break;default:l=5e3}return l=o+l,e={id:d++,callback:i,priorityLevel:e,startTime:o,expirationTime:l,sortIndex:-1},o>s?(e.sortIndex=o,n(h,e),null===r(c)&&e===r(h)&&(y?(v(O),O=-1):y=!0,L(C,o-s))):(e.sortIndex=l,n(c,e),m||g||(m=!0,I(E))),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},7881:function(e,t,n){"use strict";e.exports=n(4392)},482:function(e){"use strict";e.exports=h},4964:function(e){"use strict";e.exports=o},3505:function(e){"use strict";e.exports=i},5229:function(e){"use strict";e.exports=r},8875:function(e){"use strict";e.exports=l},3772:function(e){"use strict";e.exports=c},7584:function(e){"use strict";e.exports=a},2749:function(t){"use strict";t.exports=e},2721:function(e){"use strict";e.exports=d},467:function(e){"use strict";e.exports=u},8156:function(e){"use strict";e.exports=s},3238:function(e){"use strict";e.exports=t},6128:function(e){"use strict";e.exports=n}},p={};function g(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={id:e,loaded:!1,exports:{}};return f[e](n,n.exports,g),n.loaded=!0,n.exports}g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},g.nmd=function(e){return e.paths=[],!e.children&&(e.children=[]),e};var m={};return!function(){"use strict";let e,t,n,r,i,o,s,l,a;g.r(m),g.d(m,{PluginGraphCollectionPlugin:function(){return mD},default:function(){return mz}});var u,c,h,d,f,p,y,b,v,x,w,C,E,S,P,O,k,A,M,T,N,j,I,L,R,_,B,D,z,F,V,$,U,G,H,q,W,X,Y,J,Q,K,Z,ee,et,en,er,ei,eo,es,el,ea,eu,ec,eh,ed,ef,ep,eg,em,ey,eb,ev,ex,ew,eC,eE,eS,eP,eO,ek,eA,eM,eT,eN,ej,eI,eL,eR,e_,eB,eD,ez,eF,eV,e$,eU,eG,eH,eq,eW,eX,eY,eJ,eQ,eK,eZ,e0,e1,e2,e3,e5,e6,e4,e8,e9,e7,te,tt,tn,tr,ti,to,ts,tl,ta,tu,tc,th,td,tf,tp,tg,tm,ty,tb,tv,tx,tw,tC,tE,tS,tP,tO,tk,tA,tM,tT,tN,tj,tI,tL,tR,t_,tB,tD,tz,tF,tV,t$,tU={};g.r(tU),g.d(tU,{dot:function(){return uJ},doubleMesh:function(){return uZ},fixedDot:function(){return uQ},mesh:function(){return uK}});var tG={};g.r(tG),g.d(tG,{flipX:function(){return u1},flipXY:function(){return u3},flipY:function(){return u2},watermark:function(){return u5}});var tH={};g.r(tH),g.d(tH,{blur:function(){return u7},brightness:function(){return cs},contrast:function(){return cl},dropShadow:function(){return ce},grayScale:function(){return ct},highlight:function(){return u9},hueRotate:function(){return ci},invert:function(){return co},outline:function(){return u8},saturate:function(){return cr},sepia:function(){return cn}});var tq={};g.r(tq),g.d(tq,{async:function(){return hs},block:function(){return c4},circle:function(){return ha},circlePlus:function(){return hu},classic:function(){return c8},cross:function(){return hi},diamond:function(){return he},ellipse:function(){return hh},path:function(){return hn}});var tW={};g.r(tW),g.d(tW,{annotations:function(){return cq},atConnectionLength:function(){return hS},atConnectionLengthIgnoreGradient:function(){return hw},atConnectionLengthKeepGradient:function(){return hx},atConnectionRatio:function(){return hP},atConnectionRatioIgnoreGradient:function(){return hE},atConnectionRatioKeepGradient:function(){return hC},connection:function(){return hv},displayEmpty:function(){return cX},eol:function(){return cW},fill:function(){return cD},filter:function(){return c2},html:function(){return c1},lineHeight:function(){return cU},port:function(){return c3},ref:function(){return cu},refCx:function(){return cx},refCy:function(){return cw},refD:function(){return ck},refDKeepOffset:function(){return cE},refDResetOffset:function(){return cC},refDx:function(){return cd},refDy:function(){return cf},refHeight:function(){return cg},refHeight2:function(){return cj},refPoints:function(){return cA},refPointsKeepOffset:function(){return cP},refPointsResetOffset:function(){return cS},refR:function(){return cO},refRCircumscribed:function(){return cv},refRInscribed:function(){return cb},refRx:function(){return cm},refRy:function(){return cy},refWidth:function(){return cp},refWidth2:function(){return cN},refX:function(){return cc},refX2:function(){return cM},refY:function(){return ch},refY2:function(){return cT},resetOffset:function(){return cK},sourceMarker:function(){return hp},stroke:function(){return cz},style:function(){return c0},targetMarker:function(){return hg},text:function(){return cF},textPath:function(){return cH},textVerticalAnchor:function(){return cG},textWrap:function(){return cV},title:function(){return cY},vertexMarker:function(){return hm},xAlign:function(){return cJ},yAlign:function(){return cQ}});var tX={};g.r(tX),g.d(tX,{className:function(){return hM},opacity:function(){return hN},stroke:function(){return hI}});var tY={};g.r(tY),g.d(tY,{absolute:function(){return h_},bottom:function(){return hH},ellipse:function(){return hB},ellipseSpread:function(){return hD},left:function(){return h$},line:function(){return hV},right:function(){return hU},top:function(){return hG}});var tJ={};g.r(tJ),g.d(tJ,{bottom:function(){return hZ},inside:function(){return h2},insideOriented:function(){return h3},left:function(){return hJ},manual:function(){return hY},outside:function(){return h0},outsideOriented:function(){return h1},radial:function(){return h8},radialOriented:function(){return h9},right:function(){return hQ},top:function(){return hK}});var tQ={};g.r(tQ),g.d(tQ,{noop:function(){return da},pinAbsolute:function(){return dd},pinRelative:function(){return dh}});var tK={};g.r(tK),g.d(tK,{bottom:function(){return dN},bottomLeft:function(){return d_},bottomRight:function(){return dB},center:function(){return dM},left:function(){return dj},midSide:function(){return dU},nodeCenter:function(){return d$},orth:function(){return dV},right:function(){return dI},top:function(){return dT},topLeft:function(){return dL},topRight:function(){return dR}});var tZ={};g.r(tZ),g.d(tZ,{closest:function(){return dW},length:function(){return dH},orth:function(){return dX},ratio:function(){return dG}});var t0={};g.r(t0),g.d(t0,{anchor:function(){return d0},bbox:function(){return dQ},boundary:function(){return dZ},rect:function(){return dK}});var t1={};g.r(t1),g.d(t1,{er:function(){return fb},loop:function(){return fx},manhattan:function(){return fg},metro:function(){return fy},normal:function(){return d1},oneSide:function(){return d2},orth:function(){return d8}});var t2={};g.r(t2),g.d(t2,{jumpover:function(){return fT},loop:function(){return fC},normal:function(){return fw},rounded:function(){return fE},smooth:function(){return fS}});var t3=g("3772"),t5=g("482"),t6=g("8875"),t4=g("8156"),t8=g.n(t4),t9=g("3505"),t7=g("5229"),ne=g("7584"),nt=g("2721"),nn=g("9007"),nr=g.n(nn),ni=g("3238"),no=(0,t4.createContext)(null);no.displayName="GraphCollectionContext";var ns=function(e){var t=e.record,n=e.setTargetNode,r=e.node,i=e.handelOpenPorts;return t8().createElement(no.Provider,{value:{node:r,record:t,positionTargetNode:function(e){n(e||r)},openPorts:i}},e.children)};function nl(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,i)}function na(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){nl(o,r,i,s,l,"next",e)}function l(e){nl(o,r,i,s,l,"throw",e)}s(void 0)})}}function nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,i=t,o=n[t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}function nc(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}var nh=function(e,t){var n,r,i=(0,t3.useRequest)(function(){return Promise.resolve({data:nr()(t)})},(n=nu({},e),r=(r={manual:!0},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n)),o=(0,t3.useActionContext)();return(0,t4.useEffect)(function(){o.visible&&i.run()},[o.visible]),i};(0,t9.observer)(function(){var e=(0,t4.useContext)(no).record,t=(0,t3.useCompile)();return t8().createElement("div",null,t8().createElement(nt.Select,{popupMatchSelectWidth:!1,disabled:!0,value:e.name,options:[{value:e.name,label:t(e.title)}]}))},{displayName:"SourceCollection"});var nd=function(){var e=(0,t9.useForm)(),t=(0,t3.useActionContext)();return{run:function(){return na(function(){return nc(this,function(n){return t.setVisible(!1),e.reset(),[2]})})()}}},nf=function(e){var t=(0,t9.useForm)(),n=(0,t3.useAPIClient)(),r=(0,t3.useActionContext)(),i=(0,t3.useCollectionManager_deprecated)().refreshCM;return{run:function(){return na(function(){return nc(this,function(o){switch(o.label){case 0:return[4,t.submit()];case 1:return o.sent(),[4,n.resource("collections").create({values:t.values})];case 2:return o.sent(),r.setVisible(!1),[4,t.reset()];case 3:return o.sent(),e("last"),[4,i()];case 4:return o.sent(),[2]}})})()}}},np=function(e,t){var n=(0,t9.useForm)(),r=(0,t3.useAPIClient)(),i=(0,t3.useActionContext)(),o=(0,t3.useCollectionManager_deprecated)().refreshCM,s=(0,t4.useContext)(no),l=s.positionTargetNode,a=s.openPorts,u=(0,t3.useCollectionFieldFormValues)().getValues;return{run:function(){return na(function(){var s,c,h,d,f;return nc(this,function(p){switch(p.label){case 0:return[4,n.submit()];case 1:return p.sent(),s=u(),c=ne.lodash.omit(s,["key","uiSchemaUid","collectionName","autoCreateReverseField","uiSchema.x-uid","reverseField.key","reverseField.uiSchemaUid"]),h=!["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(s.interface),[4,r.resource("collections.fields",e).create({values:c})];case 2:if(d=p.sent().data.data,!(f=t))return[3,4];return[4,r.resource("fields").move({sourceId:d.key,targetId:t,targetScope:e,method:"insertAfter"})];case 3:f=p.sent(),p.label=4;case 4:return i.setVisible(!1),[4,n.reset()];case 5:return p.sent(),l(),h&&a&&a(),[4,o()];case 6:return p.sent(),[2]}})})()}}},ng=function(e){var t=e.collectionName,n=e.name,r=e.key,i=(0,t3.useCollectionManager_deprecated)().refreshCM,o=(0,ni.useTranslation)().t,s=(0,t9.useForm)(),l=(0,t3.useActionContext)(),a=(0,t3.useAPIClient)(),u=(0,t4.useContext)(no),c=u.positionTargetNode,h=u.node;return{run:function(){return na(function(){var e;return nc(this,function(u){switch(u.label){case 0:return[4,s.submit()];case 1:return u.sent(),[4,a.resource("collections.fields",t).update({filterByTk:n,values:s.values})];case 2:return u.sent(),l.setVisible(!1),nt.message.success(o("Saved successfully")),c(),i(),h.setPortProp(r,"uiSchema",{title:null===(e=s.values)||void 0===e?void 0:e.uiSchema.title}),[4,s.reset()];case 3:return u.sent(),[2]}})})()}}},nm=function(){var e=(0,ni.useTranslation)().t,t=(0,t9.useForm)(),n=(0,t3.useActionContext)(),r=t.values.name,i=(0,t3.useAPIClient)(),o=(0,t3.useCollectionManager_deprecated)().refreshCM,s=(0,t4.useContext)(no).positionTargetNode;return{run:function(){return na(function(){return nc(this,function(l){switch(l.label){case 0:return[4,t.submit()];case 1:return l.sent(),[4,i.resource("collections").update({filterByTk:r,values:nu({},ne.lodash.omit(t.values,["fields"]))})];case 2:return l.sent(),n.setVisible(!1),nt.message.success(e("Saved successfully")),[4,t.reset()];case 3:return l.sent(),s(),o(),[2]}})})()}}},ny=function(e){var t=(0,t3.useAPIClient)(),n=(0,t9.useForm)(),r=((null==n?void 0:n.values)||{}).cascade;return{run:function(){return na(function(){return nc(this,function(n){switch(n.label){case 0:return[4,t.resource("collections").destroy({filterByTk:e,cascade:r})];case 1:return n.sent(),[4,t.resource("graphPositions").destroy({filter:{collectionName:e}})];case 2:return n.sent(),[2]}})})()}}},nb=function(e){var t=ny(e.name).run,n=(0,t3.useCollectionManager_deprecated)().refreshCM,r=(0,t4.useContext)(no).positionTargetNode;return{run:function(){return na(function(){return nc(this,function(e){switch(e.label){case 0:return[4,t()];case 1:return e.sent(),r("destory"),[4,n()];case 2:return e.sent(),[2]}})})()}}},nv=function(e,t){var n=(0,t3.useAPIClient)(),r=(0,t4.useContext)(no).positionTargetNode;return{run:function(){return na(function(){return nc(this,function(i){switch(i.label){case 0:return[4,n.resource("collections.fields",e).destroy({filterByTk:t})];case 1:return i.sent(),r(),[2]}})})()}}},nx=function(e){var t=e.collectionName,n=e.name,r=(0,t3.useCollectionManager_deprecated)().refreshCM,i=nv(t,n).run;return{run:function(){return na(function(){return nc(this,function(e){switch(e.label){case 0:return[4,i()];case 1:return e.sent(),[4,r()];case 2:return e.sent(),[2]}})})()}}},nw=function(e){return function(t,n){var r=n.targetScope;t.loading=!0,e(r).then(t7.action.bound(function(e){t.dataSource=e,t.loading=!1})).catch(function(e){(0,ne.error)(e)})}};g("9652");class nC{get disposed(){return!0===this._disposed}dispose(){this._disposed=!0}}(nC||(nC={})).dispose=function(){return(e,t,n)=>{let r=n.value,i=e.__proto__;n.value=function(...e){if(!this.disposed)r.call(this,...e),i.dispose.call(this)}}};class nE{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){if(!this.isDisposed)this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear()}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(u=nE||(nE={})).from=function(e){let t=new u;return e.forEach(e=>{t.add(e)}),t};var nS=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},nP="object"==typeof global&&global&&global.Object===Object&&global,nO="object"==typeof self&&self&&self.Object===Object&&self,nk=nP||nO||Function("return this")(),nA=function(){return nk.Date.now()},nM=/\s/,nT=function(e){for(var t=e.length;t--&&nM.test(e.charAt(t)););return t},nN=/^\s+/,nj=nk.Symbol,nI=Object.prototype,nL=nI.hasOwnProperty,nR=nI.toString,n_=nj?nj.toStringTag:void 0,nB=function(e){var t=nL.call(e,n_),n=e[n_];try{e[n_]=void 0;var r=!0}catch(e){}var i=nR.call(e);return r&&(t?e[n_]=n:delete e[n_]),i},nD=Object.prototype.toString,nz=nj?nj.toStringTag:void 0,nF=function(e){var t;if(null==e)return void 0===e?"[object Undefined]":"[object Null]";return nz&&nz in Object(e)?nB(e):(t=e,nD.call(t))},nV=function(e){return null!=e&&"object"==typeof e},n$=function(e){return"symbol"==typeof e||nV(e)&&"[object Symbol]"==nF(e)},nU=0/0,nG=/^[-+]0x[0-9a-f]+$/i,nH=/^0b[01]+$/i,nq=/^0o[0-7]+$/i,nW=parseInt,nX=function(e){if("number"==typeof e)return e;if(n$(e))return nU;if(nS(e)){var t,n="function"==typeof e.valueOf?e.valueOf():e;e=nS(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,nT(t)+1).replace(nN,""):t;var r=nH.test(e);return r||nq.test(e)?nW(e.slice(2),r?2:8):nG.test(e)?nU:+e},nY=Math.max,nJ=Math.min,nQ=function(e,t,n){var r,i,o,s,l,a,u=0,c=!1,h=!1,d=!0;if("function"!=typeof e)throw TypeError("Expected a function");function f(t){var n=r,o=i;return r=i=void 0,u=t,s=e.apply(o,n)}t=nX(t)||0,nS(n)&&(c=!!n.leading,o=(h="maxWait"in n)?nY(nX(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d);function p(e){var n=e-a,r=e-u;return void 0===a||n>=t||n<0||h&&r>=o}function g(){var e,n,r,i,s=nA();if(p(s))return m(s);l=setTimeout(g,(n=(e=s)-a,r=e-u,i=t-n,h?nJ(i,o-r):i))}function m(e){return(l=void 0,d&&r)?f(e):(r=i=void 0,s)}function y(){var e,n=nA(),o=p(n);if(r=arguments,i=this,a=n,o){if(void 0===l){;return u=e=a,l=setTimeout(g,t),c?f(e):s}if(h)return clearTimeout(l),l=setTimeout(g,t),f(a)}return void 0===l&&(l=setTimeout(g,t)),s}return y.cancel=function(){void 0!==l&&clearTimeout(l),u=0,r=a=i=l=void 0},y.flush=function(){return void 0===l?s:m(nA())},y},nK=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return nS(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),nQ(e,t,{leading:r,maxWait:t,trailing:i})};function nZ(e,t,n){if(n)switch(n.length){case 0:break;case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2]);case 4:return e.call(t,n[0],n[1],n[2],n[3]);case 5:return e.call(t,n[0],n[1],n[2],n[3],n[4]);case 6:return e.call(t,n[0],n[1],n[2],n[3],n[4],n[5]);default:return e.apply(t,n)}return e.call(t)}function n0(e,t,...n){return nZ(e,t,n)}function n1(e){var t;return null!=e&&(e instanceof Promise||"object"==typeof(t=e)&&t.then&&"function"==typeof t.then)}function n2(...e){let t=[];return(e.forEach(e=>{Array.isArray(e)?t.push(...e):t.push(e)}),t.some(e=>n1(e)))?Promise.all(t.map(e=>n1(e)?e:Promise.resolve(!1!==e))).then(e=>e.reduce((e,t)=>!1!==t&&e,!0)):t.every(e=>!1!==e)}function n3(e,t){let n=[];for(let r=0;r<e.length;r+=2){let i=e[r],o=e[r+1],s=nZ(i,o,Array.isArray(t)?t:[t]);n.push(s)}return n2(n)}class n5{constructor(){this.listeners={}}on(e,t,n){return null==t?this:(!this.listeners[e]&&(this.listeners[e]=[]),this.listeners[e].push(t,n),this)}once(e,t,n){let r=(...i)=>(this.off(e,r),n3([t,n],i));return this.on(e,r,this)}off(e,t,n){if(!(e||t||n))return this.listeners={},this;let r=this.listeners;return(e?[e]:Object.keys(r)).forEach(e=>{let i=r[e];if(!!i){if(!(t||n)){delete r[e];return}for(let e=i.length-2;e>=0;e-=2)!(t&&i[e]!==t||n&&i[e+1]!==n)&&i.splice(e,2)}}),this}trigger(e,...t){let n=!0;if("*"!==e){let r=this.listeners[e];null!=r&&(n=n3([...r],t))}let r=this.listeners["*"];return null!=r?n2([n,n3([...r],[e,...t])]):n}emit(e,...t){return this.trigger(e,...t)}}var n6=function(e,t){return e===t||e!=e&&t!=t},n4=function(e,t){for(var n=e.length;n--;)if(n6(e[n][0],t))return n;return -1},n8=Array.prototype.splice;function n9(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}n9.prototype.clear=function(){this.__data__=[],this.size=0},n9.prototype.delete=function(e){var t=this.__data__,n=n4(t,e);return!(n<0)&&(n==t.length-1?t.pop():n8.call(t,n,1),--this.size,!0)},n9.prototype.get=function(e){var t=this.__data__,n=n4(t,e);return n<0?void 0:t[n][1]},n9.prototype.has=function(e){return n4(this.__data__,e)>-1},n9.prototype.set=function(e,t){var n=this.__data__,r=n4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var n7=function(e){if(!nS(e))return!1;var t=nF(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},re=nk["__core-js_shared__"];var rt=(c=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",rn=Function.prototype.toString,rr=function(e){if(null!=e){try{return rn.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ri=/^\[object .+?Constructor\]$/,ro=Object.prototype,rs=Function.prototype.toString,rl=ro.hasOwnProperty,ra=RegExp("^"+rs.call(rl).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ru=function(e){var t;return!!nS(e)&&(t=e,!rt||!(rt in t))&&(n7(e)?ra:ri).test(rr(e))},rc=function(e,t){var n,r,i=(n=e,r=t,null==n?void 0:n[r]);return ru(i)?i:void 0},rh=rc(nk,"Map"),rd=rc(Object,"create"),rf=Object.prototype.hasOwnProperty,rp=Object.prototype.hasOwnProperty;function rg(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rg.prototype.clear=function(){this.__data__=rd?rd(null):{},this.size=0},rg.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},rg.prototype.get=function(e){var t=this.__data__;if(rd){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return rf.call(t,e)?t[e]:void 0},rg.prototype.has=function(e){var t=this.__data__;return rd?void 0!==t[e]:rp.call(t,e)},rg.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rd&&void 0===t?"__lodash_hash_undefined__":t,this};var rm=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},ry=function(e,t){var n=e.__data__;return rm(t)?n["string"==typeof t?"string":"hash"]:n.map};function rb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rb.prototype.clear=function(){this.size=0,this.__data__={hash:new rg,map:new(rh||n9),string:new rg}},rb.prototype.delete=function(e){var t=ry(this,e).delete(e);return this.size-=t?1:0,t},rb.prototype.get=function(e){return ry(this,e).get(e)},rb.prototype.has=function(e){return ry(this,e).has(e)},rb.prototype.set=function(e,t){var n=ry(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function rv(e){var t=this.__data__=new n9(e);this.size=t.size}rv.prototype.clear=function(){this.__data__=new n9,this.size=0},rv.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},rv.prototype.get=function(e){return this.__data__.get(e)},rv.prototype.has=function(e){return this.__data__.has(e)},rv.prototype.set=function(e,t){var n=this.__data__;if(n instanceof n9){var r=n.__data__;if(!rh||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new rb(r)}return n.set(e,t),this.size=n.size,this};var rx=function(){try{var e=rc(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),rw=function(e,t,n){"__proto__"==t&&rx?rx(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},rC=function(e,t,n){(void 0!==n&&!n6(e[t],n)||void 0===n&&!(t in e))&&rw(e,t,n)};var rE=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var l=o[++r];if(!1===t(i[l],l,i))break}return e},rS="object"==typeof exports&&exports&&!exports.nodeType&&exports,rP=rS&&"object"==typeof module&&module&&!module.nodeType&&module,rO=rP&&rP.exports===rS?nk.Buffer:void 0,rk=rO?rO.allocUnsafe:void 0,rA=function(e,t){if(t)return e.slice();var n=e.length,r=rk?rk(n):new e.constructor(n);return e.copy(r),r},rM=nk.Uint8Array,rT=function(e){var t=new e.constructor(e.byteLength);return new rM(t).set(new rM(e)),t},rN=function(e,t){var n=t?rT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},rj=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},rI=Object.create,rL=function(){function e(){}return function(t){if(!nS(t))return{};if(rI)return rI(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),rR=function(e,t){return function(n){return e(t(n))}},r_=rR(Object.getPrototypeOf,Object),rB=Object.prototype,rD=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||rB)},rz=function(e){return"function"!=typeof e.constructor||rD(e)?{}:rL(r_(e))},rF=function(e){return nV(e)&&"[object Arguments]"==nF(e)},rV=Object.prototype,r$=rV.hasOwnProperty,rU=rV.propertyIsEnumerable,rG=rF(function(){return arguments}())?rF:function(e){return nV(e)&&r$.call(e,"callee")&&!rU.call(e,"callee")},rH=Array.isArray,rq=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff},rW=function(e){return null!=e&&rq(e.length)&&!n7(e)},rX=function(e){return nV(e)&&rW(e)},rY="object"==typeof exports&&exports&&!exports.nodeType&&exports,rJ=rY&&"object"==typeof module&&module&&!module.nodeType&&module,rQ=rJ&&rJ.exports===rY?nk.Buffer:void 0,rK=rQ?rQ.isBuffer:void 0,rZ=rK||function(){return!1},r0=Object.prototype,r1=Function.prototype.toString,r2=r0.hasOwnProperty,r3=r1.call(Object),r5=function(e){if(!nV(e)||"[object Object]"!=nF(e))return!1;var t=r_(e);if(null===t)return!0;var n=r2.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&r1.call(n)==r3},r6={};r6["[object Float32Array]"]=r6["[object Float64Array]"]=r6["[object Int8Array]"]=r6["[object Int16Array]"]=r6["[object Int32Array]"]=r6["[object Uint8Array]"]=r6["[object Uint8ClampedArray]"]=r6["[object Uint16Array]"]=r6["[object Uint32Array]"]=!0,r6["[object Arguments]"]=r6["[object Array]"]=r6["[object ArrayBuffer]"]=r6["[object Boolean]"]=r6["[object DataView]"]=r6["[object Date]"]=r6["[object Error]"]=r6["[object Function]"]=r6["[object Map]"]=r6["[object Number]"]=r6["[object Object]"]=r6["[object RegExp]"]=r6["[object Set]"]=r6["[object String]"]=r6["[object WeakMap]"]=!1;var r4=function(e){return function(t){return e(t)}},r8="object"==typeof exports&&exports&&!exports.nodeType&&exports,r9=r8&&"object"==typeof module&&module&&!module.nodeType&&module,r7=r9&&r9.exports===r8&&nP.process,ie=function(){try{var e=r9&&r9.require&&r9.require("util").types;if(e)return e;return r7&&r7.binding&&r7.binding("util")}catch(e){}}(),it=ie&&ie.isTypedArray,ir=it?r4(it):function(e){return nV(e)&&rq(e.length)&&!!r6[nF(e)]},ii=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},io=Object.prototype.hasOwnProperty,is=function(e,t,n){var r=e[t];(!(io.call(e,t)&&n6(r,n))||void 0===n&&!(t in e))&&rw(e,t,n)},il=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var l=t[o],a=r?r(n[l],e[l],l,n,e):void 0;void 0===a&&(a=e[l]),i?rw(n,l,a):is(n,l,a)}return n},ia=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},iu=/^(?:0|[1-9]\d*)$/,ic=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&iu.test(e))&&e>-1&&e%1==0&&e<t},ih=Object.prototype.hasOwnProperty,id=function(e,t){var n=rH(e),r=!n&&rG(e),i=!n&&!r&&rZ(e),o=!n&&!r&&!i&&ir(e),s=n||r||i||o,l=s?ia(e.length,String):[],a=l.length;for(var u in e)(t||ih.call(e,u))&&!(s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ic(u,a)))&&l.push(u);return l},ip=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ig=Object.prototype.hasOwnProperty,im=function(e){if(!nS(e))return ip(e);var t=rD(e),n=[];for(var r in e)!("constructor"==r&&(t||!ig.call(e,r)))&&n.push(r);return n},iy=function(e){return rW(e)?id(e,!0):im(e)},ib=function(e,t,n,r,i,o,s){var l=ii(e,n),a=ii(t,n),u=s.get(a);if(u){rC(e,n,u);return}var c=o?o(l,a,n+"",e,t,s):void 0,h=void 0===c;if(h){var d,f=rH(a),p=!f&&rZ(a),g=!f&&!p&&ir(a);if(c=a,f||p||g)rH(l)?c=l:rX(l)?c=rj(l):p?(h=!1,c=rA(a,!0)):g?(h=!1,c=rN(a,!0)):c=[];else if(r5(a)||rG(a)){if(c=l,rG(l)){;c=il(d=l,iy(d))}else(!nS(l)||n7(l))&&(c=rz(a))}else h=!1}h&&(s.set(a,c),i(c,a,r,o,s),s.delete(a)),rC(e,n,c)},iv=function e(t,n,r,i,o){if(t!==n)rE(n,function(s,l){if(o||(o=new rv),nS(s))ib(t,n,l,r,e,i,o);else{var a=i?i(ii(t,l),s,l+"",t,n,o):void 0;void 0===a&&(a=s),rC(t,l,a)}},iy)},ix=function(e){return e},iw=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},iC=Math.max,iE=function(e,t,n){return t=iC(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=iC(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(s),iw(e,this,l)}},iS=Date.now;var iP=(d=rx?function(e,t){var n;return rx(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0})}:ix,f=0,p=0,function(){var e=iS(),t=16-(e-p);if(p=e,t>0){if(++f>=800)return arguments[0]}else f=0;return d.apply(void 0,arguments)}),iO=function(e,t){return iP(iE(e,t,ix),e+"")},ik=function(e,t,n){if(!nS(n))return!1;var r=typeof t;return("number"==r?!!(rW(n)&&ic(t,n.length)):"string"==r&&t in n)&&n6(n[t],e)},iA=function(e){return iO(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,s&&ik(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var l=n[r];l&&e(t,l,r,o)}return t})},iM=iA(function(e,t,n){iv(e,t,n)}),iT=function e(t,n,r,i,o,s){return nS(t)&&nS(n)&&(s.set(n,t),iv(t,n,void 0,e,s),s.delete(n)),t},iN=iA(function(e,t,n,r){iv(e,t,n,r)}),ij=iO(function(e){return e.push(void 0,iT),iw(iN,void 0,e)}),iI=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},iL=rR(Object.keys,Object),iR=Object.prototype.hasOwnProperty,i_=function(e){if(!rD(e))return iL(e);var t=[];for(var n in Object(e))iR.call(e,n)&&"constructor"!=n&&t.push(n);return t},iB=function(e){return rW(e)?id(e):i_(e)},iD=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o},iz=function(){return[]},iF=Object.prototype.propertyIsEnumerable,iV=Object.getOwnPropertySymbols,i$=iV?function(e){return null==e?[]:iD(iV(e=Object(e)),function(t){return iF.call(e,t)})}:iz,iU=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},iG=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)iU(t,i$(e)),e=r_(e);return t}:iz,iH=function(e,t,n){var r=t(e);return rH(e)?r:iU(r,n(e))},iq=function(e){return iH(e,iB,i$)},iW=function(e){return iH(e,iy,iG)},iX=rc(nk,"DataView"),iY=rc(nk,"Promise"),iJ=rc(nk,"Set"),iQ=rc(nk,"WeakMap"),iK="[object Map]",iZ="[object Promise]",i0="[object Set]",i1="[object WeakMap]",i2="[object DataView]",i3=rr(iX),i5=rr(rh),i6=rr(iY),i4=rr(iJ),i8=rr(iQ),i9=nF;(iX&&i9(new iX(new ArrayBuffer(1)))!=i2||rh&&i9(new rh)!=iK||iY&&i9(iY.resolve())!=iZ||iJ&&i9(new iJ)!=i0||iQ&&i9(new iQ)!=i1)&&(i9=function(e){var t=nF(e),n="[object Object]"==t?e.constructor:void 0,r=n?rr(n):"";if(r)switch(r){case i3:return i2;case i5:return iK;case i6:return iZ;case i4:return i0;case i8:return i1}return t});var i7=i9,oe=Object.prototype.hasOwnProperty,ot=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&oe.call(e,"index")&&(n.index=e.index,n.input=e.input),n},on=function(e,t){var n=t?rT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},or=/\w*$/,oi=function(e){var t=new e.constructor(e.source,or.exec(e));return t.lastIndex=e.lastIndex,t},oo=nj?nj.prototype:void 0,os=oo?oo.valueOf:void 0,ol=function(e,t,n){var r,i=e.constructor;switch(t){case"[object ArrayBuffer]":return rT(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return on(e,n);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 rN(e,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return oi(e);case"[object Symbol]":;return r=e,os?Object(os.call(r)):{}}},oa=ie&&ie.isMap,ou=oa?r4(oa):function(e){return nV(e)&&"[object Map]"==i7(e)},oc=ie&&ie.isSet,oh=oc?r4(oc):function(e){return nV(e)&&"[object Set]"==i7(e)},od="[object Arguments]",of="[object Function]",op="[object Object]",og={};og[od]=og["[object Array]"]=og["[object ArrayBuffer]"]=og["[object DataView]"]=og["[object Boolean]"]=og["[object Date]"]=og["[object Float32Array]"]=og["[object Float64Array]"]=og["[object Int8Array]"]=og["[object Int16Array]"]=og["[object Int32Array]"]=og["[object Map]"]=og["[object Number]"]=og[op]=og["[object RegExp]"]=og["[object Set]"]=og["[object String]"]=og["[object Symbol]"]=og["[object Uint8Array]"]=og["[object Uint8ClampedArray]"]=og["[object Uint16Array]"]=og["[object Uint32Array]"]=!0,og["[object Error]"]=og[of]=og["[object WeakMap]"]=!1;var om=function e(t,n,r,i,o,s){var l,a=1&n,u=2&n,c=4&n;if(r&&(l=o?r(t,i,o,s):r(t)),void 0!==l)return l;if(!nS(t))return t;var h=rH(t);if(h){if(l=ot(t),!a)return rj(t,l)}else{var d,f,p,g,m,y,b,v,x=i7(t),w=x==of||"[object GeneratorFunction]"==x;if(rZ(t))return rA(t,a);if(x==op||x==od||w&&!o){if(l=u||w?{}:rz(t),!a){;return u?(p=t,g=(d=l,f=t,d&&il(f,iy(f),d)),il(p,iG(p),g)):(b=t,v=(m=l,y=t,m&&il(y,iB(y),m)),il(b,i$(b),v))}}else{if(!og[x])return o?t:{};l=ol(t,x,a)}}s||(s=new rv);var C=s.get(t);if(C)return C;s.set(t,l),oh(t)?t.forEach(function(i){l.add(e(i,n,r,i,t,s))}):ou(t)&&t.forEach(function(i,o){l.set(o,e(i,n,r,o,t,s))});var E=c?u?iW:iq:u?iy:iB,S=h?void 0:E(t);return iI(S||t,function(i,o){S&&(i=t[o=i]),is(l,o,e(i,n,r,o,t,s))}),l},oy=function(e){return om(e,4)},ob=Object.prototype.hasOwnProperty,ov=function(e){if(null==e)return!0;if(rW(e)&&(rH(e)||"string"==typeof e||"function"==typeof e.splice||rZ(e)||ir(e)||rG(e)))return!e.length;var t=i7(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(rD(e))return!i_(e).length;for(var n in e)if(ob.call(e,n))return!1;return!0},ox=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ow=/^\w*$/,oC=function(e,t){if(rH(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||n$(e))||ow.test(e)||!ox.test(e)||null!=t&&e in Object(t)};function oE(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(oE.Cache||rb),n}oE.Cache=rb;var oS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oP=/\\(\\)?/g;var oO=(b=(y=oE(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(oS,function(e,n,r,i){t.push(r?i.replace(oP,"$1"):n||e)}),t},function(e){return 500===b.size&&b.clear(),e})).cache,y),ok=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},oA=1/0,oM=nj?nj.prototype:void 0,oT=oM?oM.toString:void 0,oN=function e(t){if("string"==typeof t)return t;if(rH(t))return ok(t,e)+"";if(n$(t))return oT?oT.call(t):"";var n=t+"";return"0"==n&&1/t==-oA?"-0":n},oj=function(e){return null==e?"":oN(e)},oI=function(e,t){return rH(e)?e:oC(e,t)?[e]:oO(oj(e))},oL=1/0,oR=function(e){if("string"==typeof e||n$(e))return e;var t=e+"";return"0"==t&&1/e==-oL?"-0":t},o_=function(e,t){t=oI(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[oR(t[n++])];return n&&n==r?e:void 0},oB=function(e,t,n,r){if(!nS(e))return e;t=oI(t,e);for(var i=-1,o=t.length,s=o-1,l=e;null!=l&&++i<o;){var a=oR(t[i]),u=n;if("__proto__"===a||"constructor"===a||"prototype"===a)break;if(i!=s){var c=l[a];void 0===(u=r?r(c,a,l):void 0)&&(u=nS(c)?c:ic(t[i+1])?[]:{})}is(l,a,u),l=l[a]}return e},oD=function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],l=o_(e,s);n(l,s)&&oB(o,oI(s,e),l)}return o},oz=function(e,t){return null!=e&&t in Object(e)},oF=function(e,t,n){t=oI(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=oR(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&rq(i)&&ic(s,i)&&(rH(e)||rG(e))},oV=function(e,t){return null!=e&&oF(e,t,oz)},o$=nj?nj.isConcatSpreadable:void 0,oU=function(e){return rH(e)||rG(e)||!!(o$&&e&&e[o$])},oG=function e(t,n,r,i,o){var s=-1,l=t.length;for(r||(r=oU),o||(o=[]);++s<l;){var a=t[s];n>0&&r(a)?n>1?e(a,n-1,r,i,o):iU(o,a):!i&&(o[o.length]=a)}return o},oH=function(e){return(null==e?0:e.length)?oG(e,1):[]};iP(iE(v=function(e,t){var n;return null==e?{}:oD(n=e,t,function(e,t){return oV(n,t)})},void 0,oH),v+"");var oq=Object.prototype,oW=oq.hasOwnProperty,oX=iO(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&ik(t[0],t[1],i)&&(r=1);++n<r;){for(var o=t[n],s=iy(o),l=-1,a=s.length;++l<a;){var u=s[l],c=e[u];(void 0===c||n6(c,oq[u])&&!oW.call(e,u))&&(e[u]=o[u])}}return e});function oY(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new rb;++t<n;)this.add(e[t])}oY.prototype.add=oY.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},oY.prototype.has=function(e){return this.__data__.has(e)};var oJ=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},oQ=function(e,t){return e.has(t)},oK=function(e,t,n,r,i,o){var s=1&n,l=e.length,a=t.length;if(l!=a&&!(s&&a>l))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var h=-1,d=!0,f=2&n?new oY:void 0;for(o.set(e,t),o.set(t,e);++h<l;){var p=e[h],g=t[h];if(r)var m=s?r(g,p,h,t,e,o):r(p,g,h,e,t,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!oJ(t,function(e,t){if(!oQ(f,t)&&(p===e||i(p,e,n,r,o)))return f.push(t)})){d=!1;break}}else if(!(p===g||i(p,g,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d},oZ=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},o0=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},o1=nj?nj.prototype:void 0,o2=o1?o1.valueOf:void 0,o3=function(e,t,n,r,i,o,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new rM(e),new rM(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return n6(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=oZ;case"[object Set]":var a=1&r;if(l||(l=o0),e.size!=t.size&&!a)break;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var c=oK(l(e),l(t),r,i,o,s);return s.delete(e),c;case"[object Symbol]":if(o2)return o2.call(e)==o2.call(t)}return!1},o5=Object.prototype.hasOwnProperty,o6=function(e,t,n,r,i,o){var s=1&n,l=iq(e),a=l.length;if(a!=iq(t).length&&!s)return!1;for(var u=a;u--;){var c=l[u];if(!(s?c in t:o5.call(t,c)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=s;++u<a;){var g=e[c=l[u]],m=t[c];if(r)var y=s?r(m,g,c,t,e,o):r(g,m,c,e,t,o);if(!(void 0===y?g===m||i(g,m,n,r,o):y)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var b=e.constructor,v=t.constructor;b!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v)&&(f=!1)}return o.delete(e),o.delete(t),f},o4="[object Arguments]",o8="[object Array]",o9="[object Object]",o7=Object.prototype.hasOwnProperty,se=function(e,t,n,r,i,o){var s=rH(e),l=rH(t),a=s?o8:i7(e),u=l?o8:i7(t);a=a==o4?o9:a,u=u==o4?o9:u;var c=a==o9,h=u==o9,d=a==u;if(d&&rZ(e)){if(!rZ(t))return!1;s=!0,c=!1}if(d&&!c)return o||(o=new rv),s||ir(e)?oK(e,t,n,r,i,o):o3(e,t,a,n,r,i,o);if(!(1&n)){var f=c&&o7.call(e,"__wrapped__"),p=h&&o7.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return o||(o=new rv),i(g,m,n,r,o)}}return!!d&&(o||(o=new rv),o6(e,t,n,r,i,o))},st=function e(t,n,r,i,o){return t===n||(null!=t&&null!=n&&(nV(t)||nV(n))?se(t,n,r,i,e,o):t!=t&&n!=n)},sn=function(e,t){return st(e,t)},sr=Object.prototype.hasOwnProperty,si=function(e,t){return null!=e&&sr.call(e,t)},so=function(e,t){return null!=e&&oF(e,t,si)},ss=function(e){return om(e,5)};let sl=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},sa=/^\s*class\s+/.test(`${class e{}}`)||/^\s*class\s*\{/.test(`${class{}}`);function su(e,t){let n;return sa?n=class extends t{}:!function(e,t){function n(){this.constructor=e}sl(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(n=function(){return t.apply(this,arguments)},t),Object.defineProperty(n,"name",{value:e}),n}function sc(e){return"__proto__"===e}function sh(e,t,n="/"){let r;let i=Array.isArray(t)?t:t.split(n);if(i.length)for(r=e;i.length;){let e=i.shift();if(Object(r)!==r||!e||!(e in r))return;r=r[e]}return r}function sd(e,t,n,r="/"){let i=Array.isArray(t)?t:t.split(r),o=i.pop();if(o&&!sc(o)){let t=e;i.forEach(e=>{!sc(e)&&(null==t[e]&&(t[e]={}),t=t[e])}),t[o]=n}return e}function sf(e,t,n="/"){let r=Array.isArray(t)?t.slice():t.split(n),i=r.pop();if(i){if(r.length>0){let t=sh(e,r);t&&delete t[i]}else delete e[i]}return e}class sp extends n5{dispose(){this.off()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([nC.dispose()],sp.prototype,"dispose",null),(sp||(sp={})).dispose=nC.dispose,!function(e,...t){t.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{"constructor"!==n&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}(sp,nC);var sg=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return -1},sm=function(e){return e!=e},sy=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1},sb=function(e,t){var n,r,i;return!!(null==e?0:e.length)&&(n=e,i=0,((r=t)==r?sy(n,r,0):sg(n,sm,i))>-1)},sv=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1},sx=function(e,t,n,r){var i=-1,o=sb,s=!0,l=e.length,a=[],u=t.length;if(!l)return a;n&&(t=ok(t,r4(n))),r?(o=sv,s=!1):t.length>=200&&(o=oQ,s=!1,t=new oY(t));e:for(;++i<l;){var c=e[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,s&&h==h){for(var d=u;d--;)if(t[d]===h)continue e;a.push(c)}else!o(t,h,r)&&a.push(c)}return a},sw=iO(function(e,t){return rX(e)?sx(e,oG(t,1,rX,!0)):[]}),sC=function(e,t,n,r){var i=n.length,o=i,s=!r;if(null==e)return!o;for(e=Object(e);i--;){var l=n[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){var a=(l=n[i])[0],u=e[a],c=l[1];if(s&&l[2]){if(void 0===u&&!(a in e))return!1}else{var h=new rv;if(r)var d=r(u,c,a,e,t,h);if(!(void 0===d?st(c,u,3,r,h):d))return!1}}return!0},sE=function(e){return e==e&&!nS(e)},sS=function(e){for(var t=iB(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,sE(i)]}return t},sP=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},sO=function(e){var t=sS(e);return 1==t.length&&t[0][2]?sP(t[0][0],t[0][1]):function(n){return n===e||sC(n,e,t)}},sk=function(e,t,n){var r=null==e?void 0:o_(e,t);return void 0===r?n:r},sA=function(e){var t,n;return oC(e)?(t=oR(e),function(e){return null==e?void 0:e[t]}):(n=e,function(e){return o_(e,n)})},sM=function(e){if("function"==typeof e)return e;if(null==e)return ix;if("object"==typeof e){var t,n;return rH(e)?(t=e[0],n=e[1],oC(t)&&sE(n)?sP(oR(t),n):function(e){var r=sk(e,t);return void 0===r&&r===n?oV(e,t):st(n,r,3)}):sO(e)}return sA(e)},sT=0xfffffffe,sN=Math.floor,sj=Math.min,sI=function(e,t,n,r){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var s=(t=n(t))!=t,l=null===t,a=n$(t),u=void 0===t;i<o;){var c=sN((i+o)/2),h=n(e[c]),d=void 0!==h,f=null===h,p=h==h,g=n$(h);if(s)var m=r||p;else m=u?p&&(r||d):l?p&&d&&(r||!f):a?p&&d&&!f&&(r||!g):!f&&!g&&(r?h<=t:h<t);m?i=c+1:o=c}return sj(o,sT)},sL=iJ&&1/o0(new iJ([,-0]))[1]==1/0?function(e){return new iJ(e)}:function(){},sR=function(e,t,n){var r=-1,i=sb,o=e.length,s=!0,l=[],a=l;if(n)s=!1,i=sv;else if(o>=200){var u=t?null:sL(e);if(u)return o0(u);s=!1,i=oQ,a=new oY}else a=t?[]:l;e:for(;++r<o;){var c=e[r],h=t?t(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var d=a.length;d--;)if(a[d]===h)continue e;t&&a.push(h),l.push(c)}else!i(a,h,n)&&(a!==l&&a.push(h),l.push(c))}return l},s_=function(e){return e&&e.length?sR(e):[]},sB=function(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(null!=s&&(void 0===l?s==s&&!n$(s):n(s,l)))var l=s,a=o}return a},sD=function(e,t){return e>t};var sz=(x=function(e,t){return e&&rE(e,t,iB)},function(e,t){if(null==e)return e;if(!rW(e))return x(e,t);for(var n=e.length,r=-1,i=Object(e);(w?r--:++r<n)&&!1!==t(i[r],r,i););return e}),sF=function(e,t){var n=-1,r=rW(e)?Array(e.length):[];return sz(e,function(e,i,o){r[++n]=t(e,i,o)}),r},sV=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},s$=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=n$(e),s=void 0!==t,l=null===t,a=t==t,u=n$(t);if(!l&&!u&&!o&&e>t||o&&s&&a&&!l&&!u||r&&s&&a||!n&&a||!i)return 1;if(!r&&!o&&!u&&e<t||u&&n&&i&&!r&&!o||l&&n&&i||!s&&i||!a)return -1}return 0},sU=function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,l=n.length;++r<s;){var a=s$(i[r],o[r]);if(a){if(r>=l)return a;return a*("desc"==n[r]?-1:1)}}return e.index-t.index},sG=function(e,t,n){t=t.length?ok(t,function(e){return rH(e)?function(t){return o_(t,1===e.length?e[0]:e)}:e}):[ix];var r=-1;return t=ok(t,r4(sM)),sV(sF(e,function(e,n,i){return{criteria:ok(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return sU(e,t,n)})},sH=iO(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ik(e,t[0],t[1])?t=[]:n>2&&ik(t[0],t[1],t[2])&&(t=[t[0]]),sG(e,oG(t,1),[])}),sq=iO(function(e){return sR(oG(e,1,rX,!0))}),sW=function(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r},sX=function(e,t,n,r){return sz(e,function(e,i,o){t(r,e,n(e),o)}),r},sY=Object.prototype.hasOwnProperty;var sJ=(C=function(e,t,n){sY.call(e,n)?e[n].push(t):rw(e,n,[t])},function(e,t){var n=rH(e)?sW:sX,r={};return n(e,C,sM(t,2),r)}),sQ=0x7fffffff,sK=function(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=sQ){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!n$(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return sI(e,t,ix,n)},sZ=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n};var s0=(S={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(e){return null==S?void 0:S[e]}),s1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s2=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),s3=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s5=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,s6="\ud800-\udfff",s4="\\u2700-\\u27bf",s8="a-z\\xdf-\\xf6\\xf8-\\xff",s9="A-Z\\xc0-\\xd6\\xd8-\\xde",s7="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",le="['’]",lt="["+s7+"]",ln="["+s8+"]",lr="[^"+s6+s7+"\\d+"+s4+s8+s9+"]",li="(?:\ud83c[\udde6-\uddff]){2}",lo="[\ud800-\udbff][\udc00-\udfff]",ls="["+s9+"]",ll="(?:"+ln+"|"+lr+")",la="(?:"+ls+"|"+lr+")",lu="(?:"+le+"(?:d|ll|m|re|s|t|ve))?",lc="(?:"+le+"(?:D|LL|M|RE|S|T|VE))?",lh="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",ld="[\\ufe0e\\ufe0f]?",lf="(?:\\u200d(?:"+["[^"+s6+"]",li,lo].join("|")+")"+ld+lh+")*",lp="(?:"+["["+s4+"]",li,lo].join("|")+")"+(ld+lh+lf),lg=RegExp([ls+"?"+ln+"+"+lu+"(?="+[lt,ls,"$"].join("|")+")",la+"+"+lc+"(?="+[lt,ls+ll,"$"].join("|")+")",ls+"?"+ll+"+"+lu,ls+"+"+lc,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",lp].join("|"),"g"),lm=function(e,t,n){if(e=oj(e),void 0===(t=n?void 0:t)){var r;return(r=e,s5.test(r))?e.match(lg)||[]:e.match(s3)||[]}return e.match(t)||[]},ly=RegExp("['’]","g"),lb=function(e){return function(t){var n;return sZ(lm(((n=oj(n=t))&&n.replace(s1,s0).replace(s2,"")).replace(ly,"")),e,"")}},lv=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o},lx=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:lv(e,t,n)},lw=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),lC=function(e){return lw.test(e)},lE="\ud800-\udfff",lS="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",lP="\ud83c[\udffb-\udfff]",lO="[^"+lE+"]",lk="(?:\ud83c[\udde6-\uddff]){2}",lA="[\ud800-\udbff][\udc00-\udfff]",lM="(?:"+lS+"|"+lP+")?",lT="[\\ufe0e\\ufe0f]?",lN="(?:\\u200d(?:"+[lO,lk,lA].join("|")+")"+lT+lM+")*",lj=RegExp(lP+"(?="+lP+")|"+("(?:"+[lO+lS+"?",lS,lk,lA,"["+lE+"]"].join("|")+")")+(lT+lM+lN),"g"),lI=function(e){return lC(e)?e.match(lj)||[]:e.split("")},lL=function(e){return function(t){var n=lC(t=oj(t))?lI(t):void 0,r=n?n[0]:t.charAt(0),i=n?lx(n,1).join(""):t.slice(1);return r[e]()+i}},lR=lL("toUpperCase"),l_=lb(function(e,t,n){return e+(n?" ":"")+lR(t)}),lB=lb(function(e,t,n){return t=t.toLowerCase(),e+(n?lR(oj(t).toLowerCase()):t)}),lD=lb(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),lz=lb(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),lF=lL("toLowerCase");let lV=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},l$=lV(e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase()),lU=lV(e=>l_(lB(e)).replace(/ /g,""));function lG(e){let t=0x811c9dc5,n=!1,r=e;for(let e=0,i=r.length;e<i;e+=1){let i=r.charCodeAt(e);i>127&&!n&&(i=(r=unescape(encodeURIComponent(r))).charCodeAt(e),n=!0),t^=i,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}return t>>>0}function lH(){let e="",t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let n=0,r=t.length;n<r;n+=1){let r=t[n],i=16*Math.random()|0;e+=("x"===r?i:"y"===r?3&i|8:r).toString(16)}return e}lV(e=>lD(e).replace(/ /g,"_")),lV(e=>lz(e).replace(/ /g,".")),lV(e=>lz(e).replace(/ /g,"/")),lV(e=>lR(lz(e))),lV(e=>l_(lB(e)));var lq=function(e){return"number"==typeof e||nV(e)&&"[object Number]"==nF(e)},lW=function(e,t,n){var r,i,o;return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=nX(n))==n?n:0),void 0!==t&&(t=(t=nX(t))==t?t:0),r=nX(e),i=t,o=n,r==r&&(void 0!==o&&(r=r<=o?r:o),void 0!==i&&(r=r>=i?r:i)),r};function lX(e){return"string"==typeof e&&"%"===e.slice(-1)}function lY(e,t){let n;if(null==e)return 0;if("string"==typeof e){if(n=parseFloat(e),lX(e)&&Number.isFinite(n/=100))return n*t}else n=e;return Number.isFinite(n)?n>0&&n<1?n*t:n:0}function lJ(e){if("object"==typeof e){let t=0,n=0,r=0,i=0;return null!=e.vertical&&Number.isFinite(e.vertical)&&(n=i=e.vertical),null!=e.horizontal&&Number.isFinite(e.horizontal)&&(r=t=e.horizontal),null!=e.left&&Number.isFinite(e.left)&&(t=e.left),null!=e.top&&Number.isFinite(e.top)&&(n=e.top),null!=e.right&&Number.isFinite(e.right)&&(r=e.right),null!=e.bottom&&Number.isFinite(e.bottom)&&(i=e.bottom),{top:n,right:r,bottom:i,left:t}}let t=0;return null!=e&&Number.isFinite(e)&&(t=e),{top:t,right:t,bottom:t,left:t}}let lQ=!1,lK=!1,lZ=!1,l0=!1,l1=!1,l2=!1,l3=!1,l5=!1,l6=!1,l4=!1,l8=!1,l9=!1,l7=!1,ae=!1,at=!1,an=!1;if("object"==typeof navigator){let e=navigator.userAgent;lQ=e.indexOf("Macintosh")>=0,lK=!!e.match(/(iPad|iPhone|iPod)/g),lZ=e.indexOf("Windows")>=0,l0=e.indexOf("MSIE")>=0,l1=!!e.match(/Trident\/7\./),l2=!!e.match(/Edge\//),l3=e.indexOf("Mozilla/")>=0&&0>e.indexOf("MSIE")&&0>e.indexOf("Edge/"),l6=e.indexOf("Chrome/")>=0&&0>e.indexOf("Edge/"),l4=e.indexOf("Opera/")>=0||e.indexOf("OPR/")>=0,l8=e.indexOf("Firefox/")>=0,l9=e.indexOf("AppleWebKit/")>=0&&0>e.indexOf("Chrome/")&&0>e.indexOf("Edge/"),"object"==typeof document&&(an=!document.createElementNS||"[object SVGForeignObjectElement]"!=`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`||e.indexOf("Opera/")>=0)}if("object"==typeof window&&(l5=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,ae=null!=window.PointerEvent&&!lQ),"object"==typeof document){l7="ontouchstart"in document.documentElement;try{let e=Object.defineProperty({},"passive",{get(){at=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},e)}catch(e){}}(P=e4||(e4={})).IS_MAC=lQ,P.IS_IOS=lK,P.IS_WINDOWS=lZ,P.IS_IE=l0,P.IS_IE11=l1,P.IS_EDGE=l2,P.IS_NETSCAPE=l3,P.IS_CHROME_APP=l5,P.IS_CHROME=l6,P.IS_OPERA=l4,P.IS_FIREFOX=l8,P.IS_SAFARI=l9,P.SUPPORT_TOUCH=l7,P.SUPPORT_POINTER=ae,P.SUPPORT_PASSIVE=at,P.NO_FOREIGNOBJECT=an,P.SUPPORT_FOREIGNOBJECT=!P.NO_FOREIGNOBJECT,!function(e){function t(){let e=window.module;return null!=e&&null!=e.hot&&null!=e.hot.status?e.hot.status():"unkonwn"}e.getHMRStatus=t;e.isApplyingHMR=function(){return"apply"===t()};let n={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};e.isEventSupported=function(e){let t=document.createElement(n[e]||"div"),r=`on${e}`,i=r in t;return!i&&(t.setAttribute(r,"return;"),i="function"==typeof t[r]),i}}(e4||(e4={}));let ar=/[\t\r\n\f]/g,ai=/\S+/g,ao=e=>` ${e} `;function as(e){return e&&e.getAttribute&&e.getAttribute("class")||""}function al(e,t){if(null==e||null==t)return!1;let n=ao(as(e)),r=ao(t);return 1===e.nodeType&&n.replace(ar," ").includes(r)}function aa(e,t){if(null!=e&&null!=t){if("function"==typeof t)return aa(e,t(as(e)));if("string"==typeof t&&1===e.nodeType){let n=t.match(ai)||[],r=ao(as(e)).replace(ar," "),i=n.reduce((e,t)=>0>e.indexOf(ao(t))?`${e}${t} `:e,r);r!==(i=i.trim())&&e.setAttribute("class",i)}}}function au(e,t){if(null!=e){if("function"==typeof t)return au(e,t(as(e)));if((!t||"string"==typeof t)&&1===e.nodeType){let n=(t||"").match(ai)||[],r=ao(as(e)).replace(ar," "),i=n.reduce((e,t)=>{let n=ao(t);return e.indexOf(n)>-1?e.replace(n," "):e},r);r!==(i=t?i.trim():"")&&e.setAttribute("class",i)}}}let ac=0;function ah(e){return(null==e.id||""===e.id)&&(e.id=(ac+=1,`v${ac}`)),e.id}function ad(e){return null!=e&&"function"==typeof e.getScreenCTM&&e instanceof SVGElement}let af={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"};function ap(e,t=document){return t.createElement(e)}function ag(e,t=af.xhtml,n=document){return n.createElementNS(t,e)}function am(e,t=document){return ag(e,af.svg,t)}function ay(e){if(e){let{documentElement:t}=function(e,t={}){let n;try{let r=new DOMParser;null!=t.async&&(r.async=t.async),n=r.parseFromString(e,t.mimeType||"text/xml")}catch(e){n=void 0}if(!n||n.getElementsByTagName("parsererror").length)throw Error(`Invalid XML: ${e}`);return n}(`<svg xmlns="${af.svg}" xmlns:xlink="${af.xlink}" version="1.1">${e}</svg>`,{async:!1});return t}let t=document.createElementNS(af.svg,"svg");return t.setAttributeNS(af.xmlns,"xmlns:xlink",af.xlink),t.setAttribute("version","1.1"),t}function ab(e){let t=0,n=e.previousSibling;for(;n;)1===n.nodeType&&(t+=1),n=n.previousSibling;return t}function av(e,t,n){let r=e.ownerSVGElement,i=e.parentNode;for(;i&&i!==n&&i!==r;){if(al(i,t))return i;i=i.parentNode}return null}function ax(e,t){let n=t&&t.parentNode;return e===n||!!(n&&1===n.nodeType&&16&e.compareDocumentPosition(n))}function aw(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function aC(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function aE(e,t){(Array.isArray(t)?t:[t]).forEach(t=>{null!=t&&e.appendChild(t)})}function aS(e,t){let n=e.firstChild;return n?aP(n,t):aE(e,t)}function aP(e,t){let n=e.parentNode;n&&(Array.isArray(t)?t:[t]).forEach(t=>{null!=t&&n.insertBefore(t,e)})}function aO(e,t){null!=t&&t.appendChild(e)}function ak(e){try{return e instanceof HTMLElement}catch(t){return"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument}}let aA=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function aM(e,t){let n=aI(t);n.ns?e.hasAttributeNS(n.ns,n.local)&&e.removeAttributeNS(n.ns,n.local):e.hasAttribute(t)&&e.removeAttribute(t)}function aT(e,t,n){if(null==n)return aM(e,t);let r=aI(t);r.ns&&"string"==typeof n?e.setAttributeNS(r.ns,t,n):"id"===t?e.id=`${n}`:e.setAttribute(t,`${n}`)}function aN(e,t){Object.keys(t).forEach(n=>{aT(e,n,t[n])})}function aj(e,t,n){if(null==t){let t=e.attributes,n={};for(let e=0;e<t.length;e+=1)n[t[e].name]=t[e].value;return n}if("string"==typeof t&&void 0===n)return e.getAttribute(t);"object"==typeof t?aN(e,t):aT(e,t,n)}function aI(e){if(-1!==e.indexOf(":")){let t=e.split(":");return{ns:af[t[0]],local:t[1]}}return{ns:null,local:e}}function aL(e){let t={};return Object.keys(e).forEach(n=>{t[aA.includes(n)?n:l$(n)]=e[n]}),t}function aR(e){let t={};return e.split(";").forEach(e=>{let n=e.trim();if(n){let e=n.split("=");e.length&&(t[e[0].trim()]=e[1]?e[1].trim():"")}}),t}function a_(e,t){return Object.keys(t).forEach(n=>{if("class"===n)e[n]=e[n]?`${e[n]} ${t[n]}`:t[n];else if("style"===n){let r,i;let o="object"==typeof e[n],s="object"==typeof t[n];o&&s?(r=e[n],i=t[n]):o?(r=e[n],i=aR(t[n])):s?(r=aR(e[n]),i=t[n]):(r=aR(e[n]),i=aR(t[n])),e[n]=a_(r,i)}else e[n]=t[n]}),e}!function(e){function t(e){let t="data:";return e.substr(0,t.length)===t}e.isDataUrl=t;function n(e){let t,n=e.replace(/\s/g,""),r=(n=decodeURIComponent(n)).indexOf(","),i=n.slice(0,r),o=i.split(":")[1].split(";")[0],s=n.slice(r+1),l=new Uint8Array((t=i.indexOf("base64")>=0?atob(s):unescape(encodeURIComponent(s))).length);for(let e=0;e<t.length;e+=1)l[e]=t.charCodeAt(e);return new Blob([l],{type:o})}function r(e,t){let n=window.navigator.msSaveBlob;if(n)n(e,t);else{let n=window.URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}}e.imageToDataUri=function(e,n){if(!e||t(e)){setTimeout(()=>n(null,e));return}let r=()=>{n(Error(`Failed to load image: ${e}`))},i=window.FileReader?e=>{if(200===e.status){let t=new FileReader;t.onload=e=>{n(null,e.target.result)},t.onerror=r,t.readAsDataURL(e.response)}else r()}:t=>{if(200===t.status){let r=e.split(".").pop()||"png";"svg"===r&&(r="svg+xml"),n(null,`data:image/${r};base64,`+btoa((e=>{let t=[];for(let n=0;n<e.length;n+=32768)t.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return t.join("")})(new Uint8Array(t.response))))}else r()},o=new XMLHttpRequest;o.responseType=window.FileReader?"blob":"arraybuffer",o.open("GET",e,!0),o.addEventListener("error",r),o.addEventListener("load",()=>i(o)),o.send()},e.dataUriToBlob=n,e.downloadBlob=r;e.downloadDataUri=function(e,t){r(n(e),t)};function i(e){let t=parseFloat(e);return Number.isNaN(t)?null:t}e.svgToDataUrl=function(e,t={}){let n=null,r=t=>(null==n&&(n=function(e){let t=e.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return t&&t[2]?t[2].replace(/\s+/," ").split(" "):null}(e)),null!=n)?i(n[t]):null,o=t=>{let n=e.match(t);return n&&n[2]?i(n[2]):null},s=t.width;if(null==s&&(s=o(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==s&&(s=r(2)),null==s)throw Error("Can not parse width from svg string");let l=t.height;if(null==l&&(l=o(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==l&&(l=r(3)),null==l)throw Error("Can not parse height from svg string");let a=encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22");return`data:image/svg+xml,${a}`}}(e8||(e8={}));let aB={px:e=>e,mm:t=>e*t,cm:t=>e*t*10,in:t=>e*t*25.4,pt:t=>25.4*t/72*e,pc:t=>25.4*t/6*e};!function(t){function n(e,t,n){let r=document.createElement("div"),i=r.style;i.display="inline-block",i.position="absolute",i.left="-15000px",i.top="-15000px",i.width=e+(n||"px"),i.height=t+(n||"px"),document.body.appendChild(r);let o=r.getBoundingClientRect(),s={width:o.width||0,height:o.height||0};return document.body.removeChild(r),s}t.measure=n;t.toPx=function(t,r){null==e&&(e=n("1","1","mm").width);let i=r?aB[r]:null;return i?i(t):t}}(e9||(e9={}));let aD=/-(.)/g,az={},aF=["webkit","ms","moz","o"],aV=document?document.createElement("div").style:{};function a$(e,t){let n=e.ownerDocument&&e.ownerDocument.defaultView&&e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):window.getComputedStyle(e,null);return n&&t?n.getPropertyValue(t)||n[t]:n}!function(){if(document.selection||window.getSelection);}();let aU={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function aG(e,t,n){let r=window.getComputedStyle(e,null);return n?r.getPropertyValue(t)||void 0:r[t]||e.style[t]}function aH(e,t){return parseInt(aG(e,t),10)||0}function aq(e,t,n){if("string"==typeof t){var r,i,o;let s=(r=t,/^--/.test(r));if(!s&&(t=function(e){let t=e.replace(aD,(e,t)=>t.toUpperCase());if(null==az[t]){let e=t.charAt(0).toUpperCase()+t.slice(1);az[t]=t in aV?t:function(e){for(let t=0;t<aF.length;t+=1){let n=aF[t]+e;if(n in aV)return n}return null}(e)}return az[t]}(t)),void 0===n)return aG(e,t,s);if(!s){;i=t,o=n,n=aU[i]||"number"!=typeof o?o:`${o}px`}let l=e.style;return s?l.setProperty(t,n):l[t]=n,void 0}for(let n in t)aq(e,n,t[n])}let aW=new WeakMap;function aX(e,t){let n=lB(t),r=aW.get(e);if(r)return r[n]}function aY(e,t,n){if(!t){let t={};return Object.keys(aW).forEach(n=>{t[n]=aX(e,n)}),t}if("string"==typeof t)return void 0===n?aX(e,t):(!function(e,t,n){let r=lB(t),i=aW.get(e);i?i[r]=n:aW.set(e,{[r]:n})}(e,t,n),void 0);for(let n in t)aY(e,n,t[n])}let aJ={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function aQ(e,t,n){if(!!t){if("string"==typeof t)return(t=aJ[t]||t,arguments.length<3)?e[t]:(e[t]=n,void 0);for(let n in t)aQ(e,n,t[n])}}class aK{get[Symbol.toStringTag](){return aK.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,n){let r;if(!e)throw TypeError("Invalid element to create vector");if(aK.isVector(e))r=e.node;else if("string"==typeof e){if("svg"===e.toLowerCase())r=ay();else if("<"===e[0]){let t=ay(e);r=document.importNode(t.firstChild,!0)}else r=document.createElementNS(af.svg,e)}else r=e;this.node=r,t&&this.setAttributes(t),n&&this.append(n)}transform(e,t){return null==e?uc(this.node):(uc(this.node,e,t),this)}translate(e,t=0,n={}){return null==e?uh(this.node):(uh(this.node,e,t,n),this)}rotate(e,t,n,r={}){return null==e?ud(this.node):(ud(this.node,e,t,n,r),this)}scale(e,t){return null==e?uf(this.node):(uf(this.node,e,t),this)}getTransformToElement(e){let t=aK.toNode(e);return up(this.node,t)}removeAttribute(e){return aM(this.node,e),this}getAttribute(e){var t,n;return t=this.node,n=e,t.getAttribute(n)}setAttribute(e,t){return aT(this.node,e,t),this}setAttributes(e){return aN(this.node,e),this}attr(e,t){return null==e?aj(this.node):"string"==typeof e&&void 0===t?aj(this.node,e):("object"==typeof e?aj(this.node,e):aj(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:aK.create(this.node.ownerSVGElement)}defs(){let e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?aK.create(t):aK.create("defs").appendTo(e)}text(e,t={}){return a2(this.node,e,t),this}tagName(){return function(e,t=!0){let n=e.nodeName;return t?n.toLowerCase():n.toUpperCase()}(this.node)}clone(){return aK.create(this.node.cloneNode(!0))}remove(){return aw(this.node),this}empty(){return aC(this.node),this}append(e){return aE(this.node,aK.toNodes(e)),this}appendTo(e){return aO(this.node,aK.isVector(e)?e.node:e),this}prepend(e){return aS(this.node,aK.toNodes(e)),this}before(e){return aP(this.node,aK.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(aK.toNode(e),this.node),aK.create(e)}first(){return this.node.firstChild?aK.create(this.node.firstChild):null}last(){return this.node.lastChild?aK.create(this.node.lastChild):null}get(e){let t=this.node.childNodes[e];return t?aK.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(aK.toNode(e))}find(e){var t,n;let r=[];let i=(t=this.node,n=e,t.querySelectorAll(n));if(i)for(let e=0,t=i.length;e<t;e+=1)r.push(aK.create(i[e]));return r}findOne(e){var t,n;let r=(t=this.node,n=e,t.querySelector(n));return r?aK.create(r):null}findParentByClass(e,t){let n=av(this.node,e,t);return n?aK.create(n):null}matches(e){let t=this.node;this.node.matches;let n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return n&&n.call(t,e)}contains(e){return ax(this.node,aK.isVector(e)?e.node:e)}wrap(e){let t=aK.create(e),n=this.node.parentNode;return null!=n&&n.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(null==t.node.parentNode)return null;if(t=aK.create(t.node.parentNode),null==e)return t;do if("string"==typeof e?t.matches(e):t instanceof e)break;while(t=aK.create(t.node.parentNode));return t}children(){let e=this.node.childNodes,t=[];for(let n=0;n<e.length;n+=1)1===e[n].nodeType&&t.push(aK.create(e[n]));return t}eachChild(e,t){let n=this.children();for(let r=0,i=n.length;r<i;r+=1)e.call(n[r],n[r],r,n),t&&n[r].eachChild(e,t);return this}index(){return ab(this.node)}hasClass(e){return al(this.node,e)}addClass(e){return aa(this.node,e),this}removeClass(e){return au(this.node,e),this}toggleClass(e,t){return!function e(t,n,r){if(null!=t&&null!=n){if(null!=r&&"string"==typeof n){r?aa(t,n):au(t,n);return}if("function"==typeof n)return e(t,n(as(t),r),r);"string"==typeof n&&(n.match(ai)||[]).forEach(e=>{al(t,e)?au(t,e):aa(t,e)})}}(this.node,e,t),this}toLocalPoint(e,t){return function(e,t,n){let r=e instanceof SVGSVGElement?e:e.ownerSVGElement,i=r.createSVGPoint();i.x=t,i.y=n;try{let t=r.getScreenCTM(),n=i.matrixTransform(t.inverse()),o=up(e,r).inverse();return n.matrixTransform(o)}catch(e){return i}}(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?function(e,t=1){let n;let r=e.getTotalLength(),i=[],o=0;for(;o<r;)n=e.getPointAtLength(o),i.push({distance:o,x:n.x,y:n.y}),o+=t;return i}(this.node,e):[]}toPath(){return aK.create(function(e){let t=am("path");aj(t,aj(e));let n=a7(e);return n&&t.setAttribute("d",n),t}(this.node))}toPathData(){return a7(this.node)}}!function(e){function t(t){if(null==t)return!1;if(t instanceof e)return!0;let n=t[Symbol.toStringTag];return!!((null==n||n===e.toStringTag)&&t.node instanceof SVGElement)&&"function"==typeof t.sample&&"function"==typeof t.toPath||!1}function n(t,n,r){return new e(t,n,r)}e.toStringTag=`X6.${e.name}`,e.isVector=t,e.create=n;function r(e){return t(e)?e.node:e}e.createVectors=function(e){if("<"===e[0]){let t=ay(e),r=[];for(let e=0,i=t.childNodes.length;e<i;e+=1){let i=t.childNodes[e];r.push(n(document.importNode(i,!0)))}return r}return[n(e)]},e.toNode=r;e.toNodes=function(e){return Array.isArray(e)?e.map(e=>r(e)):[r(e)]}}(aK||(aK={}));let aZ=document.createElement("canvas").getContext("2d"),a0=/em$/;function a1(e,t){let n=parseFloat(e);return a0.test(e)?n*t:n}function a2(e,t,n={}){let r,i,o;t=t.replace(/ /g,"\xa0");let s=n.eol,l=n.textPath,a=n.textVerticalAnchor,u="middle"===a||"bottom"===a||"top"===a,c=n.x;void 0===c&&(c=e.getAttribute("x")||0);let h=n.includeAnnotationIndices,d=n.annotations;d&&!Array.isArray(d)&&(d=[d]);let f=n.lineHeight,p="auto"===f,g=p?"1.5em":f||"1em",m=!0,y=e.childNodes;if(1===y.length){let e=y[0];e&&"TITLE"===e.tagName.toUpperCase()&&(m=!1)}m&&aC(e),aj(e,{"xml:space":"preserve",display:t||n.displayEmpty?null:"none"});let b=aj(e,"font-size"),v=parseFloat(b);!v&&(v=16,(u||d)&&!b&&aj(e,"font-size",`${v}`)),l?("string"==typeof l&&(l={d:l}),r=function(e,t){let n=aK.create(t),r=aK.create("textPath"),i=e.d;if(i&&void 0===e["xlink:href"]){let e=aK.create("path").attr("d",i).appendTo(n.defs());r.attr("xlink:href",`#${e.id}`)}return"object"==typeof e&&r.attr(e),r.node}(l,e)):r=document.createDocumentFragment();let x=0,w=t.split("\n"),C=[],E=w.length-1;for(let e=0;e<=E;e+=1){let t;i=g;let n="v-line",a=am("tspan"),u=w[e];if(u){if(d){let n=(t=function(e,t,n){let r;let i=n.eol,o=n.baseSize,s=n.lineHeight,l=0,a={},u=t.length-1;for(let s=0;s<=u;s+=1){let a=t[s],c=null;if("object"==typeof a){let e=a.attrs,t=aK.create("tspan",e);r=t.node;let h=a.t;i&&s===u&&(h+=i),r.textContent=h;let d=e.class;d&&t.addClass(d),n.includeAnnotationIndices&&t.attr("annotations",a.annotations.join(",")),void 0===(c=parseFloat(e["font-size"]))&&(c=o),c&&c>l&&(l=c)}else i&&s===u&&(a+=i),r=document.createTextNode(a||" "),o&&o>l&&(l=o);e.appendChild(r)}return l&&(a.maxFontSize=l),s?a.lineHeight=s:l&&(a.lineHeight=1.2*l),a}(a,function(e,t,n={}){let r,i;let o=n.offset||0,s=[],l=[],a=null;for(let u=0;u<e.length;u+=1){r=l[u]=e[u];for(let i=0,s=t.length;i<s;i+=1){let s=t[i],a=s.start+o,c=s.end+o;u>=a&&u<c&&("string"==typeof r?r=l[u]={t:e[u],attrs:s.attrs}:r.attrs=a_(a_({},r.attrs),s.attrs),n.includeAnnotationIndices&&(null==r.annotations&&(r.annotations=[]),r.annotations.push(i)))}(i=l[u-1])?nS(r)&&nS(i)?JSON.stringify(r.attrs)===JSON.stringify(i.attrs)?a.t+=r.t:(s.push(a),a=r):nS(r)?(s.push(a),a=r):nS(i)?(s.push(a),a=r):a=(a||"")+r:a=r}return null!=a&&s.push(a),s}(u,d,{offset:-x,includeAnnotationIndices:h}),{eol:e!==E&&s,baseSize:v,lineHeight:p?null:g,includeAnnotationIndices:h})).lineHeight;n&&p&&0!==e&&(i=n),0===e&&(o=.8*t.maxFontSize)}else s&&e!==E&&(u+=s),a.textContent=u}else{a.textContent="-",n+=" v-empty-line";let e=a.style;e.fillOpacity=0,e.strokeOpacity=0,d&&(t={})}t&&C.push(t),e>0&&a.setAttribute("dy",i),(e>0||l)&&a.setAttribute("x",c),a.className.baseVal=n,r.appendChild(a),x+=u.length+1}if(u){if(d)i=function(e,t,n,r){let i;if(!Array.isArray(t))return 0;let o=t.length;if(!o)return 0;let s=t[0],l=a1(s.maxFontSize,n)||n,a=0,u=a1(r,n);for(let e=1;e<o;e+=1)a+=a1((s=t[e]).lineHeight,n)||u;let c=a1(s.maxFontSize,n)||n;switch(e){case"middle":i=l/2-.15*c-a/2;break;case"bottom":i=-(.25*c)-a;break;default:i=.8*l}return i}(a,C,v,g);else if("top"===a)i="0.8em";else{let e;switch(E>0?(e=(parseFloat(g)||1)*E,!a0.test(g)&&(e/=v)):e=0,a){case"middle":i=`${.3-e/2}em`;break;case"bottom":i=`${-e-.3}em`}}}else 0===a?i="0em":a?i=a:(i=0,null==e.getAttribute("y")&&e.setAttribute("y",`${o||"0.8em"}`));r.firstChild.setAttribute("dy",i),e.appendChild(r)}function a3(e,t={}){if(!e)return{width:0};let n=[],r=t["font-size"]?`${parseFloat(t["font-size"])}px`:"14px";return n.push(t["font-style"]||"normal"),n.push(t["font-variant"]||"normal"),n.push(t["font-weight"]||400),n.push(r),n.push(t["font-family"]||"sans-serif"),aZ.font=n.join(" "),aZ.measureText(e)}function a5(e,t,n,r={}){if(t>=n)return[e,""];let i=e.length,o={},s=Math.round(t/n*i-1);for(s<0&&(s=0);s>=0&&s<i;){let n=e.slice(0,s),i=o[n]||a3(n,r).width,l=e.slice(0,s+1),a=o[l]||a3(l,r).width;if(o[n]=i,o[l]=a,i>t)s-=1;else if(a<=t)s+=1;else break}return[e.slice(0,s),e.slice(s)]}function a6(e,t,n=NaN){let r=e.getAttribute(t);if(null==r)return n;let i=parseFloat(r);return Number.isNaN(i)?n:i}function a4(e){let t=e.map(e=>`${e.x} ${e.y}`);return`M ${t.join(" L")}`}function a8(e){let t=[],n=e.points;if(n)for(let e=0,r=n.numberOfItems;e<r;e+=1)t.push(n.getItem(e));return t}function a9(e){let t;let n=e.x,r=e.y,i=e.width,o=e.height,s=Math.min(e.rx||e["top-rx"]||0,i/2),l=Math.min(e.rx||e["bottom-rx"]||0,i/2),a=Math.min(e.ry||e["top-ry"]||0,o/2),u=Math.min(e.ry||e["bottom-ry"]||0,o/2);return(t=s||l||a||u?["M",n,r+a,"v",o-a-u,"a",l,u,0,0,0,l,u,"h",i-2*l,"a",l,u,0,0,0,l,-u,"v",-(o-u-a),"a",s,a,0,0,0,-s,-a,"h",-(i-2*s),"a",s,a,0,0,0,-s,a,"Z"]:["M",n,r,"H",n+i,"V",r+o,"H",n,"V",r,"Z"]).join(" ")}function a7(e){var t,n;let r=e.tagName.toLowerCase();switch(r){case"path":return e.getAttribute("d");case"line":;return["M",a6(t=e,"x1"),a6(t,"y1"),"L",a6(t,"x2"),a6(t,"y2")].join(" ");case"polygon":return function(e){let t=a8(e);return 0===t.length?null:`${a4(t)} Z`}(e);case"polyline":return function(e){let t=a8(e);return 0===t.length?null:a4(t)}(e);case"ellipse":return function(e){let t=a6(e,"cx",0),n=a6(e,"cy",0),r=a6(e,"rx"),i=a6(e,"ry")||r,o=.551784*r,s=.551784*i;return["M",t,n-i,"C",t+o,n-i,t+r,n-s,t+r,n,"C",t+r,n+s,t+o,n+i,t,n+i,"C",t-o,n+i,t-r,n+s,t-r,n,"C",t-r,n-s,t-o,n-i,t,n-i,"Z"].join(" ")}(e);case"circle":return function(e){let t=a6(e,"cx",0),n=a6(e,"cy",0),r=a6(e,"r"),i=.551784*r;return["M",t,n-r,"C",t+i,n-r,t+r,n-i,t+r,n,"C",t+r,n+i,t+i,n+r,t,n+r,"C",t-i,n+r,t-r,n+i,t-r,n,"C",t-r,n-i,t-i,n-r,t,n-r,"Z"].join(" ")}(e);case"rect":;return a9({x:a6(n=e,"x",0),y:a6(n,"y",0),width:a6(n,"width",0),height:a6(n,"height",0),rx:a6(n,"rx",0),ry:a6(n,"ry",0)})}throw Error(`"${r}" cannot be converted to svg path element.`)}let ue=am("svg"),ut=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,un=/[ ,]+/,ur=/^(\w+)\((.*)\)/;function ui(e){let t=ue.createSVGMatrix();if(null!=e)for(let n in e)t[n]=e[n];return t}function uo(e){return null!=e?(!(e instanceof DOMMatrix)&&(e=ui(e)),ue.createSVGTransformFromMatrix(e)):ue.createSVGTransform()}function us(e){let t=ui(),n=null!=e&&e.match(ut);if(!n)return t;for(let e=0,r=n.length;e<r;e+=1){let r=n[e].match(ur);if(r){let e,n,i,o,s;let l=ui(),a=r[2].split(un);switch(r[1].toLowerCase()){case"scale":e=parseFloat(a[0]),n=void 0===a[1]?e:parseFloat(a[1]),l=l.scaleNonUniform(e,n);break;case"translate":i=parseFloat(a[0]),o=parseFloat(a[1]),l=l.translate(i,o);break;case"rotate":s=parseFloat(a[0]),i=parseFloat(a[1])||0,o=parseFloat(a[2])||0,l=0!==i||0!==o?l.translate(i,o).rotate(s).translate(-i,-o):l.rotate(s);break;case"skewx":s=parseFloat(a[0]),l=l.skewX(s);break;case"skewy":s=parseFloat(a[0]),l=l.skewY(s);break;case"matrix":l.a=parseFloat(a[0]),l.b=parseFloat(a[1]),l.c=parseFloat(a[2]),l.d=parseFloat(a[3]),l.e=parseFloat(a[4]),l.f=parseFloat(a[5]);break;default:continue}t=t.multiply(l)}}return t}function ul(e){let t=e||{},n=null!=t.a?t.a:1,r=null!=t.b?t.b:0,i=null!=t.c?t.c:0,o=null!=t.d?t.d:1,s=null!=t.e?t.e:0,l=null!=t.f?t.f:0;return`matrix(${n},${r},${i},${o},${s},${l})`}function ua(e){let t,n,r;if(e){if(e.trim().indexOf("matrix")>=0){let i=function(e){let t=uu(e,{x:0,y:1}),n=uu(e,{x:1,y:0}),r=180/Math.PI*Math.atan2(t.y,t.x)-90;return{skewX:r,skewY:180/Math.PI*Math.atan2(n.y,n.x),translateX:e.e,translateY:e.f,scaleX:Math.sqrt(e.a*e.a+e.b*e.b),scaleY:Math.sqrt(e.c*e.c+e.d*e.d),rotation:r}}(us(e));t=[i.translateX,i.translateY],n=[i.rotation],r=[i.scaleX,i.scaleY];let o=[];(0!==t[0]||0!==t[1])&&o.push(`translate(${t.join(",")})`),(1!==r[0]||1!==r[1])&&o.push(`scale(${r.join(",")})`),0!==n[0]&&o.push(`rotate(${n[0]})`),e=o.join(" ")}else{let i=e.match(/translate\((.*?)\)/);i&&(t=i[1].split(un));let o=e.match(/rotate\((.*?)\)/);o&&(n=o[1].split(un));let s=e.match(/scale\((.*?)\)/);s&&(r=s[1].split(un))}}let i=r&&r[0]?parseFloat(r[0]):1;return{raw:e||"",translation:{tx:t&&t[0]?parseInt(t[0],10):0,ty:t&&t[1]?parseInt(t[1],10):0},rotation:{angle:n&&n[0]?parseInt(n[0],10):0,cx:n&&n[1]?parseInt(n[1],10):void 0,cy:n&&n[2]?parseInt(n[2],10):void 0},scale:{sx:i,sy:r&&r[1]?parseFloat(r[1]):i}}}function uu(e,t){let n=t.x*e.a+t.y*e.c+0;return{x:n,y:t.x*e.b+t.y*e.d+0}}function uc(e,t,n={}){if(null==t)return us(aj(e,"transform"));if(n.absolute){e.setAttribute("transform",ul(t));return}let r=e.transform,i=uo(t);r.baseVal.appendItem(i)}function uh(e,t,n=0,r={}){let i=aj(e,"transform"),o=ua(i);if(null==t)return o.translation;i=(i=o.raw).replace(/translate\([^)]*\)/g,"").trim();let s=r.absolute?t:o.translation.tx+t,l=r.absolute?n:o.translation.ty+n,a=`translate(${s},${l})`;e.setAttribute("transform",`${a} ${i}`.trim())}function ud(e,t,n,r,i={}){let o=aj(e,"transform"),s=ua(o);if(null==t)return s.rotation;o=(o=s.raw).replace(/rotate\([^)]*\)/g,"").trim(),t%=360;let l=i.absolute?t:s.rotation.angle+t,a=null!=n&&null!=r?`,${n},${r}`:"",u=`rotate(${l}${a})`;e.setAttribute("transform",`${o} ${u}`.trim())}function uf(e,t,n){let r=aj(e,"transform"),i=ua(r);if(null==t)return i.scale;n=null==n?t:n,r=(r=i.raw).replace(/scale\([^)]*\)/g,"").trim();let o=`scale(${t},${n})`;e.setAttribute("transform",`${r} ${o}`.trim())}function up(e,t){if(ad(t)&&ad(e)){let n=t.getScreenCTM(),r=e.getScreenCTM();if(n&&r)return n.inverse().multiply(r)}return ui()}!function(e){let t={};e.get=function(e){return t[e]||{}};e.register=function(e,n){t[e]=n};e.unregister=function(e){delete t[e]}}(e7||(e7={})),!function(e){let t=new WeakMap;e.ensure=function(e){return!t.has(e)&&t.set(e,{events:Object.create(null)}),t.get(e)};e.get=function(e){return t.get(e)};e.remove=function(e){return t.delete(e)}}(te||(te={})),(O=tt||(tt={})).returnTrue=()=>!0,O.returnFalse=()=>!1,O.stopPropagationCallback=function(e){e.stopPropagation()},O.addEventListener=function(e,t,n){null!=e.addEventListener&&e.addEventListener(t,n)},O.removeEventListener=function(e,t,n){null!=e.removeEventListener&&e.removeEventListener(t,n)},!function(e){let t=/[^\x20\t\r\n\f]+/g,n=/^([^.]*)(?:\.(.+)|)/;e.splitType=function(e){return(e||"").match(t)||[""]};e.normalizeType=function(e){let t=n.exec(e)||[];return{originType:t[1]?t[1].trim():t[1],namespaces:t[2]?t[2].split(".").map(e=>e.trim()).sort():[]}};e.isValidTarget=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};e.isValidSelector=function(e,t){return!t||null!=e.querySelector&&null!=e.querySelector(t)}}(tt||(tt={})),!function(e){let t=0,n=new WeakMap;e.ensureHandlerId=function(e){return!n.has(e)&&(n.set(e,t),t+=1),n.get(e)};e.getHandlerId=function(e){return n.get(e)};e.removeHandlerId=function(e){return n.delete(e)};e.setHandlerId=function(e,t){return n.set(e,t)}}(tt||(tt={})),(tt||(tt={})).getHandlerQueue=function(e,t){let n=[],r=te.get(e),i=r&&r.events&&r.events[t.type],o=i&&i.handlers||[],s=i?i.delegateCount:0;if(s>0&&!("click"===t.type&&"number"==typeof t.button&&t.button>=1)){for(let r=t.target;r!==e;r=r.parentNode||e)if(1===r.nodeType&&!("click"===t.type&&!0===r.disabled)){let t=[],i={};for(let n=0;n<s;n+=1){let s=o[n],l=s.selector;if(null!=l&&null==i[l]){let t=[];e.querySelectorAll(l).forEach(e=>{t.push(e)}),i[l]=t.includes(r)}i[l]&&t.push(s)}t.length&&n.push({elem:r,handlers:t})}}return s<o.length&&n.push({elem:e,handlers:o.slice(s)}),n},(tt||(tt={})).isWindow=function(e){return null!=e&&e===e.window},(tt||(tt={})).contains=function(e,t){let n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))};class ug{constructor(e,t){this.isDefaultPrevented=tt.returnFalse,this.isPropagationStopped=tt.returnFalse,this.isImmediatePropagationStopped=tt.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{let e=this.originalEvent;this.isDefaultPrevented=tt.returnTrue,e&&!this.isSimulated&&e.preventDefault()},this.stopPropagation=()=>{let e=this.originalEvent;this.isPropagationStopped=tt.returnTrue,e&&!this.isSimulated&&e.stopPropagation()},this.stopImmediatePropagation=()=>{let e=this.originalEvent;this.isImmediatePropagationStopped=tt.returnTrue,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()},"string"==typeof e?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?tt.returnTrue:tt.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),!this.timeStamp&&(this.timeStamp=Date.now())}}(k=ug||(ug={})).create=function(e){return e instanceof k?e:new k(e)},(A=ug||(ug={})).addProperty=function(e,t){Object.defineProperty(A.prototype,e,{enumerable:!0,configurable:!0,get:"function"==typeof t?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},!function(e){let t={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(t).forEach(n=>e.addProperty(n,t[n]))}(ug||(ug={})),M=tn||(tn={}),e7.register("load",{noBubble:!0}),T=tn||(tn={}),e7.register("beforeunload",{postDispatch(e,t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}),N=tn||(tn={}),e7.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let n;let r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!tt.contains(e,r))&&(t.type=i.originType,n=i.handler.call(e,t),t.type="mouseover"),n}}),e7.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let n;let r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!tt.contains(e,r))&&(t.type=i.originType,n=i.handler.call(e,t),t.type="mouseout"),n}});var um=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};!function(e){let t;e.on=function(e,r,i,o,s){let l;if(!tt.isValidTarget(e))return;if("function"!=typeof i){let{handler:e,selector:t}=i,n=um(i,["handler","selector"]);i=e,s=t,l=n}let a=te.ensure(e),u=a.handler;null==u&&(u=a.handler=function(r,...i){return t!==r.type?n(e,r,...i):void 0});let c=tt.ensureHandlerId(i);tt.splitType(r).forEach(t=>{let{originType:n,namespaces:r}=tt.normalizeType(t);if(!n)return;let h=n,d=e7.get(h);h=(s?d.delegateType:d.bindType)||h,d=e7.get(h);let f=Object.assign({type:h,originType:n,data:o,selector:s,guid:c,handler:i,namespace:r.join(".")},l),p=a.events,g=p[h];!g&&(g=p[h]={handlers:[],delegateCount:0},(!d.setup||!1===d.setup(e,o,r,u))&&tt.addEventListener(e,h,u)),d.add&&(tt.removeHandlerId(f.handler),d.add(e,f),tt.setHandlerId(f.handler,c)),s?(g.handlers.splice(g.delegateCount,0,f),g.delegateCount+=1):g.handlers.push(f)})};function n(e,t,...r){let i=ug.create(t);i.delegateTarget=e;let o=e7.get(i.type);if(o.preDispatch&&!1===o.preDispatch(e,i))return;let s=tt.getHandlerQueue(e,i);for(let e=0,t=s.length;e<t&&!i.isPropagationStopped();e+=1){let t=s[e];i.currentTarget=t.elem;for(let e=0,n=t.handlers.length;e<n&&!i.isImmediatePropagationStopped();e+=1){let n=t.handlers[e];if(null==i.rnamespace||n.namespace&&i.rnamespace.test(n.namespace)){i.handleObj=n,i.data=n.data;let e=e7.get(n.originType).handle,o=e?e(t.elem,i,...r):n.handler.call(t.elem,i,...r);void 0!==o&&(i.result=o,!1===o&&(i.preventDefault(),i.stopPropagation()))}}}return o.postDispatch&&o.postDispatch(e,i),i.result}e.off=function e(t,n,r,i,o){let s=te.get(t);if(!s)return;let l=s.events;if(!!l)tt.splitType(n).forEach(n=>{let{originType:a,namespaces:u}=tt.normalizeType(n);if(!a){Object.keys(l).forEach(o=>{e(t,o+n,r,i,!0)});return}let c=a,h=e7.get(c),d=l[c=(i?h.delegateType:h.bindType)||c];if(!d)return;let f=u.length>0?RegExp(`(^|\\.)${u.join("\\.(?:.*\\.|)")}(\\.|$)`):null,p=d.handlers.length;for(let e=d.handlers.length-1;e>=0;e-=1){let n=d.handlers[e];(o||a===n.originType)&&(!r||tt.getHandlerId(r)===n.guid)&&(null==f||n.namespace&&f.test(n.namespace))&&(null==i||i===n.selector||"**"===i&&n.selector)&&(d.handlers.splice(e,1),n.selector&&(d.delegateCount-=1),h.remove&&h.remove(t,n))}p&&0===d.handlers.length&&((!h.teardown||!1===h.teardown(t,u,s.handler))&&tt.removeEventListener(t,c,s.handler),delete l[c])}),0===Object.keys(l).length&&te.remove(t)},e.dispatch=n;e.trigger=function(e,n,r,i){let o,s=e,l="string"==typeof e?e:e.type,a="string"==typeof e||null==s.namespace?[]:s.namespace.split(".");if(3===r.nodeType||8===r.nodeType)return;l.indexOf(".")>-1&&(l=(a=l.split(".")).shift(),a.sort());let u=0>l.indexOf(":")&&`on${l}`;(s=e instanceof ug?e:new ug(l,"object"==typeof e?e:null)).namespace=a.join("."),s.rnamespace=s.namespace?RegExp(`(^|\\.)${a.join("\\.(?:.*\\.|)")}(\\.|$)`):null,s.result=void 0,!s.target&&(s.target=r);let c=[s];Array.isArray(n)?c.push(...n):c.push(n);let h=e7.get(l);if(!i&&h.trigger&&!1===h.trigger(r,s,n))return;let d=[r];if(!i&&!h.noBubble&&!tt.isWindow(r)){o=h.delegateType||l;let e=r,t=r.parentNode;for(;null!=t;)d.push(t),e=t,t=t.parentNode;if(e===(r.ownerDocument||document)){let t=e.defaultView||e.parentWindow||window;d.push(t)}}let f=r;for(let e=0,t=d.length;e<t&&!s.isPropagationStopped();e+=1){let t=d[e];f=t,s.type=e>1?o:h.bindType||l;let n=te.get(t);n&&n.events[s.type]&&n.handler&&n.handler.call(t,...c);let r=u&&t[u]||null;r&&tt.isValidTarget(t)&&(s.result=r.call(t,...c),!1===s.result&&s.preventDefault())}if(s.type=l,!i&&!s.isDefaultPrevented()){let e=h.preventDefault;if((null==e||!1===e(d.pop(),s,n))&&tt.isValidTarget(r)&&u&&"function"==typeof r[l]&&!tt.isWindow(r)){let e=r[u];e&&(r[u]=null),t=l,s.isPropagationStopped()&&f.addEventListener(l,tt.stopPropagationCallback),r[l](),s.isPropagationStopped()&&f.removeEventListener(l,tt.stopPropagationCallback),t=void 0,e&&(r[u]=e)}}return s.result}}(tr||(tr={})),(j=ti||(ti={})).on=function(e,t,n,r,i){return to.on(e,t,n,r,i),e},j.once=function(e,t,n,r,i){return to.on(e,t,n,r,i,!0),e},j.off=function(e,t,n,r){return to.off(e,t,n,r),e},j.trigger=function(e,t,n,r){return tr.trigger(t,n,e,r),e},(I=to||(to={})).on=function e(t,n,r,i,o,s){if("object"==typeof n){"string"!=typeof r&&(i=i||r,r=void 0),Object.keys(n).forEach(o=>e(t,o,r,i,n[o],s));return}if(null==i&&null==o?(o=r,i=r=void 0):null==o&&("string"==typeof r?(o=i,i=void 0):(o=i,i=r,r=void 0)),!1===o)o=tt.returnFalse;else if(!o)return;if(s){let e=o;o=function(n,...r){return I.off(t,n),e.call(this,n,...r)},tt.setHandlerId(o,tt.ensureHandlerId(e))}tr.on(t,n,o,i,r)},I.off=function e(t,n,r,i){if(n&&null!=n.preventDefault&&null!=n.handleObj){let t=n.handleObj;e(n.delegateTarget,t.namespace?`${t.originType}.${t.namespace}`:t.originType,t.selector,t.handler);return}if("object"==typeof n){Object.keys(n).forEach(i=>e(t,i,r,n[i]));return}(!1===r||"function"==typeof r)&&(i=r,r=void 0),!1===i&&(i=tt.returnFalse),tr.off(t,n,i,r)};class uy{constructor(e,t,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=e4.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){let t;if(null==this.onWheelGuard||!!this.onWheelGuard(e))this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault(),(0!==this.deltaX||0!==this.deltaY)&&(e.stopPropagation(),t=!0),!0===t&&0===this.animationFrameId&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function ub(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView;return{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}}function uv(e,t=60){let n=null;return(...r)=>{n&&clearTimeout(n),n=window.setTimeout(()=>{e.apply(this,r)},t)}}let ux="undefined"!=typeof ResizeObserver?function(e){let t=null,n=[],r=uv(()=>{n.forEach(t=>{t(e)})}),i=()=>{let t=new ResizeObserver(r);return t.observe(e),r(),t},o=()=>{t&&(t.disconnect(),n=[],t=null)};return{element:e,bind:e=>{!t&&(t=i()),-1===n.indexOf(e)&&n.push(e)},destroy:o,unbind:e=>{let r=n.indexOf(e);-1!==r&&n.splice(r,1),0===n.length&&t&&o()}}}:function(e){let t=null,n=[],r=()=>{"static"===getComputedStyle(e).position&&(e.style.position="relative");let t=document.createElement("object");return t.onload=()=>{t.contentDocument.defaultView.addEventListener("resize",i),i()},t.style.display="block",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.height="100%",t.style.width="100%",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex="-1",t.style.opacity="0",t.setAttribute("tabindex","-1"),t.type="text/html",e.appendChild(t),t.data="about:blank",t},i=uv(()=>{n.forEach(t=>t(e))}),o=()=>{t&&t.parentNode&&(t.contentDocument&&t.contentDocument.defaultView.removeEventListener("resize",i),t.parentNode.removeChild(t),t=null,n=[])};return{element:e,bind:e=>{!t&&(t=r()),-1===n.indexOf(e)&&n.push(e)},destroy:o,unbind:e=>{let r=n.indexOf(e);-1!==r&&n.splice(r,1),0===n.length&&t&&o()}}};!function(e){let t=new WeakMap;function n(e){let n=t.get(e);return n?n:(n=ux(e),t.set(e,n),n)}e.bind=(e,t)=>{let r=n(e);return r.bind(t),()=>r.unbind(t)},e.clear=e=>{var r;(r=n(e)).destroy(),t.delete(r.element)}}(ts||(ts={}));class uw{constructor(e={}){this.comparator=e.comparator||uw.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return 0===this.data.length}insert(e,t,n){let r={priority:e,value:t},i=this.data.length;return n&&(r.id=n,this.index[n]=i),this.data.push(r),this.bubbleUp(i),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,t){let n=this.index[e];if(void 0===n)throw Error(`Node with id '${e}' was not found in the heap.`);let r=this.data,i=r[n].priority,o=this.comparator(t,i);o<0?(r[n].priority=t,this.bubbleUp(n)):o>0&&(r[n].priority=t,this.bubbleDown(n))}remove(){let e=this.data,t=e[0],n=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){let t,n;let r=this.data,i=e;for(;i>0;)if(n=i-1>>>1,0>this.comparator(r[i].priority,r[n].priority)){t=r[n],r[n]=r[i];let e=r[i].id;null!=e&&(this.index[e]=n),r[i]=t,null!=(e=r[i].id)&&(this.index[e]=i),i=n}else break}bubbleDown(e){let t=this.data,n=t.length-1,r=e;for(;;){let e=(r<<1)+1,i=e+1,o=r;if(e<=n&&0>this.comparator(t[e].priority,t[o].priority)&&(o=e),i<=n&&0>this.comparator(t[i].priority,t[o].priority)&&(o=i),o!==r){let e=t[o];t[o]=t[r];let n=t[r].id;null!=n&&(this.index[n]=o),t[r]=e,null!=(n=t[r].id)&&(this.index[n]=r),r=o}else break}}}(uw||(uw={})).defaultComparator=(e,t)=>e-t,(tl||(tl={})).run=function(e,t,n=(e,t)=>1){let r={},i={},o={},s=new uw;for(r[t]=0,Object.keys(e).forEach(e=>{e!==t&&(r[e]=1/0),s.insert(r[e],e,e)});!s.isEmpty();){let t=s.remove();o[t]=!0;let l=e[t]||[];for(let e=0;e<l.length;e+=1){let a=l[e];if(!o[a]){let e=r[t]+n(t,a);e<r[a]&&(r[a]=e,i[a]=t,s.updatePriority(a,e))}}}return i};class uC{constructor(e,t,n,r){if(null==e)return this.set(255,255,255,1);if("number"==typeof e)return this.set(e,t,n,r);if("string"==typeof e)return uC.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,null==e.a?1:e.a)}blend(e,t,n){this.set(e.r+(t.r-e.r)*n,e.g+(t.g-e.g)*n,e.b+(t.b-e.b)*n,e.a+(t.a-e.a)*n)}lighten(e){let t=uC.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,n,r){let i=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,s=Array.isArray(e)?e[2]:n,l=Array.isArray(e)?e[3]:r;return this.r=Math.round(lW(i,0,255)),this.g=Math.round(lW(o,0,255)),this.b=Math.round(lW(s,0,255)),this.a=null==l?1:lW(l,0,1),this}toHex(){let e=["r","g","b"].map(e=>{let t=this[e].toString(16);return t.length<2?`0${t}`:t});return`#${e.join("")}`}toRGBA(){return this.toArray()}toHSLA(){return uC.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){let t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return uC.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}!function(e){function t(t){return new e([...l(t),1])}function n(t){let n=t.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);return n?new e(n[1].split(/\s*,\s*/).map(e=>parseInt(e,10))):null}function r(e,t,n){n<0&&++n,n>1&&--n;let r=6*n;return r<1?e+(t-e)*r:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function i(t){let n=t.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(n){let t=n[2].split(/\s*,\s*/),r=(parseFloat(t[0])%360+360)%360/360,i=parseFloat(t[1])/100,s=parseFloat(t[2])/100;return new e(o(r,i,s,null==t[3]?1:parseInt(t[3],10)))}return null}e.fromArray=function(t){return new e(t)},e.fromHex=t,e.fromRGBA=n,e.fromHSLA=i;e.fromString=function(r){if(r.startsWith("#"))return t(r);if(r.startsWith("rgb"))return n(r);let o=e.named[r];return o?t(o):i(r)};e.makeGrey=function(t,n){return e.fromArray([t,t,t,n])};function o(e,t,n,i){let o=Array.isArray(e)?e[0]:e,s=Array.isArray(e)?e[1]:t,l=Array.isArray(e)?e[2]:n,a=Array.isArray(e)?e[3]:i,u=l<=.5?l*(s+1):l+s-l*s,c=2*l-u;return[256*r(c,u,o+1/3),256*r(c,u,o),256*r(c,u,o-1/3),null==a?1:a]}function s(t){return new e(Math.round(256*Math.random()),Math.round(256*Math.random()),Math.round(256*Math.random()),t?void 0:parseFloat(Math.random().toFixed(2)))}e.rgba2hsla=function(e,t,n,r){let i=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,s=Array.isArray(e)?e[2]:n,l=Array.isArray(e)?e[3]:r,a=Math.max(i,o,s),u=Math.min(i,o,s),c=(a+u)/2,h=0,d=0;if(u!==a){let e=a-u;switch(d=c>.5?e/(2-a-u):e/(a+u),a){case i:h=(o-s)/e+(o<s?6:0);break;case o:h=(s-i)/e+2;break;case s:h=(i-o)/e+4}h/=6}return[h,d,c,null==l?1:l]},e.hsla2rgba=o,e.random=s;e.randomHex=function(){let e="#";for(let t=0;t<6;t+=1)e+="0123456789ABCDEF"[Math.floor(16*Math.random())];return e};e.randomRGBA=function(e){return s(e).toString()};function l(e){let t=0===e.indexOf("#")?e:`#${e}`,n=Number(`0x${t.substr(1)}`);if(!(4===t.length||7===t.length)||Number.isNaN(n))throw Error("Invalid hex color.");let r=4===t.length?4:8,i=(1<<r)-1,o=["b","g","r"].map(()=>{let e=n&i;return n>>=r,4===r?17*e:e});return[o[2],o[1],o[0]]}function a(e,t,n){let r=e=>e.length<2?`0${e}`:e;return`${r(e.toString(16))}${r(t.toString(16))}${r(n.toString(16))}`}e.invert=function(e,t){if("string"==typeof e){let n="#"===e[0],[r,i,o]=l(e);return t?.299*r+.587*i+.114*o>186?"#000000":"#ffffff":`${n?"#":""}${a(255-r,255-i,255-o)}`}let n=e[0],r=e[1],i=e[2],o=e[3];return t?.299*n+.587*r+.114*i>186?[0,0,0,o]:[255,255,255,o]:[255-n,255-r,255-i,o]};e.lighten=function(e,t){return u(e,t)};function u(e,t){if("string"==typeof e){let n="#"===e[0],r=parseInt(n?e.substr(1):e,16),i=lW((r>>16)+t,0,255),o=lW((r>>8&255)+t,0,255),s=lW((255&r)+t,0,255);return`${n?"#":""}${(s|o<<8|i<<16).toString(16)}`}let n=l(u(a(e[0],e[1],e[2]),t));return[n[0],n[1],n[2],e[3]]}e.darken=function(e,t){return u(e,-t)}}(uC||(uC={})),(uC||(uC={})).named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};class uE{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){let t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);let n=this.map.get(e);return this.map.delete(e),n}each(e){this.arr.forEach(t=>{e(this.map.get(t),t)})}dispose(){this.clear()}}!function(e){function t(e){let t=[],n=[];return Array.isArray(e)?t.push(...e):e.split("|").forEach(e=>{-1===e.indexOf("&")?t.push(e):n.push(...e.split("&"))}),{or:t,and:n}}e.parse=t;e.equals=function(e,n){if(null!=e&&null!=n){let r=t(e),i=t(n),o=r.or.sort(),s=i.or.sort(),l=r.and.sort(),a=i.and.sort(),u=(e,t)=>e.length===t.length&&(0===e.length||e.every((e,n)=>e===t[n]));return u(o,s)&&u(l,a)}return null==e&&null==n||!1};e.isMatch=function(e,n,r){if(null==n||Array.isArray(n)&&0===n.length)return!r||!0!==e.altKey&&!0!==e.ctrlKey&&!0!==e.metaKey&&!0!==e.shiftKey;let{or:i,and:o}=t(n),s=t=>!0===e[`${t.toLowerCase()}Key`];return i.some(e=>s(e))&&o.every(e=>s(e))}}(ta||(ta={})),(L=tu||(tu={})).linear=e=>e,L.quad=e=>e*e,L.cubic=e=>e*e*e,L.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;let t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)},L.exponential=e=>Math.pow(2,10*(e-1)),L.bounce=e=>{for(let t=0,n=1;;t+=n,n/=2)if(e>=(7-4*t)/11){let r=(11-6*t-11*e)/4;return-r*r+n*n}},(tu||(tu={})).decorators={reverse:e=>t=>1-e(1-t),reflect:e=>t=>.5*(t<.5?e(2*t):2-e(2-2*t)),clamp:(e,t=0,n=1)=>r=>{let i=e(r);return i<t?t:i>n?n:i},back:(e=1.70158)=>t=>t*t*((e+1)*t-e),elastic:(e=1.5)=>t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)},!function(e){e.easeInSine=function(e){return -1*Math.cos(Math.PI/2*e)+1};e.easeOutSine=function(e){return Math.sin(Math.PI/2*e)};e.easeInOutSine=function(e){return -.5*(Math.cos(Math.PI*e)-1)};e.easeInQuad=function(e){return e*e};e.easeOutQuad=function(e){return e*(2-e)};e.easeInOutQuad=function(e){return e<.5?2*e*e:-1+(4-2*e)*e};e.easeInCubic=function(e){return e*e*e};e.easeOutCubic=function(e){let t=e-1;return t*t*t+1};e.easeInOutCubic=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1};e.easeInQuart=function(e){return e*e*e*e};e.easeOutQuart=function(e){let t=e-1;return 1-t*t*t*t};e.easeInOutQuart=function(e){let t=e-1;return e<.5?8*e*e*e*e:1-8*t*t*t*t};e.easeInQuint=function(e){return e*e*e*e*e};e.easeOutQuint=function(e){let t=e-1;return 1+t*t*t*t*t};e.easeInOutQuint=function(e){let t=e-1;return e<.5?16*e*e*e*e*e:1+16*t*t*t*t*t};e.easeInExpo=function(e){return 0===e?0:Math.pow(2,10*(e-1))};e.easeOutExpo=function(e){return 1===e?1:-Math.pow(2,-10*e)+1};e.easeInOutExpo=function(e){if(0===e||1===e)return e;let t=2*e,n=t-1;return t<1?.5*Math.pow(2,10*n):.5*(-Math.pow(2,-10*n)+2)};e.easeInCirc=function(e){return -1*(Math.sqrt(1-e/1*e)-1)};e.easeOutCirc=function(e){let t=e-1;return Math.sqrt(1-t*t)};e.easeInOutCirc=function(e){let t=2*e,n=t-2;return t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-n*n)+1)};e.easeInBack=function(e,t=1.70158){return e*e*((t+1)*e-t)};e.easeOutBack=function(e,t=1.70158){let n=e/1-1;return n*n*((t+1)*n+t)+1};e.easeInOutBack=function(e,t=1.70158){let n=2*e,r=n-2,i=1.525*t;return n<1?.5*n*n*((i+1)*n-i):.5*(r*r*((i+1)*r+i)+2)};e.easeInElastic=function(e,t=.7){if(0===e||1===e)return e;let n=e/1-1,r=1-t;return-(Math.pow(2,10*n)*Math.sin(2*Math.PI*(n-r/(2*Math.PI)*Math.asin(1))/r))};e.easeOutElastic=function(e,t=.7){let n=1-t,r=2*e;return 0===e||1===e?e:Math.pow(2,-10*r)*Math.sin(2*Math.PI*(r-n/(2*Math.PI)*Math.asin(1))/n)+1};function t(e){let t=e/1;if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){let e=t-1.5/2.75;return 7.5625*e*e+.75}if(t<2.5/2.75){let e=t-2.25/2.75;return 7.5625*e*e+.9375}{let e=t-2.625/2.75;return 7.5625*e*e+.984375}}function n(e){return 1-t(1-e)}e.easeInOutElastic=function(e,t=.65){let n=1-t;if(0===e||1===e)return e;let r=2*e,i=r-1,o=n/(2*Math.PI)*Math.asin(1);return r<1?-(Math.pow(2,10*i)*Math.sin(2*Math.PI*(i-o)/n)*.5):Math.pow(2,-10*i)*Math.sin(2*Math.PI*(i-o)/n)*.5+1},e.easeOutBounce=t,e.easeInBounce=n;e.easeInOutBounce=function(e){return e<.5?.5*n(2*e):.5*t(2*e-1)+.5}}(tu||(tu={})),(R=tc||(tc={})).number=(e,t)=>{let n=t-e;return t=>e+n*t},R.object=(e,t)=>{let n=Object.keys(e);return r=>{let i={};for(let o=n.length-1;-1!==o;o-=1){let s=n[o];i[s]=e[s]+(t[s]-e[s])*r}return i}},R.unit=(e,t)=>{let n=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=n.exec(e),i=n.exec(t),o=i?i[1]:"",s=r?+r[1]:0,l=i?+i[1]:0,a=o.indexOf("."),u=a>0?o[1].length-a-1:0,c=l-s,h=r?r[2]:"";return e=>(s+c*e).toFixed(u)+h},R.color=(e,t)=>{let n=parseInt(e.slice(1),16),r=parseInt(t.slice(1),16),i=255&n,o=(255&r)-i,s=65280&n,l=(65280&r)-s,a=0xff0000&n,u=(0xff0000&r)-a;return e=>`#${(0x1000000|i+o*e&255|s+l*e&65280|a+u*e&0xff0000).toString(16).slice(1)}`};let uS=[];function uP(e,t){let n=uS.find(t=>t.name===e);if(!n||(n.loadTimes+=1,!(n.loadTimes>1))){if(!e4.isApplyingHMR()){let n=document.createElement("style");n.setAttribute("type","text/css"),n.textContent=t;let r=document.querySelector("head");r&&r.insertBefore(n,r.firstChild),uS.push({name:e,loadTimes:1,styleElement:n})}}}function uO(e){let t=uS.findIndex(t=>t.name===e);if(t>-1){let e=uS[t];if(e.loadTimes-=1,e.loadTimes>0)return;let n=e.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,uS.splice(t,1)}}(_=th||(th={})).toDeg=function(e){return 180*e/Math.PI%360},_.toRad=function(e,t=!1){return(t?e:e%360)*Math.PI/180},_.normalize=function(e){return e%360+(e<0?360:0)},(B=td||(td={})).round=function(e,t=0){return Number.isInteger(e)?e:+e.toFixed(t)},B.random=function(e,t){let n,r;if(null==t?(r=null==e?1:e,n=0):(r=t,n=null==e?0:e),r<n){let e=n;n=r,r=e}return Math.floor(Math.random()*(r-n+1)+n)},B.clamp=function(e,t,n){return Number.isNaN(e)?NaN:Number.isNaN(t)||Number.isNaN(n)?0:t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e},B.snapToGrid=function(e,t){return t*Math.round(e/t)},B.containsPoint=function(e,t){return null!=t&&null!=e&&t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height},B.squaredLength=function(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r};class uk{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class uA extends uk{constructor(e,t){super(),this.x=null==e?0:e,this.y=null==t?0:t}round(e=0){return this.x=td.round(this.x,e),this.y=td.round(this.y,e),this}add(e,t){let n=uA.create(e,t);return this.x+=n.x,this.y+=n.y,this}update(e,t){let n=uA.create(e,t);return this.x=n.x,this.y=n.y,this}translate(e,t){let n=uA.create(e,t);return this.x+=n.x,this.y+=n.y,this}rotate(e,t){let n=uA.rotate(this,e,t);return this.x=n.x,this.y=n.y,this}scale(e,t,n=new uA){let r=uA.create(n);return this.x=r.x+e*(this.x-r.x),this.y=r.y+t*(this.y-r.y),this}closest(e){if(1===e.length)return uA.create(e[0]);let t=null,n=1/0;return e.forEach(e=>{let r=this.squaredDistance(e);r<n&&(t=e,n=r)}),t?uA.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){let t=uA.create(e),n=this.x-t.x,r=this.y-t.y;return n*n+r*r}manhattanDistance(e){let t=uA.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new uA){let t=uA.create(e),n=-(t.y-this.y),r=Math.atan2(n,t.x-this.x);return r<0&&(r=2*Math.PI+r),180*r/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let n=this.theta(t)-this.theta(e);return n<0&&(n+=360),n}vectorAngle(e){return new uA(0,0).angleBetween(this,e)}toPolar(e){return this.update(uA.toPolar(this,e)),this}changeInAngle(e,t,n=new uA){return this.clone().translate(-e,-t).theta(n)-this.theta(n)}adhereToRect(e){return!td.containsPoint(e,this)&&(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){let t=uA.create(e),n=th.toRad(this.y),r=th.toRad(t.y),i=this.x,o=t.x,s=th.toRad(o-i),l=Math.sin(s)*Math.cos(r),a=Math.cos(n)*Math.sin(r)-Math.sin(n)*Math.cos(r)*Math.cos(s),u=th.toDeg(Math.atan2(l,a)),c=u-22.5;return c<0&&(c+=360),["NE","E","SE","S","SW","W","NW","N"][c=parseInt(c/45,10)]}cross(e,t){if(null!=e&&null!=t){let n=uA.create(e),r=uA.create(t);return(r.x-this.x)*(n.y-this.y)-(r.y-this.y)*(n.x-this.x)}return NaN}dot(e){let t=uA.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if("number"==typeof e)return new uA(this.x-e,this.y-t);let n=uA.create(e);return new uA(this.x-n.x,this.y-n.y)}lerp(e,t){let n=uA.create(e);return new uA((1-t)*this.x+t*n.x,(1-t)*this.y+t*n.y)}normalize(e=1){let t=e/this.magnitude();return this.scale(t,t)}move(e,t){let n=uA.create(e),r=th.toRad(n.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return uA.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=td.snapToGrid(this.x,e),this.y=td.snapToGrid(this.y,null==t?e:t),this}equals(e){let t=uA.create(e);return null!=t&&t.x===this.x&&t.y===this.y}clone(){return uA.clone(this)}toJSON(){return uA.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(D=uA||(uA={})).isPoint=function(e){return null!=e&&e instanceof D},(z=uA||(uA={})).isPointLike=function(e){return null!=e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y},z.isPointData=function(e){return null!=e&&Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]},!function(e){function t(t){return e.isPoint(t)?new e(t.x,t.y):Array.isArray(t)?new e(t[0],t[1]):new e(t.x,t.y)}e.create=function(n,r){return null==n||"number"==typeof n?new e(n,r):t(n)},e.clone=t;e.toJSON=function(t){return e.isPoint(t)?{x:t.x,y:t.y}:Array.isArray(t)?{x:t[0],y:t[1]}:{x:t.x,y:t.y}};e.fromPolar=function(n,r,i=new e){let o=Math.abs(n*Math.cos(r)),s=Math.abs(n*Math.sin(r)),l=t(i),a=th.normalize(th.toDeg(r));return a<90?s=-s:a<180?(o=-o,s=-s):a<270&&(o=-o),new e(l.x+o,l.y+s)};function n(e,t){return e===t||null!=e&&null!=t&&e.x===t.x&&e.y===t.y}e.toPolar=function(n,r=new e){let i=t(n),o=t(r),s=i.x-o.x,l=i.y-o.y;return new e(Math.sqrt(s*s+l*l),th.toRad(o.theta(i)))},e.equals=n;e.equalPoints=function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!==t.length)return!1;if(null!=e&&null!=t){for(let r=0,i=e.length;r<i;r+=1)if(!n(e[r],t[r]))return!1}return!0};e.random=function(t,n,r,i){return new e(td.random(t,n),td.random(r,i))};function r(n,i,o,s=new e){let l=t(n),a=t(s),u=l.x-a.x,c=l.y-a.y;return new e(u*i-c*o+a.x,c*i+u*o+a.y)}e.rotate=function(e,t,n){let i=th.toRad(th.normalize(-t)),o=Math.sin(i);return r(e,Math.cos(i),o,n)},e.rotateEx=r}(uA||(uA={}));class uM extends uk{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new uA(this.x,this.y)}get topLeft(){return new uA(this.x,this.y)}get topCenter(){return new uA(this.x+this.width/2,this.y)}get topRight(){return new uA(this.x+this.width,this.y)}get center(){return new uA(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new uA(this.x,this.y+this.height)}get bottomCenter(){return new uA(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new uA(this.x+this.width,this.y+this.height)}get corner(){return new uA(this.x+this.width,this.y+this.height)}get rightMiddle(){return new uA(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new uA(this.x,this.y+this.height/2)}get topLine(){return new uT(this.topLeft,this.topRight)}get rightLine(){return new uT(this.topRight,this.bottomRight)}get bottomLine(){return new uT(this.bottomLeft,this.bottomRight)}get leftLine(){return new uT(this.topLeft,this.bottomLeft)}constructor(e,t,n,r){super(),this.x=null==e?0:e,this.y=null==t?0:t,this.width=null==n?0:n,this.height=null==r?0:r}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();let t=th.toRad(e),n=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),i=this.width*r+this.height*n,o=this.width*n+this.height*r;return new uM(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(e=0){return this.x=td.round(this.x,e),this.y=td.round(this.y,e),this.width=td.round(this.width,e),this.height=td.round(this.height,e),this}add(e,t,n,r){let i=uM.create(e,t,n,r),o=Math.min(this.x,i.x),s=Math.min(this.y,i.y),l=Math.max(this.x+this.width,i.x+i.width),a=Math.max(this.y+this.height,i.y+i.height);return this.x=o,this.y=s,this.width=l-o,this.height=a-s,this}update(e,t,n,r){let i=uM.create(e,t,n,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(e,t){let n=null!=t?t:e;return this.x-=e,this.y-=n,this.width+=2*e,this.height+=2*n,this}snapToGrid(e,t){let n=this.origin.snapToGrid(e,t),r=this.corner.snapToGrid(e,t);return this.x=n.x,this.y=n.y,this.width=r.x-n.x,this.height=r.y-n.y,this}translate(e,t){let n=uA.create(e,t);return this.x+=n.x,this.y+=n.y,this}scale(e,t,n=new uA){let r=this.origin.scale(e,t,n);return this.x=r.x,this.y=r.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(0!==e){let n=th.toRad(e),r=Math.cos(n),i=Math.sin(n),o=this.getOrigin(),s=this.getTopRight(),l=this.getBottomRight(),a=this.getBottomLeft();o=uA.rotateEx(o,r,i,t),s=uA.rotateEx(s,r,i,t),l=uA.rotateEx(l,r,i,t),a=uA.rotateEx(a,r,i,t);let u=new uM(o.x,o.y,0,0);u.add(s.x,s.y,0,0),u.add(l.x,l.y,0,0),u.add(a.x,a.y,0,0),this.update(u)}return this}rotate90(){let e=(this.width-this.height)/2;this.x+=e,this.y-=e;let t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){let t=uM.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){let n=uM.clone(e),r=t.x,i=t.y,o=1/0,s=1/0,l=1/0,a=1/0,u=1/0,c=1/0,h=1/0,d=1/0,f=n.topLeft;f.x<r&&(o=(this.x-r)/(f.x-r)),f.y<i&&(u=(this.y-i)/(f.y-i));let p=n.bottomRight;p.x>r&&(s=(this.x+this.width-r)/(p.x-r)),p.y>i&&(c=(this.y+this.height-i)/(p.y-i));let g=n.topRight;g.x>r&&(l=(this.x+this.width-r)/(g.x-r)),g.y<i&&(h=(this.y-i)/(g.y-i));let m=n.bottomLeft;return m.x<r&&(a=(this.x-r)/(m.x-r)),m.y>i&&(d=(this.y+this.height-i)/(m.y-i)),{sx:Math.min(o,s,l,a),sy:Math.min(u,c,h,d)}}getMaxUniformScaleToFit(e,t=this.center){let n=this.getMaxScaleToFit(e,t);return Math.min(n.sx,n.sy)}containsPoint(e,t){return td.containsPoint(this,uA.create(e,t))}containsRect(e,t,n,r){let i=uM.create(e,t,n,r),o=this.x,s=this.y,l=this.width,a=this.height,u=i.x,c=i.y,h=i.width,d=i.height;return 0!==l&&0!==a&&0!==h&&0!==d&&u>=o&&c>=s&&u+h<=o+l&&c+d<=s+a}intersectsWithLine(e){let t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],r=[];return t.forEach(t=>{let i=e.intersectsWithLine(t);null!==i&&0>r.indexOf(i.toString())&&(n.push(i),r.push(i.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(e,t){let n=uA.clone(e),r=this.center,i=null;null!=t&&0!==t&&n.rotate(t,r);let o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],s=new uT(r,n);for(let e=o.length-1;e>=0;e-=1){let t=o[e].intersectsWithLine(s);if(null!==t){i=t;break}}return i&&null!=t&&0!==t&&i.rotate(-t,r),i}intersectsWithRect(e,t,n,r){let i=uM.create(e,t,n,r);if(!this.isIntersectWithRect(i))return null;let o=this.origin,s=this.corner,l=i.origin,a=i.corner,u=Math.max(o.x,l.x),c=Math.max(o.y,l.y);return new uM(u,c,Math.min(s.x,a.x)-u,Math.min(s.y,a.y)-c)}isIntersectWithRect(e,t,n,r){let i=uM.create(e,t,n,r),o=this.origin,s=this.corner,l=i.origin,a=i.corner;return!(a.x<=o.x)&&!(a.y<=o.y)&&!(l.x>=s.x)&&!(l.y>=s.y)&&!0}normalize(){let e=this.x,t=this.y,n=this.width,r=this.height;return this.width<0&&(e=this.x+this.width,n=-this.width),this.height<0&&(t=this.y+this.height,r=-this.height),this.x=e,this.y=t,this.width=n,this.height=r,this}union(e){let t=uM.clone(e),n=this.origin,r=this.corner,i=t.origin,o=t.corner,s=Math.min(n.x,i.x),l=Math.min(n.y,i.y),a=Math.max(r.x,o.x),u=Math.max(r.y,o.y);return new uM(s,l,a-s,u-l)}getNearestSideToPoint(e){let t=uA.clone(e),n=t.x-this.x,r=this.x+this.width-t.x,i=t.y-this.y,o=this.y+this.height-t.y,s=n,l="left";return r<s&&(s=r,l="right"),i<s&&(s=i,l="top"),o<s&&(l="bottom"),l}getNearestPointToPoint(e){let t=uA.clone(e);if(this.containsPoint(t)){let e=this.getNearestSideToPoint(t);if("left"===e)return new uA(this.x,t.y);if("top"===e)return new uA(t.x,this.y);if("right"===e)return new uA(this.x+this.width,t.y);if("bottom"===e)return new uA(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return null!=e&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new uM(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(F=uM||(uM={})).isRectangle=function(e){return null!=e&&e instanceof F},(uM||(uM={})).isRectangleLike=function(e){return null!=e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.width&&"number"==typeof e.height},!function(e){function t(t){return e.isRectangle(t)?t.clone():Array.isArray(t)?new e(t[0],t[1],t[2],t[3]):new e(t.x,t.y,t.width,t.height)}e.create=function(n,r,i,o){return null==n||"number"==typeof n?new e(n,r,i,o):t(n)},e.clone=t;e.fromEllipse=function(t){return new e(t.x-t.a,t.y-t.b,2*t.a,2*t.b)};e.fromSize=function(t){return new e(0,0,t.width,t.height)};e.fromPositionAndSize=function(t,n){return new e(t.x,t.y,n.width,n.height)}}(uM||(uM={}));class uT extends uk{get center(){return new uA((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,n,r){super(),"number"==typeof e&&"number"==typeof t?(this.start=new uA(e,t),this.end=new uA(n,r)):(this.start=uA.create(e),this.end=uA.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return"number"==typeof e?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,n){return this.start.scale(e,t,n),this.end.scale(e,t,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){let e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){let t=this.length();if(!t)return this;let n=e/t;return this.scale(n,n,this.start)}parallel(e){let t=this.clone();if(!t.isDifferentiable())return t;let{start:n,end:r}=t,i=n.clone().rotate(270,r),o=r.clone().rotate(90,n);return n.move(o,e),r.move(i,e),t}vector(){return new uA(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){let e=new uA(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){let e=Math.min(this.start.x,this.end.x),t=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),r=Math.max(this.start.y,this.end.y);return new uM(e,t,n-e,r-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){let t=Math.min(1,Math.max(0,this.vector().dot(new uT(this.start,e).vector())/this.squaredLength()));return Number.isNaN(t)?0:t}pointAt(e){let t=this.start,n=this.end;return e<=0?t.clone():e>=1?n.clone():t.lerp(n,e)}pointAtLength(e){let t=this.start,n=this.end,r=!0;e<0&&(r=!1,e=-e);let i=this.length();if(e>=i)return r?n.clone():t.clone();let o=(r?e:i-e)/i;return this.pointAt(o)}divideAt(e){let t=this.pointAt(e);return[new uT(this.start,t),new uT(t,this.end)]}divideAtLength(e){let t=this.pointAtLength(e);return[new uT(this.start,t),new uT(t,this.end)]}containsPoint(e){let t=this.start,n=this.end;if(0!==t.cross(e,n))return!1;let r=this.length();return!(new uT(t,e).length()>r||new uT(e,n).length()>r)&&!0}intersect(e,t){let n=e.intersectsWithLine(this,t);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(e){let t=new uA(this.end.x-this.start.x,this.end.y-this.start.y),n=new uA(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*n.y-t.y*n.x,i=new uA(e.start.x-this.start.x,e.start.y-this.start.y),o=i.x*n.y-i.y*n.x,s=i.x*t.y-i.y*t.x;if(0===r||o*r<0||s*r<0)return null;if(r>0){if(o>r||s>r)return null}else if(o<r||s<r)return null;return new uA(this.start.x+o*t.x/r,this.start.y+o*t.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){let t=uA.clone(e),n=this.start,r=this.end;return((r.x-n.x)*(t.y-n.y)-(r.y-n.y)*(t.x-n.x))/this.length()}pointSquaredDistance(e,t){let n=uA.create(e,t);return this.closestPoint(n).squaredDistance(n)}pointDistance(e,t){let n=uA.create(e,t);return this.closestPoint(n).distance(n)}tangentAt(e){if(!this.isDifferentiable())return null;let t=this.start,n=this.end,r=this.pointAt(e),i=new uT(t,n);return i.translate(r.x-t.x,r.y-t.y),i}tangentAtLength(e){if(!this.isDifferentiable())return null;let t=this.start,n=this.end,r=this.pointAtLength(e),i=new uT(t,n);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){let n=uA.create(e,t),r=n.x-this.start.x,i=n.y-this.start.y,o=this.end.x-this.start.x,s=this.end.y-this.start.y,l=r*s-i*o;return 0===l&&(l=r*o+i*s)>0&&(r-=o,i-=s,(l=r*o+i*s)<0&&(l=0)),l<0?-1:l>0?1:0}equals(e){return null!=e&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new uT(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(V=uT||(uT={})).isLine=function(e){return null!=e&&e instanceof V};class uN extends uk{get center(){return new uA(this.x,this.y)}constructor(e,t,n,r){super(),this.x=null==e?0:e,this.y=null==t?0:t,this.a=null==n?0:n,this.b=null==r?0:r}bbox(){return uM.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){return this.a+=2*e,this.b+=2*(null!=t?t:e),this}normalizedDistance(e,t){let n=uA.create(e,t),r=n.x-this.x,i=n.y-this.y,o=this.a,s=this.b;return r*r/(o*o)+i*i/(s*s)}containsPoint(e,t){return 1>=this.normalizedDistance(e,t)}intersectsWithLine(e){let t=[],n=this.a,r=this.b,i=e.start,o=e.end,s=e.vector(),l=i.diff(new uA(this.x,this.y)),a=new uA(s.x/(n*n),s.y/(r*r)),u=new uA(l.x/(n*n),l.y/(r*r)),c=s.dot(a),h=s.dot(u),d=h*h-c*(l.dot(u)-1);if(d<0)return null;if(d>0){let e=Math.sqrt(d),n=(-h-e)/c,r=(-h+e)/c;if((n<0||n>1)&&(r<0||r>1))return null;n>=0&&n<=1&&t.push(i.lerp(o,n)),r>=0&&r<=1&&t.push(i.lerp(o,r))}else{let e=-h/c;if(!(e>=0)||!(e<=1))return null;t.push(i.lerp(o,e))}return t}intersectsWithLineFromCenterToPoint(e,t=0){let n;let r=uA.clone(e);t&&r.rotate(t,this.getCenter());let i=r.x-this.x,o=r.y-this.y;if(0===i)return(n=this.bbox().getNearestPointToPoint(r),t)?n.rotate(-t,this.getCenter()):n;let s=o/i,l=this.a*this.a,a=Math.sqrt(1/(1/l+s*s/(this.b*this.b))),u=s*(a=i<0?-a:a);return(n=new uA(this.x+a,this.y+u),t)?n.rotate(-t,this.getCenter()):n}tangentTheta(e){let t,n;let r=uA.clone(e),i=r.x,o=r.y,s=this.a,l=this.b,a=this.bbox().center,u=a.x,c=a.y,h=i>a.x+s/2,d=i<a.x-s/2;return h||d?(n=i>a.x?o-30:o+30,t=s*s/(i-u)-s*s*(o-c)*(n-c)/(l*l*(i-u))+u):(t=o>a.y?i+30:i-30,n=l*l/(o-c)-l*l*(i-u)*(t-u)/(s*s*(o-c))+c),new uA(t,n).theta(r)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){let n=uM.fromEllipse(this);n.rotate(e,t);let r=uN.fromRect(n);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(e,t){let n=uA.create(e,t);return this.x+=n.x,this.y+=n.y,this}equals(e){return null!=e&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new uN(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}($=uN||(uN={})).isEllipse=function(e){return null!=e&&e instanceof $},!function(e){function t(t){return e.isEllipse(t)?t.clone():Array.isArray(t)?new e(t[0],t[1],t[2],t[3]):new e(t.x,t.y,t.a,t.b)}e.create=function(n,r,i,o){return null==n||"number"==typeof n?new e(n,r,i,o):t(n)},e.parse=t;e.fromRect=function(t){let n=t.center;return new e(n.x,n.y,t.width/2,t.height/2)}}(uN||(uN={}));let uj=RegExp("^[\\s\\dLMCZz,.]*$");function uI(e){return"string"==typeof e&&uj.test(e)}function uL(e,t){return(e%t+t)%t}function uR(e,t={}){let n=[];return e&&e.length&&e.forEach(e=>{Array.isArray(e)?n.push({x:e[0],y:e[1]}):n.push({x:e.x,y:e.y})}),function(e,t,n,r,i){let o=[],s=e[e.length-1],l=null!=t&&t>0,a=t||0;if(r&&l){let t=(e=e.slice())[0],n=new uA(s.x+(t.x-s.x)/2,s.y+(t.y-s.y)/2);e.splice(0,0,n)}let u=e[0],c=1;for(n?o.push("M",u.x,u.y):o.push("L",u.x,u.y);c<(r?e.length:e.length-1);){var h,d,f;let t=e[(c%(h=e.length)+h)%h],n=u.x-t.x,r=u.y-t.y;if(l&&(0!==n||0!==r)&&(null==i||0>i.indexOf(c-1))){;let i=Math.sqrt(n*n+r*r),s=n*Math.min(a,i/2)/i,l=r*Math.min(a,i/2)/i,u=t.x+s,h=t.y+l;o.push("L",u,h);let p=e[((c+1)%(d=e.length)+d)%d];for(;c<e.length-2&&0===Math.round(p.x-t.x)&&0===Math.round(p.y-t.y);){;p=e[((c+2)%(f=e.length)+f)%f],c+=1}n=p.x-t.x,i=Math.max(1,Math.sqrt(n*n+(r=p.y-t.y)*r));let g=n*Math.min(a,i/2)/i,m=r*Math.min(a,i/2)/i,y=t.x+g,b=t.y+m;o.push("Q",t.x,t.y,y,b),t=new uA(y,b)}else o.push("L",t.x,t.y);u=t,c+=1}return r?o.push("Z"):o.push("L",s.x,s.y),o.map(e=>"string"==typeof e?e:+e.toFixed(3)).join(" ")}(n,t.round,null==t.initialMove||t.initialMove,t.close,t.exclude)}function u_(e,t,n,r,i=0,o=0,s=0,l,a){let u;if(0===n||0===r)return[];let c=-(l-=e)/2,h=-(a-=t)/2,d=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),p=d*c+f*h,g=-1*f*c+d*h,m=p*p,y=g*g,b=(n=Math.abs(n))*n,v=(r=Math.abs(r))*r,x=m/b+y/v;if(x>1)n=Math.sqrt(x)*n,r=Math.sqrt(x)*r,u=0;else{let e=1;o===s&&(e=-1),u=e*Math.sqrt((b*v-b*y-v*m)/(b*y+v*m))}let w=u*n*g/r,C=-1*u*r*p/n,E=d*w-f*C+l/2,S=f*w+d*C+a/2,P=Math.atan2((g-C)/r,(p-w)/n)-Math.atan2(0,1),O=P>=0?P:2*Math.PI+P,k=(P=Math.atan2((-g-C)/r,(-p-w)/n)-Math.atan2((g-C)/r,(p-w)/n))>=0?P:2*Math.PI+P;0===s&&k>0?k-=2*Math.PI:0!==s&&k<0&&(k+=2*Math.PI);let A=2*k/Math.PI,M=Math.ceil(A<0?-1*A:A),T=k/M,N=8/3*Math.sin(T/4)*Math.sin(T/4)/Math.sin(T/2),j=d*n,I=d*r,L=f*n,R=f*r,_=Math.cos(O),B=Math.sin(O),D=-N*(j*B+R*_),z=-N*(L*B-I*_),F=0,V=0,$=[];for(let n=0;n<M;n+=1){O+=T,F=j*(_=Math.cos(O))-R*(B=Math.sin(O))+E,V=L*_+I*B+S;let r=-N*(j*B+R*_),i=-N*(L*B-I*_),o=6*n;$[o]=Number(D+e),$[o+1]=Number(z+t),$[o+2]=Number(F-r+e),$[o+3]=Number(V-i+t),$[o+4]=Number(F+e),$[o+5]=Number(V+t),D=F+r,z=V+i}return $.map(e=>+e.toFixed(2))}function uB(e,t,n,r,i=0,o=0,s=0,l,a){let u=[],c=u_(e,t,n,r,i,o,s,l,a);if(null!=c)for(let e=0,t=c.length;e<t;e+=6)u.push("C",c[e],c[e+1],c[e+2],c[e+3],c[e+4],c[e+5]);return u.join(" ")}class uD extends uk{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),null!=e){if("string"==typeof e)return uD.parse(e);this.points=e.map(e=>uA.create(e))}else this.points=[]}scale(e,t,n=new uA){return this.points.forEach(r=>r.scale(e,t,n)),this}rotate(e,t){return this.points.forEach(n=>n.rotate(e,t)),this}translate(e,t){let n=uA.create(e,t);return this.points.forEach(e=>e.translate(n.x,n.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(0===this.points.length)return new uM;let e=1/0,t=-1/0,n=1/0,r=-1/0,i=this.points;for(let o=0,s=i.length;o<s;o+=1){let s=i[o],l=s.x,a=s.y;l<e&&(e=l),l>t&&(t=l),a<n&&(n=a),a>r&&(r=a)}return new uM(e,n,t-e,r-n)}closestPoint(e){let t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){let t=this.points,n=t.length;if(0===n||1===n)return 0;let r=0,i=0,o=1/0;for(let s=0,l=n-1;s<l;s+=1){let n=new uT(t[s],t[s+1]),l=n.length(),a=n.closestPointNormalizedLength(e),u=n.pointAt(a).squaredDistance(e);u<o&&(o=u,i=r+a*l),r+=l}return i}closestPointNormalizedLength(e){let t=this.length();return 0===t?0:this.closestPointLength(e)/t}closestPointTangent(e){let t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(0===this.points.length)return!1;let t=uA.clone(e),n=t.x,r=t.y,i=this.points,o=i.length,s=o-1,l=0;for(let a=0;a<o;a+=1){let o=i[s],u=i[a];if(t.equals(o))return!0;let c=new uT(o,u);if(c.containsPoint(e))return!0;if(r<=o.y&&r>u.y||r>o.y&&r<=u.y){let t=o.x-n>u.x-n?o.x-n:u.x-n;if(t>=0){let i=new uA(n+t,r),o=new uT(e,i);c.intersectsWithLine(o)&&(l+=1)}}s=a}return l%2==1}intersectsWithLine(e){let t=[];for(let n=0,r=this.points.length-1;n<r;n+=1){let r=this.points[n],i=this.points[n+1],o=e.intersectsWithLine(new uT(r,i));o&&t.push(o)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){let t=this.points[e],n=this.points[e+1];if(new uT(t,n).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,n=this.points.length-1;t<n;t+=1){let n=this.points[t],r=this.points[t+1];e+=n.distance(r)}return e}pointAt(e){let t=this.points,n=t.length;if(0===n)return null;if(1===n||e<=0)return t[0].clone();if(e>=1)return t[n-1].clone();let r=this.length();return this.pointAtLength(r*e)}pointAtLength(e){let t=this.points,n=t.length;if(0===n)return null;if(1===n)return t[0].clone();let r=!0;e<0&&(r=!1,e=-e);let i=0;for(let o=0,s=n-1;o<s;o+=1){let n=r?o:s-1-o,l=t[n],a=t[n+1],u=new uT(l,a),c=l.distance(a);if(e<=i+c)return u.pointAtLength((r?1:-1)*(e-i));i+=c}return(r?t[n-1]:t[0]).clone()}tangentAt(e){let t=this.points.length;if(0===t||1===t)return null;e<0&&(e=0),e>1&&(e=1);let n=this.length()*e;return this.tangentAtLength(n)}tangentAtLength(e){let t;let n=this.points,r=n.length;if(0===r||1===r)return null;let i=!0;e<0&&(i=!1,e=-e);let o=0;for(let s=0,l=r-1;s<l;s+=1){let r=i?s:l-1-s,a=n[r],u=n[r+1],c=new uT(a,u),h=a.distance(u);if(c.isDifferentiable()){if(e<=o+h)return c.tangentAtLength((i?1:-1)*(e-o));t=c}o+=h}if(t){let e=i?1:0;return t.tangentAt(e)}return null}simplify(e={}){let t=this.points;if(t.length<3)return this;let n=e.threshold||0,r=0;for(;t[r+2];){let e=r,i=r+1,o=r+2,s=t[e],l=t[i],a=t[o];new uT(s,a).closestPoint(l).distance(l)<=n?t.splice(i,1):r+=1}return this}toHull(){let e;let t=this.points,n=t.length;if(0===n)return new uD;let r=t[0];for(let e=1;e<n;e+=1)t[e].y<r.y?r=t[e]:t[e].y===r.y&&t[e].x>r.x&&(r=t[e]);let i=[];for(let e=0;e<n;e+=1){let n=r.theta(t[e]);0===n&&(n=360),i.push([t[e],e,n])}if(i.sort((e,t)=>{let n=e[2]-t[2];return 0===n&&(n=t[1]-e[1]),n}),i.length>2){let e=i[i.length-1];i.unshift(e)}let o={},s=[],l=e=>`${e[0].toString()}@${e[1]}`;for(;0!==i.length;){let e=i.pop(),t=e[0];if(o[l(e)])continue;let n=!1;for(;!n;)if(s.length<2)s.push(e),n=!0;else{let r=s.pop(),a=r[0],u=s.pop(),c=u[0],h=c.cross(a,t);if(h<0)s.push(u),s.push(r),s.push(e),n=!0;else if(0===h){let e=a.angleBetween(c,t);1e-10>Math.abs(e-180)?(o[l(r)]=a,s.push(u)):a.equals(t)||c.equals(a)?(o[l(r)]=a,s.push(u)):1e-10>Math.abs((e+1)%360-1)&&(s.push(u),i.push(r))}else o[l(r)]=a,s.push(u)}}s.length>2&&s.pop();let a=-1;for(let t=0,n=s.length;t<n;t+=1){let n=s[t][1];(void 0===e||n<e)&&(e=n,a=t)}let u=[];if(a>0){let e=s.slice(a),t=s.slice(0,a);u=e.concat(t)}else u=s;let c=[];for(let e=0,t=u.length;e<t;e+=1)c.push(u[e][0]);return new uD(c)}equals(e){return null!=e&&e.points.length===this.points.length&&e.points.every((e,t)=>e.equals(this.points[t]))}clone(){return new uD(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(U=uD||(uD={})).isPolyline=function(e){return null!=e&&e instanceof U},(G=uD||(uD={})).parse=function(e){let t=e.trim();if(""===t)return new G;let n=[],r=t.split(/\s*,\s*|\s+/);for(let e=0,t=r.length;e<t;e+=2)n.push({x:+r[e],y:+r[e+1]});return new G(n)};class uz extends uk{constructor(e,t,n,r){super(),this.PRECISION=3,this.start=uA.create(e),this.controlPoint1=uA.create(t),this.controlPoint2=uA.create(n),this.end=uA.create(r)}bbox(){let e,t,n,r,i,o,s,l,a,u,c;let h=this.start,d=this.controlPoint1,f=this.controlPoint2,p=this.end,g=h.x,m=h.y,y=d.x,b=d.y,v=f.x,x=f.y,w=p.x,C=p.y,E=[],S=[],P=[[],[]];for(let a=0;a<2;a+=1){if(0===a?(t=6*g-12*y+6*v,e=-3*g+9*y-9*v+3*w,n=3*y-3*g):(t=6*m-12*b+6*x,e=-3*m+9*b-9*x+3*C,n=3*b-3*m),1e-12>Math.abs(e)){if(1e-12>Math.abs(t))continue;(r=-n/t)>0&&r<1&&S.push(r);continue}l=Math.sqrt(s=t*t-4*n*e),!(s<0)&&((i=(-t+l)/(2*e))>0&&i<1&&S.push(i),(o=(-t-l)/(2*e))>0&&o<1&&S.push(o))}let O=S.length,k=O;for(;O;)O-=1,a=(c=1-(r=S[O]))*c*c*g+3*c*c*r*y+3*c*r*r*v+r*r*r*w,P[0][O]=a,u=c*c*c*m+3*c*c*r*b+3*c*r*r*x+r*r*r*C,P[1][O]=u,E[O]={X:a,Y:u};S[k]=0,S[k+1]=1,E[k]={X:g,Y:m},E[k+1]={X:w,Y:C},P[0][k]=g,P[1][k]=m,P[0][k+1]=w,P[1][k+1]=C,S.length=k+2,P[0].length=k+2,P[1].length=k+2,E.length=k+2;let A=Math.min.apply(null,P[0]),M=Math.min.apply(null,P[1]),T=Math.max.apply(null,P[0]),N=Math.max.apply(null,P[1]);return new uM(A,M,T-A,N-M)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){let n=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,n),n)}closestPointNormalizedLength(e,t={}){let n=this.getOptions(t),r=this.closestPointLength(e,n);if(!r)return 0;let i=this.length(n);return 0===i?0:r/i}closestPointT(e,t={}){let n=this.getPrecision(t),r=this.getDivisions(t),i=Math.pow(10,-n),o=null,s=0,l=0,a=0,u=0,c=0,h=null,d=r.length,f=d>0?1/d:0;for(r.forEach((t,n)=>{let r=t.start.distance(e),i=t.end.distance(e),d=r+i;(null==h||d<h)&&(o=t,s=n*f,l=(n+1)*f,a=r,u=i,h=d,c=t.endpointDistance())});;){let t=a?Math.abs(a-u)/a:0,n=null!=u?Math.abs(a-u)/u:0,r=t<i||n<i,h=!a||a<c*i,d=!u||u<c*i,p=h||d;if(r||p)return a<=u?s:l;let g=o.divide(.5);f/=2;let m=g[0].start.distance(e),y=g[0].end.distance(e),b=m+y,v=g[1].start.distance(e),x=g[1].end.distance(e);b<=v+x?(o=g[0],l-=f,a=m,u=y):(o=g[1],s+=f,a=v,u=x)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);let n=this.tAt(e,t);return this.divideAtT(n)}divideAtLength(e,t={}){let n=this.tAtLength(e,t);return this.divideAtT(n)}divide(e){return this.divideAtT(e)}divideAtT(e){let t=this.start,n=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return[new uz(t,t,t,t),new uz(t,n,r,i)];if(e>=1)return[new uz(t,n,r,i),new uz(i,i,i,i)];let o=this.getSkeletonPoints(e),s=o.startControlPoint1,l=o.startControlPoint2,a=o.divider,u=o.dividerControlPoint1,c=o.dividerControlPoint2;return[new uz(t,s,l,a),new uz(a,u,c,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){let t=this.start,n=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:r.clone()};if(e>=1)return{startControlPoint1:n.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};let o=new uT(t,n).pointAt(e),s=new uT(n,r).pointAt(e),l=new uT(r,i).pointAt(e),a=new uT(o,s).pointAt(e),u=new uT(s,l).pointAt(e),c=new uT(a,u).pointAt(e);return{startControlPoint1:o,startControlPoint2:a,divider:c,dividerControlPoint1:u,dividerControlPoint2:l}}getSubdivisions(e={}){let t=this.getPrecision(e),n=[new uz(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===t)return n;let r=this.endpointDistance(),i=Math.pow(10,-t),o=0;for(;;){o+=1;let e=[];n.forEach(t=>{let n=t.divide(.5);e.push(n[0],n[1])});let t=e.reduce((e,t)=>e+t.endpointDistance(),0),s=0!==t?(t-r)/t:0;if(o>1&&s<i)return e;n=e,r=t}}length(e={}){return this.getDivisions(e).reduce((e,t)=>e+t.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;let n=void 0===t.precision?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:n})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();let n=this.tAt(e,t);return this.pointAtT(n)}pointAtLength(e,t={}){let n=this.tAtLength(e,t);return this.pointAtT(n)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){let e=this.start,t=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(n)&&n.equals(r))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);let n=this.tAt(e,t);return this.tangentAtT(n)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;let n=this.tAtLength(e,t);return this.tangentAtT(n)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);let t=this.getSkeletonPoints(e),n=t.startControlPoint2,r=t.dividerControlPoint1,i=t.divider,o=new uT(n,r);return o.translate(i.x-n.x,i.y-n.y),o}getPrecision(e={}){return null==e.precision?this.PRECISION:e.precision}getDivisions(e={}){if(null!=e.subdivisions)return e.subdivisions;let t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){let t=this.getPrecision(e);return{precision:t,subdivisions:this.getDivisions(e)}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;let n=this.getOptions(t),r=this.length(n);return this.tAtLength(r*e,n)}tAtLength(e,t={}){let n,r,i=!0;e<0&&(i=!1,e=-e);let o=this.getPrecision(t),s=this.getDivisions(t),l=null,a=0,u=0,c=0,h=s.length,d=h>0?1/h:0;for(let t=0;t<h;t+=1){let o=i?t:h-1-t,f=s[t],p=f.endpointDistance();if(e<=c+p){l=f,n=o*d,r=(o+1)*d,a=i?e-c:p+c-e,u=i?p+c-e:e-c;break}c+=p}if(null==l)return i?1:0;let f=this.length({precision:o,subdivisions:s}),p=Math.pow(10,-o);for(;;){let e,t,i;if((e=0!==f?a/f:0)<p)return n;if((e=0!==f?u/f:0)<p)return r;let o=l.divide(.5);d/=2;let s=o[0].endpointDistance(),c=o[1].endpointDistance();a<=s?(l=o[0],r-=d,i=s-(t=a)):(l=o[1],n+=d,i=c-(t=a-s)),a=t,u=i}}toPoints(e={}){let t=this.getDivisions(e),n=[t[0].start.clone()];return t.forEach(e=>n.push(e.end.clone())),n}toPolyline(e={}){return new uD(this.toPoints(e))}scale(e,t,n){return this.start.scale(e,t,n),this.controlPoint1.scale(e,t,n),this.controlPoint2.scale(e,t,n),this.end.scale(e,t,n),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return"number"==typeof e?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return null!=e&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new uz(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(H=uz||(uz={})).isCurve=function(e){return null!=e&&e instanceof H},!function(e){function t(e){let t=e.length,n=[],r=[],i=2;n[0]=e[0]/i;for(let o=1;o<t;o+=1)r[o]=1/i,i=(o<t-1?4:3.5)-r[o],n[o]=(e[o]-n[o-1])/i;for(let e=1;e<t;e+=1)n[t-e-1]-=r[t-e]*n[t-e];return n}e.throughPoints=function(n){if(null==n||Array.isArray(n)&&n.length<2)throw Error("At least 2 points are required");let r=function(e){let n=e.map(e=>uA.clone(e)),r=[],i=[],o=n.length-1;if(1===o)return r[0]=new uA((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),i[0]=new uA(2*r[0].x-n[0].x,2*r[0].y-n[0].y),[r,i];let s=[];for(let e=1;e<o-1;e+=1)s[e]=4*n[e].x+2*n[e+1].x;s[0]=n[0].x+2*n[1].x,s[o-1]=(8*n[o-1].x+n[o].x)/2;let l=t(s);for(let e=1;e<o-1;e+=1)s[e]=4*n[e].y+2*n[e+1].y;s[0]=n[0].y+2*n[1].y,s[o-1]=(8*n[o-1].y+n[o].y)/2;let a=t(s);for(let e=0;e<o;e+=1)r.push(new uA(l[e],a[e])),e<o-1?i.push(new uA(2*n[e+1].x-l[e+1],2*n[e+1].y-a[e+1])):i.push(new uA((n[o].x+l[o-1])/2,(n[o].y+a[o-1])/2));return[r,i]}(n),i=[];for(let t=0,o=r[0].length;t<o;t+=1){let o=new uA(r[0][t].x,r[0][t].y),s=new uA(r[1][t].x,r[1][t].y);i.push(new e(n[t],o,s,n[t+1]))}return i}}(uz||(uz={}));class uF extends uk{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(null==this.previousSegment)throw Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;let n=this.length();return e>=1?n:n*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class uV extends uF{constructor(e,t){super(),uT.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=uA.create(e,t).round(2)}get type(){return"L"}get line(){return new uT(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){let t=this.line.divideAt(e);return[new uV(t[0]),new uV(t[1])]}divideAtLength(e){let t=this.line.divideAtLength(e);return[new uV(t[0]),new uV(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return null!=this.previousSegment&&!this.start.equals(this.end)}clone(){return new uV(this.end)}scale(e,t,n){return this.end.scale(e,t,n),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return"number"==typeof e?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){let e=this.end;return`${this.type} ${e.x} ${e.y}`}}(q=uV||(uV={})).create=function(...e){let t=e.length,n=e[0];if(uT.isLine(n))return new q(n);if(uA.isPointLike(n))return 1===t?new q(n):e.map(e=>new q(e));if(2===t)return new q(+e[0],+e[1]);let r=[];for(let n=0;n<t;n+=2){let t=+e[n],i=+e[n+1];r.push(new q(t,i))}return r};class u$ extends uF{get end(){if(!this.subpathStartSegment)throw Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new uT(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){let t=this.line.divideAt(e);return[t[1].isDifferentiable()?new uV(t[0]):this.clone(),new uV(t[1])]}divideAtLength(e){let t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new uV(t[0]):this.clone(),new uV(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!!this.previousSegment&&!!this.subpathStartSegment&&!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new u$}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(W=u$||(u$={})).create=function(){return new W};class uU extends uF{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,uT.isLine(e)||uz.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=uA.create(e,t).round(2)}get start(){throw Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,t,n){return this.end.scale(e,t,n),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return"number"==typeof e?this.end.translate(e,t):this.end.translate(e),this}clone(){return new uU(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){let e=this.end;return`${this.type} ${e.x} ${e.y}`}}(X=uU||(uU={})).create=function(...e){let t=e.length,n=e[0];if(uT.isLine(n)||uz.isCurve(n))return new X(n);if(uA.isPointLike(n)){if(1===t)return new X(n);let r=[];for(let n=0;n<t;n+=1)0===n?r.push(new X(e[n])):r.push(new uV(e[n]));return r}if(2===t)return new X(+e[0],+e[1]);let r=[];for(let n=0;n<t;n+=2){let t=+e[n],i=+e[n+1];0===n?r.push(new X(t,i)):r.push(new uV(t,i))}return r};class uG extends uF{constructor(e,t,n,r,i,o){super(),uz.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):"number"==typeof e?(this.controlPoint1=new uA(e,t).round(2),this.controlPoint2=new uA(n,r).round(2),this.endPoint=new uA(i,o).round(2)):(this.controlPoint1=uA.create(e).round(2),this.controlPoint2=uA.create(t).round(2),this.endPoint=uA.create(n).round(2))}get type(){return"C"}get curve(){return new uz(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){let n=this.curve.divideAt(e,t);return[new uG(n[0]),new uG(n[1])]}divideAtLength(e,t={}){let n=this.curve.divideAtLength(e,t);return[new uG(n[0]),new uG(n[1])]}divideAtT(e){let t=this.curve.divideAtT(e);return[new uG(t[0]),new uG(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;let e=this.start,t=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(n)&&n.equals(r))}scale(e,t,n){return this.controlPoint1.scale(e,t,n),this.controlPoint2.scale(e,t,n),this.end.scale(e,t,n),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return"number"==typeof e?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new uG(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){let e=this.controlPoint1,t=this.controlPoint2,n=this.end;return[this.type,e.x,e.y,t.x,t.y,n.x,n.y].join(" ")}}function uH(e,t,n){return{x:e*Math.cos(n)-t*Math.sin(n),y:e*Math.sin(n)+t*Math.cos(n)}}function uq(e,t,n,r,i,o){let s=1/3,l=2/3;return[1/3*e+2/3*n,1/3*t+2/3*r,1/3*i+2/3*n,1/3*o+2/3*r,i,o]}(Y=uG||(uG={})).create=function(...e){let t=e.length,n=e[0];if(uz.isCurve(n))return new Y(n);if(uA.isPointLike(n)){if(3===t)return new Y(e[0],e[1],e[2]);let n=[];for(let r=0;r<t;r+=3)n.push(new Y(e[r],e[r+1],e[r+2]));return n}if(6===t)return new Y(e[0],e[1],e[2],e[3],e[4],e[5]);let r=[];for(let n=0;n<t;n+=6)r.push(new Y(e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]));return r};function uW(e){return(function(e){let t=function(e){let t=function(e){if(!e)return null;let t=" \n\v\f\r \xa0 ᠎              \u2028\u2029",n=RegExp(`([a-z])[${t},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${t}]*,?[${t}]*)+)`,"ig"),r=RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${t}]*,?[${t}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return e.replace(n,(e,t,n)=>{let s=[],l=t.toLowerCase();n.replace(r,(e,t)=>(t&&s.push(+t),e)),"m"===l&&s.length>2&&(o.push([t,...s.splice(0,2)]),l="l",t="m"===t?"l":"L");let a=i[l];for(;s.length>=a&&(o.push([t,...s.splice(0,a)]),a););return e}),o}(e);if(!t||!t.length)return[["M",0,0]];let n=0,r=0,i=0,o=0,s=[];for(let e=0,l=t.length;e<l;e+=1){let l=[];s.push(l);let a=t[e],u=a[0];if(u!==u.toUpperCase())switch(l[0]=u.toUpperCase(),l[0]){case"A":l[1]=a[1],l[2]=a[2],l[3]=a[3],l[4]=a[4],l[5]=a[5],l[6]=+a[6]+n,l[7]=+a[7]+r;break;case"V":l[1]=+a[1]+r;break;case"H":l[1]=+a[1]+n;break;case"M":i=+a[1]+n,o=+a[2]+r;for(let e=1,t=a.length;e<t;e+=1)l[e]=+a[e]+(e%2?n:r);break;default:for(let e=1,t=a.length;e<t;e+=1)l[e]=+a[e]+(e%2?n:r)}else for(let e=0,t=a.length;e<t;e+=1)l[e]=a[e];switch(l[0]){case"Z":n=+i,r=+o;break;case"H":n=l[1];break;case"V":r=l[1];break;case"M":i=l[l.length-2],o=l[l.length-1],n=l[l.length-2],r=l[l.length-1];break;default:n=l[l.length-2],r=l[l.length-1]}}return s}(e),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=[],i="",o=t.length;for(let e=0;e<o;e+=1){let s="";t[e]&&(s=t[e][0]),"C"!==s&&(r[e]=s,e>0&&(i=r[e-1])),t[e]=function(e,t,n){let r,i;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=null,t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":if(0===parseFloat(e[1])||0===parseFloat(e[2]))return["L",e[6],e[7]];return["C"].concat((function e(t,n,r,i,o,s,l,a,u,c){let h,d,f,p,g;let m=120*Math.PI/180,y=Math.PI/180*(+o||0),b=[];if(c)d=c[0],f=c[1],p=c[2],g=c[3];else{t=(h=uH(t,n,-y)).x,n=h.y,a=(h=uH(a,u,-y)).x,u=h.y;let e=(t-a)/2,o=(n-u)/2,c=e*e/(r*r)+o*o/(i*i);c>1&&(r*=c=Math.sqrt(c),i*=c);let m=r*r,b=i*i,v=(s===l?-1:1)*Math.sqrt(Math.abs((m*b-m*o*o-b*e*e)/(m*o*o+b*e*e)));p=v*r*o/i+(t+a)/2,g=-(v*i)*e/r+(n+u)/2,d=Math.asin((n-g)/i),f=Math.asin((u-g)/i),d=t<p?Math.PI-d:d,f=a<p?Math.PI-f:f,d<0&&(d=2*Math.PI+d),f<0&&(f=2*Math.PI+f),l&&d>f&&(d-=2*Math.PI),!l&&f>d&&(f-=2*Math.PI)}let v=f-d;if(Math.abs(v)>m){let t=f,n=a,s=u;a=p+r*Math.cos(f=d+m*(l&&f>d?1:-1)),b=e(a,u=g+i*Math.sin(f),r,i,o,0,l,n,s,[f,t,p,g])}v=f-d;let x=Math.cos(d),w=Math.cos(f),C=Math.tan(v/4),E=4/3*(r*C),S=4/3*(i*C),P=[t,n],O=[t+E*Math.sin(d),n-S*x],k=[a+E*Math.sin(f),u-S*w],A=[a,u];if(O[0]=2*P[0]-O[0],O[1]=2*P[1]-O[1],c)return[O,k,A].concat(b);{b=[O,k,A].concat(b).join().split(",");let e=[],t=b.length;for(let n=0;n<t;n+=1)e[n]=n%2?uH(+b[n-1],+b[n],y).y:uH(+b[n],+b[n+1],y).x;return e}}).apply(0,[t.x,t.y].concat(e.slice(1))));case"S":return"C"===n||"S"===n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),["C",r,i].concat(e.slice(1));case"T":return"Q"===n||"T"===n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),["C"].concat(uq(t.x,t.y,t.qx,t.qy,e[1],e[2]));case"Q":return t.qx=e[1],t.qy=e[2],["C"].concat(uq(t.x,t.y,e[1],e[2],e[3],e[4]));case"H":return["L"].concat(e[1],t.y);case"V":return["L"].concat(t.x,e[1])}return e}(t[e],n,i),"A"!==r[e]&&"C"===s&&(r[e]="C"),!function(e,n){if(e[n].length>7){e[n].shift();let i=e[n];for(;i.length;)r[n]="A",n+=1,e.splice(n,0,["C"].concat(i.splice(0,6)));e.splice(n,1),o=t.length}}(t,e);let l=t[e],a=l.length;n.x=l[a-2],n.y=l[a-1],n.bx=parseFloat(l[a-4])||n.x,n.by=parseFloat(l[a-3])||n.y}return(!t[0][0]||"M"!==t[0][0])&&t.unshift(["M",0,0]),t})(e).map(e=>e.map(e=>"string"==typeof e?e:td.round(e,2))).join(",").split(",").join(" ")}class uX extends uk{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e)){if(uT.isLine(e[0])||uz.isCurve(e[0])){let t=null;e.forEach((e,n)=>{0===n&&this.appendSegment(uX.createSegment("M",e.start)),null!=t&&!t.end.equals(e.start)&&this.appendSegment(uX.createSegment("M",e.start)),uT.isLine(e)?this.appendSegment(uX.createSegment("L",e.end)):uz.isCurve(e)&&this.appendSegment(uX.createSegment("C",e.controlPoint1,e.controlPoint2,e.end)),t=e})}else e.forEach(e=>{e.isSegment&&this.appendSegment(e)})}else null!=e&&(uT.isLine(e)?(this.appendSegment(uX.createSegment("M",e.start)),this.appendSegment(uX.createSegment("L",e.end))):uz.isCurve(e)?(this.appendSegment(uX.createSegment("M",e.start)),this.appendSegment(uX.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):uD.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((e,t)=>{let n=0===t?uX.createSegment("M",e):uX.createSegment("L",e);this.appendSegment(n)}):e.isSegment&&this.appendSegment(e))}get start(){let e=this.segments,t=e.length;if(0===t)return null;for(let n=0;n<t;n+=1){let t=e[n];if(t.isVisible)return t.start}return e[t-1].end}get end(){let e=this.segments,t=e.length;if(0===t)return null;for(let n=t-1;n>=0;n-=1){let t=e[n];if(t.isVisible)return t.end}return e[t-1].end}moveTo(...e){return this.appendSegment(uU.create.call(null,...e))}lineTo(...e){return this.appendSegment(uV.create.call(null,...e))}curveTo(...e){return this.appendSegment(uG.create.call(null,...e))}arcTo(e,t,n,r,i,o,s){let l=this.end||new uA,a="number"==typeof o?u_(l.x,l.y,e,t,n,r,i,o,s):u_(l.x,l.y,e,t,n,r,i,o.x,o.y);if(null!=a)for(let e=0,t=a.length;e<t;e+=6)this.curveTo(a[e],a[e+1],a[e+2],a[e+3],a[e+4],a[e+5]);return this}quadTo(e,t,n,r){let i=this.end||new uA,o=["M",i.x,i.y];"number"==typeof e?o.push("Q",e,t,n,r):o.push("Q",e.x,e.y,t.x,t.y);let s=uX.parse(o.join(" "));return this.appendSegment(s.segments.slice(1)),this}close(){return this.appendSegment(u$.create())}drawPoints(e,t={}){let n=uR(e,t),r=uX.parse(n);r&&r.segments&&this.appendSegment(r.segments)}bbox(){let e;let t=this.segments,n=t.length;if(0===n)return null;for(let r=0;r<n;r+=1){let n=t[r];if(n.isVisible){let t=n.bbox();null!=t&&(e=e?e.union(t):t)}}if(null!=e)return e;let r=t[n-1];return new uM(r.end.x,r.end.y,0,0)}appendSegment(e){let t;let n=this.segments.length,r=0!==n?this.segments[n-1]:null;if(Array.isArray(e))for(let n=0,i=e.length;n<i;n+=1){let i=e[n];t=this.prepareSegment(i,r,null),this.segments.push(t),r=t}else null!=e&&e.isSegment&&(t=this.prepareSegment(e,r,null),this.segments.push(t));return this}insertSegment(e,t){let n;let r=this.segments.length;if(e<0&&(e=r+e+1),e>r||e<0)throw Error("Index out of range.");let i=null,o=null;if(0!==r&&(e>=1?o=(i=this.segments[e-1]).nextSegment:(i=null,o=this.segments[0])),Array.isArray(t))for(let r=0,s=t.length;r<s;r+=1){let s=t[r];n=this.prepareSegment(s,i,o),this.segments.splice(e+r,0,n),i=n}else n=this.prepareSegment(t,i,o),this.segments.splice(e,0,n);return this}removeSegment(e){let t=this.fixIndex(e),n=this.segments.splice(t,1)[0],r=n.previousSegment,i=n.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),n.isSubpathStart&&i&&this.updateSubpathStartSegment(i),n}replaceSegment(e,t){let n;let r=this.fixIndex(e),i=this.segments[r],o=i.previousSegment,s=i.nextSegment,l=i.isSubpathStart;if(Array.isArray(t)){this.segments.splice(e,1);for(let r=0,i=t.length;r<i;r+=1){let i=t[r];n=this.prepareSegment(i,o,s),this.segments.splice(e+r,0,n),o=n,l&&n.isSubpathStart&&(l=!1)}}else n=this.prepareSegment(t,o,s),this.segments.splice(r,1,n),l&&n.isSubpathStart&&(l=!1);l&&s&&this.updateSubpathStartSegment(s)}getSegment(e){let t=this.fixIndex(e);return this.segments[t]}fixIndex(e){let t=this.segments.length;if(0===t)throw Error("Path has no segments.");let n=e;for(;n<0;)n=t+n;if(n>=t||n<0)throw Error("Index out of range.");return n}segmentAt(e,t={}){let n=this.segmentIndexAt(e,t);return n?this.getSegment(n):null}segmentAtLength(e,t={}){let n=this.segmentIndexAtLength(e,t);return n?this.getSegment(n):null}segmentIndexAt(e,t={}){if(0===this.segments.length)return null;let n=td.clamp(e,0,1),r=this.getOptions(t),i=this.length(r);return this.segmentIndexAtLength(i*n,r)}segmentIndexAtLength(e,t={}){let n=this.segments.length;if(0===n)return null;let r=!0;e<0&&(r=!1,e=-e);let i=this.getPrecision(t),o=this.getSubdivisions(t),s=0,l=null;for(let t=0;t<n;t+=1){let a=r?t:n-1-t,u=this.segments[a],c=o[a],h=u.length({precision:i,subdivisions:c});if(u.isVisible){if(e<=s+h)return a;l=a}s+=h}return l}getSegmentSubdivisions(e={}){let t=this.getPrecision(e),n=[];for(let e=0,r=this.segments.length;e<r;e+=1){let r=this.segments[e].getSubdivisions({precision:t});n.push(r)}return n}updateSubpathStartSegment(e){let t=e.previousSegment,n=e;for(;n&&!n.isSubpathStart;)null!=t?n.subpathStartSegment=t.subpathStartSegment:n.subpathStartSegment=null,t=n,n=n.nextSegment}prepareSegment(e,t,n){e.previousSegment=t,e.nextSegment=n,null!=t&&(t.nextSegment=e),null!=n&&(n.previousSegment=e);let r=e;return e.isSubpathStart&&(e.subpathStartSegment=e,r=n),null!=r&&this.updateSubpathStartSegment(r),e}closestPoint(e,t={}){let n=this.closestPointT(e,t);return n?this.pointAtT(n):null}closestPointLength(e,t={}){let n=this.getOptions(t),r=this.closestPointT(e,n);return r?this.lengthAtT(r,n):0}closestPointNormalizedLength(e,t={}){let n=this.getOptions(t),r=this.closestPointLength(e,n);if(0===r)return 0;let i=this.length(n);return 0===i?0:r/i}closestPointT(e,t={}){let n;if(0===this.segments.length)return null;let r=this.getPrecision(t),i=this.getSubdivisions(t),o=1/0;for(let t=0,s=this.segments.length;t<s;t+=1){let s=this.segments[t],l=i[t];if(s.isVisible){let i=s.closestPointT(e,{precision:r,subdivisions:l}),a=s.pointAtT(i),u=td.squaredLength(a,e);u<o&&(n={segmentIndex:t,value:i},o=u)}}return n?n:{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){let n;if(0===this.segments.length)return null;let r=this.getPrecision(t),i=this.getSubdivisions(t),o=1/0;for(let t=0,s=this.segments.length;t<s;t+=1){let s=this.segments[t],l=i[t];if(s.isDifferentiable()){let t=s.closestPointT(e,{precision:r,subdivisions:l}),i=s.pointAtT(t),a=td.squaredLength(i,e);a<o&&(n=s.tangentAtT(t),o=a)}}return n?n:null}containsPoint(e,t={}){let n=this.toPolylines(t);if(!n)return!1;let r=0;for(let t=0,i=n.length;t<i;t+=1)n[t].containsPoint(e)&&(r+=1);return r%2==1}pointAt(e,t={}){if(0===this.segments.length)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();let n=this.getOptions(t),r=this.length(n);return this.pointAtLength(r*e,n)}pointAtLength(e,t={}){let n;if(0===this.segments.length)return null;if(0===e)return this.start.clone();let r=!0;e<0&&(r=!1,e=-e);let i=this.getPrecision(t),o=this.getSubdivisions(t),s=0;for(let t=0,l=this.segments.length;t<l;t+=1){let a=r?t:l-1-t,u=this.segments[a],c=o[a],h=u.length({precision:i,subdivisions:c});if(u.isVisible){if(e<=s+h)return u.pointAtLength((r?1:-1)*(e-s),{precision:i,subdivisions:c});n=u}s+=h}return n?r?n.end:n.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){let t=this.segments,n=t.length;if(0===n)return null;let r=e.segmentIndex;if(r<0)return t[0].pointAtT(0);if(r>=n)return t[n-1].pointAtT(1);let i=td.clamp(e.value,0,1);return t[r].pointAtT(i)}divideAt(e,t={}){if(0===this.segments.length)return null;let n=td.clamp(e,0,1),r=this.getOptions(t),i=this.length(r);return this.divideAtLength(i*n,r)}divideAtLength(e,t={}){let n,r,i,o,s;if(0===this.segments.length)return null;let l=!0;e<0&&(l=!1,e=-e);let a=this.getPrecision(t),u=this.getSubdivisions(t),c=0;for(let t=0,s=this.segments.length;t<s;t+=1){let h=l?t:s-1-t,d=this.getSegment(h),f={precision:a,subdivisions:u[h]},p=d.length(f);if(d.isDifferentiable()&&(i=d,o=h,e<=c+p)){r=h,n=d.divideAtLength((l?1:-1)*(e-c),f);break}c+=p}if(!i)return null;!n&&(r=o,s=l?1:0,n=i.divideAtT(s));let h=this.clone(),d=r;h.replaceSegment(d,n);let f=d+1,p=d+2;!n[0].isDifferentiable()&&(h.removeSegment(d),f-=1,p-=1);let g=h.getSegment(f).start;h.insertSegment(f,uX.createSegment("M",g)),p+=1,!n[1].isDifferentiable()&&(h.removeSegment(p-1),p-=1);let m=p-d-1;for(let e=p,t=h.segments.length;e<t;e+=1){let t=this.getSegment(e-m),n=h.getSegment(e);if("Z"===n.type&&!t.subpathStartSegment.end.equals(n.subpathStartSegment.end)){let n=uX.createSegment("L",t.end);h.replaceSegment(e,n)}}let y=new uX(h.segments.slice(0,f));return[y,new uX(h.segments.slice(f))]}intersectsWithLine(e,t={}){let n=this.toPolylines(t);if(null==n)return null;let r=null;for(let t=0,i=n.length;t<i;t+=1){let i=n[t],o=e.intersect(i);o&&(null==r&&(r=[]),Array.isArray(o)?r.push(...o):r.push(o))}return r}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){let e=this.segments;return 0===e.length||"M"===e[0].type}length(e={}){if(0===this.segments.length)return 0;let t=this.getSubdivisions(e),n=0;for(let e=0,r=this.segments.length;e<r;e+=1){let r=this.segments[e],i=t[e];n+=r.length({subdivisions:i})}return n}lengthAtT(e,t={}){let n=this.segments.length;if(0===n)return 0;let r=e.segmentIndex;if(r<0)return 0;let i=td.clamp(e.value,0,1);r>=n&&(r=n-1,i=1);let o=this.getPrecision(t),s=this.getSubdivisions(t),l=0;for(let e=0;e<r;e+=1){let t=this.segments[e],n=s[e];l+=t.length({precision:o,subdivisions:n})}let a=this.segments[r],u=s[r];return l+=a.lengthAtT(i,{precision:o,subdivisions:u})}tangentAt(e,t={}){if(0===this.segments.length)return null;let n=td.clamp(e,0,1),r=this.getOptions(t),i=this.length(r);return this.tangentAtLength(i*n,r)}tangentAtLength(e,t={}){let n;if(0===this.segments.length)return null;let r=!0;e<0&&(r=!1,e=-e);let i=this.getPrecision(t),o=this.getSubdivisions(t),s=0;for(let t=0,l=this.segments.length;t<l;t+=1){let a=r?t:l-1-t,u=this.segments[a],c=o[a],h=u.length({precision:i,subdivisions:c});if(u.isDifferentiable()){if(e<=s+h)return u.tangentAtLength((r?1:-1)*(e-s),{precision:i,subdivisions:c});n=u}s+=h}if(n){let e=r?1:0;return n.tangentAtT(e)}return null}tangentAtT(e){let t=this.segments.length;if(0===t)return null;let n=e.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=t)return this.segments[t-1].tangentAtT(1);let r=td.clamp(e.value,0,1);return this.segments[n].tangentAtT(r)}getPrecision(e={}){return null==e.precision?this.PRECISION:e.precision}getSubdivisions(e={}){if(null==e.segmentSubdivisions){let t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){let t=this.getPrecision(e);return{precision:t,segmentSubdivisions:this.getSubdivisions(e)}}toPoints(e={}){let t=this.segments,n=t.length;if(0===n)return null;let r=this.getSubdivisions(e),i=[],o=[];for(let e=0;e<n;e+=1){let n=t[e];if(n.isVisible){let t=r[e];t.length>0?t.forEach(e=>o.push(e.start)):o.push(n.start)}else o.length>0&&(o.push(t[e-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(e={}){let t=this.toPoints(e);return t?t.map(e=>new uD(e)):null}scale(e,t,n){return this.segments.forEach(r=>r.scale(e,t,n)),this}rotate(e,t){return this.segments.forEach(n=>n.rotate(e,t)),this}translate(e,t){return"number"==typeof e?this.segments.forEach(n=>n.translate(e,t)):this.segments.forEach(t=>t.translate(e)),this}clone(){let e=new uX;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(null==e)return!1;let t=this.segments,n=e.segments,r=t.length;if(n.length!==r)return!1;for(let e=0;e<r;e+=1){let r=t[e],i=n[e];if(r.type!==i.type||!r.equals(i))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(J=uX||(uX={})).isPath=function(e){return null!=e&&e instanceof J},!function(e){function t(e,...n){if("M"===e)return uU.create.call(null,...n);if("L"===e)return uV.create.call(null,...n);if("C"===e)return uG.create.call(null,...n);if("z"===e||"Z"===e)return u$.create();throw Error(`Invalid path segment type "${e}"`)}e.parse=function(n){if(!n)return new e;let r=new e,i=e.normalize(n).match(/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g);if(null!=i)for(let e=0,n=i.length;e<n;e+=1){let n=i[e],o=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,s=n.match(o);if(null!=s){let e=s[0],n=t.call(null,e,...s.slice(1).map(e=>+e));r.appendSegment(n)}}return r},e.createSegment=t}(uX||(uX={})),(Q=uX||(uX={})).normalize=uW,Q.isValid=uI,Q.drawArc=uB,Q.drawPoints=uR,Q.arcToCurves=u_;class uY{constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,t,n=!1){if("object"==typeof e){Object.entries(e).forEach(([e,n])=>{this.register(e,n,t)});return}this.exist(e)&&!n&&!e4.isApplyingHMR()&&this.onDuplicated(e);let r=this.options.process,i=r?n0(r,this,e,t):t;return this.data[e]=i,i}unregister(e){let t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return!!e&&null!=this.data[e]}onDuplicated(e){try{throw this.options.onConflict&&n0(this.options.onConflict,this,e),Error(`${lR(this.options.type)} with name '${e}' already registered.`)}catch(e){throw e}}onNotFound(e,t){throw Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){let n=this.getSpellingSuggestionForName(e),r=t?`${t} ${lF(this.options.type)}`:this.options.type;return`${lR(r)} with name '${e}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(e){return function(e,t,n){let r;let i=Math.min(2,Math.floor(.34*e.length)),o=Math.floor(.4*e.length)+1,s=!1,l=e.toLowerCase();for(let a of t){let t=n(a);if(void 0!==t&&Math.abs(t.length-l.length)<=i){let n=t.toLowerCase();if(n===l){if(t===e)continue;return a}if(s||t.length<3)continue;let i=function(e,t,n){let r=Array(t.length+1),i=Array(t.length+1),o=n+1;for(let e=0;e<=t.length;e+=1)r[e]=e;for(let s=1;s<=e.length;s+=1){let l=e.charCodeAt(s-1),a=s>n?s-n:1,u=t.length>n+s?n+s:t.length;i[0]=s;let c=s;for(let e=1;e<a;e+=1)i[e]=o;for(let e=a;e<=u;e+=1){let n=l===t.charCodeAt(e-1)?r[e-1]:Math.min(r[e]+1,i[e-1]+1,r[e-1]+2);i[e]=n,c=Math.min(c,n)}for(let e=u+1;e<=t.length;e+=1)i[e]=o;if(c>n)return;let h=r;r=i,i=h}let s=r[t.length];return s>n?void 0:s}(l,n,o-1);if(void 0===i)continue;i<3?s=!0:o=i,r=a}}return r}(e,Object.keys(this.data),e=>e)}}(K=uY||(uY={})).create=function(e){return new K(e)};let uJ={color:"#aaaaaa",thickness:1,markup:"rect",update(e,t){let n=t.thickness*t.sx,r=t.thickness*t.sy;aj(e,{width:n,height:r,rx:n,ry:r,fill:t.color})}},uQ={color:"#aaaaaa",thickness:1,markup:"rect",update(e,t){let n=t.sx<=1?t.thickness*t.sx:t.thickness;aj(e,{width:n,height:n,rx:n,ry:n,fill:t.color})}},uK={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(e,t){let n;let r=t.width,i=t.height,o=t.thickness;aj(e,{d:n=r-o>=0&&i-o>=0?["M",r,0,"H0 M0 0 V0",i].join(" "):"M 0 0 0 0",stroke:t.color,"stroke-width":t.thickness})}},uZ=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(e,t){let n;let r=t.width,i=t.height,o=t.thickness;aj(e,{d:n=r-o>=0&&i-o>=0?["M",r,0,"H0 M0 0 V0",i].join(" "):"M 0 0 0 0",stroke:t.color,"stroke-width":t.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(e,t){let n;let r=t.factor||1,i=t.width*r,o=t.height*r,s=t.thickness;n=i-s>=0&&o-s>=0?["M",i,0,"H0 M0 0 V0",o].join(" "):"M 0 0 0 0",t.width=i,t.height=o,aj(e,{d:n,stroke:t.color,"stroke-width":t.thickness})}}];class u0{constructor(){this.patterns={},this.root=aK.create(ay(),{width:"100%",height:"100%"},[am("defs")]).node}add(e,t){let n=this.root.childNodes[0];n&&n.appendChild(t),this.patterns[e]=t,aK.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return null!=this.patterns[e]}}(Z=u0||(u0={})).presets=tU,Z.registry=uY.create({type:"grid"}),Z.registry.register(Z.presets,!0);let u1=function(e){let t=document.createElement("canvas"),n=e.width,r=e.height;t.width=2*n,t.height=r;let i=t.getContext("2d");return i.drawImage(e,0,0,n,r),i.translate(2*n,0),i.scale(-1,1),i.drawImage(e,0,0,n,r),t},u2=function(e){let t=document.createElement("canvas"),n=e.width,r=e.height;t.width=n,t.height=2*r;let i=t.getContext("2d");return i.drawImage(e,0,0,n,r),i.translate(0,2*r),i.scale(1,-1),i.drawImage(e,0,0,n,r),t},u3=function(e){let t=document.createElement("canvas"),n=e.width,r=e.height;t.width=2*n,t.height=2*r;let i=t.getContext("2d");return i.drawImage(e,0,0,n,r),i.setTransform(-1,0,0,-1,t.width,t.height),i.drawImage(e,0,0,n,r),i.setTransform(-1,0,0,1,t.width,0),i.drawImage(e,0,0,n,r),i.setTransform(1,0,0,-1,0,t.height),i.drawImage(e,0,0,n,r),t},u5=function(e,t){let n=e.width,r=e.height,i=document.createElement("canvas");i.width=3*n,i.height=3*r;let o=i.getContext("2d"),s=null!=t.angle?-t.angle:-20,l=th.toRad(s),a=i.width/4,u=i.height/4;for(let t=0;t<4;t+=1)for(let i=0;i<4;i+=1)(t+i)%2>0&&(o.setTransform(1,0,0,1,(2*t-1)*a,(2*i-1)*u),o.rotate(l),o.drawImage(e,-n/2,-r/2,n,r));return i};function u6(e,t){return null!=e?e:t}function u4(e,t){return null!=e&&Number.isFinite(e)?e:t}function u8(e={}){let t=u6(e.color,"blue"),n=u4(e.width,1),r=u4(e.margin,2),i=u4(e.opacity,1);return`
10
+ (function(J,L){typeof exports=="object"&&typeof module!="undefined"?L(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("@formily/react"),require("@formily/reactive"),require("@nocobase/utils/client"),require("antd"),require("react-i18next"),require("@emotion/css"),require("lodash"),require("react-router-dom"),require("ahooks")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@ant-design/icons","@formily/shared","react","@formily/react","@formily/reactive","@nocobase/utils/client","antd","react-i18next","@emotion/css","lodash","react-router-dom","ahooks"],L):(J=typeof globalThis!="undefined"?globalThis:J||self,L(J["@nocobase/plugin-graph-collection-manager"]={},J["@nocobase/client"],J.jsxRuntime,J["@ant-design/icons"],J["@formily/shared"],J.react,J["@formily/react"],J["@formily/reactive"],J["@nocobase/utils"],J.antd,J["react-i18next"],J["@emotion/css"],J.lodash,J["react-router-dom"],J.ahooks))})(this,function(J,L,_,ue,fo,ee,Ft,go,pn,ce,Ja,Pr,Uu,Xy,VM){"use strict";var rY=Object.defineProperty,iY=Object.defineProperties;var sY=Object.getOwnPropertyDescriptors;var Hu=Object.getOwnPropertySymbols;var jM=Object.prototype.hasOwnProperty,DM=Object.prototype.propertyIsEnumerable;var RM=(J,L,_)=>L in J?rY(J,L,{enumerable:!0,configurable:!0,writable:!0,value:_}):J[L]=_,re=(J,L)=>{for(var _ in L||(L={}))jM.call(L,_)&&RM(J,_,L[_]);if(Hu)for(var _ of Hu(L))DM.call(L,_)&&RM(J,_,L[_]);return J},De=(J,L)=>iY(J,sY(L));var Wy=(J,L)=>{var _={};for(var ue in J)jM.call(J,ue)&&L.indexOf(ue)<0&&(_[ue]=J[ue]);if(J!=null&&Hu)for(var ue of Hu(J))L.indexOf(ue)<0&&DM.call(J,ue)&&(_[ue]=J[ue]);return _};var Be=(J,L,_)=>new Promise((ue,fo)=>{var ee=pn=>{try{go(_.next(pn))}catch(ce){fo(ce)}},Ft=pn=>{try{go(_.throw(pn))}catch(ce){fo(ce)}},go=pn=>pn.done?ue(pn.value):Promise.resolve(pn.value).then(ee,Ft);go((_=_.apply(J,L)).next())});var Qa=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Yy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function qM(){this.__data__=[],this.size=0}var GM=qM;function HM(n,e){return n===e||n!==n&&e!==e}var Ui=HM,UM=Ui;function WM(n,e){for(var t=n.length;t--;)if(UM(n[t][0],e))return t;return-1}var Za=WM,XM=Za,YM=Array.prototype,KM=YM.splice;function JM(n){var e=this.__data__,t=XM(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():KM.call(e,t,1),--this.size,!0}var QM=JM,ZM=Za;function eT(n){var e=this.__data__,t=ZM(e,n);return t<0?void 0:e[t][1]}var tT=eT,nT=Za;function rT(n){return nT(this.__data__,n)>-1}var iT=rT,sT=Za;function oT(n,e){var t=this.__data__,r=sT(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}var aT=oT,lT=GM,cT=QM,uT=tT,hT=iT,fT=aT;function Wi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Wi.prototype.clear=lT,Wi.prototype.delete=cT,Wi.prototype.get=uT,Wi.prototype.has=hT,Wi.prototype.set=fT;var el=Wi,dT=el;function gT(){this.__data__=new dT,this.size=0}var pT=gT;function mT(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}var yT=mT;function vT(n){return this.__data__.get(n)}var bT=vT;function wT(n){return this.__data__.has(n)}var xT=wT,CT=typeof Qa=="object"&&Qa&&Qa.Object===Object&&Qa,Ky=CT,ST=Ky,PT=typeof self=="object"&&self&&self.Object===Object&&self,ET=ST||PT||Function("return this")(),mn=ET,AT=mn,OT=AT.Symbol,Xi=OT,Jy=Xi,Qy=Object.prototype,MT=Qy.hasOwnProperty,TT=Qy.toString,po=Jy?Jy.toStringTag:void 0;function _T(n){var e=MT.call(n,po),t=n[po];try{n[po]=void 0;var r=!0}catch(s){}var i=TT.call(n);return r&&(e?n[po]=t:delete n[po]),i}var NT=_T,kT=Object.prototype,IT=kT.toString;function $T(n){return IT.call(n)}var LT=$T,Zy=Xi,RT=NT,jT=LT,DT="[object Null]",BT="[object Undefined]",ev=Zy?Zy.toStringTag:void 0;function zT(n){return n==null?n===void 0?BT:DT:ev&&ev in Object(n)?RT(n):jT(n)}var di=zT;function FT(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Qt=FT,VT=di,qT=Qt,GT="[object AsyncFunction]",HT="[object Function]",UT="[object GeneratorFunction]",WT="[object Proxy]";function XT(n){if(!qT(n))return!1;var e=VT(n);return e==HT||e==UT||e==GT||e==WT}var mo=XT,YT=mn,KT=YT["__core-js_shared__"],JT=KT,Wu=JT,tv=function(){var n=/[^.]+$/.exec(Wu&&Wu.keys&&Wu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function QT(n){return!!tv&&tv in n}var ZT=QT,e2=Function.prototype,t2=e2.toString;function n2(n){if(n!=null){try{return t2.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var nv=n2,r2=mo,i2=ZT,s2=Qt,o2=nv,a2=/[\\^$.*+?()[\]{}|]/g,l2=/^\[object .+?Constructor\]$/,c2=Function.prototype,u2=Object.prototype,h2=c2.toString,f2=u2.hasOwnProperty,d2=RegExp("^"+h2.call(f2).replace(a2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g2(n){if(!s2(n)||i2(n))return!1;var e=r2(n)?d2:l2;return e.test(o2(n))}var p2=g2;function m2(n,e){return n==null?void 0:n[e]}var y2=m2,v2=p2,b2=y2;function w2(n,e){var t=b2(n,e);return v2(t)?t:void 0}var gi=w2,x2=gi,C2=mn,S2=x2(C2,"Map"),Xu=S2,P2=gi,E2=P2(Object,"create"),tl=E2,rv=tl;function A2(){this.__data__=rv?rv(null):{},this.size=0}var O2=A2;function M2(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var T2=M2,_2=tl,N2="__lodash_hash_undefined__",k2=Object.prototype,I2=k2.hasOwnProperty;function $2(n){var e=this.__data__;if(_2){var t=e[n];return t===N2?void 0:t}return I2.call(e,n)?e[n]:void 0}var L2=$2,R2=tl,j2=Object.prototype,D2=j2.hasOwnProperty;function B2(n){var e=this.__data__;return R2?e[n]!==void 0:D2.call(e,n)}var z2=B2,F2=tl,V2="__lodash_hash_undefined__";function q2(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=F2&&e===void 0?V2:e,this}var G2=q2,H2=O2,U2=T2,W2=L2,X2=z2,Y2=G2;function Yi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Yi.prototype.clear=H2,Yi.prototype.delete=U2,Yi.prototype.get=W2,Yi.prototype.has=X2,Yi.prototype.set=Y2;var K2=Yi,iv=K2,J2=el,Q2=Xu;function Z2(){this.size=0,this.__data__={hash:new iv,map:new(Q2||J2),string:new iv}}var e_=Z2;function t_(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}var n_=t_,r_=n_;function i_(n,e){var t=n.__data__;return r_(e)?t[typeof e=="string"?"string":"hash"]:t.map}var nl=i_,s_=nl;function o_(n){var e=s_(this,n).delete(n);return this.size-=e?1:0,e}var a_=o_,l_=nl;function c_(n){return l_(this,n).get(n)}var u_=c_,h_=nl;function f_(n){return h_(this,n).has(n)}var d_=f_,g_=nl;function p_(n,e){var t=g_(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}var m_=p_,y_=e_,v_=a_,b_=u_,w_=d_,x_=m_;function Ki(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ki.prototype.clear=y_,Ki.prototype.delete=v_,Ki.prototype.get=b_,Ki.prototype.has=w_,Ki.prototype.set=x_;var Yu=Ki,C_=el,S_=Xu,P_=Yu,E_=200;function A_(n,e){var t=this.__data__;if(t instanceof C_){var r=t.__data__;if(!S_||r.length<E_-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new P_(r)}return t.set(n,e),this.size=t.size,this}var O_=A_,M_=el,T_=pT,__=yT,N_=bT,k_=xT,I_=O_;function Ji(n){var e=this.__data__=new M_(n);this.size=e.size}Ji.prototype.clear=T_,Ji.prototype.delete=__,Ji.prototype.get=N_,Ji.prototype.has=k_,Ji.prototype.set=I_;var rl=Ji;function $_(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var Ku=$_,L_=gi,R_=function(){try{var n=L_(Object,"defineProperty");return n({},"",{}),n}catch(e){}}(),sv=R_,ov=sv;function j_(n,e,t){e=="__proto__"&&ov?ov(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var il=j_,D_=il,B_=Ui,z_=Object.prototype,F_=z_.hasOwnProperty;function V_(n,e,t){var r=n[e];(!(F_.call(n,e)&&B_(r,t))||t===void 0&&!(e in n))&&D_(n,e,t)}var sl=V_,q_=sl,G_=il;function H_(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),i?G_(t,a,l):q_(t,a,l)}return t}var yo=H_;function U_(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var W_=U_;function X_(n){return n!=null&&typeof n=="object"}var Rn=X_,Y_=di,K_=Rn,J_="[object Arguments]";function Q_(n){return K_(n)&&Y_(n)==J_}var Z_=Q_,av=Z_,eN=Rn,lv=Object.prototype,tN=lv.hasOwnProperty,nN=lv.propertyIsEnumerable,rN=av(function(){return arguments}())?av:function(n){return eN(n)&&tN.call(n,"callee")&&!nN.call(n,"callee")},vo=rN,iN=Array.isArray,Qe=iN,ol={exports:{}};function sN(){return!1}var oN=sN;ol.exports,function(n,e){var t=mn,r=oN,i=e&&!e.nodeType&&e,s=i&&!0&&n&&!n.nodeType&&n,o=s&&s.exports===i,a=o?t.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;n.exports=c}(ol,ol.exports);var Qi=ol.exports,aN=9007199254740991,lN=/^(?:0|[1-9]\d*)$/;function cN(n,e){var t=typeof n;return e=e==null?aN:e,!!e&&(t=="number"||t!="symbol"&&lN.test(n))&&n>-1&&n%1==0&&n<e}var al=cN,uN=9007199254740991;function hN(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=uN}var Ju=hN,fN=di,dN=Ju,gN=Rn,pN="[object Arguments]",mN="[object Array]",yN="[object Boolean]",vN="[object Date]",bN="[object Error]",wN="[object Function]",xN="[object Map]",CN="[object Number]",SN="[object Object]",PN="[object RegExp]",EN="[object Set]",AN="[object String]",ON="[object WeakMap]",MN="[object ArrayBuffer]",TN="[object DataView]",_N="[object Float32Array]",NN="[object Float64Array]",kN="[object Int8Array]",IN="[object Int16Array]",$N="[object Int32Array]",LN="[object Uint8Array]",RN="[object Uint8ClampedArray]",jN="[object Uint16Array]",DN="[object Uint32Array]",Ae={};Ae[_N]=Ae[NN]=Ae[kN]=Ae[IN]=Ae[$N]=Ae[LN]=Ae[RN]=Ae[jN]=Ae[DN]=!0,Ae[pN]=Ae[mN]=Ae[MN]=Ae[yN]=Ae[TN]=Ae[vN]=Ae[bN]=Ae[wN]=Ae[xN]=Ae[CN]=Ae[SN]=Ae[PN]=Ae[EN]=Ae[AN]=Ae[ON]=!1;function BN(n){return gN(n)&&dN(n.length)&&!!Ae[fN(n)]}var zN=BN;function FN(n){return function(e){return n(e)}}var ll=FN,cl={exports:{}};cl.exports,function(n,e){var t=Ky,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s&&t.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch(c){}}();n.exports=a}(cl,cl.exports);var Qu=cl.exports,VN=zN,qN=ll,cv=Qu,uv=cv&&cv.isTypedArray,GN=uv?qN(uv):VN,bo=GN,HN=W_,UN=vo,WN=Qe,XN=Qi,YN=al,KN=bo,JN=Object.prototype,QN=JN.hasOwnProperty;function ZN(n,e){var t=WN(n),r=!t&&UN(n),i=!t&&!r&&XN(n),s=!t&&!r&&!i&&KN(n),o=t||r||i||s,a=o?HN(n.length,String):[],l=a.length;for(var c in n)(e||QN.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||YN(c,l)))&&a.push(c);return a}var hv=ZN,ek=Object.prototype;function tk(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||ek;return n===t}var ul=tk;function nk(n,e){return function(t){return n(e(t))}}var fv=nk,rk=fv,ik=rk(Object.keys,Object),sk=ik,ok=ul,ak=sk,lk=Object.prototype,ck=lk.hasOwnProperty;function uk(n){if(!ok(n))return ak(n);var e=[];for(var t in Object(n))ck.call(n,t)&&t!="constructor"&&e.push(t);return e}var Zu=uk,hk=mo,fk=Ju;function dk(n){return n!=null&&fk(n.length)&&!hk(n)}var Yn=dk,gk=hv,pk=Zu,mk=Yn;function yk(n){return mk(n)?gk(n):pk(n)}var Er=yk,vk=yo,bk=Er;function wk(n,e){return n&&vk(e,bk(e),n)}var xk=wk;function Ck(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var Sk=Ck,Pk=Qt,Ek=ul,Ak=Sk,Ok=Object.prototype,Mk=Ok.hasOwnProperty;function Tk(n){if(!Pk(n))return Ak(n);var e=Ek(n),t=[];for(var r in n)r=="constructor"&&(e||!Mk.call(n,r))||t.push(r);return t}var _k=Tk,Nk=hv,kk=_k,Ik=Yn;function $k(n){return Ik(n)?Nk(n,!0):kk(n)}var pi=$k,Lk=yo,Rk=pi;function jk(n,e){return n&&Lk(e,Rk(e),n)}var Dk=jk,hl={exports:{}};hl.exports,function(n,e){var t=mn,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s?t.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var h=c.length,f=a?a(h):new c.constructor(h);return c.copy(f),f}n.exports=l}(hl,hl.exports);var dv=hl.exports;function Bk(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var gv=Bk;function zk(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var o=n[t];e(o,t,n)&&(s[i++]=o)}return s}var pv=zk;function Fk(){return[]}var mv=Fk,Vk=pv,qk=mv,Gk=Object.prototype,Hk=Gk.propertyIsEnumerable,yv=Object.getOwnPropertySymbols,Uk=yv?function(n){return n==null?[]:(n=Object(n),Vk(yv(n),function(e){return Hk.call(n,e)}))}:qk,eh=Uk,Wk=yo,Xk=eh;function Yk(n,e){return Wk(n,Xk(n),e)}var Kk=Yk;function Jk(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var th=Jk,Qk=fv,Zk=Qk(Object.getPrototypeOf,Object),fl=Zk,eI=th,tI=fl,nI=eh,rI=mv,iI=Object.getOwnPropertySymbols,sI=iI?function(n){for(var e=[];n;)eI(e,nI(n)),n=tI(n);return e}:rI,vv=sI,oI=yo,aI=vv;function lI(n,e){return oI(n,aI(n),e)}var cI=lI,uI=th,hI=Qe;function fI(n,e,t){var r=e(n);return hI(n)?r:uI(r,t(n))}var bv=fI,dI=bv,gI=eh,pI=Er;function mI(n){return dI(n,pI,gI)}var wv=mI,yI=bv,vI=vv,bI=pi;function wI(n){return yI(n,bI,vI)}var xI=wI,CI=gi,SI=mn,PI=CI(SI,"DataView"),EI=PI,AI=gi,OI=mn,MI=AI(OI,"Promise"),TI=MI,_I=gi,NI=mn,kI=_I(NI,"Set"),xv=kI,II=gi,$I=mn,LI=II($I,"WeakMap"),RI=LI,nh=EI,rh=Xu,ih=TI,sh=xv,oh=RI,Cv=di,Zi=nv,Sv="[object Map]",jI="[object Object]",Pv="[object Promise]",Ev="[object Set]",Av="[object WeakMap]",Ov="[object DataView]",DI=Zi(nh),BI=Zi(rh),zI=Zi(ih),FI=Zi(sh),VI=Zi(oh),mi=Cv;(nh&&mi(new nh(new ArrayBuffer(1)))!=Ov||rh&&mi(new rh)!=Sv||ih&&mi(ih.resolve())!=Pv||sh&&mi(new sh)!=Ev||oh&&mi(new oh)!=Av)&&(mi=function(n){var e=Cv(n),t=e==jI?n.constructor:void 0,r=t?Zi(t):"";if(r)switch(r){case DI:return Ov;case BI:return Sv;case zI:return Pv;case FI:return Ev;case VI:return Av}return e});var es=mi,qI=Object.prototype,GI=qI.hasOwnProperty;function HI(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&GI.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var UI=HI,WI=mn,XI=WI.Uint8Array,Mv=XI,Tv=Mv;function YI(n){var e=new n.constructor(n.byteLength);return new Tv(e).set(new Tv(n)),e}var ah=YI,KI=ah;function JI(n,e){var t=e?KI(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var QI=JI,ZI=/\w*$/;function e$(n){var e=new n.constructor(n.source,ZI.exec(n));return e.lastIndex=n.lastIndex,e}var t$=e$,_v=Xi,Nv=_v?_v.prototype:void 0,kv=Nv?Nv.valueOf:void 0;function n$(n){return kv?Object(kv.call(n)):{}}var r$=n$,i$=ah;function s$(n,e){var t=e?i$(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Iv=s$,o$=ah,a$=QI,l$=t$,c$=r$,u$=Iv,h$="[object Boolean]",f$="[object Date]",d$="[object Map]",g$="[object Number]",p$="[object RegExp]",m$="[object Set]",y$="[object String]",v$="[object Symbol]",b$="[object ArrayBuffer]",w$="[object DataView]",x$="[object Float32Array]",C$="[object Float64Array]",S$="[object Int8Array]",P$="[object Int16Array]",E$="[object Int32Array]",A$="[object Uint8Array]",O$="[object Uint8ClampedArray]",M$="[object Uint16Array]",T$="[object Uint32Array]";function _$(n,e,t){var r=n.constructor;switch(e){case b$:return o$(n);case h$:case f$:return new r(+n);case w$:return a$(n,t);case x$:case C$:case S$:case P$:case E$:case A$:case O$:case M$:case T$:return u$(n,t);case d$:return new r;case g$:case y$:return new r(n);case p$:return l$(n);case m$:return new r;case v$:return c$(n)}}var N$=_$,k$=Qt,$v=Object.create,I$=function(){function n(){}return function(e){if(!k$(e))return{};if($v)return $v(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}(),Lv=I$,$$=Lv,L$=fl,R$=ul;function j$(n){return typeof n.constructor=="function"&&!R$(n)?$$(L$(n)):{}}var Rv=j$,D$=es,B$=Rn,z$="[object Map]";function F$(n){return B$(n)&&D$(n)==z$}var V$=F$,q$=V$,G$=ll,jv=Qu,Dv=jv&&jv.isMap,H$=Dv?G$(Dv):q$,U$=H$,W$=es,X$=Rn,Y$="[object Set]";function K$(n){return X$(n)&&W$(n)==Y$}var J$=K$,Q$=J$,Z$=ll,Bv=Qu,zv=Bv&&Bv.isSet,eL=zv?Z$(zv):Q$,tL=eL,nL=rl,rL=Ku,iL=sl,sL=xk,oL=Dk,aL=dv,lL=gv,cL=Kk,uL=cI,hL=wv,fL=xI,dL=es,gL=UI,pL=N$,mL=Rv,yL=Qe,vL=Qi,bL=U$,wL=Qt,xL=tL,CL=Er,SL=pi,PL=1,EL=2,AL=4,Fv="[object Arguments]",OL="[object Array]",ML="[object Boolean]",TL="[object Date]",_L="[object Error]",Vv="[object Function]",NL="[object GeneratorFunction]",kL="[object Map]",IL="[object Number]",qv="[object Object]",$L="[object RegExp]",LL="[object Set]",RL="[object String]",jL="[object Symbol]",DL="[object WeakMap]",BL="[object ArrayBuffer]",zL="[object DataView]",FL="[object Float32Array]",VL="[object Float64Array]",qL="[object Int8Array]",GL="[object Int16Array]",HL="[object Int32Array]",UL="[object Uint8Array]",WL="[object Uint8ClampedArray]",XL="[object Uint16Array]",YL="[object Uint32Array]",xe={};xe[Fv]=xe[OL]=xe[BL]=xe[zL]=xe[ML]=xe[TL]=xe[FL]=xe[VL]=xe[qL]=xe[GL]=xe[HL]=xe[kL]=xe[IL]=xe[qv]=xe[$L]=xe[LL]=xe[RL]=xe[jL]=xe[UL]=xe[WL]=xe[XL]=xe[YL]=!0,xe[_L]=xe[Vv]=xe[DL]=!1;function dl(n,e,t,r,i,s){var o,a=e&PL,l=e&EL,c=e&AL;if(t&&(o=i?t(n,r,i,s):t(n)),o!==void 0)return o;if(!wL(n))return n;var u=yL(n);if(u){if(o=gL(n),!a)return lL(n,o)}else{var h=dL(n),f=h==Vv||h==NL;if(vL(n))return aL(n,a);if(h==qv||h==Fv||f&&!i){if(o=l||f?{}:mL(n),!a)return l?uL(n,oL(o,n)):cL(n,sL(o,n))}else{if(!xe[h])return i?n:{};o=pL(n,h,a)}}s||(s=new nL);var d=s.get(n);if(d)return d;s.set(n,o),xL(n)?n.forEach(function(b){o.add(dl(b,e,t,b,n,s))}):bL(n)&&n.forEach(function(b,m){o.set(m,dl(b,e,t,m,n,s))});var g=c?l?fL:hL:l?SL:CL,p=u?void 0:g(n);return rL(p||n,function(b,m){p&&(m=b,b=n[m]),iL(o,m,dl(b,e,t,m,n,s))}),o}var Gv=dl,KL=Gv,JL=1,QL=4;function ZL(n){return KL(n,JL|QL)}var Hv=ZL;const eR=Yy(Hv),Ar=ee.createContext(null);Ar.displayName="GraphCollectionContext";const Uv=n=>{const{record:e,setTargetNode:t,node:r,handelOpenPorts:i}=n;return _.jsx(Ar.Provider,{value:{node:r,record:e,positionTargetNode:s=>{t(s||r)},openPorts:i},children:n.children})},tR=(n,e)=>{const t=L.useRequest(()=>Promise.resolve({data:eR(e)}),De(re({},n),{manual:!0})),r=L.useActionContext();return ee.useEffect(()=>{r.visible&&t.run()},[r.visible]),t};Ft.observer(()=>{const{record:n}=ee.useContext(Ar),e=L.useCompile();return _.jsx("div",{children:_.jsx(ce.Select,{popupMatchSelectWidth:!1,disabled:!0,value:n.name,options:[{value:n.name,label:e(n.title)}]})})},{displayName:"SourceCollection"});const Kn=()=>{const n=Ft.useForm(),e=L.useActionContext();return{run(){return Be(this,null,function*(){e.setVisible(!1),n.reset()})}}},Wv=n=>{const e=Ft.useForm(),t=L.useAPIClient(),r=L.useActionContext(),{refreshCM:i}=L.useCollectionManager_deprecated();return{run(){return Be(this,null,function*(){yield e.submit(),yield t.resource("collections").create({values:e.values}),r.setVisible(!1),yield e.reset(),n("last"),yield i()})}}},Xv=(n,e)=>{const t=Ft.useForm(),r=L.useAPIClient(),i=L.useActionContext(),{refreshCM:s}=L.useCollectionManager_deprecated(),{positionTargetNode:o,openPorts:a}=ee.useContext(Ar),{getValues:l}=L.useCollectionFieldFormValues();return{run(){return Be(this,null,function*(){yield t.submit();const u=l(),h=pn.lodash.omit(u,["key","uiSchemaUid","collectionName","autoCreateReverseField","uiSchema.x-uid","reverseField.key","reverseField.uiSchemaUid"]),f=!["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(u.interface),{data:{data:d}}=yield r.resource("collections.fields",n).create({values:h});e&&(yield r.resource("fields").move({sourceId:d.key,targetId:e,targetScope:n,method:"insertAfter"})),i.setVisible(!1),yield t.reset(),o(),f&&a&&a(),yield s()})}}},nR=({collectionName:n,name:e,key:t})=>{const{refreshCM:r}=L.useCollectionManager_deprecated(),{t:i}=Ja.useTranslation(),s=Ft.useForm(),o=L.useActionContext(),a=L.useAPIClient(),{positionTargetNode:l,node:c}=ee.useContext(Ar);return{run(){return Be(this,null,function*(){var h;yield s.submit(),yield a.resource("collections.fields",n).update({filterByTk:e,values:s.values}),o.setVisible(!1),ce.message.success(i("Saved successfully")),l(),r(),c.setPortProp(t,"uiSchema",{title:(h=s.values)==null?void 0:h.uiSchema.title}),yield s.reset()})}}},gl=()=>{const{t:n}=Ja.useTranslation(),e=Ft.useForm(),t=L.useActionContext(),{name:r}=e.values,i=L.useAPIClient(),{refreshCM:s}=L.useCollectionManager_deprecated(),{positionTargetNode:o}=ee.useContext(Ar);return{run(){return Be(this,null,function*(){yield e.submit(),yield i.resource("collections").update({filterByTk:r,values:re({},pn.lodash.omit(e.values,["fields"]))}),t.setVisible(!1),ce.message.success(n("Saved successfully")),yield e.reset(),o(),s()})}}},rR=n=>{const e=L.useAPIClient(),t=Ft.useForm(),{cascade:r}=(t==null?void 0:t.values)||{};return{run(){return Be(this,null,function*(){yield e.resource("collections").destroy({filterByTk:n,cascade:r}),yield e.resource("graphPositions").destroy({filter:{collectionName:n}})})}}},iR=n=>{const{name:e}=n,{run:t}=rR(e),{refreshCM:r}=L.useCollectionManager_deprecated(),{positionTargetNode:i}=ee.useContext(Ar);return{run(){return Be(this,null,function*(){yield t(),i("destory"),yield r()})}}},sR=(n,e)=>{const t=L.useAPIClient(),{positionTargetNode:r}=ee.useContext(Ar);return{run(){return Be(this,null,function*(){yield t.resource("collections.fields",n).destroy({filterByTk:e}),r()})}}},oR=n=>{const{collectionName:e,name:t}=n,{refreshCM:r}=L.useCollectionManager_deprecated(),{run:i}=sR(e,t);return{run(){return Be(this,null,function*(){yield i(),yield r()})}}},lh=n=>(e,{targetScope:t})=>{e.loading=!0,n(t).then(go.action.bound(r=>{e.dataSource=r,e.loading=!1})).catch(r=>{pn.error(r)})};typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const r=document.createDocumentFragment();t.forEach(i=>{const s=i instanceof Node;r.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(r)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);class yn{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,r,i)=>{const s=i.value,o=t.__proto__;i.value=function(...a){this.disposed||(s.call(this,...a),o.dispose.call(this))}}}n.dispose=e})(yn||(yn={}));class Yv{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const r=new n;return t.forEach(i=>{r.add(i)}),r}n.from=e})(Yv||(Yv={}));var Kv=typeof global=="object"&&global&&global.Object===Object&&global,aR=typeof self=="object"&&self&&self.Object===Object&&self,vn=Kv||aR||Function("return this")(),Zt=vn.Symbol,Jv=Object.prototype,lR=Jv.hasOwnProperty,cR=Jv.toString,wo=Zt?Zt.toStringTag:void 0;function uR(n){var e=lR.call(n,wo),t=n[wo];try{n[wo]=void 0;var r=!0}catch(s){}var i=cR.call(n);return r&&(e?n[wo]=t:delete n[wo]),i}var hR=Object.prototype,fR=hR.toString;function dR(n){return fR.call(n)}var gR="[object Null]",pR="[object Undefined]",Qv=Zt?Zt.toStringTag:void 0;function Or(n){return n==null?n===void 0?pR:gR:Qv&&Qv in Object(n)?uR(n):dR(n)}function bn(n){return n!=null&&typeof n=="object"}var mR="[object Symbol]";function jn(n){return typeof n=="symbol"||bn(n)&&Or(n)==mR}function pl(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}var xt=Array.isArray,yR=1/0,Zv=Zt?Zt.prototype:void 0,e0=Zv?Zv.toString:void 0;function t0(n){if(typeof n=="string")return n;if(xt(n))return pl(n,t0)+"";if(jn(n))return e0?e0.call(n):"";var e=n+"";return e=="0"&&1/n==-yR?"-0":e}var vR=/\s/;function bR(n){for(var e=n.length;e--&&vR.test(n.charAt(e)););return e}var wR=/^\s+/;function xR(n){return n&&n.slice(0,bR(n)+1).replace(wR,"")}function Ze(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var n0=NaN,CR=/^[-+]0x[0-9a-f]+$/i,SR=/^0b[01]+$/i,PR=/^0o[0-7]+$/i,ER=parseInt;function xo(n){if(typeof n=="number")return n;if(jn(n))return n0;if(Ze(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ze(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=xR(n);var t=SR.test(n);return t||PR.test(n)?ER(n.slice(2),t?2:8):CR.test(n)?n0:+n}function ts(n){return n}var AR="[object AsyncFunction]",OR="[object Function]",MR="[object GeneratorFunction]",TR="[object Proxy]";function ch(n){if(!Ze(n))return!1;var e=Or(n);return e==OR||e==MR||e==AR||e==TR}var uh=vn["__core-js_shared__"],r0=function(){var n=/[^.]+$/.exec(uh&&uh.keys&&uh.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function _R(n){return!!r0&&r0 in n}var NR=Function.prototype,kR=NR.toString;function yi(n){if(n!=null){try{return kR.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var IR=/[\\^$.*+?()[\]{}|]/g,$R=/^\[object .+?Constructor\]$/,LR=Function.prototype,RR=Object.prototype,jR=LR.toString,DR=RR.hasOwnProperty,BR=RegExp("^"+jR.call(DR).replace(IR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zR(n){if(!Ze(n)||_R(n))return!1;var e=ch(n)?BR:$R;return e.test(yi(n))}function FR(n,e){return n==null?void 0:n[e]}function vi(n,e){var t=FR(n,e);return zR(t)?t:void 0}var hh=vi(vn,"WeakMap"),i0=Object.create,VR=function(){function n(){}return function(e){if(!Ze(e))return{};if(i0)return i0(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function s0(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function qR(){}function o0(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var GR=800,HR=16,UR=Date.now;function WR(n){var e=0,t=0;return function(){var r=UR(),i=HR-(r-t);if(t=r,i>0){if(++e>=GR)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function XR(n){return function(){return n}}var ml=function(){try{var n=vi(Object,"defineProperty");return n({},"",{}),n}catch(e){}}(),YR=ml?function(n,e){return ml(n,"toString",{configurable:!0,enumerable:!1,value:XR(e),writable:!0})}:ts,KR=WR(YR);function JR(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}function QR(n,e,t,r){for(var i=n.length,s=t+-1;++s<i;)if(e(n[s],s,n))return s;return-1}function ZR(n){return n!==n}function ej(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function tj(n,e,t){return e===e?ej(n,e,t):QR(n,ZR,t)}function a0(n,e){var t=n==null?0:n.length;return!!t&&tj(n,e,0)>-1}var nj=9007199254740991,rj=/^(?:0|[1-9]\d*)$/;function fh(n,e){var t=typeof n;return e=e==null?nj:e,!!e&&(t=="number"||t!="symbol"&&rj.test(n))&&n>-1&&n%1==0&&n<e}function yl(n,e,t){e=="__proto__"&&ml?ml(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function ns(n,e){return n===e||n!==n&&e!==e}var ij=Object.prototype,sj=ij.hasOwnProperty;function l0(n,e,t){var r=n[e];(!(sj.call(n,e)&&ns(r,t))||t===void 0&&!(e in n))&&yl(n,e,t)}function Co(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=n[a]),i?yl(t,a,l):l0(t,a,l)}return t}var c0=Math.max;function oj(n,e,t){return e=c0(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=c0(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(o),s0(n,this,a)}}function rs(n,e){return KR(oj(n,e,ts),n+"")}var aj=9007199254740991;function dh(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=aj}function bi(n){return n!=null&&dh(n.length)&&!ch(n)}function vl(n,e,t){if(!Ze(t))return!1;var r=typeof e;return(r=="number"?bi(t)&&fh(e,t.length):r=="string"&&e in t)?ns(t[e],n):!1}function u0(n){return rs(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,o&&vl(t[0],t[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,s)}return e})}var lj=Object.prototype;function bl(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||lj;return n===t}function cj(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var uj="[object Arguments]";function h0(n){return bn(n)&&Or(n)==uj}var f0=Object.prototype,hj=f0.hasOwnProperty,fj=f0.propertyIsEnumerable,is=h0(function(){return arguments}())?h0:function(n){return bn(n)&&hj.call(n,"callee")&&!fj.call(n,"callee")};function dj(){return!1}var d0=typeof J=="object"&&J&&!J.nodeType&&J,g0=d0&&typeof module=="object"&&module&&!module.nodeType&&module,gj=g0&&g0.exports===d0,p0=gj?vn.Buffer:void 0,pj=p0?p0.isBuffer:void 0,ss=pj||dj,mj="[object Arguments]",yj="[object Array]",vj="[object Boolean]",bj="[object Date]",wj="[object Error]",xj="[object Function]",Cj="[object Map]",Sj="[object Number]",Pj="[object Object]",Ej="[object RegExp]",Aj="[object Set]",Oj="[object String]",Mj="[object WeakMap]",Tj="[object ArrayBuffer]",_j="[object DataView]",Nj="[object Float32Array]",kj="[object Float64Array]",Ij="[object Int8Array]",$j="[object Int16Array]",Lj="[object Int32Array]",Rj="[object Uint8Array]",jj="[object Uint8ClampedArray]",Dj="[object Uint16Array]",Bj="[object Uint32Array]",Oe={};Oe[Nj]=Oe[kj]=Oe[Ij]=Oe[$j]=Oe[Lj]=Oe[Rj]=Oe[jj]=Oe[Dj]=Oe[Bj]=!0,Oe[mj]=Oe[yj]=Oe[Tj]=Oe[vj]=Oe[_j]=Oe[bj]=Oe[wj]=Oe[xj]=Oe[Cj]=Oe[Sj]=Oe[Pj]=Oe[Ej]=Oe[Aj]=Oe[Oj]=Oe[Mj]=!1;function zj(n){return bn(n)&&dh(n.length)&&!!Oe[Or(n)]}function wl(n){return function(e){return n(e)}}var m0=typeof J=="object"&&J&&!J.nodeType&&J,So=m0&&typeof module=="object"&&module&&!module.nodeType&&module,Fj=So&&So.exports===m0,gh=Fj&&Kv.process,os=function(){try{var n=So&&So.require&&So.require("util").types;return n||gh&&gh.binding&&gh.binding("util")}catch(e){}}(),y0=os&&os.isTypedArray,xl=y0?wl(y0):zj,Vj=Object.prototype,qj=Vj.hasOwnProperty;function v0(n,e){var t=xt(n),r=!t&&is(n),i=!t&&!r&&ss(n),s=!t&&!r&&!i&&xl(n),o=t||r||i||s,a=o?cj(n.length,String):[],l=a.length;for(var c in n)(e||qj.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||fh(c,l)))&&a.push(c);return a}function b0(n,e){return function(t){return n(e(t))}}var Gj=b0(Object.keys,Object),Hj=Object.prototype,Uj=Hj.hasOwnProperty;function w0(n){if(!bl(n))return Gj(n);var e=[];for(var t in Object(n))Uj.call(n,t)&&t!="constructor"&&e.push(t);return e}function Po(n){return bi(n)?v0(n):w0(n)}function Wj(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var Xj=Object.prototype,Yj=Xj.hasOwnProperty;function Kj(n){if(!Ze(n))return Wj(n);var e=bl(n),t=[];for(var r in n)r=="constructor"&&(e||!Yj.call(n,r))||t.push(r);return t}function as(n){return bi(n)?v0(n,!0):Kj(n)}var Jj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qj=/^\w*$/;function ph(n,e){if(xt(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||jn(n)?!0:Qj.test(n)||!Jj.test(n)||e!=null&&n in Object(e)}var Eo=vi(Object,"create");function Zj(){this.__data__=Eo?Eo(null):{},this.size=0}function eD(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var tD="__lodash_hash_undefined__",nD=Object.prototype,rD=nD.hasOwnProperty;function iD(n){var e=this.__data__;if(Eo){var t=e[n];return t===tD?void 0:t}return rD.call(e,n)?e[n]:void 0}var sD=Object.prototype,oD=sD.hasOwnProperty;function aD(n){var e=this.__data__;return Eo?e[n]!==void 0:oD.call(e,n)}var lD="__lodash_hash_undefined__";function cD(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Eo&&e===void 0?lD:e,this}function wi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}wi.prototype.clear=Zj,wi.prototype.delete=eD,wi.prototype.get=iD,wi.prototype.has=aD,wi.prototype.set=cD;function uD(){this.__data__=[],this.size=0}function Cl(n,e){for(var t=n.length;t--;)if(ns(n[t][0],e))return t;return-1}var hD=Array.prototype,fD=hD.splice;function dD(n){var e=this.__data__,t=Cl(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():fD.call(e,t,1),--this.size,!0}function gD(n){var e=this.__data__,t=Cl(e,n);return t<0?void 0:e[t][1]}function pD(n){return Cl(this.__data__,n)>-1}function mD(n,e){var t=this.__data__,r=Cl(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Jn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Jn.prototype.clear=uD,Jn.prototype.delete=dD,Jn.prototype.get=gD,Jn.prototype.has=pD,Jn.prototype.set=mD;var Ao=vi(vn,"Map");function yD(){this.size=0,this.__data__={hash:new wi,map:new(Ao||Jn),string:new wi}}function vD(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Sl(n,e){var t=n.__data__;return vD(e)?t[typeof e=="string"?"string":"hash"]:t.map}function bD(n){var e=Sl(this,n).delete(n);return this.size-=e?1:0,e}function wD(n){return Sl(this,n).get(n)}function xD(n){return Sl(this,n).has(n)}function CD(n,e){var t=Sl(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Qn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Qn.prototype.clear=yD,Qn.prototype.delete=bD,Qn.prototype.get=wD,Qn.prototype.has=xD,Qn.prototype.set=CD;var SD="Expected a function";function mh(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(SD);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=t.cache;if(s.has(i))return s.get(i);var o=n.apply(this,r);return t.cache=s.set(i,o)||s,o};return t.cache=new(mh.Cache||Qn),t}mh.Cache=Qn;var PD=500;function ED(n){var e=mh(n,function(r){return t.size===PD&&t.clear(),r}),t=e.cache;return e}var AD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OD=/\\(\\)?/g,MD=ED(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(AD,function(t,r,i,s){e.push(i?s.replace(OD,"$1"):r||t)}),e});function Oo(n){return n==null?"":t0(n)}function x0(n,e){return xt(n)?n:ph(n,e)?[n]:MD(Oo(n))}var TD=1/0;function Pl(n){if(typeof n=="string"||jn(n))return n;var e=n+"";return e=="0"&&1/n==-TD?"-0":e}function yh(n,e){e=x0(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[Pl(e[t++])];return t&&t==r?n:void 0}function _D(n,e,t){var r=n==null?void 0:yh(n,e);return r===void 0?t:r}function vh(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var C0=Zt?Zt.isConcatSpreadable:void 0;function ND(n){return xt(n)||is(n)||!!(C0&&n&&n[C0])}function bh(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=ND),i||(i=[]);++s<o;){var a=n[s];t(a)?vh(i,a):r||(i[i.length]=a)}return i}var wh=b0(Object.getPrototypeOf,Object),kD="[object Object]",ID=Function.prototype,$D=Object.prototype,S0=ID.toString,LD=$D.hasOwnProperty,RD=S0.call(Object);function Dn(n){if(!bn(n)||Or(n)!=kD)return!1;var e=wh(n);if(e===null)return!0;var t=LD.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&S0.call(t)==RD}function jD(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=n[r+e];return s}function DD(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:jD(n,e,t)}var BD="\\ud800-\\udfff",zD="\\u0300-\\u036f",FD="\\ufe20-\\ufe2f",VD="\\u20d0-\\u20ff",qD=zD+FD+VD,GD="\\ufe0e\\ufe0f",HD="\\u200d",UD=RegExp("["+HD+BD+qD+GD+"]");function P0(n){return UD.test(n)}function WD(n){return n.split("")}var E0="\\ud800-\\udfff",XD="\\u0300-\\u036f",YD="\\ufe20-\\ufe2f",KD="\\u20d0-\\u20ff",JD=XD+YD+KD,QD="\\ufe0e\\ufe0f",ZD="["+E0+"]",xh="["+JD+"]",Ch="\\ud83c[\\udffb-\\udfff]",eB="(?:"+xh+"|"+Ch+")",A0="[^"+E0+"]",O0="(?:\\ud83c[\\udde6-\\uddff]){2}",M0="[\\ud800-\\udbff][\\udc00-\\udfff]",tB="\\u200d",T0=eB+"?",_0="["+QD+"]?",nB="(?:"+tB+"(?:"+[A0,O0,M0].join("|")+")"+_0+T0+")*",rB=_0+T0+nB,iB="(?:"+[A0+xh+"?",xh,O0,M0,ZD].join("|")+")",sB=RegExp(Ch+"(?="+Ch+")|"+iB+rB,"g");function oB(n){return n.match(sB)||[]}function aB(n){return P0(n)?oB(n):WD(n)}function N0(n){return function(e){e=Oo(e);var t=P0(e)?aB(e):void 0,r=t?t[0]:e.charAt(0),i=t?DD(t,1).join(""):e.slice(1);return r[n]()+i}}var El=N0("toUpperCase");function lB(n){return El(Oo(n).toLowerCase())}function cB(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;)t=e(t,n[i],i,n);return t}function uB(n){return function(e){return n==null?void 0:n[e]}}var hB={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},fB=uB(hB),dB=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gB="\\u0300-\\u036f",pB="\\ufe20-\\ufe2f",mB="\\u20d0-\\u20ff",yB=gB+pB+mB,vB="["+yB+"]",bB=RegExp(vB,"g");function wB(n){return n=Oo(n),n&&n.replace(dB,fB).replace(bB,"")}var xB=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function CB(n){return n.match(xB)||[]}var SB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function PB(n){return SB.test(n)}var k0="\\ud800-\\udfff",EB="\\u0300-\\u036f",AB="\\ufe20-\\ufe2f",OB="\\u20d0-\\u20ff",MB=EB+AB+OB,I0="\\u2700-\\u27bf",$0="a-z\\xdf-\\xf6\\xf8-\\xff",TB="\\xac\\xb1\\xd7\\xf7",_B="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",NB="\\u2000-\\u206f",kB=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",L0="A-Z\\xc0-\\xd6\\xd8-\\xde",IB="\\ufe0e\\ufe0f",R0=TB+_B+NB+kB,j0="['’]",D0="["+R0+"]",$B="["+MB+"]",B0="\\d+",LB="["+I0+"]",z0="["+$0+"]",F0="[^"+k0+R0+B0+I0+$0+L0+"]",RB="\\ud83c[\\udffb-\\udfff]",jB="(?:"+$B+"|"+RB+")",DB="[^"+k0+"]",V0="(?:\\ud83c[\\udde6-\\uddff]){2}",q0="[\\ud800-\\udbff][\\udc00-\\udfff]",ls="["+L0+"]",BB="\\u200d",G0="(?:"+z0+"|"+F0+")",zB="(?:"+ls+"|"+F0+")",H0="(?:"+j0+"(?:d|ll|m|re|s|t|ve))?",U0="(?:"+j0+"(?:D|LL|M|RE|S|T|VE))?",W0=jB+"?",X0="["+IB+"]?",FB="(?:"+BB+"(?:"+[DB,V0,q0].join("|")+")"+X0+W0+")*",VB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",GB=X0+W0+FB,HB="(?:"+[LB,V0,q0].join("|")+")"+GB,UB=RegExp([ls+"?"+z0+"+"+H0+"(?="+[D0,ls,"$"].join("|")+")",zB+"+"+U0+"(?="+[D0,ls+G0,"$"].join("|")+")",ls+"?"+G0+"+"+H0,ls+"+"+U0,qB,VB,B0,HB].join("|"),"g");function WB(n){return n.match(UB)||[]}function XB(n,e,t){return n=Oo(n),e=e,e===void 0?PB(n)?WB(n):CB(n):n.match(e)||[]}var YB="['’]",KB=RegExp(YB,"g");function Y0(n){return function(e){return cB(XB(wB(e).replace(KB,"")),n,"")}}var Al=Y0(function(n,e,t){return e=e.toLowerCase(),n+(t?lB(e):e)});function JB(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function en(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=xo(t),t=t===t?t:0),e!==void 0&&(e=xo(e),e=e===e?e:0),JB(xo(n),e,t)}function QB(){this.__data__=new Jn,this.size=0}function ZB(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function e3(n){return this.__data__.get(n)}function t3(n){return this.__data__.has(n)}var n3=200;function r3(n,e){var t=this.__data__;if(t instanceof Jn){var r=t.__data__;if(!Ao||r.length<n3-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Qn(r)}return t.set(n,e),this.size=t.size,this}function wn(n){var e=this.__data__=new Jn(n);this.size=e.size}wn.prototype.clear=QB,wn.prototype.delete=ZB,wn.prototype.get=e3,wn.prototype.has=t3,wn.prototype.set=r3;function i3(n,e){return n&&Co(e,Po(e),n)}function s3(n,e){return n&&Co(e,as(e),n)}var K0=typeof J=="object"&&J&&!J.nodeType&&J,J0=K0&&typeof module=="object"&&module&&!module.nodeType&&module,o3=J0&&J0.exports===K0,Q0=o3?vn.Buffer:void 0,Z0=Q0?Q0.allocUnsafe:void 0;function eb(n,e){if(e)return n.slice();var t=n.length,r=Z0?Z0(t):new n.constructor(t);return n.copy(r),r}function a3(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var o=n[t];e(o,t,n)&&(s[i++]=o)}return s}function tb(){return[]}var l3=Object.prototype,c3=l3.propertyIsEnumerable,nb=Object.getOwnPropertySymbols,Sh=nb?function(n){return n==null?[]:(n=Object(n),a3(nb(n),function(e){return c3.call(n,e)}))}:tb;function u3(n,e){return Co(n,Sh(n),e)}var h3=Object.getOwnPropertySymbols,rb=h3?function(n){for(var e=[];n;)vh(e,Sh(n)),n=wh(n);return e}:tb;function f3(n,e){return Co(n,rb(n),e)}function ib(n,e,t){var r=e(n);return xt(n)?r:vh(r,t(n))}function Ph(n){return ib(n,Po,Sh)}function d3(n){return ib(n,as,rb)}var Eh=vi(vn,"DataView"),Ah=vi(vn,"Promise"),cs=vi(vn,"Set"),sb="[object Map]",g3="[object Object]",ob="[object Promise]",ab="[object Set]",lb="[object WeakMap]",cb="[object DataView]",p3=yi(Eh),m3=yi(Ao),y3=yi(Ah),v3=yi(cs),b3=yi(hh),tn=Or;(Eh&&tn(new Eh(new ArrayBuffer(1)))!=cb||Ao&&tn(new Ao)!=sb||Ah&&tn(Ah.resolve())!=ob||cs&&tn(new cs)!=ab||hh&&tn(new hh)!=lb)&&(tn=function(n){var e=Or(n),t=e==g3?n.constructor:void 0,r=t?yi(t):"";if(r)switch(r){case p3:return cb;case m3:return sb;case y3:return ob;case v3:return ab;case b3:return lb}return e});var w3=Object.prototype,x3=w3.hasOwnProperty;function C3(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&x3.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Ol=vn.Uint8Array;function Oh(n){var e=new n.constructor(n.byteLength);return new Ol(e).set(new Ol(n)),e}function S3(n,e){var t=e?Oh(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var P3=/\w*$/;function E3(n){var e=new n.constructor(n.source,P3.exec(n));return e.lastIndex=n.lastIndex,e}var ub=Zt?Zt.prototype:void 0,hb=ub?ub.valueOf:void 0;function A3(n){return hb?Object(hb.call(n)):{}}function fb(n,e){var t=e?Oh(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var O3="[object Boolean]",M3="[object Date]",T3="[object Map]",_3="[object Number]",N3="[object RegExp]",k3="[object Set]",I3="[object String]",$3="[object Symbol]",L3="[object ArrayBuffer]",R3="[object DataView]",j3="[object Float32Array]",D3="[object Float64Array]",B3="[object Int8Array]",z3="[object Int16Array]",F3="[object Int32Array]",V3="[object Uint8Array]",q3="[object Uint8ClampedArray]",G3="[object Uint16Array]",H3="[object Uint32Array]";function U3(n,e,t){var r=n.constructor;switch(e){case L3:return Oh(n);case O3:case M3:return new r(+n);case R3:return S3(n,t);case j3:case D3:case B3:case z3:case F3:case V3:case q3:case G3:case H3:return fb(n,t);case T3:return new r;case _3:case I3:return new r(n);case N3:return E3(n);case k3:return new r;case $3:return A3(n)}}function db(n){return typeof n.constructor=="function"&&!bl(n)?VR(wh(n)):{}}var W3="[object Map]";function X3(n){return bn(n)&&tn(n)==W3}var gb=os&&os.isMap,Y3=gb?wl(gb):X3,K3="[object Set]";function J3(n){return bn(n)&&tn(n)==K3}var pb=os&&os.isSet,Q3=pb?wl(pb):J3,Z3=1,ez=2,tz=4,mb="[object Arguments]",nz="[object Array]",rz="[object Boolean]",iz="[object Date]",sz="[object Error]",yb="[object Function]",oz="[object GeneratorFunction]",az="[object Map]",lz="[object Number]",vb="[object Object]",cz="[object RegExp]",uz="[object Set]",hz="[object String]",fz="[object Symbol]",dz="[object WeakMap]",gz="[object ArrayBuffer]",pz="[object DataView]",mz="[object Float32Array]",yz="[object Float64Array]",vz="[object Int8Array]",bz="[object Int16Array]",wz="[object Int32Array]",xz="[object Uint8Array]",Cz="[object Uint8ClampedArray]",Sz="[object Uint16Array]",Pz="[object Uint32Array]",Ce={};Ce[mb]=Ce[nz]=Ce[gz]=Ce[pz]=Ce[rz]=Ce[iz]=Ce[mz]=Ce[yz]=Ce[vz]=Ce[bz]=Ce[wz]=Ce[az]=Ce[lz]=Ce[vb]=Ce[cz]=Ce[uz]=Ce[hz]=Ce[fz]=Ce[xz]=Ce[Cz]=Ce[Sz]=Ce[Pz]=!0,Ce[sz]=Ce[yb]=Ce[dz]=!1;function Mo(n,e,t,r,i,s){var o,a=e&Z3,l=e&ez,c=e&tz;if(o!==void 0)return o;if(!Ze(n))return n;var u=xt(n);if(u){if(o=C3(n),!a)return o0(n,o)}else{var h=tn(n),f=h==yb||h==oz;if(ss(n))return eb(n,a);if(h==vb||h==mb||f&&!i){if(o=l||f?{}:db(n),!a)return l?f3(n,s3(o,n)):u3(n,i3(o,n))}else{if(!Ce[h])return i?n:{};o=U3(n,h,a)}}s||(s=new wn);var d=s.get(n);if(d)return d;s.set(n,o),Q3(n)?n.forEach(function(b){o.add(Mo(b,e,t,b,n,s))}):Y3(n)&&n.forEach(function(b,m){o.set(m,Mo(b,e,t,m,n,s))});var g=c?l?d3:Ph:l?as:Po,p=u?void 0:g(n);return JR(p||n,function(b,m){p&&(m=b,b=n[m]),l0(o,m,Mo(b,e,t,m,n,s))}),o}var Ez=4;function Mh(n){return Mo(n,Ez)}var Az=1,Oz=4;function ze(n){return Mo(n,Az|Oz)}var Mz="__lodash_hash_undefined__";function Tz(n){return this.__data__.set(n,Mz),this}function _z(n){return this.__data__.has(n)}function us(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Qn;++e<t;)this.add(n[e])}us.prototype.add=us.prototype.push=Tz,us.prototype.has=_z;function Nz(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Th(n,e){return n.has(e)}var kz=1,Iz=2;function bb(n,e,t,r,i,s){var o=t&kz,a=n.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(n),u=s.get(e);if(c&&u)return c==e&&u==n;var h=-1,f=!0,d=t&Iz?new us:void 0;for(s.set(n,e),s.set(e,n);++h<a;){var g=n[h],p=e[h];if(r)var b=o?r(p,g,h,e,n,s):r(g,p,h,n,e,s);if(b!==void 0){if(b)continue;f=!1;break}if(d){if(!Nz(e,function(m,v){if(!Th(d,v)&&(g===m||i(g,m,t,r,s)))return d.push(v)})){f=!1;break}}else if(!(g===p||i(g,p,t,r,s))){f=!1;break}}return s.delete(n),s.delete(e),f}function $z(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function _h(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Lz=1,Rz=2,jz="[object Boolean]",Dz="[object Date]",Bz="[object Error]",zz="[object Map]",Fz="[object Number]",Vz="[object RegExp]",qz="[object Set]",Gz="[object String]",Hz="[object Symbol]",Uz="[object ArrayBuffer]",Wz="[object DataView]",wb=Zt?Zt.prototype:void 0,Nh=wb?wb.valueOf:void 0;function Xz(n,e,t,r,i,s,o){switch(t){case Wz:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case Uz:return!(n.byteLength!=e.byteLength||!s(new Ol(n),new Ol(e)));case jz:case Dz:case Fz:return ns(+n,+e);case Bz:return n.name==e.name&&n.message==e.message;case Vz:case Gz:return n==e+"";case zz:var a=$z;case qz:var l=r&Lz;if(a||(a=_h),n.size!=e.size&&!l)return!1;var c=o.get(n);if(c)return c==e;r|=Rz,o.set(n,e);var u=bb(a(n),a(e),r,i,s,o);return o.delete(n),u;case Hz:if(Nh)return Nh.call(n)==Nh.call(e)}return!1}var Yz=1,Kz=Object.prototype,Jz=Kz.hasOwnProperty;function Qz(n,e,t,r,i,s){var o=t&Yz,a=Ph(n),l=a.length,c=Ph(e),u=c.length;if(l!=u&&!o)return!1;for(var h=l;h--;){var f=a[h];if(!(o?f in e:Jz.call(e,f)))return!1}var d=s.get(n),g=s.get(e);if(d&&g)return d==e&&g==n;var p=!0;s.set(n,e),s.set(e,n);for(var b=o;++h<l;){f=a[h];var m=n[f],v=e[f];if(r)var y=o?r(v,m,f,e,n,s):r(m,v,f,n,e,s);if(!(y===void 0?m===v||i(m,v,t,r,s):y)){p=!1;break}b||(b=f=="constructor")}if(p&&!b){var w=n.constructor,x=e.constructor;w!=x&&"constructor"in n&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof x=="function"&&x instanceof x)&&(p=!1)}return s.delete(n),s.delete(e),p}var Zz=1,xb="[object Arguments]",Cb="[object Array]",Ml="[object Object]",eF=Object.prototype,Sb=eF.hasOwnProperty;function tF(n,e,t,r,i,s){var o=xt(n),a=xt(e),l=o?Cb:tn(n),c=a?Cb:tn(e);l=l==xb?Ml:l,c=c==xb?Ml:c;var u=l==Ml,h=c==Ml,f=l==c;if(f&&ss(n)){if(!ss(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new wn),o||xl(n)?bb(n,e,t,r,i,s):Xz(n,e,l,t,r,i,s);if(!(t&Zz)){var d=u&&Sb.call(n,"__wrapped__"),g=h&&Sb.call(e,"__wrapped__");if(d||g){var p=d?n.value():n,b=g?e.value():e;return s||(s=new wn),i(p,b,t,r,s)}}return f?(s||(s=new wn),Qz(n,e,t,r,i,s)):!1}function Tl(n,e,t,r,i){return n===e?!0:n==null||e==null||!bn(n)&&!bn(e)?n!==n&&e!==e:tF(n,e,t,r,Tl,i)}var nF=1,rF=2;function iF(n,e,t,r){var i=t.length,s=i;if(n==null)return!s;for(n=Object(n);i--;){var o=t[i];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++i<s;){o=t[i];var a=o[0],l=n[a],c=o[1];if(o[2]){if(l===void 0&&!(a in n))return!1}else{var u=new wn,h;if(!(h===void 0?Tl(c,l,nF|rF,r,u):h))return!1}}return!0}function Pb(n){return n===n&&!Ze(n)}function sF(n){for(var e=Po(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,Pb(i)]}return e}function Eb(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function oF(n){var e=sF(n);return e.length==1&&e[0][2]?Eb(e[0][0],e[0][1]):function(t){return t===n||iF(t,n,e)}}function aF(n,e){return n!=null&&e in Object(n)}function Ab(n,e,t){e=x0(e,n);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Pl(e[r]);if(!(s=n!=null&&t(n,o)))break;n=n[o]}return s||++r!=i?s:(i=n==null?0:n.length,!!i&&dh(i)&&fh(o,i)&&(xt(n)||is(n)))}function lF(n,e){return n!=null&&Ab(n,e,aF)}var cF=1,uF=2;function hF(n,e){return ph(n)&&Pb(e)?Eb(Pl(n),e):function(t){var r=_D(t,n);return r===void 0&&r===e?lF(t,n):Tl(e,r,cF|uF)}}function fF(n){return function(e){return e==null?void 0:e[n]}}function dF(n){return function(e){return yh(e,n)}}function gF(n){return ph(n)?fF(Pl(n)):dF(n)}function kh(n){return typeof n=="function"?n:n==null?ts:typeof n=="object"?xt(n)?hF(n[0],n[1]):oF(n):gF(n)}function pF(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;){var o=n[i];e(r,o,t(o),n)}return r}function mF(n){return function(e,t,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[++i];if(t(s[l],l,s)===!1)break}return e}}var Ob=mF();function yF(n,e){return n&&Ob(n,e,Po)}function vF(n,e){return function(t,r){if(t==null)return t;if(!bi(t))return n(t,r);for(var i=t.length,s=-1,o=Object(t);++s<i&&r(o[s],s,o)!==!1;);return t}}var Mb=vF(yF);function bF(n,e,t,r){return Mb(n,function(i,s,o){e(r,i,t(i),o)}),r}function wF(n,e){return function(t,r){var i=xt(t)?pF:bF,s=e?e():{};return i(t,n,kh(r),s)}}var Ih=function(){return vn.Date.now()},xF="Expected a function",CF=Math.max,SF=Math.min;function $h(n,e,t){var r,i,s,o,a,l,c=0,u=!1,h=!1,f=!0;if(typeof n!="function")throw new TypeError(xF);e=xo(e)||0,Ze(t)&&(u=!!t.leading,h="maxWait"in t,s=h?CF(xo(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(C){var S=r,E=i;return r=i=void 0,c=C,o=n.apply(E,S),o}function g(C){return c=C,a=setTimeout(m,e),u?d(C):o}function p(C){var S=C-l,E=C-c,A=e-S;return h?SF(A,s-E):A}function b(C){var S=C-l,E=C-c;return l===void 0||S>=e||S<0||h&&E>=s}function m(){var C=Ih();if(b(C))return v(C);a=setTimeout(m,p(C))}function v(C){return a=void 0,f&&r?d(C):(r=i=void 0,o)}function y(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function w(){return a===void 0?o:v(Ih())}function x(){var C=Ih(),S=b(C);if(r=arguments,i=this,l=C,S){if(a===void 0)return g(l);if(h)return clearTimeout(a),a=setTimeout(m,e),d(l)}return a===void 0&&(a=setTimeout(m,e)),o}return x.cancel=y,x.flush=w,x}var Tb=Object.prototype,PF=Tb.hasOwnProperty,EF=rs(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&vl(e[0],e[1],i)&&(r=1);++t<r;)for(var s=e[t],o=as(s),a=-1,l=o.length;++a<l;){var c=o[a],u=n[c];(u===void 0||ns(u,Tb[c])&&!PF.call(n,c))&&(n[c]=s[c])}return n});function Lh(n,e,t){(t!==void 0&&!ns(n[e],t)||t===void 0&&!(e in n))&&yl(n,e,t)}function _l(n){return bn(n)&&bi(n)}function Rh(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function AF(n){return Co(n,as(n))}function OF(n,e,t,r,i,s,o){var a=Rh(n,t),l=Rh(e,t),c=o.get(l);if(c){Lh(n,t,c);return}var u=s?s(a,l,t+"",n,e,o):void 0,h=u===void 0;if(h){var f=xt(l),d=!f&&ss(l),g=!f&&!d&&xl(l);u=l,f||d||g?xt(a)?u=a:_l(a)?u=o0(a):d?(h=!1,u=eb(l,!0)):g?(h=!1,u=fb(l,!0)):u=[]:Dn(l)||is(l)?(u=a,is(a)?u=AF(a):(!Ze(a)||ch(a))&&(u=db(l))):h=!1}h&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),Lh(n,t,u)}function Nl(n,e,t,r,i){n!==e&&Ob(e,function(s,o){if(i||(i=new wn),Ze(s))OF(n,e,o,t,Nl,r,i);else{var a=r?r(Rh(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),Lh(n,o,a)}},as)}function _b(n,e,t,r,i,s){return Ze(n)&&Ze(e)&&(s.set(e,n),Nl(n,e,void 0,_b,s),s.delete(e)),n}var MF=u0(function(n,e,t,r){Nl(n,e,t,r)}),Nb=rs(function(n){return n.push(void 0,_b),s0(MF,void 0,n)}),TF=200;function _F(n,e,t,r){var i=-1,s=a0,o=!0,a=n.length,l=[],c=e.length;if(!a)return l;e.length>=TF&&(s=Th,o=!1,e=new us(e));e:for(;++i<a;){var u=n[i],h=u;if(u=u!==0?u:0,o&&h===h){for(var f=c;f--;)if(e[f]===h)continue e;l.push(u)}else s(e,h,r)||l.push(u)}return l}var NF=rs(function(n,e){return _l(n)?_F(n,bh(e,1,_l,!0)):[]});function kF(n,e){var t=-1,r=bi(n)?Array(n.length):[];return Mb(n,function(i,s,o){r[++t]=e(i,s,o)}),r}var IF=Object.prototype,$F=IF.hasOwnProperty,kb=wF(function(n,e,t){$F.call(n,t)?n[t].push(e):yl(n,t,[e])});function LF(n,e){return n>e}var RF=Object.prototype,jF=RF.hasOwnProperty;function DF(n,e){return n!=null&&jF.call(n,e)}function kl(n,e){return n!=null&&Ab(n,e,DF)}var BF="[object Map]",zF="[object Set]",FF=Object.prototype,VF=FF.hasOwnProperty;function Ib(n){if(n==null)return!0;if(bi(n)&&(xt(n)||typeof n=="string"||typeof n.splice=="function"||ss(n)||xl(n)||is(n)))return!n.length;var e=tn(n);if(e==BF||e==zF)return!n.size;if(bl(n))return!w0(n).length;for(var t in n)if(VF.call(n,t))return!1;return!0}function Zn(n,e){return Tl(n,e)}var qF="[object Number]";function $b(n){return typeof n=="number"||bn(n)&&Or(n)==qF}var GF=N0("toLowerCase");function HF(n,e,t){for(var r=-1,i=n.length;++r<i;){var s=n[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!jn(o):t(o,a)))var a=o,l=s}return l}function UF(n){return n&&n.length?HF(n,ts,LF):void 0}var Ie=u0(function(n,e,t){Nl(n,e,t)});function WF(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function XF(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n===n,s=jn(n),o=e!==void 0,a=e===null,l=e===e,c=jn(e);if(!a&&!c&&!s&&n>e||s&&o&&l&&!a&&!c||r&&o&&l||!t&&l||!i)return 1;if(!r&&!s&&!c&&n<e||c&&t&&i&&!r&&!s||a&&t&&i||!o&&i||!l)return-1}return 0}function YF(n,e,t){for(var r=-1,i=n.criteria,s=e.criteria,o=i.length,a=t.length;++r<o;){var l=XF(i[r],s[r]);if(l){if(r>=a)return l;var c=t[r];return l*(c=="desc"?-1:1)}}return n.index-e.index}function KF(n,e,t){e.length?e=pl(e,function(s){return xt(s)?function(o){return yh(o,s.length===1?s[0]:s)}:s}):e=[ts];var r=-1;e=pl(e,wl(kh));var i=kF(n,function(s,o,a){var l=pl(e,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return WF(i,function(s,o){return YF(s,o,t)})}var Lb=rs(function(n,e){if(n==null)return[];var t=e.length;return t>1&&vl(n,e[0],e[1])?e=[]:t>2&&vl(e[0],e[1],e[2])&&(e=[e[0]]),KF(n,bh(e),[])}),JF=4294967295,QF=JF-1,ZF=Math.floor,eV=Math.min;function Rb(n,e,t,r){var i=0,s=n==null?0:n.length;if(s===0)return 0;e=t(e);for(var o=e!==e,a=e===null,l=jn(e),c=e===void 0;i<s;){var u=ZF((i+s)/2),h=t(n[u]),f=h!==void 0,d=h===null,g=h===h,p=jn(h);if(o)var b=g;else c?b=g&&f:a?b=g&&f&&!d:l?b=g&&f&&!d&&!p:d||p?b=!1:b=h<e;b?i=u+1:s=u}return eV(s,QF)}var tV=4294967295,nV=tV>>>1;function rV(n,e,t){var r=0,i=n==null?r:n.length;if(typeof e=="number"&&e===e&&i<=nV){for(;r<i;){var s=r+i>>>1,o=n[s];o!==null&&!jn(o)&&o<e?r=s+1:i=s}return i}return Rb(n,e,ts)}function iV(n,e){return rV(n,e)}function sV(n,e,t){return Rb(n,e,kh(t))}var oV=Y0(function(n,e,t){return n+(t?" ":"")+El(e)}),aV="Expected a function";function lV(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(aV);return Ze(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),$h(n,e,{leading:r,maxWait:e,trailing:i})}var cV=1/0,uV=cs&&1/_h(new cs([,-0]))[1]==cV?function(n){return new cs(n)}:qR,hV=200;function jb(n,e,t){var r=-1,i=a0,s=n.length,o=!0,a=[],l=a;if(s>=hV){var c=uV(n);if(c)return _h(c);o=!1,i=Th,l=new us}else l=a;e:for(;++r<s;){var u=n[r],h=u;if(u=u!==0?u:0,o&&h===h){for(var f=l.length;f--;)if(l[f]===h)continue e;a.push(u)}else i(l,h,t)||(l!==a&&l.push(h),a.push(u))}return a}var Db=rs(function(n){return jb(bh(n,1,_l,!0))});function Bb(n){return n&&n.length?jb(n):[]}function zb(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function Y(n,e,...t){return zb(n,e,t)}function fV(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Fb(n){return n!=null&&(n instanceof Promise||fV(n))}function Vb(...n){const e=[];if(n.forEach(r=>{Array.isArray(r)?e.push(...r):e.push(r)}),e.some(r=>Fb(r))){const r=e.map(i=>Fb(i)?i:Promise.resolve(i!==!1));return Promise.all(r).then(i=>i.reduce((s,o)=>o!==!1&&s,!0))}return e.every(r=>r!==!1)}function jh(n,e){const t=[];for(let r=0;r<n.length;r+=2){const i=n[r],s=n[r+1],o=Array.isArray(e)?e:[e],a=zb(i,s,o);t.push(a)}return Vb(t)}class dV{constructor(){this.listeners={}}on(e,t,r){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,r),this)}once(e,t,r){const i=(...s)=>(this.off(e,i),jh([t,r],s));return this.on(e,i,this)}off(e,t,r){if(!(e||t||r))return this.listeners={},this;const i=this.listeners;return(e?[e]:Object.keys(i)).forEach(o=>{const a=i[o];if(a){if(!(t||r)){delete i[o];return}for(let l=a.length-2;l>=0;l-=2)t&&a[l]!==t||r&&a[l+1]!==r||a.splice(l,2)}}),this}trigger(e,...t){let r=!0;if(e!=="*"){const s=this.listeners[e];s!=null&&(r=jh([...s],t))}const i=this.listeners["*"];return i!=null?Vb([r,jh([...i],[e,...t])]):r}emit(e,...t){return this.trigger(e,...t)}}function gV(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r))})})}const pV=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function mV(n,e){pV(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}let yV=class{};const vV=/^\s*class\s+/.test(`${yV}`)||/^\s*class\s*\{/.test(`${class{}}`);function Dh(n,e){let t;return vV?t=class extends e{}:(t=function(){return e.apply(this,arguments)},mV(t,e)),Object.defineProperty(t,"name",{value:n}),t}function qb(n){return n==="__proto__"}function Bh(n,e,t="/"){let r;const i=Array.isArray(e)?e:e.split(t);if(i.length)for(r=n;i.length;){const s=i.shift();if(Object(r)===r&&s&&s in r)r=r[s];else return}return r}function hs(n,e,t,r="/"){const i=Array.isArray(e)?e:e.split(r),s=i.pop();if(s&&!qb(s)){let o=n;i.forEach(a=>{qb(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[s]=t}return n}function Gb(n,e,t="/"){const r=Array.isArray(e)?e.slice():e.split(t),i=r.pop();if(i)if(r.length>0){const s=Bh(n,r);s&&delete s[i]}else delete n[i];return n}var bV=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class pt extends dV{dispose(){this.off()}}bV([yn.dispose()],pt.prototype,"dispose",null),function(n){n.dispose=yn.dispose}(pt||(pt={})),gV(pt,yn);const Hb=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Ub=Hb(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),zh=Hb(n=>oV(Al(n)).replace(/ /g,""));function Fh(n){let e=2166136261,t=!1,r=n;for(let i=0,s=r.length;i<s;i+=1){let o=r.charCodeAt(i);o>127&&!t&&(r=unescape(encodeURIComponent(r)),o=r.charCodeAt(i),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Il(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=Math.random()*16|0,o=i==="x"?s:i==="y"?s&3|8:i;n+=o.toString(16)}return n}function wV(n,e,t){const r=Math.min(2,Math.floor(n.length*.34));let i=Math.floor(n.length*.4)+1,s,o=!1;const a=n.toLowerCase();for(const l of e){const c=t(l);if(c!==void 0&&Math.abs(c.length-a.length)<=r){const u=c.toLowerCase();if(u===a){if(c===n)continue;return l}if(o||c.length<3)continue;const h=xV(a,u,i-1);if(h===void 0)continue;h<3?(o=!0,s=l):(i=h,s=l)}}return s}function xV(n,e,t){let r=new Array(e.length+1),i=new Array(e.length+1);const s=t+1;for(let a=0;a<=e.length;a+=1)r[a]=a;for(let a=1;a<=n.length;a+=1){const l=n.charCodeAt(a-1),c=a>t?a-t:1,u=e.length>t+a?t+a:e.length;i[0]=a;let h=a;for(let d=1;d<c;d+=1)i[d]=s;for(let d=c;d<=u;d+=1){const g=l===e.charCodeAt(d-1)?r[d-1]:Math.min(r[d]+1,i[d-1]+1,r[d-1]+2);i[d]=g,h=Math.min(h,g)}for(let d=u+1;d<=e.length;d+=1)i[d]=s;if(h>t)return;const f=r;r=i,i=f}const o=r[e.length];return o>t?void 0:o}function er(n){return typeof n=="string"&&n.slice(-1)==="%"}function Vt(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),er(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function Bn(n){if(typeof n=="object"){let t=0,r=0,i=0,s=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(r=s=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(i=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=n.left),n.top!=null&&Number.isFinite(n.top)&&(r=n.top),n.right!=null&&Number.isFinite(n.right)&&(i=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(s=n.bottom),{top:r,right:i,bottom:s,left:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let Vh=!1,Wb=!1,Xb=!1,Yb=!1,Kb=!1,Jb=!1,Qb=!1,Zb=!1,e1=!1,t1=!1,n1=!1,r1=!1,i1=!1,s1=!1,o1=!1,a1=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Vh=n.indexOf("Macintosh")>=0,Wb=!!n.match(/(iPad|iPhone|iPod)/g),Xb=n.indexOf("Windows")>=0,Yb=n.indexOf("MSIE")>=0,Kb=!!n.match(/Trident\/7\./),Jb=!!n.match(/Edge\//),Qb=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,e1=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,t1=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,n1=n.indexOf("Firefox/")>=0,r1=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(a1=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(Zb=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,s1=window.PointerEvent!=null&&!Vh),typeof document=="object"){i1="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){o1=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch(n){}}var nn;(function(n){n.IS_MAC=Vh,n.IS_IOS=Wb,n.IS_WINDOWS=Xb,n.IS_IE=Yb,n.IS_IE11=Kb,n.IS_EDGE=Jb,n.IS_NETSCAPE=Qb,n.IS_CHROME_APP=Zb,n.IS_CHROME=e1,n.IS_OPERA=t1,n.IS_FIREFOX=n1,n.IS_SAFARI=r1,n.SUPPORT_TOUCH=i1,n.SUPPORT_POINTER=s1,n.SUPPORT_PASSIVE=o1,n.NO_FOREIGNOBJECT=a1,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(nn||(nn={})),function(n){function e(){const s=window.module;return s!=null&&s.hot!=null&&s.hot.status!=null?s.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;const r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function i(s){const o=document.createElement(r[s]||"div"),a=`on${s}`;let l=a in o;return l||(o.setAttribute(a,"return;"),l=typeof o[a]=="function"),l}n.isEventSupported=i}(nn||(nn={}));const qh=/[\t\r\n\f]/g,Gh=/\S+/g,fs=n=>` ${n} `;function ds(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function gs(n,e){if(n==null||e==null)return!1;const t=fs(ds(n)),r=fs(e);return n.nodeType===1?t.replace(qh," ").includes(r):!1}function K(n,e){if(!(n==null||e==null)){if(typeof e=="function")return K(n,e(ds(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(Gh)||[],r=fs(ds(n)).replace(qh," ");let i=t.reduce((s,o)=>s.indexOf(fs(o))<0?`${s}${o} `:s,r);i=i.trim(),r!==i&&n.setAttribute("class",i)}}}function mt(n,e){if(n!=null){if(typeof e=="function")return mt(n,e(ds(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(Gh)||[],r=fs(ds(n)).replace(qh," ");let i=t.reduce((s,o)=>{const a=fs(o);return s.indexOf(a)>-1?s.replace(a," "):s},r);i=e?i.trim():"",r!==i&&n.setAttribute("class",i)}}}function l1(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?K(n,e):mt(n,e);return}if(typeof e=="function")return l1(n,e(ds(n),t),t);typeof e=="string"&&(e.match(Gh)||[]).forEach(i=>{gs(n,i)?mt(n,i):K(n,i)})}}let c1=0;function CV(){return c1+=1,`v${c1}`}function Hh(n){return(n.id==null||n.id==="")&&(n.id=CV()),n.id}function Mr(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const ct={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},u1="1.1";function h1(n,e=document){return e.createElement(n)}function Uh(n,e=ct.xhtml,t=document){return t.createElementNS(e,n)}function tr(n,e=document){return Uh(n,ct.svg,e)}function $l(n){if(n){const t=`<svg xmlns="${ct.svg}" xmlns:xlink="${ct.xlink}" version="${u1}">${n}</svg>`,{documentElement:r}=SV(t,{async:!1});return r}const e=document.createElementNS(ct.svg,"svg");return e.setAttributeNS(ct.xmlns,"xmlns:xlink",ct.xlink),e.setAttribute("version",u1),e}function SV(n,e={}){let t;try{const r=new DOMParser;if(e.async!=null){const i=r;i.async=e.async}t=r.parseFromString(n,e.mimeType||"text/xml")}catch(r){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function PV(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Wh(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function EV(n,e){return n.querySelectorAll(e)}function AV(n,e){return n.querySelector(e)}function f1(n,e,t){const r=n.ownerSVGElement;let i=n.parentNode;for(;i&&i!==t&&i!==r;){if(gs(i,e))return i;i=i.parentNode}return null}function d1(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function nr(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function To(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function zn(n,e){(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&n.appendChild(r)})}function g1(n,e){const t=n.firstChild;return t?_o(t,e):zn(n,e)}function _o(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n)})}function OV(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n.nextSibling)})}function Tr(n,e){e!=null&&e.appendChild(n)}function MV(n){return!!n&&n.nodeType===1}function p1(n){try{return n instanceof HTMLElement}catch(e){return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function TV(n,e){const t=[];let r=n.firstChild;for(;r;r=r.nextSibling)r.nodeType===1&&(!e||gs(r,e))&&t.push(r);return t}const m1=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function _V(n,e){return n.getAttribute(e)}function Xh(n,e){const t=v1(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Yh(n,e,t){if(t==null)return Xh(n,e);const r=v1(e);r.ns&&typeof t=="string"?n.setAttributeNS(r.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function y1(n,e){Object.keys(e).forEach(t=>{Yh(n,t,e[t])})}function fe(n,e,t){if(e==null){const r=n.attributes,i={};for(let s=0;s<r.length;s+=1)i[r[s].name]=r[s].value;return i}if(typeof e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?y1(n,e):Yh(n,e,t)}function v1(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:ct[e[0]],local:e[1]}}return{ns:null,local:n}}function No(n){const e={};return Object.keys(n).forEach(t=>{const r=m1.includes(t)?t:Ub(t);e[r]=n[t]}),e}function Ll(n){const e={};return n.split(";").forEach(r=>{const i=r.trim();if(i){const s=i.split("=");s.length&&(e[s[0].trim()]=s[1]?s[1].trim():"")}}),e}function Kh(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const r=typeof n[t]=="object",i=typeof e[t]=="object";let s,o;r&&i?(s=n[t],o=e[t]):r?(s=n[t],o=Ll(e[t])):i?(s=Ll(n[t]),o=e[t]):(s=Ll(n[t]),o=Ll(e[t])),n[t]=Kh(s,o)}else n[t]=e[t]}),n}function NV(n,e,t={}){const r=t.offset||0,i=[],s=[];let o,a,l=null;for(let c=0;c<n.length;c+=1){o=s[c]=n[c];for(let u=0,h=e.length;u<h;u+=1){const f=e[u],d=f.start+r,g=f.end+r;c>=d&&c<g&&(typeof o=="string"?o=s[c]={t:n[c],attrs:f.attrs}:o.attrs=Kh(Kh({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(u)))}a=s[c-1],a?Ze(o)&&Ze(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(i.push(l),l=o)):Ze(o)||Ze(a)?(l=l,i.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&i.push(l),i}function kV(n){return n.replace(/ /g," ")}var b1;(function(n){function e(c){const u="data:";return c.substr(0,u.length)===u}n.isDataUrl=e;function t(c,u){if(!c||e(c)){setTimeout(()=>u(null,c));return}const h=()=>{u(new Error(`Failed to load image: ${c}`))},f=window.FileReader?g=>{if(g.status===200){const p=new FileReader;p.onload=b=>{const m=b.target.result;u(null,m)},p.onerror=h,p.readAsDataURL(g.response)}else h()}:g=>{const p=b=>{const v=[];for(let y=0;y<b.length;y+=32768)v.push(String.fromCharCode.apply(null,b.subarray(y,y+32768)));return v.join("")};if(g.status===200){let b=c.split(".").pop()||"png";b==="svg"&&(b="svg+xml");const m=`data:image/${b};base64,`,v=new Uint8Array(g.response),y=m+btoa(p(v));u(null,y)}else h()},d=new XMLHttpRequest;d.responseType=window.FileReader?"blob":"arraybuffer",d.open("GET",c,!0),d.addEventListener("error",h),d.addEventListener("load",()=>f(d)),d.send()}n.imageToDataUri=t;function r(c){let u=c.replace(/\s/g,"");u=decodeURIComponent(u);const h=u.indexOf(","),f=u.slice(0,h),d=f.split(":")[1].split(";")[0],g=u.slice(h+1);let p;f.indexOf("base64")>=0?p=atob(g):p=unescape(encodeURIComponent(g));const b=new Uint8Array(p.length);for(let m=0;m<p.length;m+=1)b[m]=p.charCodeAt(m);return new Blob([b],{type:d})}n.dataUriToBlob=r;function i(c,u){const h=window.navigator.msSaveBlob;if(h)h(c,u);else{const f=window.URL.createObjectURL(c),d=document.createElement("a");d.href=f,d.download=u,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(f)}}n.downloadBlob=i;function s(c,u){const h=r(c);i(h,u)}n.downloadDataUri=s;function o(c){const u=c.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return u&&u[2]?u[2].replace(/\s+/," ").split(" "):null}function a(c){const u=parseFloat(c);return Number.isNaN(u)?null:u}function l(c,u={}){let h=null;const f=y=>(h==null&&(h=o(c)),h!=null?a(h[y]):null),d=y=>{const w=c.match(y);return w&&w[2]?a(w[2]):null};let g=u.width;if(g==null&&(g=d(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=f(2)),g==null)throw new Error("Can not parse width from svg string");let p=u.height;if(p==null&&(p=d(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),p==null&&(p=f(3)),p==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(c).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=l})(b1||(b1={}));let xi;const IV={px(n){return n},mm(n){return xi*n},cm(n){return xi*n*10},in(n){return xi*n*25.4},pt(n){return xi*(25.4*n/72)},pc(n){return xi*(25.4*n/6)}};var w1;(function(n){function e(r,i,s){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=r+(s||"px"),a.height=i+(s||"px"),document.body.appendChild(o);const l=o.getBoundingClientRect(),c={width:l.width||0,height:l.height||0};return document.body.removeChild(o),c}n.measure=e;function t(r,i){xi==null&&(xi=e("1","1","mm").width);const s=i?IV[i]:null;return s?s(r):r}n.toPx=t})(w1||(w1={}));const $V=/-(.)/g;function LV(n){return n.replace($V,(e,t)=>t.toUpperCase())}const Jh={},x1=["webkit","ms","moz","o"],C1=document?document.createElement("div").style:{};function RV(n){for(let e=0;e<x1.length;e+=1){const t=x1[e]+n;if(t in C1)return t}return null}function jV(n){const e=LV(n);if(Jh[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Jh[e]=e in C1?e:RV(t)}return Jh[e]}function S1(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const DV={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function BV(n){return/^--/.test(n)}function Rl(n,e,t){const r=window.getComputedStyle(n,null);return t?r.getPropertyValue(e)||void 0:r[e]||n.style[e]}function jl(n,e){return parseInt(Rl(n,e),10)||0}function zV(n,e){return!DV[n]&&typeof e=="number"?`${e}px`:e}function me(n,e,t){if(typeof e=="string"){const r=BV(e);if(r||(e=jV(e)),t===void 0)return Rl(n,e,r);r||(t=zV(e,t));const i=n.style;r?i.setProperty(e,t):i[e]=t;return}for(const r in e)me(n,r,e[r])}const Dl=new WeakMap;function P1(n,e){const t=Al(e),r=Dl.get(n);if(r)return r[t]}function FV(n,e,t){const r=Al(e),i=Dl.get(n);i?i[r]=t:Dl.set(n,{[r]:t})}function Ci(n,e,t){if(!e){const r={};return Object.keys(Dl).forEach(i=>{r[i]=P1(n,i)}),r}if(typeof e=="string"){if(t===void 0)return P1(n,e);FV(n,e,t);return}for(const r in e)Ci(n,r,e[r])}const VV={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function Qh(n,e,t){if(e){if(typeof e=="string"){if(e=VV[e]||e,arguments.length<3)return n[e];n[e]=t;return}for(const r in e)Qh(n,r,e[r])}}class Z{get[Symbol.toStringTag](){return Z.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,r){if(!e)throw new TypeError("Invalid element to create vector");let i;if(Z.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=$l();else if(e[0]==="<"){const s=$l(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(ct.svg,e);else i=e;this.node=i,t&&this.setAttributes(t),r&&this.append(r)}transform(e,t){return e==null?ms(this.node):(ms(this.node,e,t),this)}translate(e,t=0,r={}){return e==null?$1(this.node):($1(this.node,e,t,r),this)}rotate(e,t,r,i={}){return e==null?tf(this.node):(tf(this.node,e,t,r,i),this)}scale(e,t){return e==null?nf(this.node):(nf(this.node,e,t),this)}getTransformToElement(e){const t=Z.toNode(e);return Lo(this.node,t)}removeAttribute(e){return Xh(this.node,e),this}getAttribute(e){return _V(this.node,e)}setAttribute(e,t){return Yh(this.node,e,t),this}setAttributes(e){return y1(this.node,e),this}attr(e,t){return e==null?fe(this.node):typeof e=="string"&&t===void 0?fe(this.node,e):(typeof e=="object"?fe(this.node,e):fe(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:Z.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?Z.create(t):Z.create("defs").appendTo(e)}text(e,t={}){return O1(this.node,e,t),this}tagName(){return PV(this.node)}clone(){return Z.create(this.node.cloneNode(!0))}remove(){return nr(this.node),this}empty(){return To(this.node),this}append(e){return zn(this.node,Z.toNodes(e)),this}appendTo(e){return Tr(this.node,Z.isVector(e)?e.node:e),this}prepend(e){return g1(this.node,Z.toNodes(e)),this}before(e){return _o(this.node,Z.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(Z.toNode(e),this.node),Z.create(e)}first(){return this.node.firstChild?Z.create(this.node.firstChild):null}last(){return this.node.lastChild?Z.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?Z.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(Z.toNode(e))}find(e){const t=[],r=EV(this.node,e);if(r)for(let i=0,s=r.length;i<s;i+=1)t.push(Z.create(r[i]));return t}findOne(e){const t=AV(this.node,e);return t?Z.create(t):null}findParentByClass(e,t){const r=f1(this.node,e,t);return r?Z.create(r):null}matches(e){const t=this.node;this.node.matches;const r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return r&&r.call(t,e)}contains(e){return d1(this.node,Z.isVector(e)?e.node:e)}wrap(e){const t=Z.create(e),r=this.node.parentNode;return r!=null&&r.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=Z.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=Z.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let r=0;r<e.length;r+=1)e[r].nodeType===1&&t.push(Z.create(e[r]));return t}eachChild(e,t){const r=this.children();for(let i=0,s=r.length;i<s;i+=1)e.call(r[i],r[i],i,r),t&&r[i].eachChild(e,t);return this}index(){return Wh(this.node)}hasClass(e){return gs(this.node,e)}addClass(e){return K(this.node,e),this}removeClass(e){return mt(this.node,e),this}toggleClass(e,t){return l1(this.node,e,t),this}toLocalPoint(e,t){return lq(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?UV(this.node,e):[]}toPath(){return Z.create(ZV(this.node))}toPathData(){return k1(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],l=o;return(a==null||a===n.toStringTag)&&l.node instanceof SVGElement&&typeof l.sample=="function"&&typeof l.toPath=="function"}n.isVector=e;function t(o,a,l){return new n(o,a,l)}n.create=t;function r(o){if(o[0]==="<"){const a=$l(o),l=[];for(let c=0,u=a.childNodes.length;c<u;c+=1){const h=a.childNodes[c];l.push(t(document.importNode(h,!0)))}return l}return[t(o)]}n.createVectors=r;function i(o){return e(o)?o.node:o}n.toNode=i;function s(o){return Array.isArray(o)?o.map(a=>i(a)):[i(o)]}n.toNodes=s})(Z||(Z={}));const E1=document.createElement("canvas").getContext("2d");function qV(n,e){const t=Z.create(e),r=Z.create("textPath"),i=n.d;if(i&&n["xlink:href"]===void 0){const s=Z.create("path").attr("d",i).appendTo(t.defs());r.attr("xlink:href",`#${s.id}`)}return typeof n=="object"&&r.attr(n),r.node}function GV(n,e,t){const r=t.eol,i=t.baseSize,s=t.lineHeight;let o=0,a;const l={},c=e.length-1;for(let u=0;u<=c;u+=1){let h=e[u],f=null;if(typeof h=="object"){const d=h.attrs,g=Z.create("tspan",d);a=g.node;let p=h.t;r&&u===c&&(p+=r),a.textContent=p;const b=d.class;b&&g.addClass(b),t.includeAnnotationIndices&&g.attr("annotations",h.annotations.join(",")),f=parseFloat(d["font-size"]),f===void 0&&(f=i),f&&f>o&&(o=f)}else r&&u===c&&(h+=r),a=document.createTextNode(h||" "),i&&i>o&&(o=i);n.appendChild(a)}return o&&(l.maxFontSize=o),s?l.lineHeight=s:o&&(l.lineHeight=o*1.2),l}const A1=/em$/;function Bl(n,e){const t=parseFloat(n);return A1.test(n)?t*e:t}function HV(n,e,t,r){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const o=Bl(s.maxFontSize,t)||t;let a=0;const l=Bl(r,t);for(let h=1;h<i;h+=1){s=e[h];const f=Bl(s.lineHeight,t)||l;a+=f}const c=Bl(s.maxFontSize,t)||t;let u;switch(n){case"middle":u=o/2-.15*c-a/2;break;case"bottom":u=-(.25*c)-a;break;case"top":default:u=.8*o;break}return u}function O1(n,e,t={}){e=kV(e);const r=t.eol;let i=t.textPath;const s=t.textVerticalAnchor,o=s==="middle"||s==="bottom"||s==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const l=t.includeAnnotationIndices;let c=t.annotations;c&&!Array.isArray(c)&&(c=[c]);const u=t.lineHeight,h=u==="auto",f=h?"1.5em":u||"1em";let d=!0;const g=n.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(d=!1)}d&&To(n),fe(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const p=fe(n,"font-size");let b=parseFloat(p);b||(b=16,(o||c)&&!p&&fe(n,"font-size",`${b}`));let m;i?(typeof i=="string"&&(i={d:i}),m=qV(i,n)):m=document.createDocumentFragment();let v,y=0,w;const x=e.split(`
11
+ `),C=[],S=x.length-1;for(let A=0;A<=S;A+=1){v=f;let M="v-line";const O=tr("tspan");let I,q=x[A];if(q)if(c){const U=NV(q,c,{offset:-y,includeAnnotationIndices:l});I=GV(O,U,{eol:A!==S&&r,baseSize:b,lineHeight:h?null:f,includeAnnotationIndices:l});const T=I.lineHeight;T&&h&&A!==0&&(v=T),A===0&&(w=I.maxFontSize*.8)}else r&&A!==S&&(q+=r),O.textContent=q;else{O.textContent="-",M+=" v-empty-line";const U=O.style;U.fillOpacity=0,U.strokeOpacity=0,c&&(I={})}I&&C.push(I),A>0&&O.setAttribute("dy",v),(A>0||i)&&O.setAttribute("x",a),O.className.baseVal=M,m.appendChild(O),y+=q.length+1}if(o)if(c)v=HV(s,C,b,f);else if(s==="top")v="0.8em";else{let A;switch(S>0?(A=parseFloat(f)||1,A*=S,A1.test(f)||(A/=b)):A=0,s){case"middle":v=`${.3-A/2}em`;break;case"bottom":v=`${-A-.3}em`;break}}else s===0?v="0em":s?v=s:(v=0,n.getAttribute("y")==null&&n.setAttribute("y",`${w||"0.8em"}`));m.firstChild.setAttribute("dy",v),n.appendChild(m)}function ko(n,e={}){if(!n)return{width:0};const t=[],r=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return t.push(e["font-style"]||"normal"),t.push(e["font-variant"]||"normal"),t.push(e["font-weight"]||400),t.push(r),t.push(e["font-family"]||"sans-serif"),E1.font=t.join(" "),E1.measureText(n)}function M1(n,e,t,r={}){if(e>=t)return[n,""];const i=n.length,s={};let o=Math.round(e/t*i-1);for(o<0&&(o=0);o>=0&&o<i;){const a=n.slice(0,o),l=s[a]||ko(a,r).width,c=n.slice(0,o+1),u=s[c]||ko(c,r).width;if(s[a]=l,s[c]=u,l>e)o-=1;else if(u<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function T1(n,e,t={},r={}){const i=e.width,s=e.height,o=r.eol||`
12
+ `,a=t.fontSize||14,l=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(a*1.4),c=Math.floor(s/l);if(n.indexOf(o)>-1){const b=Il(),m=[];return n.split(o).map(v=>{const y=T1(v,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),t,Object.assign(Object.assign({},r),{eol:b}));y&&m.push(...y.split(b))}),m.slice(0,c).join(o)}const{width:u}=ko(n,t);if(u<i)return n;const h=[];let f=n,d=u,g=r.ellipsis,p=0;g&&(typeof g!="string"&&(g="…"),p=ko(g,t).width);for(let b=0;b<c;b+=1)if(d>i)if(b===c-1){const[v]=M1(f,i-p,d,t);h.push(g?`${v}${g}`:v)}else{const[v,y]=M1(f,i,d,t);h.push(v),f=y,d=ko(f,t).width}else{h.push(f);break}return h.join(o)}const Zh=.551784;function yt(n,e,t=NaN){const r=n.getAttribute(e);if(r==null)return t;const i=parseFloat(r);return Number.isNaN(i)?t:i}function UV(n,e=1){const t=n.getTotalLength(),r=[];let i=0,s;for(;i<t;)s=n.getPointAtLength(i),r.push({distance:i,x:s.x,y:s.y}),i+=e;return r}function WV(n){return["M",yt(n,"x1"),yt(n,"y1"),"L",yt(n,"x2"),yt(n,"y2")].join(" ")}function XV(n){const e=zl(n);return e.length===0?null:`${_1(e)} Z`}function YV(n){const e=zl(n);return e.length===0?null:_1(e)}function _1(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function zl(n){const e=[],t=n.points;if(t)for(let r=0,i=t.numberOfItems;r<i;r+=1)e.push(t.getItem(r));return e}function KV(n){const e=yt(n,"cx",0),t=yt(n,"cy",0),r=yt(n,"r"),i=r*Zh;return["M",e,t-r,"C",e+i,t-r,e+r,t-i,e+r,t,"C",e+r,t+i,e+i,t+r,e,t+r,"C",e-i,t+r,e-r,t+i,e-r,t,"C",e-r,t-i,e-i,t-r,e,t-r,"Z"].join(" ")}function JV(n){const e=yt(n,"cx",0),t=yt(n,"cy",0),r=yt(n,"rx"),i=yt(n,"ry")||r,s=r*Zh,o=i*Zh;return["M",e,t-i,"C",e+s,t-i,e+r,t-o,e+r,t,"C",e+r,t+o,e+s,t+i,e,t+i,"C",e-s,t+i,e-r,t+o,e-r,t,"C",e-r,t-o,e-s,t-i,e,t-i,"Z"].join(" ")}function QV(n){return N1({x:yt(n,"x",0),y:yt(n,"y",0),width:yt(n,"width",0),height:yt(n,"height",0),rx:yt(n,"rx",0),ry:yt(n,"ry",0)})}function N1(n){let e;const t=n.x,r=n.y,i=n.width,s=n.height,o=Math.min(n.rx||n["top-rx"]||0,i/2),a=Math.min(n.rx||n["bottom-rx"]||0,i/2),l=Math.min(n.ry||n["top-ry"]||0,s/2),c=Math.min(n.ry||n["bottom-ry"]||0,s/2);return o||a||l||c?e=["M",t,r+l,"v",s-l-c,"a",a,c,0,0,0,a,c,"h",i-2*a,"a",a,c,0,0,0,a,-c,"v",-(s-c-l),"a",o,l,0,0,0,-o,-l,"h",-(i-2*o),"a",o,l,0,0,0,-o,l,"Z"]:e=["M",t,r,"H",t+i,"V",r+s,"H",t,"V",r,"Z"],e.join(" ")}function ZV(n){const e=tr("path");fe(e,fe(n));const t=k1(n);return t&&e.setAttribute("d",t),e}function k1(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return WV(n);case"polygon":return XV(n);case"polyline":return YV(n);case"ellipse":return JV(n);case"circle":return KV(n);case"rect":return QV(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const Fl=tr("svg"),eq=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,I1=/[ ,]+/,tq=/^(\w+)\((.*)\)/;function nq(n,e){const t=Fl.createSVGPoint();return t.x=n,t.y=e,t}function ut(n){const e=Fl.createSVGMatrix();if(n!=null){const t=n,r=e;for(const i in t)r[i]=t[i]}return e}function Io(n){return n!=null?(n instanceof DOMMatrix||(n=ut(n)),Fl.createSVGTransformFromMatrix(n)):Fl.createSVGTransform()}function $o(n){let e=ut();const t=n!=null&&n.match(eq);if(!t)return e;for(let r=0,i=t.length;r<i;r+=1){const o=t[r].match(tq);if(o){let a,l,c,u,h,f=ut();const d=o[2].split(I1);switch(o[1].toLowerCase()){case"scale":a=parseFloat(d[0]),l=d[1]===void 0?a:parseFloat(d[1]),f=f.scaleNonUniform(a,l);break;case"translate":c=parseFloat(d[0]),u=parseFloat(d[1]),f=f.translate(c,u);break;case"rotate":h=parseFloat(d[0]),c=parseFloat(d[1])||0,u=parseFloat(d[2])||0,c!==0||u!==0?f=f.translate(c,u).rotate(h).translate(-c,-u):f=f.rotate(h);break;case"skewx":h=parseFloat(d[0]),f=f.skewX(h);break;case"skewy":h=parseFloat(d[0]),f=f.skewY(h);break;case"matrix":f.a=parseFloat(d[0]),f.b=parseFloat(d[1]),f.c=parseFloat(d[2]),f.d=parseFloat(d[3]),f.e=parseFloat(d[4]),f.f=parseFloat(d[5]);break;default:continue}e=e.multiply(f)}}return e}function ps(n){const e=n||{},t=e.a!=null?e.a:1,r=e.b!=null?e.b:0,i=e.c!=null?e.c:0,s=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${r},${i},${s},${o},${a})`}function Vl(n){let e,t,r;if(n){const s=I1;if(n.trim().indexOf("matrix")>=0){const o=$o(n),a=rq(o);e=[a.translateX,a.translateY],t=[a.rotation],r=[a.scaleX,a.scaleY];const l=[];(e[0]!==0||e[1]!==0)&&l.push(`translate(${e.join(",")})`),(r[0]!==1||r[1]!==1)&&l.push(`scale(${r.join(",")})`),t[0]!==0&&l.push(`rotate(${t[0]})`),n=l.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(s));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(s));const l=n.match(/scale\((.*?)\)/);l&&(r=l[1].split(s))}}const i=r&&r[0]?parseFloat(r[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:i,sy:r&&r[1]?parseFloat(r[1]):i}}}function ef(n,e){const t=e.x*n.a+e.y*n.c+0,r=e.x*n.b+e.y*n.d+0;return{x:t,y:r}}function rq(n){const e=ef(n,{x:0,y:1}),t=ef(n,{x:1,y:0}),r=180/Math.PI*Math.atan2(e.y,e.x)-90,i=180/Math.PI*Math.atan2(t.y,t.x);return{skewX:r,skewY:i,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:r}}function iq(n){let e,t,r,i;return n?(e=n.a==null?1:n.a,i=n.d==null?1:n.d,t=n.b,r=n.c):e=i=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:r?Math.sqrt(r*r+i*i):i}}function sq(n){let e={x:0,y:1};n&&(e=ef(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function oq(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function ms(n,e,t={}){if(e==null)return $o(fe(n,"transform"));if(t.absolute){n.setAttribute("transform",ps(e));return}const r=n.transform,i=Io(e);r.baseVal.appendItem(i)}function $1(n,e,t=0,r={}){let i=fe(n,"transform");const s=Vl(i);if(e==null)return s.translation;i=s.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const o=r.absolute?e:s.translation.tx+e,a=r.absolute?t:s.translation.ty+t,l=`translate(${o},${a})`;n.setAttribute("transform",`${l} ${i}`.trim())}function tf(n,e,t,r,i={}){let s=fe(n,"transform");const o=Vl(s);if(e==null)return o.rotation;s=o.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=i.absolute?e:o.rotation.angle+e,l=t!=null&&r!=null?`,${t},${r}`:"",c=`rotate(${a}${l})`;n.setAttribute("transform",`${s} ${c}`.trim())}function nf(n,e,t){let r=fe(n,"transform");const i=Vl(r);if(e==null)return i.scale;t=t==null?e:t,r=i.raw,r=r.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${t})`;n.setAttribute("transform",`${r} ${s}`.trim())}function Lo(n,e){if(Mr(e)&&Mr(n)){const t=e.getScreenCTM(),r=n.getScreenCTM();if(t&&r)return t.inverse().multiply(r)}return ut()}function aq(n,e){let t=ut();if(Mr(e)&&Mr(n)){let r=n;const i=[];for(;r&&r!==e;){const s=r.getAttribute("transform")||null,o=$o(s);i.push(o),r=r.parentNode}i.reverse().forEach(s=>{t=t.multiply(s)})}return t}function lq(n,e,t){const r=n instanceof SVGSVGElement?n:n.ownerSVGElement,i=r.createSVGPoint();i.x=e,i.y=t;try{const s=r.getScreenCTM(),o=i.matrixTransform(s.inverse()),a=Lo(n,r).inverse();return o.matrixTransform(a)}catch(s){return i}}var rn;(function(n){const e={};function t(s){return e[s]||{}}n.get=t;function r(s,o){e[s]=o}n.register=r;function i(s){delete e[s]}n.unregister=i})(rn||(rn={}));var Si;(function(n){const e=new WeakMap;function t(s){return e.has(s)||e.set(s,{events:Object.create(null)}),e.get(s)}n.ensure=t;function r(s){return e.get(s)}n.get=r;function i(s){return e.delete(s)}n.remove=i})(Si||(Si={}));var ie;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(i){i.stopPropagation()}n.stopPropagationCallback=e;function t(i,s,o){i.addEventListener!=null&&i.addEventListener(s,o)}n.addEventListener=t;function r(i,s,o){i.removeEventListener!=null&&i.removeEventListener(s,o)}n.removeEventListener=r})(ie||(ie={})),function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function r(a){return(a||"").match(e)||[""]}n.splitType=r;function i(a){const l=t.exec(a)||[];return{originType:l[1]?l[1].trim():l[1],namespaces:l[2]?l[2].split(".").map(c=>c.trim()).sort():[]}}n.normalizeType=i;function s(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=s;function o(a,l){if(l){const c=a;return c.querySelector!=null&&c.querySelector(l)!=null}return!0}n.isValidSelector=o}(ie||(ie={})),function(n){let e=0;const t=new WeakMap;function r(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=r;function i(a){return t.get(a)}n.getHandlerId=i;function s(a){return t.delete(a)}n.removeHandlerId=s;function o(a,l){return t.set(a,l)}n.setHandlerId=o}(ie||(ie={})),function(n){function e(t,r){const i=[],s=Si.get(t),o=s&&s.events&&s.events[r.type],a=o&&o.handlers||[],l=o?o.delegateCount:0;if(l>0&&!(r.type==="click"&&typeof r.button=="number"&&r.button>=1)){for(let c=r.target;c!==t;c=c.parentNode||t)if(c.nodeType===1&&!(r.type==="click"&&c.disabled===!0)){const u=[],h={};for(let f=0;f<l;f+=1){const d=a[f],g=d.selector;if(g!=null&&h[g]==null){const p=t,b=[];p.querySelectorAll(g).forEach(m=>{b.push(m)}),h[g]=b.includes(c)}h[g]&&u.push(d)}u.length&&i.push({elem:c,handlers:u})}}return l<a.length&&i.push({elem:t,handlers:a.slice(l)}),i}n.getHandlerQueue=e}(ie||(ie={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ie||(ie={})),function(n){function e(t,r){const i=t.nodeType===9?t.documentElement:t,s=r&&r.parentNode;return t===s||!!(s&&s.nodeType===1&&(i.contains?i.contains(s):t.compareDocumentPosition&&t.compareDocumentPosition(s)&16))}n.contains=e}(ie||(ie={}));class Fn{constructor(e,t){this.isDefaultPrevented=ie.returnFalse,this.isPropagationStopped=ie.returnFalse,this.isImmediatePropagationStopped=ie.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const r=this.originalEvent;this.isDefaultPrevented=ie.returnTrue,r&&!this.isSimulated&&r.preventDefault()},this.stopPropagation=()=>{const r=this.originalEvent;this.isPropagationStopped=ie.returnTrue,r&&!this.isSimulated&&r.stopPropagation()},this.stopImmediatePropagation=()=>{const r=this.originalEvent;this.isImmediatePropagationStopped=ie.returnTrue,r&&!this.isSimulated&&r.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ie.returnTrue:ie.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(Fn||(Fn={})),function(n){function e(t,r){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof r=="function"?function(){if(this.originalEvent)return r(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(i){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:i})}})}n.addProperty=e}(Fn||(Fn={})),function(n){const e={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(e).forEach(t=>n.addProperty(t,e[t]))}(Fn||(Fn={})),function(n){rn.register("load",{noBubble:!0})}(),function(n){rn.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){rn.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!ie.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseover"),r}}),rn.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!ie.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseout"),r}})}();var cq=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Ro;(function(n){let e;function t(o,a,l,c,u){if(!ie.isValidTarget(o))return;let h;if(typeof l!="function"){const{handler:p,selector:b}=l,m=cq(l,["handler","selector"]);l=p,u=b,h=m}const f=Si.ensure(o);let d=f.handler;d==null&&(d=f.handler=function(p,...b){return e!==p.type?i(o,p,...b):void 0});const g=ie.ensureHandlerId(l);ie.splitType(a).forEach(p=>{const{originType:b,namespaces:m}=ie.normalizeType(p);if(!b)return;let v=b,y=rn.get(v);v=(u?y.delegateType:y.bindType)||v,y=rn.get(v);const w=Object.assign({type:v,originType:b,data:c,selector:u,guid:g,handler:l,namespace:m.join(".")},h),x=f.events;let C=x[v];C||(C=x[v]={handlers:[],delegateCount:0},(!y.setup||y.setup(o,c,m,d)===!1)&&ie.addEventListener(o,v,d)),y.add&&(ie.removeHandlerId(w.handler),y.add(o,w),ie.setHandlerId(w.handler,g)),u?(C.handlers.splice(C.delegateCount,0,w),C.delegateCount+=1):C.handlers.push(w)})}n.on=t;function r(o,a,l,c,u){const h=Si.get(o);if(!h)return;const f=h.events;f&&(ie.splitType(a).forEach(d=>{const{originType:g,namespaces:p}=ie.normalizeType(d);if(!g){Object.keys(f).forEach(x=>{r(o,x+d,l,c,!0)});return}let b=g;const m=rn.get(b);b=(c?m.delegateType:m.bindType)||b;const v=f[b];if(!v)return;const y=p.length>0?new RegExp(`(^|\\.)${p.join("\\.(?:.*\\.|)")}(\\.|$)`):null,w=v.handlers.length;for(let x=v.handlers.length-1;x>=0;x-=1){const C=v.handlers[x];(u||g===C.originType)&&(!l||ie.getHandlerId(l)===C.guid)&&(y==null||C.namespace&&y.test(C.namespace))&&(c==null||c===C.selector||c==="**"&&C.selector)&&(v.handlers.splice(x,1),C.selector&&(v.delegateCount-=1),m.remove&&m.remove(o,C))}w&&v.handlers.length===0&&((!m.teardown||m.teardown(o,p,h.handler)===!1)&&ie.removeEventListener(o,b,h.handler),delete f[b])}),Object.keys(f).length===0&&Si.remove(o))}n.off=r;function i(o,a,...l){const c=Fn.create(a);c.delegateTarget=o;const u=rn.get(c.type);if(u.preDispatch&&u.preDispatch(o,c)===!1)return;const h=ie.getHandlerQueue(o,c);for(let f=0,d=h.length;f<d&&!c.isPropagationStopped();f+=1){const g=h[f];c.currentTarget=g.elem;for(let p=0,b=g.handlers.length;p<b&&!c.isImmediatePropagationStopped();p+=1){const m=g.handlers[p];if(c.rnamespace==null||m.namespace&&c.rnamespace.test(m.namespace)){c.handleObj=m,c.data=m.data;const v=rn.get(m.originType).handle,y=v?v(g.elem,c,...l):m.handler.call(g.elem,c,...l);y!==void 0&&(c.result=y,y===!1&&(c.preventDefault(),c.stopPropagation()))}}}return u.postDispatch&&u.postDispatch(o,c),c.result}n.dispatch=i;function s(o,a,l,c){let u=o,h=typeof o=="string"?o:o.type,f=typeof o=="string"||u.namespace==null?[]:u.namespace.split(".");const d=l;if(d.nodeType===3||d.nodeType===8)return;h.indexOf(".")>-1&&(f=h.split("."),h=f.shift(),f.sort());const g=h.indexOf(":")<0&&`on${h}`;u=o instanceof Fn?o:new Fn(h,typeof o=="object"?o:null),u.namespace=f.join("."),u.rnamespace=u.namespace?new RegExp(`(^|\\.)${f.join("\\.(?:.*\\.|)")}(\\.|$)`):null,u.result=void 0,u.target||(u.target=d);const p=[u];Array.isArray(a)?p.push(...a):p.push(a);const b=rn.get(h);if(!c&&b.trigger&&b.trigger(d,u,a)===!1)return;let m;const v=[d];if(!c&&!b.noBubble&&!ie.isWindow(d)){m=b.delegateType||h;let w=d,x=d.parentNode;for(;x!=null;)v.push(x),w=x,x=x.parentNode;const C=d.ownerDocument||document;if(w===C){const S=w.defaultView||w.parentWindow||window;v.push(S)}}let y=d;for(let w=0,x=v.length;w<x&&!u.isPropagationStopped();w+=1){const C=v[w];y=C,u.type=w>1?m:b.bindType||h;const S=Si.get(C);S&&S.events[u.type]&&S.handler&&S.handler.call(C,...p);const E=g&&C[g]||null;E&&ie.isValidTarget(C)&&(u.result=E.call(C,...p),u.result===!1&&u.preventDefault())}if(u.type=h,!c&&!u.isDefaultPrevented()){const w=b.preventDefault;if((w==null||w(v.pop(),u,a)===!1)&&ie.isValidTarget(d)&&g&&typeof d[h]=="function"&&!ie.isWindow(d)){const x=d[g];x&&(d[g]=null),e=h,u.isPropagationStopped()&&y.addEventListener(h,ie.stopPropagationCallback),d[h](),u.isPropagationStopped()&&y.removeEventListener(h,ie.stopPropagationCallback),e=void 0,x&&(d[g]=x)}}return u.result}n.trigger=s})(Ro||(Ro={}));var Se;(function(n){function e(s,o,a,l,c){return jo.on(s,o,a,l,c),s}n.on=e;function t(s,o,a,l,c){return jo.on(s,o,a,l,c,!0),s}n.once=t;function r(s,o,a,l){return jo.off(s,o,a,l),s}n.off=r;function i(s,o,a,l){return Ro.trigger(o,a,s,l),s}n.trigger=i})(Se||(Se={}));var jo;(function(n){function e(r,i,s,o,a,l){if(typeof i=="object"){typeof s!="string"&&(o=o||s,s=void 0),Object.keys(i).forEach(c=>e(r,c,s,o,i[c],l));return}if(o==null&&a==null?(a=s,o=s=void 0):a==null&&(typeof s=="string"?(a=o,o=void 0):(a=o,o=s,s=void 0)),a===!1)a=ie.returnFalse;else if(!a)return;if(l){const c=a;a=function(u,...h){return n.off(r,u),c.call(this,u,...h)},ie.setHandlerId(a,ie.ensureHandlerId(c))}Ro.on(r,i,a,o,s)}n.on=e;function t(r,i,s,o){const a=i;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;t(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof i=="object"){const l=i;Object.keys(l).forEach(c=>t(r,c,s,l[c]));return}(s===!1||typeof s=="function")&&(o=s,s=void 0),o===!1&&(o=ie.returnFalse),Ro.off(r,i,o,s)}n.off=t})(jo||(jo={}));class L1{constructor(e,t,r){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=nn.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,this.onWheelGuard=r,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function Do(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function uq(n){return n.getBoundingClientRect().width}function hq(n){return n.getBoundingClientRect().height}function fq(n){const e=Rl(n,"position")==="fixed";let t;if(e){const r=n.getBoundingClientRect();t={left:r.left,top:r.top}}else t=Do(n);if(!e){const r=n.ownerDocument;let i=n.offsetParent||r.documentElement;for(;(i===r.body||i===r.documentElement)&&Rl(i,"position")==="static";)i=i.parentNode;if(i!==n&&MV(i)){const s=Do(i);t.top-=s.top+jl(i,"borderTopWidth"),t.left-=s.left+jl(i,"borderLeftWidth")}}return{top:t.top-jl(n,"marginTop"),left:t.left-jl(n,"marginLeft")}}function R1(n,e=60){let t=null;return(...r)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,r)},e)}}function dq(n){let e=null,t=[];const r=()=>{if(getComputedStyle(n).position==="static"){const c=n.style;c.position="relative"}const l=document.createElement("object");return l.onload=()=>{l.contentDocument.defaultView.addEventListener("resize",i),i()},l.style.display="block",l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.height="100%",l.style.width="100%",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="-1",l.style.opacity="0",l.setAttribute("tabindex","-1"),l.type="text/html",n.appendChild(l),l.data="about:blank",l},i=R1(()=>{t.forEach(l=>l(n))}),s=l=>{e||(e=r()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",i),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:s,destroy:o,unbind:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),t.length===0&&e&&o()}}}function gq(n){let e=null,t=[];const r=R1(()=>{t.forEach(l=>{l(n)})}),i=()=>{const l=new ResizeObserver(r);return l.observe(n),r(),l},s=l=>{e||(e=i()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:s,destroy:o,unbind:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),t.length===0&&e&&o()}}}const pq=typeof ResizeObserver!="undefined"?gq:dq;var ql;(function(n){const e=new WeakMap;function t(i){let s=e.get(i);return s||(s=pq(i),e.set(i,s),s)}function r(i){i.destroy(),e.delete(i.element)}n.bind=(i,s)=>{const o=t(i);return o.bind(s),()=>o.unbind(s)},n.clear=i=>{const s=t(i);r(s)}})(ql||(ql={}));class Bo{constructor(e={}){this.comparator=e.comparator||Bo.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,r){const i={priority:e,value:t},s=this.data.length;return r&&(i.id=r,this.index[r]=s),this.data.push(i),this.bubbleUp(s),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,t){const r=this.index[e];if(typeof r=="undefined")throw new Error(`Node with id '${e}' was not found in the heap.`);const i=this.data,s=i[r].priority,o=this.comparator(t,s);o<0?(i[r].priority=t,this.bubbleUp(r)):o>0&&(i[r].priority=t,this.bubbleDown(r))}remove(){const e=this.data,t=e[0],r=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=r,r.id&&(this.index[r.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let r,i,s=e;for(;s>0&&(i=s-1>>>1,this.comparator(t[s].priority,t[i].priority)<0);){r=t[i],t[i]=t[s];let o=t[s].id;o!=null&&(this.index[o]=i),t[s]=r,o=t[s].id,o!=null&&(this.index[o]=s),s=i}}bubbleDown(e){const t=this.data,r=t.length-1;let i=e;for(;;){const s=(i<<1)+1,o=s+1;let a=i;if(s<=r&&this.comparator(t[s].priority,t[a].priority)<0&&(a=s),o<=r&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==i){const l=t[a];t[a]=t[i];let c=t[i].id;c!=null&&(this.index[c]=a),t[i]=l,c=t[i].id,c!=null&&(this.index[c]=i),i=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(Bo||(Bo={}));var rf;(function(n){function e(t,r,i=(s,o)=>1){const s={},o={},a={},l=new Bo;for(s[r]=0,Object.keys(t).forEach(c=>{c!==r&&(s[c]=1/0),l.insert(s[c],c,c)});!l.isEmpty();){const c=l.remove();a[c]=!0;const u=t[c]||[];for(let h=0;h<u.length;h+=1){const f=u[h];if(!a[f]){const d=s[c]+i(c,f);d<s[f]&&(s[f]=d,o[f]=c,l.updatePriority(f,d))}}}return o}n.run=e})(rf||(rf={}));class rr{constructor(e,t,r,i){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,r,i);if(typeof e=="string")return rr.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,r){this.set(e.r+(t.r-e.r)*r,e.g+(t.g-e.g)*r,e.b+(t.b-e.b)*r,e.a+(t.a-e.a)*r)}lighten(e){const t=rr.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,r,i){const s=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:r,l=Array.isArray(e)?e[3]:i;return this.r=Math.round(en(s,0,255)),this.g=Math.round(en(o,0,255)),this.b=Math.round(en(a,0,255)),this.a=l==null?1:en(l,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const r=this[t].toString(16);return r.length<2?`0${r}`:r}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return rr.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return rr.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function e(y){return new n(y)}n.fromArray=e;function t(y){return new n([...g(y),1])}n.fromHex=t;function r(y){const w=y.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(w){const x=w[1].split(/\s*,\s*/).map(C=>parseInt(C,10));return new n(x)}return null}n.fromRGBA=r;function i(y,w,x){x<0&&++x,x>1&&--x;const C=6*x;return C<1?y+(w-y)*C:2*x<1?w:3*x<2?y+(w-y)*(2/3-x)*6:y}function s(y){const w=y.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(w){const x=w[2].split(/\s*,\s*/),C=(parseFloat(x[0])%360+360)%360/360,S=parseFloat(x[1])/100,E=parseFloat(x[2])/100,A=x[3]==null?1:parseInt(x[3],10);return new n(c(C,S,E,A))}return null}n.fromHSLA=s;function o(y){if(y.startsWith("#"))return t(y);if(y.startsWith("rgb"))return r(y);const w=n.named[y];return w?t(w):s(y)}n.fromString=o;function a(y,w){return n.fromArray([y,y,y,w])}n.makeGrey=a;function l(y,w,x,C){const S=Array.isArray(y)?y[0]:y,E=Array.isArray(y)?y[1]:w,A=Array.isArray(y)?y[2]:x,M=Array.isArray(y)?y[3]:C,O=Math.max(S,E,A),I=Math.min(S,E,A),q=(O+I)/2;let U=0,T=0;if(I!==O){const k=O-I;switch(T=q>.5?k/(2-O-I):k/(O+I),O){case S:U=(E-A)/k+(E<A?6:0);break;case E:U=(A-S)/k+2;break;case A:U=(S-E)/k+4;break}U/=6}return[U,T,q,M==null?1:M]}n.rgba2hsla=l;function c(y,w,x,C){const S=Array.isArray(y)?y[0]:y,E=Array.isArray(y)?y[1]:w,A=Array.isArray(y)?y[2]:x,M=Array.isArray(y)?y[3]:C,O=A<=.5?A*(E+1):A+E-A*E,I=2*A-O;return[i(I,O,S+1/3)*256,i(I,O,S)*256,i(I,O,S-1/3)*256,M==null?1:M]}n.hsla2rgba=c;function u(y){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),y?void 0:parseFloat(Math.random().toFixed(2)))}n.random=u;function h(){const y="0123456789ABCDEF";let w="#";for(let x=0;x<6;x+=1)w+=y[Math.floor(Math.random()*16)];return w}n.randomHex=h;function f(y){return u(y).toString()}n.randomRGBA=f;function d(y,w){if(typeof y=="string"){const A=y[0]==="#",[M,O,I]=g(y);return w?M*.299+O*.587+I*.114>186?"#000000":"#ffffff":`${A?"#":""}${p(255-M,255-O,255-I)}`}const x=y[0],C=y[1],S=y[2],E=y[3];return w?x*.299+C*.587+S*.114>186?[0,0,0,E]:[255,255,255,E]:[255-x,255-C,255-S,E]}n.invert=d;function g(y){const w=y.indexOf("#")===0?y:`#${y}`;let x=+`0x${w.substr(1)}`;if(!(w.length===4||w.length===7)||Number.isNaN(x))throw new Error("Invalid hex color.");const C=w.length===4?4:8,S=(1<<C)-1,E=["b","g","r"].map(()=>{const A=x&S;return x>>=C,C===4?17*A:A});return[E[2],E[1],E[0]]}function p(y,w,x){const C=S=>S.length<2?`0${S}`:S;return`${C(y.toString(16))}${C(w.toString(16))}${C(x.toString(16))}`}function b(y,w){return v(y,w)}n.lighten=b;function m(y,w){return v(y,-w)}n.darken=m;function v(y,w){if(typeof y=="string"){const S=y[0]==="#",E=parseInt(S?y.substr(1):y,16),A=en((E>>16)+w,0,255),M=en((E>>8&255)+w,0,255),O=en((E&255)+w,0,255);return`${S?"#":""}${(O|M<<8|A<<16).toString(16)}`}const x=p(y[0],y[1],y[2]),C=g(v(x,w));return[C[0],C[1],C[2],y[3]]}})(rr||(rr={})),function(n){n.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(rr||(rr={}));class sf{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const r=this.map.get(e);return this.map.delete(e),r}each(e){this.arr.forEach(t=>{const r=this.map.get(t);e(r,t)})}dispose(){this.clear()}}var ir;(function(n){function e(i){const s=[],o=[];return Array.isArray(i)?s.push(...i):i.split("|").forEach(a=>{a.indexOf("&")===-1?s.push(a):o.push(...a.split("&"))}),{or:s,and:o}}n.parse=e;function t(i,s){if(i!=null&&s!=null){const o=e(i),a=e(s),l=o.or.sort(),c=a.or.sort(),u=o.and.sort(),h=a.and.sort(),f=(d,g)=>d.length===g.length&&(d.length===0||d.every((p,b)=>p===g[b]));return f(l,c)&&f(u,h)}return i==null&&s==null}n.equals=t;function r(i,s,o){if(s==null||Array.isArray(s)&&s.length===0)return o?i.altKey!==!0&&i.ctrlKey!==!0&&i.metaKey!==!0&&i.shiftKey!==!0:!0;const{or:a,and:l}=e(s),c=u=>{const h=`${u.toLowerCase()}Key`;return i[h]===!0};return a.some(u=>c(u))&&l.every(u=>c(u))}n.isMatch=r})(ir||(ir={}));var Pi;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=e=>{for(let t=0,r=1;;t+=r,r/=2)if(e>=(7-4*t)/11){const i=(11-6*t-11*e)/4;return-i*i+r*r}}})(Pi||(Pi={})),function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,r=1){return i=>{const s=e(i);return s<t?t:s>r?r:s}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}}(Pi||(Pi={})),function(n){function e(T){return-1*Math.cos(T*(Math.PI/2))+1}n.easeInSine=e;function t(T){return Math.sin(T*(Math.PI/2))}n.easeOutSine=t;function r(T){return-.5*(Math.cos(Math.PI*T)-1)}n.easeInOutSine=r;function i(T){return T*T}n.easeInQuad=i;function s(T){return T*(2-T)}n.easeOutQuad=s;function o(T){return T<.5?2*T*T:-1+(4-2*T)*T}n.easeInOutQuad=o;function a(T){return T*T*T}n.easeInCubic=a;function l(T){const k=T-1;return k*k*k+1}n.easeOutCubic=l;function c(T){return T<.5?4*T*T*T:(T-1)*(2*T-2)*(2*T-2)+1}n.easeInOutCubic=c;function u(T){return T*T*T*T}n.easeInQuart=u;function h(T){const k=T-1;return 1-k*k*k*k}n.easeOutQuart=h;function f(T){const k=T-1;return T<.5?8*T*T*T*T:1-8*k*k*k*k}n.easeInOutQuart=f;function d(T){return T*T*T*T*T}n.easeInQuint=d;function g(T){const k=T-1;return 1+k*k*k*k*k}n.easeOutQuint=g;function p(T){const k=T-1;return T<.5?16*T*T*T*T*T:1+16*k*k*k*k*k}n.easeInOutQuint=p;function b(T){return T===0?0:Math.pow(2,10*(T-1))}n.easeInExpo=b;function m(T){return T===1?1:-Math.pow(2,-10*T)+1}n.easeOutExpo=m;function v(T){if(T===0||T===1)return T;const k=T*2,Q=k-1;return k<1?.5*Math.pow(2,10*Q):.5*(-Math.pow(2,-10*Q)+2)}n.easeInOutExpo=v;function y(T){const k=T/1;return-1*(Math.sqrt(1-k*T)-1)}n.easeInCirc=y;function w(T){const k=T-1;return Math.sqrt(1-k*k)}n.easeOutCirc=w;function x(T){const k=T*2,Q=k-2;return k<1?-.5*(Math.sqrt(1-k*k)-1):.5*(Math.sqrt(1-Q*Q)+1)}n.easeInOutCirc=x;function C(T,k=1.70158){return T*T*((k+1)*T-k)}n.easeInBack=C;function S(T,k=1.70158){const Q=T/1-1;return Q*Q*((k+1)*Q+k)+1}n.easeOutBack=S;function E(T,k=1.70158){const Q=T*2,j=Q-2,z=k*1.525;return Q<1?.5*Q*Q*((z+1)*Q-z):.5*(j*j*((z+1)*j+z)+2)}n.easeInOutBack=E;function A(T,k=.7){if(T===0||T===1)return T;const j=T/1-1,z=1-k,H=z/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*j)*Math.sin((j-H)*(2*Math.PI)/z))}n.easeInElastic=A;function M(T,k=.7){const Q=1-k,j=T*2;if(T===0||T===1)return T;const z=Q/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*j)*Math.sin((j-z)*(2*Math.PI)/Q)+1}n.easeOutElastic=M;function O(T,k=.65){const Q=1-k;if(T===0||T===1)return T;const j=T*2,z=j-1,H=Q/(2*Math.PI)*Math.asin(1);return j<1?-.5*(Math.pow(2,10*z)*Math.sin((z-H)*(2*Math.PI)/Q)):Math.pow(2,-10*z)*Math.sin((z-H)*(2*Math.PI)/Q)*.5+1}n.easeInOutElastic=O;function I(T){const k=T/1;if(k<1/2.75)return 7.5625*k*k;if(k<2/2.75){const Q=k-.5454545454545454;return 7.5625*Q*Q+.75}if(k<2.5/2.75){const Q=k-.8181818181818182;return 7.5625*Q*Q+.9375}{const Q=k-.9545454545454546;return 7.5625*Q*Q+.984375}}n.easeOutBounce=I;function q(T){return 1-I(1-T)}n.easeInBounce=q;function U(T){return T<.5?q(T*2)*.5:I(T*2-1)*.5+.5}n.easeInOutBounce=U}(Pi||(Pi={}));var Ei;(function(n){n.number=(e,t)=>{const r=t-e;return i=>e+r*i},n.object=(e,t)=>{const r=Object.keys(e);return i=>{const s={};for(let o=r.length-1;o!==-1;o-=1){const a=r[o];s[a]=e[a]+(t[a]-e[a])*i}return s}},n.unit=(e,t)=>{const r=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=r.exec(e),s=r.exec(t),o=s?s[1]:"",a=i?+i[1]:0,l=s?+s[1]:0,c=o.indexOf("."),u=c>0?o[1].length-c-1:0,h=l-a,f=i?i[2]:"";return d=>(a+h*d).toFixed(u)+f},n.color=(e,t)=>{const r=parseInt(e.slice(1),16),i=parseInt(t.slice(1),16),s=r&255,o=(i&255)-s,a=r&65280,l=(i&65280)-a,c=r&16711680,u=(i&16711680)-c;return h=>{const f=s+o*h&255,d=a+l*h&65280,g=c+u*h&16711680;return`#${(1<<24|f|d|g).toString(16).slice(1)}`}}})(Ei||(Ei={}));const zo=[];function Fo(n,e){const t=zo.find(r=>r.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!nn.isApplyingHMR()){const r=document.createElement("style");r.setAttribute("type","text/css"),r.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(r,i.firstChild),zo.push({name:n,loadTimes:1,styleElement:r})}}function Vo(n){const e=zo.findIndex(t=>t.name===n);if(e>-1){const t=zo[e];if(t.loadTimes-=1,t.loadTimes>0)return;let r=t.styleElement;r&&r.parentNode&&r.parentNode.removeChild(r),r=null,zo.splice(e,1)}}var ve;(function(n){function e(r){return 180*r/Math.PI%360}n.toDeg=e,n.toRad=function(r,i=!1){return(i?r:r%360)*Math.PI/180};function t(r){return r%360+(r<0?360:0)}n.normalize=t})(ve||(ve={}));var we;(function(n){function e(a,l=0){return Number.isInteger(a)?a:+a.toFixed(l)}n.round=e;function t(a,l){let c,u;if(l==null?(u=a==null?1:a,c=0):(u=l,c=a==null?0:a),u<c){const h=c;c=u,u=h}return Math.floor(Math.random()*(u-c+1)+c)}n.random=t;function r(a,l,c){return Number.isNaN(a)?NaN:Number.isNaN(l)||Number.isNaN(c)?0:l<c?a<l?l:a>c?c:a:a<c?c:a>l?l:a}n.clamp=r;function i(a,l){return l*Math.round(a/l)}n.snapToGrid=i;function s(a,l){return l!=null&&a!=null&&l.x>=a.x&&l.x<=a.x+a.width&&l.y>=a.y&&l.y<=a.y+a.height}n.containsPoint=s;function o(a,l){const c=a.x-l.x,u=a.y-l.y;return c*c+u*u}n.squaredLength=o})(we||(we={}));class _r{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class P extends _r{constructor(e,t){super(),this.x=e==null?0:e,this.y=t==null?0:t}round(e=0){return this.x=we.round(this.x,e),this.y=we.round(this.y,e),this}add(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}update(e,t){const r=P.create(e,t);return this.x=r.x,this.y=r.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}rotate(e,t){const r=P.rotate(this,e,t);return this.x=r.x,this.y=r.y,this}scale(e,t,r=new P){const i=P.create(r);return this.x=i.x+e*(this.x-i.x),this.y=i.y+t*(this.y-i.y),this}closest(e){if(e.length===1)return P.create(e[0]);let t=null,r=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<r&&(t=i,r=s)}),t?P.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=P.create(e),r=this.x-t.x,i=this.y-t.y;return r*r+i*i}manhattanDistance(e){const t=P.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new P){const t=P.create(e),r=-(t.y-this.y),i=t.x-this.x;let s=Math.atan2(r,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let r=this.theta(t)-this.theta(e);return r<0&&(r+=360),r}vectorAngle(e){return new P(0,0).angleBetween(this,e)}toPolar(e){return this.update(P.toPolar(this,e)),this}changeInAngle(e,t,r=new P){return this.clone().translate(-e,-t).theta(r)-this.theta(r)}adhereToRect(e){return we.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=P.create(e),r=ve.toRad(this.y),i=ve.toRad(t.y),s=this.x,o=t.x,a=ve.toRad(o-s),l=Math.sin(a)*Math.cos(i),c=Math.cos(r)*Math.sin(i)-Math.sin(r)*Math.cos(i)*Math.cos(a),u=ve.toDeg(Math.atan2(l,c)),h=["NE","E","SE","S","SW","W","NW","N"];let f=u-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),h[f]}cross(e,t){if(e!=null&&t!=null){const r=P.create(e),i=P.create(t);return(i.x-this.x)*(r.y-this.y)-(i.y-this.y)*(r.x-this.x)}return NaN}dot(e){const t=P.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new P(this.x-e,this.y-t);const r=P.create(e);return new P(this.x-r.x,this.y-r.y)}lerp(e,t){const r=P.create(e);return new P((1-t)*this.x+t*r.x,(1-t)*this.y+t*r.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const r=P.create(e),i=ve.toRad(r.theta(this));return this.translate(Math.cos(i)*t,-Math.sin(i)*t)}reflection(e){return P.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=we.snapToGrid(this.x,e),this.y=we.snapToGrid(this.y,t==null?e:t),this}equals(e){const t=P.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return P.clone(this)}toJSON(){return P.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(P||(P={})),function(n){function e(r){return r!=null&&typeof r=="object"&&typeof r.x=="number"&&typeof r.y=="number"}n.isPointLike=e;function t(r){return r!=null&&Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}n.isPointData=t}(P||(P={})),function(n){function e(h,f){return h==null||typeof h=="number"?new n(h,f):t(h)}n.create=e;function t(h){return n.isPoint(h)?new n(h.x,h.y):Array.isArray(h)?new n(h[0],h[1]):new n(h.x,h.y)}n.clone=t;function r(h){return n.isPoint(h)?{x:h.x,y:h.y}:Array.isArray(h)?{x:h[0],y:h[1]}:{x:h.x,y:h.y}}n.toJSON=r;function i(h,f,d=new n){let g=Math.abs(h*Math.cos(f)),p=Math.abs(h*Math.sin(f));const b=t(d),m=ve.normalize(ve.toDeg(f));return m<90?p=-p:m<180?(g=-g,p=-p):m<270&&(g=-g),new n(b.x+g,b.y+p)}n.fromPolar=i;function s(h,f=new n){const d=t(h),g=t(f),p=d.x-g.x,b=d.y-g.y;return new n(Math.sqrt(p*p+b*b),ve.toRad(g.theta(d)))}n.toPolar=s;function o(h,f){return h===f?!0:h!=null&&f!=null?h.x===f.x&&h.y===f.y:!1}n.equals=o;function a(h,f){if(h==null&&f!=null||h!=null&&f==null||h!=null&&f!=null&&h.length!==f.length)return!1;if(h!=null&&f!=null){for(let d=0,g=h.length;d<g;d+=1)if(!o(h[d],f[d]))return!1}return!0}n.equalPoints=a;function l(h,f,d,g){return new n(we.random(h,f),we.random(d,g))}n.random=l;function c(h,f,d){const g=ve.toRad(ve.normalize(-f)),p=Math.sin(g),b=Math.cos(g);return u(h,b,p,d)}n.rotate=c;function u(h,f,d,g=new n){const p=t(h),b=t(g),m=p.x-b.x,v=p.y-b.y,y=m*f-v*d,w=v*f+m*d;return new n(y+b.x,w+b.y)}n.rotateEx=u}(P||(P={}));class D extends _r{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new P(this.x,this.y)}get topLeft(){return new P(this.x,this.y)}get topCenter(){return new P(this.x+this.width/2,this.y)}get topRight(){return new P(this.x+this.width,this.y)}get center(){return new P(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new P(this.x,this.y+this.height)}get bottomCenter(){return new P(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new P(this.x+this.width,this.y+this.height)}get corner(){return new P(this.x+this.width,this.y+this.height)}get rightMiddle(){return new P(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new P(this.x,this.y+this.height/2)}get topLine(){return new F(this.topLeft,this.topRight)}get rightLine(){return new F(this.topRight,this.bottomRight)}get bottomLine(){return new F(this.bottomLeft,this.bottomRight)}get leftLine(){return new F(this.topLeft,this.bottomLeft)}constructor(e,t,r,i){super(),this.x=e==null?0:e,this.y=t==null?0:t,this.width=r==null?0:r,this.height=i==null?0:i}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const t=ve.toRad(e),r=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t)),s=this.width*i+this.height*r,o=this.width*r+this.height*i;return new D(this.x+(this.width-s)/2,this.y+(this.height-o)/2,s,o)}round(e=0){return this.x=we.round(this.x,e),this.y=we.round(this.y,e),this.width=we.round(this.width,e),this.height=we.round(this.height,e),this}add(e,t,r,i){const s=D.create(e,t,r,i),o=Math.min(this.x,s.x),a=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),c=Math.max(this.y+this.height,s.y+s.height);return this.x=o,this.y=a,this.width=l-o,this.height=c-a,this}update(e,t,r,i){const s=D.create(e,t,r,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,t){const r=e,i=t!=null?t:e;return this.x-=r,this.y-=i,this.width+=2*r,this.height+=2*i,this}snapToGrid(e,t){const r=this.origin.snapToGrid(e,t),i=this.corner.snapToGrid(e,t);return this.x=r.x,this.y=r.y,this.width=i.x-r.x,this.height=i.y-r.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}scale(e,t,r=new P){const i=this.origin.scale(e,t,r);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const r=ve.toRad(e),i=Math.cos(r),s=Math.sin(r);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();o=P.rotateEx(o,i,s,t),a=P.rotateEx(a,i,s,t),l=P.rotateEx(l,i,s,t),c=P.rotateEx(c,i,s,t);const u=new D(o.x,o.y,0,0);u.add(a.x,a.y,0,0),u.add(l.x,l.y,0,0),u.add(c.x,c.y,0,0),this.update(u)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=D.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const r=D.clone(e),i=t.x,s=t.y;let o=1/0,a=1/0,l=1/0,c=1/0,u=1/0,h=1/0,f=1/0,d=1/0;const g=r.topLeft;g.x<i&&(o=(this.x-i)/(g.x-i)),g.y<s&&(u=(this.y-s)/(g.y-s));const p=r.bottomRight;p.x>i&&(a=(this.x+this.width-i)/(p.x-i)),p.y>s&&(h=(this.y+this.height-s)/(p.y-s));const b=r.topRight;b.x>i&&(l=(this.x+this.width-i)/(b.x-i)),b.y<s&&(f=(this.y-s)/(b.y-s));const m=r.bottomLeft;return m.x<i&&(c=(this.x-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s)),{sx:Math.min(o,a,l,c),sy:Math.min(u,h,f,d)}}getMaxUniformScaleToFit(e,t=this.center){const r=this.getMaxScaleToFit(e,t);return Math.min(r.sx,r.sy)}containsPoint(e,t){return we.containsPoint(this,P.create(e,t))}containsRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.x,a=this.y,l=this.width,c=this.height,u=s.x,h=s.y,f=s.width,d=s.height;return l===0||c===0||f===0||d===0?!1:u>=o&&h>=a&&u+f<=o+l&&h+d<=a+c}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],r=[],i=[];return t.forEach(s=>{const o=e.intersectsWithLine(s);o!==null&&i.indexOf(o.toString())<0&&(r.push(o),i.push(o.toString()))}),r.length>0?r:null}intersectsWithLineFromCenterToPoint(e,t){const r=P.clone(e),i=this.center;let s=null;t!=null&&t!==0&&r.rotate(t,i);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new F(i,r);for(let l=o.length-1;l>=0;l-=1){const c=o[l].intersectsWithLine(a);if(c!==null){s=c;break}}return s&&t!=null&&t!==0&&s.rotate(-t,i),s}intersectsWithRect(e,t,r,i){const s=D.create(e,t,r,i);if(!this.isIntersectWithRect(s))return null;const o=this.origin,a=this.corner,l=s.origin,c=s.corner,u=Math.max(o.x,l.x),h=Math.max(o.y,l.y);return new D(u,h,Math.min(a.x,c.x)-u,Math.min(a.y,c.y)-h)}isIntersectWithRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.origin,a=this.corner,l=s.origin,c=s.corner;return!(c.x<=o.x||c.y<=o.y||l.x>=a.x||l.y>=a.y)}normalize(){let e=this.x,t=this.y,r=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,r=-this.width),this.height<0&&(t=this.y+this.height,i=-this.height),this.x=e,this.y=t,this.width=r,this.height=i,this}union(e){const t=D.clone(e),r=this.origin,i=this.corner,s=t.origin,o=t.corner,a=Math.min(r.x,s.x),l=Math.min(r.y,s.y),c=Math.max(i.x,o.x),u=Math.max(i.y,o.y);return new D(a,l,c-a,u-l)}getNearestSideToPoint(e){const t=P.clone(e),r=t.x-this.x,i=this.x+this.width-t.x,s=t.y-this.y,o=this.y+this.height-t.y;let a=r,l="left";return i<a&&(a=i,l="right"),s<a&&(a=s,l="top"),o<a&&(l="bottom"),l}getNearestPointToPoint(e){const t=P.clone(e);if(this.containsPoint(t)){const r=this.getNearestSideToPoint(t);if(r==="left")return new P(this.x,t.y);if(r==="top")return new P(t.x,this.y);if(r==="right")return new P(this.x+this.width,t.y);if(r==="bottom")return new P(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new D(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isRectangle=e})(D||(D={})),function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e}(D||(D={})),function(n){function e(o,a,l,c){return o==null||typeof o=="number"?new n(o,a,l,c):t(o)}n.create=e;function t(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=t;function r(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=r;function i(o){return new n(0,0,o.width,o.height)}n.fromSize=i;function s(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=s}(D||(D={}));class F extends _r{get center(){return new P((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,r,i){super(),typeof e=="number"&&typeof t=="number"?(this.start=new P(e,t),this.end=new P(r,i)):(this.start=P.create(e),this.end=P.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,r){return this.start.scale(e,t,r),this.end.scale(e,t,r),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const r=e/t;return this.scale(r,r,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:r,end:i}=t,s=r.clone().rotate(270,i),o=i.clone().rotate(90,r);return r.move(o,e),i.move(s,e),t}vector(){return new P(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new P(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=Math.min(this.start.y,this.end.y),r=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new D(e,t,r-e,i-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new F(this.start,e).vector()),r=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(r)?0:r}pointAt(e){const t=this.start,r=this.end;return e<=0?t.clone():e>=1?r.clone():t.lerp(r,e)}pointAtLength(e){const t=this.start,r=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?r.clone():t.clone();const o=(i?e:s-e)/s;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new F(this.start,t),new F(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new F(this.start,t),new F(t,this.end)]}containsPoint(e){const t=this.start,r=this.end;if(t.cross(e,r)!==0)return!1;const i=this.length();return!(new F(t,e).length()>i||new F(e,r).length()>i)}intersect(e,t){const r=e.intersectsWithLine(this,t);return r?Array.isArray(r)?r:[r]:null}intersectsWithLine(e){const t=new P(this.end.x-this.start.x,this.end.y-this.start.y),r=new P(e.end.x-e.start.x,e.end.y-e.start.y),i=t.x*r.y-t.y*r.x,s=new P(e.start.x-this.start.x,e.start.y-this.start.y),o=s.x*r.y-s.y*r.x,a=s.x*t.y-s.y*t.x;if(i===0||o*i<0||a*i<0)return null;if(i>0){if(o>i||a>i)return null}else if(o<i||a<i)return null;return new P(this.start.x+o*t.x/i,this.start.y+o*t.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=P.clone(e),r=this.start,i=this.end;return((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x))/this.length()}pointSquaredDistance(e,t){const r=P.create(e,t);return this.closestPoint(r).squaredDistance(r)}pointDistance(e,t){const r=P.create(e,t);return this.closestPoint(r).distance(r)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAt(e),s=new F(t,r);return s.translate(i.x-t.x,i.y-t.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAtLength(e),s=new F(t,r);return s.translate(i.x-t.x,i.y-t.y),s}relativeCcw(e,t){const r=P.create(e,t);let i=r.x-this.start.x,s=r.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=i*a-s*o;return l===0&&(l=i*o+s*a,l>0&&(i-=o,s-=a,l=i*o+s*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new F(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isLine=e})(F||(F={}));class xn extends _r{get center(){return new P(this.x,this.y)}constructor(e,t,r,i){super(),this.x=e==null?0:e,this.y=t==null?0:t,this.a=r==null?0:r,this.b=i==null?0:i}bbox(){return D.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const r=e,i=t!=null?t:e;return this.a+=2*r,this.b+=2*i,this}normalizedDistance(e,t){const r=P.create(e,t),i=r.x-this.x,s=r.y-this.y,o=this.a,a=this.b;return i*i/(o*o)+s*s/(a*a)}containsPoint(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],r=this.a,i=this.b,s=e.start,o=e.end,a=e.vector(),l=s.diff(new P(this.x,this.y)),c=new P(a.x/(r*r),a.y/(i*i)),u=new P(l.x/(r*r),l.y/(i*i)),h=a.dot(c),f=a.dot(u),d=l.dot(u)-1,g=f*f-h*d;if(g<0)return null;if(g>0){const p=Math.sqrt(g),b=(-f-p)/h,m=(-f+p)/h;if((b<0||b>1)&&(m<0||m>1))return null;b>=0&&b<=1&&t.push(s.lerp(o,b)),m>=0&&m<=1&&t.push(s.lerp(o,m))}else{const p=-f/h;if(p>=0&&p<=1)t.push(s.lerp(o,p));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const r=P.clone(e);t&&r.rotate(t,this.getCenter());const i=r.x-this.x,s=r.y-this.y;let o;if(i===0)return o=this.bbox().getNearestPointToPoint(r),t?o.rotate(-t,this.getCenter()):o;const a=s/i,l=a*a,c=this.a*this.a,u=this.b*this.b;let h=Math.sqrt(1/(1/c+l/u));h=i<0?-h:h;const f=a*h;return o=new P(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=P.clone(e),r=t.x,i=t.y,s=this.a,o=this.b,a=this.bbox().center,l=a.x,c=a.y,u=30,h=r>a.x+s/2,f=r<a.x-s/2;let d,g;return h||f?(g=r>a.x?i-u:i+u,d=s*s/(r-l)-s*s*(i-c)*(g-c)/(o*o*(r-l))+l):(d=i>a.y?r+u:r-u,g=o*o/(i-c)-o*o*(r-l)*(d-l)/(s*s*(i-c))+c),new P(d,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const r=D.fromEllipse(this);r.rotate(e,t);const i=xn.fromRect(r);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new xn(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isEllipse=e})(xn||(xn={})),function(n){function e(i,s,o,a){return i==null||typeof i=="number"?new n(i,s,o,a):t(i)}n.create=e;function t(i){return n.isEllipse(i)?i.clone():Array.isArray(i)?new n(i[0],i[1],i[2],i[3]):new n(i.x,i.y,i.a,i.b)}n.parse=t;function r(i){const s=i.center;return new n(s.x,s.y,i.width/2,i.height/2)}n.fromRect=r}(xn||(xn={}));const mq=new RegExp("^[\\s\\dLMCZz,.]*$");function yq(n){return typeof n!="string"?!1:mq.test(n)}function of(n,e){return(n%e+e)%e}function vq(n,e,t,r,i){const s=[],o=n[n.length-1],a=e!=null&&e>0,l=e||0;if(r&&a){n=n.slice();const h=n[0],f=new P(o.x+(h.x-o.x)/2,o.y+(h.y-o.y)/2);n.splice(0,0,f)}let c=n[0],u=1;for(t?s.push("M",c.x,c.y):s.push("L",c.x,c.y);u<(r?n.length:n.length-1);){let h=n[of(u,n.length)],f=c.x-h.x,d=c.y-h.y;if(a&&(f!==0||d!==0)&&(i==null||i.indexOf(u-1)<0)){let g=Math.sqrt(f*f+d*d);const p=f*Math.min(l,g/2)/g,b=d*Math.min(l,g/2)/g,m=h.x+p,v=h.y+b;s.push("L",m,v);let y=n[of(u+1,n.length)];for(;u<n.length-2&&Math.round(y.x-h.x)===0&&Math.round(y.y-h.y)===0;)y=n[of(u+2,n.length)],u+=1;f=y.x-h.x,d=y.y-h.y,g=Math.max(1,Math.sqrt(f*f+d*d));const w=f*Math.min(l,g/2)/g,x=d*Math.min(l,g/2)/g,C=h.x+w,S=h.y+x;s.push("Q",h.x,h.y,C,S),h=new P(C,S)}else s.push("L",h.x,h.y);c=h,u+=1}return r?s.push("Z"):s.push("L",o.x,o.y),s.map(h=>typeof h=="string"?h:+h.toFixed(3)).join(" ")}function j1(n,e={}){const t=[];return n&&n.length&&n.forEach(r=>{Array.isArray(r)?t.push({x:r[0],y:r[1]}):t.push({x:r.x,y:r.y})}),vq(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function Gl(n,e,t,r,i=0,s=0,o=0,a,l){if(t===0||r===0)return[];a-=n,l-=e,t=Math.abs(t),r=Math.abs(r);const c=-a/2,u=-l/2,h=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),d=h*c+f*u,g=-1*f*c+h*u,p=d*d,b=g*g,m=t*t,v=r*r,y=p/m+b/v;let w;if(y>1)t=Math.sqrt(y)*t,r=Math.sqrt(y)*r,w=0;else{let lt=1;s===o&&(lt=-1),w=lt*Math.sqrt((m*v-m*b-v*p)/(m*b+v*p))}const x=w*t*g/r,C=-1*w*r*d/t,S=h*x-f*C+a/2,E=f*x+h*C+l/2;let A=Math.atan2((g-C)/r,(d-x)/t)-Math.atan2(0,1),M=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-C)/r,(-d-x)/t)-Math.atan2((g-C)/r,(d-x)/t);let O=A>=0?A:2*Math.PI+A;o===0&&O>0?O-=2*Math.PI:o!==0&&O<0&&(O+=2*Math.PI);const I=O*2/Math.PI,q=Math.ceil(I<0?-1*I:I),U=O/q,T=8/3*Math.sin(U/4)*Math.sin(U/4)/Math.sin(U/2),k=h*t,Q=h*r,j=f*t,z=f*r;let H=Math.cos(M),te=Math.sin(M),_e=-T*(k*te+z*H),In=-T*(j*te-Q*H),rt=0,Kt=0;const Ke=[];for(let lt=0;lt<q;lt+=1){M+=U,H=Math.cos(M),te=Math.sin(M),rt=k*H-z*te+S,Kt=j*H+Q*te+E;const Ya=-T*(k*te+z*H),uo=-T*(j*te-Q*H),fi=lt*6;Ke[fi]=Number(_e+n),Ke[fi+1]=Number(In+e),Ke[fi+2]=Number(rt-Ya+n),Ke[fi+3]=Number(Kt-uo+e),Ke[fi+4]=Number(rt+n),Ke[fi+5]=Number(Kt+e),_e=rt+Ya,In=Kt+uo}return Ke.map(lt=>+lt.toFixed(2))}function bq(n,e,t,r,i=0,s=0,o=0,a,l){const c=[],u=Gl(n,e,t,r,i,s,o,a,l);if(u!=null)for(let h=0,f=u.length;h<f;h+=6)c.push("C",u[h],u[h+1],u[h+2],u[h+3],u[h+4],u[h+5]);return c.join(" ")}class He extends _r{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return He.parse(e);this.points=e.map(t=>P.create(t))}else this.points=[]}scale(e,t,r=new P){return this.points.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.points.forEach(r=>r.rotate(e,t)),this}translate(e,t){const r=P.create(e,t);return this.points.forEach(i=>i.translate(r.x,r.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new D;let e=1/0,t=-1/0,r=1/0,i=-1/0;const s=this.points;for(let o=0,a=s.length;o<a;o+=1){const l=s[o],c=l.x,u=l.y;c<e&&(e=c),c>t&&(t=c),u<r&&(r=u),u>i&&(i=u)}return new D(e,r,t-e,i-r)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,r=t.length;if(r===0||r===1)return 0;let i=0,s=0,o=1/0;for(let a=0,l=r-1;a<l;a+=1){const c=new F(t[a],t[a+1]),u=c.length(),h=c.closestPointNormalizedLength(e),d=c.pointAt(h).squaredDistance(e);d<o&&(o=d,s=i+h*u),i+=u}return s}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=P.clone(e),r=t.x,i=t.y,s=this.points,o=s.length;let a=o-1,l=0;for(let c=0;c<o;c+=1){const u=s[a],h=s[c];if(t.equals(u))return!0;const f=new F(u,h);if(f.containsPoint(e))return!0;if(i<=u.y&&i>h.y||i>u.y&&i<=h.y){const d=u.x-r>h.x-r?u.x-r:h.x-r;if(d>=0){const g=new P(r+d,i),p=new F(e,g);f.intersectsWithLine(p)&&(l+=1)}}a=c}return l%2===1}intersectsWithLine(e){const t=[];for(let r=0,i=this.points.length-1;r<i;r+=1){const s=this.points[r],o=this.points[r+1],a=e.intersectsWithLine(new F(s,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const r=this.points[e],i=this.points[e+1];if(new F(r,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,r=this.points.length-1;t<r;t+=1){const i=this.points[t],s=this.points[t+1];e+=i.distance(s)}return e}pointAt(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1||e<=0)return t[0].clone();if(e>=1)return t[r-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1)return t[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let a=0,l=r-1;a<l;a+=1){const c=i?a:l-1-a,u=t[c],h=t[c+1],f=new F(u,h),d=u.distance(h);if(e<=s+d)return f.pointAtLength((i?1:-1)*(e-s));s+=d}return(i?t[r-1]:t[0]).clone()}tangentAt(e){const r=this.points.length;if(r===0||r===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const t=this.points,r=t.length;if(r===0||r===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,o=0;for(let a=0,l=r-1;a<l;a+=1){const c=i?a:l-1-a,u=t[c],h=t[c+1],f=new F(u,h),d=u.distance(h);if(f.isDifferentiable()){if(e<=o+d)return f.tangentAtLength((i?1:-1)*(e-o));s=f}o+=d}if(s){const a=i?1:0;return s.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const r=e.threshold||0;let i=0;for(;t[i+2];){const s=i,o=i+1,a=i+2,l=t[s],c=t[o],u=t[a];new F(l,u).closestPoint(c).distance(c)<=r?t.splice(o,1):i+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new He;let r=e[0];for(let f=1;f<t;f+=1)(e[f].y<r.y||e[f].y===r.y&&e[f].x>r.x)&&(r=e[f]);const i=[];for(let f=0;f<t;f+=1){let d=r.theta(e[f]);d===0&&(d=360),i.push([e[f],f,d])}if(i.sort((f,d)=>{let g=f[2]-d[2];return g===0&&(g=d[1]-f[1]),g}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},o=[],a=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),d=f[0];if(s[a(f)])continue;let g=!1;for(;!g;)if(o.length<2)o.push(f),g=!0;else{const p=o.pop(),b=p[0],m=o.pop(),v=m[0],y=v.cross(b,d);if(y<0)o.push(m),o.push(p),o.push(f),g=!0;else if(y===0){const x=b.angleBetween(v,d);Math.abs(x-180)<1e-10||b.equals(d)||v.equals(b)?(s[a(p)]=b,o.push(m)):Math.abs((x+1)%360-1)<1e-10&&(o.push(m),i.push(p))}else s[a(p)]=b,o.push(m)}}o.length>2&&o.pop();let l,c=-1;for(let f=0,d=o.length;f<d;f+=1){const g=o[f][1];(l===void 0||g<l)&&(l=g,c=f)}let u=[];if(c>0){const f=o.slice(c),d=o.slice(0,c);u=f.concat(d)}else u=o;const h=[];for(let f=0,d=u.length;f<d;f+=1)h.push(u[f][0]);return new He(h)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,r)=>t.equals(this.points[r]))}clone(){return new He(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})(He||(He={})),function(n){function e(t){const r=t.trim();if(r==="")return new n;const i=[],s=r.split(/\s*,\s*|\s+/);for(let o=0,a=s.length;o<a;o+=2)i.push({x:+s[o],y:+s[o+1]});return new n(i)}n.parse=e}(He||(He={}));class Fe extends _r{constructor(e,t,r,i){super(),this.PRECISION=3,this.start=P.create(e),this.controlPoint1=P.create(t),this.controlPoint2=P.create(r),this.end=P.create(i)}bbox(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end,s=e.x,o=e.y,a=t.x,l=t.y,c=r.x,u=r.y,h=i.x,f=i.y,d=[],g=[[],[]];let p,b,m,v,y,w,x,C;for(let k=0;k<2;k+=1){if(k===0?(b=6*s-12*a+6*c,p=-3*s+9*a-9*c+3*h,m=3*a-3*s):(b=6*o-12*l+6*u,p=-3*o+9*l-9*u+3*f,m=3*l-3*o),Math.abs(p)<1e-12){if(Math.abs(b)<1e-12)continue;v=-m/b,v>0&&v<1&&d.push(v);continue}x=b*b-4*m*p,C=Math.sqrt(x),!(x<0)&&(y=(-b+C)/(2*p),y>0&&y<1&&d.push(y),w=(-b-C)/(2*p),w>0&&w<1&&d.push(w))}let S,E,A,M=d.length;const O=M;for(;M;)M-=1,v=d[M],A=1-v,S=A*A*A*s+3*A*A*v*a+3*A*v*v*c+v*v*v*h,g[0][M]=S,E=A*A*A*o+3*A*A*v*l+3*A*v*v*u+v*v*v*f,g[1][M]=E;d[O]=0,d[O+1]=1,g[0][O]=s,g[1][O]=o,g[0][O+1]=h,g[1][O+1]=f,d.length=O+2,g[0].length=O+2,g[1].length=O+2;const I=Math.min.apply(null,g[0]),q=Math.min.apply(null,g[1]),U=Math.max.apply(null,g[0]),T=Math.max.apply(null,g[1]);return new D(I,q,U-I,T-q)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const r=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,r),r)}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(!i)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){const r=this.getPrecision(t),i=this.getDivisions(t),s=Math.pow(10,-r);let o=null,a=0,l=0,c=0,u=0,h=0,f=null;const d=i.length;let g=d>0?1/d:0;for(i.forEach((p,b)=>{const m=p.start.distance(e),v=p.end.distance(e),y=m+v;(f==null||y<f)&&(o=p,a=b*g,l=(b+1)*g,c=m,u=v,f=y,h=p.endpointDistance())});;){const p=c?Math.abs(c-u)/c:0,b=u!=null?Math.abs(c-u)/u:0,m=p<s||b<s,v=c?c<h*s:!0,y=u?u<h*s:!0;if(m||(v||y))return c<=u?a:l;const x=o.divide(.5);g/=2;const C=x[0].start.distance(e),S=x[0].end.distance(e),E=C+S,A=x[1].start.distance(e),M=x[1].end.distance(e),O=A+M;E<=O?(o=x[0],l-=g,c=C,u=S):(o=x[1],a+=g,c=A,u=M)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const r=this.tAt(e,t);return this.divideAtT(r)}divideAtLength(e,t={}){const r=this.tAtLength(e,t);return this.divideAtT(r)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new Fe(t,t,t,t),new Fe(t,r,i,s)];if(e>=1)return[new Fe(t,r,i,s),new Fe(s,s,s,s)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,l=o.startControlPoint2,c=o.divider,u=o.dividerControlPoint1,h=o.dividerControlPoint2;return[new Fe(t,a,l,c),new Fe(c,u,h,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:r.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:r.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const o=new F(t,r).pointAt(e),a=new F(r,i).pointAt(e),l=new F(i,s).pointAt(e),c=new F(o,a).pointAt(e),u=new F(a,l).pointAt(e),h=new F(c,u).pointAt(e);return{startControlPoint1:o,startControlPoint2:c,divider:h,dividerControlPoint1:u,dividerControlPoint2:l}}getSubdivisions(e={}){const t=this.getPrecision(e);let r=[new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return r;let i=this.endpointDistance();const s=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];r.forEach(u=>{const h=u.divide(.5);a.push(h[0],h[1])});const l=a.reduce((u,h)=>u+h.endpointDistance(),0),c=l!==0?(l-i)/l:0;if(o>1&&c<s)return a;r=a,i=l}}length(e={}){return this.getDivisions(e).reduce((r,i)=>r+i.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const r=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:r})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.tAt(e,t);return this.pointAtT(r)}pointAtLength(e,t={}){const r=this.tAtLength(e,t);return this.pointAtT(r)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const r=this.tAt(e,t);return this.tangentAtT(r)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const r=this.tAtLength(e,t);return this.tangentAtT(r)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),r=t.startControlPoint2,i=t.dividerControlPoint1,s=t.divider,o=new F(r,i);return o.translate(s.x-r.x,s.y-r.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),r=this.getDivisions(e);return{precision:t,subdivisions:r}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const r=this.getOptions(t),s=this.length(r)*e;return this.tAtLength(s,r)}tAtLength(e,t={}){let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getDivisions(t),o={precision:i,subdivisions:s};let a=null,l,c,u=0,h=0,f=0;const d=s.length;let g=d>0?1/d:0;for(let m=0;m<d;m+=1){const v=r?m:d-1-m,y=s[m],w=y.endpointDistance();if(e<=f+w){a=y,l=v*g,c=(v+1)*g,u=r?e-f:w+f-e,h=r?w+f-e:e-f;break}f+=w}if(a==null)return r?1:0;const p=this.length(o),b=Math.pow(10,-i);for(;;){let m;if(m=p!==0?u/p:0,m<b)return l;if(m=p!==0?h/p:0,m<b)return c;let v,y;const w=a.divide(.5);g/=2;const x=w[0].endpointDistance(),C=w[1].endpointDistance();u<=x?(a=w[0],c-=g,v=u,y=x-v):(a=w[1],l+=g,v=u-x,y=C-v),u=v,h=y}}toPoints(e={}){const t=this.getDivisions(e),r=[t[0].start.clone()];return t.forEach(i=>r.push(i.end.clone())),r}toPolyline(e={}){return new He(this.toPoints(e))}scale(e,t,r){return this.start.scale(e,t,r),this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isCurve=e})(Fe||(Fe={})),function(n){function e(i){const s=i.length,o=[],a=[];let l=2;o[0]=i[0]/l;for(let c=1;c<s;c+=1)a[c]=1/l,l=(c<s-1?4:3.5)-a[c],o[c]=(i[c]-o[c-1])/l;for(let c=1;c<s;c+=1)o[s-c-1]-=a[s-c]*o[s-c];return o}function t(i){const s=i.map(f=>P.clone(f)),o=[],a=[],l=s.length-1;if(l===1)return o[0]=new P((2*s[0].x+s[1].x)/3,(2*s[0].y+s[1].y)/3),a[0]=new P(2*o[0].x-s[0].x,2*o[0].y-s[0].y),[o,a];const c=[];for(let f=1;f<l-1;f+=1)c[f]=4*s[f].x+2*s[f+1].x;c[0]=s[0].x+2*s[1].x,c[l-1]=(8*s[l-1].x+s[l].x)/2;const u=e(c);for(let f=1;f<l-1;f+=1)c[f]=4*s[f].y+2*s[f+1].y;c[0]=s[0].y+2*s[1].y,c[l-1]=(8*s[l-1].y+s[l].y)/2;const h=e(c);for(let f=0;f<l;f+=1)o.push(new P(u[f],h[f])),f<l-1?a.push(new P(2*s[f+1].x-u[f+1],2*s[f+1].y-h[f+1])):a.push(new P((s[l].x+u[l-1])/2,(s[l].y+h[l-1])/2));return[o,a]}function r(i){if(i==null||Array.isArray(i)&&i.length<2)throw new Error("At least 2 points are required");const s=t(i),o=[];for(let a=0,l=s[0].length;a<l;a+=1){const c=new P(s[0][a].x,s[0][a].y),u=new P(s[1][a].x,s[1][a].y);o.push(new n(i[a],c,u,i[a+1]))}return o}n.throughPoints=r}(Fe||(Fe={}));class Hl extends _r{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const r=this.length();return e>=1?r:r*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class Ct extends Hl{constructor(e,t){super(),F.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=P.create(e,t).round(2)}get type(){return"L"}get line(){return new F(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new Ct(t[0]),new Ct(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new Ct(t[0]),new Ct(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new Ct(this.end)}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(F.isLine(i))return new n(i);if(P.isPointLike(i))return r===1?new n(i):t.map(o=>new n(o));if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];s.push(new n(a,l))}return s}n.create=e})(Ct||(Ct={}));class ys extends Hl{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new F(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new Ct(t[0]):this.clone(),new Ct(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new Ct(t[0]):this.clone(),new Ct(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new ys}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(ys||(ys={}));class vs extends Hl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,F.isLine(e)||Fe.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=P.create(e,t).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new vs(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(F.isLine(i))return new n(i);if(Fe.isCurve(i))return new n(i);if(P.isPointLike(i)){if(r===1)return new n(i);const o=[];for(let a=0;a<r;a+=1)a===0?o.push(new n(t[a])):o.push(new Ct(t[a]));return o}if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];o===0?s.push(new n(a,l)):s.push(new Ct(a,l))}return s}n.create=e})(vs||(vs={}));class sn extends Hl{constructor(e,t,r,i,s,o){super(),Fe.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new P(e,t).round(2),this.controlPoint2=new P(r,i).round(2),this.endPoint=new P(s,o).round(2)):(this.controlPoint1=P.create(e).round(2),this.controlPoint2=P.create(t).round(2),this.endPoint=P.create(r).round(2))}get type(){return"C"}get curve(){return new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const r=this.curve.divideAt(e,t);return[new sn(r[0]),new sn(r[1])]}divideAtLength(e,t={}){const r=this.curve.divideAtLength(e,t);return[new sn(r[0]),new sn(r[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new sn(t[0]),new sn(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}scale(e,t,r){return this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new sn(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,t=this.controlPoint2,r=this.end;return[this.type,e.x,e.y,t.x,t.y,r.x,r.y].join(" ")}}(function(n){function e(...t){const r=t.length,i=t[0];if(Fe.isCurve(i))return new n(i);if(P.isPointLike(i)){if(r===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<r;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(r===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const s=[];for(let o=0;o<r;o+=6)s.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return s}n.create=e})(sn||(sn={}));function Ul(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function D1(n,e,t,r,i,s){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*r,o*i+a*t,o*s+a*r,i,s]}function B1(n,e,t,r,i,s,o,a,l,c){const u=Math.PI*120/180,h=Math.PI/180*(+i||0);let f=[],d,g,p,b,m;if(c)g=c[0],p=c[1],b=c[2],m=c[3];else{d=Ul(n,e,-h),n=d.x,e=d.y,d=Ul(a,l,-h),a=d.x,l=d.y;const U=(n-a)/2,T=(e-l)/2;let k=U*U/(t*t)+T*T/(r*r);k>1&&(k=Math.sqrt(k),t=k*t,r=k*r);const Q=t*t,j=r*r,z=(s===o?-1:1)*Math.sqrt(Math.abs((Q*j-Q*T*T-j*U*U)/(Q*T*T+j*U*U)));b=z*t*T/r+(n+a)/2,m=z*-r*U/t+(e+l)/2,g=Math.asin((e-m)/r),p=Math.asin((l-m)/r),g=n<b?Math.PI-g:g,p=a<b?Math.PI-p:p,g<0&&(g=Math.PI*2+g),p<0&&(p=Math.PI*2+p),o&&g>p&&(g-=Math.PI*2),!o&&p>g&&(p-=Math.PI*2)}let v=p-g;if(Math.abs(v)>u){const U=p,T=a,k=l;p=g+u*(o&&p>g?1:-1),a=b+t*Math.cos(p),l=m+r*Math.sin(p),f=B1(a,l,t,r,i,0,o,T,k,[p,U,b,m])}v=p-g;const y=Math.cos(g),w=Math.sin(g),x=Math.cos(p),C=Math.sin(p),S=Math.tan(v/4),E=4/3*(t*S),A=4/3*(r*S),M=[n,e],O=[n+E*w,e-A*y],I=[a+E*C,l-A*x],q=[a,l];if(O[0]=2*M[0]-O[0],O[1]=2*M[1]-O[1],c)return[O,I,q].concat(f);{f=[O,I,q].concat(f).join().split(",");const U=[],T=f.length;for(let k=0;k<T;k+=1)U[k]=k%2?Ul(+f[k-1],+f[k],h).y:Ul(+f[k],+f[k+1],h).x;return U}}function wq(n){if(!n)return null;const e=`
13
+ \v\f\r   ᠎              \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),r=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return n.replace(t,(o,a,l)=>{const c=[];let u=a.toLowerCase();l.replace(r,(f,d)=>(d&&c.push(+d),f)),u==="m"&&c.length>2&&(s.push([a,...c.splice(0,2)]),u="l",a=a==="m"?"l":"L");const h=i[u];for(;c.length>=h&&(s.push([a,...c.splice(0,h)]),!!h););return o}),s}function xq(n){const e=wq(n);if(!e||!e.length)return[["M",0,0]];let t=0,r=0,i=0,s=0;const o=[];for(let a=0,l=e.length;a<l;a+=1){const c=[];o.push(c);const u=e[a],h=u[0];if(h!==h.toUpperCase())switch(c[0]=h.toUpperCase(),c[0]){case"A":c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5],c[6]=+u[6]+t,c[7]=+u[7]+r;break;case"V":c[1]=+u[1]+r;break;case"H":c[1]=+u[1]+t;break;case"M":i=+u[1]+t,s=+u[2]+r;for(let f=1,d=u.length;f<d;f+=1)c[f]=+u[f]+(f%2?t:r);break;default:for(let f=1,d=u.length;f<d;f+=1)c[f]=+u[f]+(f%2?t:r);break}else for(let f=0,d=u.length;f<d;f+=1)c[f]=u[f];switch(c[0]){case"Z":t=+i,r=+s;break;case"H":t=c[1];break;case"V":r=c[1];break;case"M":i=c[c.length-2],s=c[c.length-1],t=c[c.length-2],r=c[c.length-1];break;default:t=c[c.length-2],r=c[c.length-1];break}}return o}function Cq(n){const e=xq(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function r(l,c,u){let h,f;if(!l)return["C",c.x,c.y,c.x,c.y,c.x,c.y];switch(l[0]in{T:1,Q:1}||(c.qx=null,c.qy=null),l[0]){case"M":c.X=l[1],c.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(B1.apply(0,[c.x,c.y].concat(l.slice(1))));case"S":return u==="C"||u==="S"?(h=c.x*2-c.bx,f=c.y*2-c.by):(h=c.x,f=c.y),["C",h,f].concat(l.slice(1));case"T":return u==="Q"||u==="T"?(c.qx=c.x*2-c.qx,c.qy=c.y*2-c.qy):(c.qx=c.x,c.qy=c.y),["C"].concat(D1(c.x,c.y,c.qx,c.qy,l[1],l[2]));case"Q":return c.qx=l[1],c.qy=l[2],["C"].concat(D1(c.x,c.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],c.y);case"V":return["L"].concat(c.x,l[1])}return l}function i(l,c){if(l[c].length>7){l[c].shift();const u=l[c];for(;u.length;)s[c]="A",c+=1,l.splice(c,0,["C"].concat(u.splice(0,6)));l.splice(c,1),a=e.length}}const s=[];let o="",a=e.length;for(let l=0;l<a;l+=1){let c="";e[l]&&(c=e[l][0]),c!=="C"&&(s[l]=c,l>0&&(o=s[l-1])),e[l]=r(e[l],t,o),s[l]!=="A"&&c==="C"&&(s[l]="C"),i(e,l);const u=e[l],h=u.length;t.x=u[h-2],t.y=u[h-1],t.bx=parseFloat(u[h-4])||t.x,t.by=parseFloat(u[h-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function Sq(n){return Cq(n).map(e=>e.map(t=>typeof t=="string"?t:we.round(t,2))).join(",").split(",").join(" ")}class X extends _r{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(F.isLine(e[0])||Fe.isCurve(e[0])){let t=null;e.forEach((i,s)=>{s===0&&this.appendSegment(X.createSegment("M",i.start)),t!=null&&!t.end.equals(i.start)&&this.appendSegment(X.createSegment("M",i.start)),F.isLine(i)?this.appendSegment(X.createSegment("L",i.end)):Fe.isCurve(i)&&this.appendSegment(X.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),t=i})}else e.forEach(r=>{r.isSegment&&this.appendSegment(r)});else e!=null&&(F.isLine(e)?(this.appendSegment(X.createSegment("M",e.start)),this.appendSegment(X.createSegment("L",e.end))):Fe.isCurve(e)?(this.appendSegment(X.createSegment("M",e.start)),this.appendSegment(X.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):He.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,r)=>{const i=r===0?X.createSegment("M",t):X.createSegment("L",t);this.appendSegment(i)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=0;r<t;r+=1){const i=e[r];if(i.isVisible)return i.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=t-1;r>=0;r-=1){const i=e[r];if(i.isVisible)return i.end}return e[t-1].end}moveTo(...e){return this.appendSegment(vs.create.call(null,...e))}lineTo(...e){return this.appendSegment(Ct.create.call(null,...e))}curveTo(...e){return this.appendSegment(sn.create.call(null,...e))}arcTo(e,t,r,i,s,o,a){const l=this.end||new P,c=typeof o=="number"?Gl(l.x,l.y,e,t,r,i,s,o,a):Gl(l.x,l.y,e,t,r,i,s,o.x,o.y);if(c!=null)for(let u=0,h=c.length;u<h;u+=6)this.curveTo(c[u],c[u+1],c[u+2],c[u+3],c[u+4],c[u+5]);return this}quadTo(e,t,r,i){const s=this.end||new P,o=["M",s.x,s.y];if(typeof e=="number")o.push("Q",e,t,r,i);else{const l=t;o.push("Q",e.x,e.y,l.x,l.y)}const a=X.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(ys.create())}drawPoints(e,t={}){const r=j1(e,t),i=X.parse(r);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let r;for(let s=0;s<t;s+=1){const o=e[s];if(o.isVisible){const a=o.bbox();a!=null&&(r=r?r.union(a):a)}}if(r!=null)return r;const i=e[t-1];return new D(i.end.x,i.end.y,0,0)}appendSegment(e){const t=this.segments.length;let r=t!==0?this.segments[t-1]:null,i;const s=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const l=e[o];i=this.prepareSegment(l,r,s),this.segments.push(i),r=i}else e!=null&&e.isSegment&&(i=this.prepareSegment(e,r,s),this.segments.push(i));return this}insertSegment(e,t){const r=this.segments.length;if(e<0&&(e=r+e+1),e>r||e<0)throw new Error("Index out of range.");let i,s=null,o=null;if(r!==0&&(e>=1?(s=this.segments[e-1],o=s.nextSegment):(s=null,o=this.segments[0])),!Array.isArray(t))i=this.prepareSegment(t,s,o),this.segments.splice(e,0,i);else for(let a=0,l=t.length;a<l;a+=1){const c=t[a];i=this.prepareSegment(c,s,o),this.segments.splice(e+a,0,i),s=i}return this}removeSegment(e){const t=this.fixIndex(e),r=this.segments.splice(t,1)[0],i=r.previousSegment,s=r.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),r.isSubpathStart&&s&&this.updateSubpathStartSegment(s),r}replaceSegment(e,t){const r=this.fixIndex(e);let i;const s=this.segments[r];let o=s.previousSegment;const a=s.nextSegment;let l=s.isSubpathStart;if(!Array.isArray(t))i=this.prepareSegment(t,o,a),this.segments.splice(r,1,i),l&&i.isSubpathStart&&(l=!1);else{this.segments.splice(e,1);for(let c=0,u=t.length;c<u;c+=1){const h=t[c];i=this.prepareSegment(h,o,a),this.segments.splice(e+c,0,i),o=i,l&&i.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let r=e;for(;r<0;)r=t+r;if(r>=t||r<0)throw new Error("Index out of range.");return r}segmentAt(e,t={}){const r=this.segmentIndexAt(e,t);return r?this.getSegment(r):null}segmentAtLength(e,t={}){const r=this.segmentIndexAtLength(e,t);return r?this.getSegment(r):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const r=we.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.segmentIndexAtLength(o,i)}segmentIndexAtLength(e,t={}){const r=this.segments.length;if(r===0)return null;let i=!0;e<0&&(i=!1,e=-e);const s=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,l=null;for(let c=0;c<r;c+=1){const u=i?c:r-1-c,h=this.segments[u],f=o[u],d=h.length({precision:s,subdivisions:f});if(h.isVisible){if(e<=a+d)return u;l=u}a+=d}return l}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),r=[];for(let i=0,s=this.segments.length;i<s;i+=1){const a=this.segments[i].getSubdivisions({precision:t});r.push(a)}return r}updateSubpathStartSegment(e){let t=e.previousSegment,r=e;for(;r&&!r.isSubpathStart;)t!=null?r.subpathStartSegment=t.subpathStartSegment:r.subpathStartSegment=null,t=r,r=r.nextSegment}prepareSegment(e,t,r){e.previousSegment=t,e.nextSegment=r,t!=null&&(t.nextSegment=e),r!=null&&(r.previousSegment=e);let i=e;return e.isSubpathStart&&(e.subpathStartSegment=e,i=r),i!=null&&this.updateSubpathStartSegment(i),e}closestPoint(e,t={}){const r=this.closestPointT(e,t);return r?this.pointAtT(r):null}closestPointLength(e,t={}){const r=this.getOptions(t),i=this.closestPointT(e,r);return i?this.lengthAtT(i,r):0}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(i===0)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],u=i[a];if(c.isVisible){const h=c.closestPointT(e,{precision:r,subdivisions:u}),f=c.pointAtT(h),d=we.squaredLength(f,e);d<o&&(s={segmentIndex:a,value:h},o=d)}}return s||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],u=i[a];if(c.isDifferentiable()){const h=c.closestPointT(e,{precision:r,subdivisions:u}),f=c.pointAtT(h),d=we.squaredLength(f,e);d<o&&(s=c.tangentAtT(h),o=d)}}return s||null}containsPoint(e,t={}){const r=this.toPolylines(t);if(!r)return!1;let i=0;for(let s=0,o=r.length;s<o;s+=1)r[s].containsPoint(e)&&(i+=1);return i%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.getOptions(t),s=this.length(r)*e;return this.pointAtLength(s,r)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let c=0,u=this.segments.length;c<u;c+=1){const h=r?c:u-1-c,f=this.segments[h],d=s[h],g=f.length({precision:i,subdivisions:d});if(f.isVisible){if(e<=a+g)return f.pointAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:d});o=f}a+=g}return o?r?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,r=t.length;if(r===0)return null;const i=e.segmentIndex;if(i<0)return t[0].pointAtT(0);if(i>=r)return t[r-1].pointAtT(1);const s=we.clamp(e.value,0,1);return t[i].pointAtT(s)}divideAt(e,t={}){if(this.segments.length===0)return null;const r=we.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.divideAtLength(o,i)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o=0,a,l,c,u,h;for(let x=0,C=this.segments.length;x<C;x+=1){const S=r?x:C-1-x,E=this.getSegment(S),A=s[S],M={precision:i,subdivisions:A},O=E.length(M);if(E.isDifferentiable()&&(c=E,u=S,e<=o+O)){l=S,a=E.divideAtLength((r?1:-1)*(e-o),M);break}o+=O}if(!c)return null;a||(l=u,h=r?1:0,a=c.divideAtT(h));const f=this.clone(),d=l;f.replaceSegment(d,a);const g=d;let p=d+1,b=d+2;a[0].isDifferentiable()||(f.removeSegment(g),p-=1,b-=1);const m=f.getSegment(p).start;f.insertSegment(p,X.createSegment("M",m)),b+=1,a[1].isDifferentiable()||(f.removeSegment(b-1),b-=1);const v=b-g-1;for(let x=b,C=f.segments.length;x<C;x+=1){const S=this.getSegment(x-v),E=f.getSegment(x);if(E.type==="Z"&&!S.subpathStartSegment.end.equals(E.subpathStartSegment.end)){const A=X.createSegment("L",S.end);f.replaceSegment(x,A)}}const y=new X(f.segments.slice(0,p)),w=new X(f.segments.slice(p));return[y,w]}intersectsWithLine(e,t={}){const r=this.toPolylines(t);if(r==null)return null;let i=null;for(let s=0,o=r.length;s<o;s+=1){const a=r[s],l=e.intersect(a);l&&(i==null&&(i=[]),Array.isArray(l)?i.push(...l):i.push(l))}return i}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let r=0;for(let i=0,s=this.segments.length;i<s;i+=1){const o=this.segments[i],a=t[i];r+=o.length({subdivisions:a})}return r}lengthAtT(e,t={}){const r=this.segments.length;if(r===0)return 0;let i=e.segmentIndex;if(i<0)return 0;let s=we.clamp(e.value,0,1);i>=r&&(i=r-1,s=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let l=0;for(let h=0;h<i;h+=1){const f=this.segments[h],d=a[h];l+=f.length({precision:o,subdivisions:d})}const c=this.segments[i],u=a[i];return l+=c.lengthAtT(s,{precision:o,subdivisions:u}),l}tangentAt(e,t={}){if(this.segments.length===0)return null;const r=we.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.tangentAtLength(o,i)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const u=r?l:c-1-l,h=this.segments[u],f=s[u],d=h.length({precision:i,subdivisions:f});if(h.isDifferentiable()){if(e<=a+d)return h.tangentAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:f});o=h}a+=d}if(o){const l=r?1:0;return o.tangentAtT(l)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const r=e.segmentIndex;if(r<0)return this.segments[0].tangentAtT(0);if(r>=t)return this.segments[t-1].tangentAtT(1);const i=we.clamp(e.value,0,1);return this.segments[r].tangentAtT(i)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),r=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:r}}toPoints(e={}){const t=this.segments,r=t.length;if(r===0)return null;const i=this.getSubdivisions(e),s=[];let o=[];for(let a=0;a<r;a+=1){const l=t[a];if(l.isVisible){const c=i[a];c.length>0?c.forEach(u=>o.push(u.start)):o.push(l.start)}else o.length>0&&(o.push(t[a-1].end),s.push(o),o=[])}return o.length>0&&(o.push(this.end),s.push(o)),s}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(r=>new He(r)):null}scale(e,t,r){return this.segments.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.segments.forEach(r=>r.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(r=>r.translate(e,t)):this.segments.forEach(r=>r.translate(e)),this}clone(){const e=new X;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,r=e.segments,i=t.length;if(r.length!==i)return!1;for(let s=0;s<i;s+=1){const o=t[s],a=r[s];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(X||(X={})),function(n){function e(r){if(!r)return new n;const i=new n,s=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(r).match(s);if(o!=null)for(let a=0,l=o.length;a<l;a+=1){const c=o[a],u=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,h=c.match(u);if(h!=null){const f=h[0],d=h.slice(1).map(p=>+p),g=t.call(null,f,...d);i.appendSegment(g)}}return i}n.parse=e;function t(r,...i){if(r==="M")return vs.create.call(null,...i);if(r==="L")return Ct.create.call(null,...i);if(r==="C")return sn.create.call(null,...i);if(r==="z"||r==="Z")return ys.create();throw new Error(`Invalid path segment type "${r}"`)}n.createSegment=t}(X||(X={})),function(n){n.normalize=Sq,n.isValid=yq,n.drawArc=bq,n.drawPoints=j1,n.arcToCurves=Gl}(X||(X={}));class Ue{constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,t,r=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!r&&!nn.isApplyingHMR()&&this.onDuplicated(e);const i=this.options.process,s=i?Y(i,this,e,t):t;return this.data[e]=s,s}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&Y(this.options.onConflict,this,e),new Error(`${El(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const r=this.getSpellingSuggestionForName(e),i=t?`${t} ${GF(this.options.type)}`:this.options.type;return`${El(i)} with name '${e}' does not exist.${r?` Did you mean '${r}'?`:""}`}getSpellingSuggestionForName(e){return wV(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Ue||(Ue={}));const Pq=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,r=e.thickness*e.sy;fe(n,{width:t,height:r,rx:t,ry:r,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const r=e.factor||1,i=e.width*r,s=e.height*r,o=e.thickness;i-o>=0&&s-o>=0?t=["M",i,0,"H0 M0 0 V0",s].join(" "):t="M 0 0 0 0",e.width=i,e.height=s,fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;fe(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Nr{constructor(){this.patterns={},this.root=Z.create($l(),{width:"100%",height:"100%"},[tr("defs")]).node}add(e,t){const r=this.root.childNodes[0];r&&r.appendChild(t),this.patterns[e]=t,Z.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=Pq,n.registry=Ue.create({type:"grid"}),n.registry.register(n.presets,!0)})(Nr||(Nr={}));const z1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t*2,e.height=r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(2*t,0),i.scale(-1,1),i.drawImage(n,0,0,t,r),e},F1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t,e.height=r*2;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(0,2*r),i.scale(1,-1),i.drawImage(n,0,0,t,r),e},V1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=2*t,e.height=2*r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(n,0,0,t,r),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(n,0,0,t,r),e},Eq=Object.freeze(Object.defineProperty({__proto__:null,flipX:z1,flipXY:V1,flipY:F1,watermark:function(n,e){const t=n.width,r=n.height,i=document.createElement("canvas");i.width=t*3,i.height=r*3;const s=i.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=ve.toRad(o),l=i.width/4,c=i.height/4;for(let u=0;u<4;u+=1)for(let h=0;h<4;h+=1)(u+h)%2>0&&(s.setTransform(1,0,0,1,(2*u-1)*l,(2*h-1)*c),s.rotate(a),s.drawImage(n,-t/2,-r/2,t,r));return i}},Symbol.toStringTag,{value:"Module"}));var qo;(function(n){n.presets=Object.assign({},Eq),n.presets["flip-x"]=z1,n.presets["flip-y"]=F1,n.presets["flip-xy"]=V1,n.registry=Ue.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(qo||(qo={}));function af(n,e){return n!=null?n:e}function ht(n,e){return n!=null&&Number.isFinite(n)?n:e}function Aq(n={}){const e=af(n.color,"blue"),t=ht(n.width,1),r=ht(n.margin,2),i=ht(n.opacity,1),s=r,o=r+t;return`
11
14
  <filter>
12
- <feFlood flood-color="${t}" flood-opacity="${i}" result="colored"/>
13
- <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${r+n}" />
14
- <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${r}" />
15
+ <feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>
16
+ <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />
17
+ <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${s}" />
15
18
  <feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>
16
19
  <feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>
17
20
  <feMerge>
@@ -19,77 +22,77 @@
19
22
  <feMergeNode in="SourceGraphic"/>
20
23
  </feMerge>
21
24
  </filter>
22
- `.trim()}function u9(e={}){let t=u6(e.color,"red"),n=u4(e.blur,0),r=u4(e.width,1),i=u4(e.opacity,1);return`
25
+ `.trim()}function Oq(n={}){const e=af(n.color,"red"),t=ht(n.blur,0),r=ht(n.width,1),i=ht(n.opacity,1);return`
23
26
  <filter>
24
- <feFlood flood-color="${t}" flood-opacity="${i}" result="colored"/>
27
+ <feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>
25
28
  <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${r}"/>
26
29
  <feComposite result="composed" in="colored" in2="morphed" operator="in"/>
27
- <feGaussianBlur result="blured" in="composed" stdDeviation="${n}"/>
30
+ <feGaussianBlur result="blured" in="composed" stdDeviation="${t}"/>
28
31
  <feBlend in="SourceGraphic" in2="blured" mode="normal"/>
29
32
  </filter>
30
- `.trim()}function u7(e={}){let t=u4(e.x,2),n=null!=e.y&&Number.isFinite(e.y)?[t,e.y]:t;return`
33
+ `.trim()}function Mq(n={}){const e=ht(n.x,2);return`
31
34
  <filter>
32
- <feGaussianBlur stdDeviation="${n}"/>
35
+ <feGaussianBlur stdDeviation="${n.y!=null&&Number.isFinite(n.y)?[e,n.y]:e}"/>
33
36
  </filter>
34
- `.trim()}function ce(e={}){let t=u4(e.dx,0),n=u4(e.dy,0),r=u6(e.color,"black"),i=u4(e.blur,4),o=u4(e.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
35
- <feDropShadow stdDeviation="${i}" dx="${t}" dy="${n}" flood-color="${r}" flood-opacity="${o}" />
37
+ `.trim()}function Tq(n={}){const e=ht(n.dx,0),t=ht(n.dy,0),r=af(n.color,"black"),i=ht(n.blur,4),s=ht(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
38
+ <feDropShadow stdDeviation="${i}" dx="${e}" dy="${t}" flood-color="${r}" flood-opacity="${s}" />
36
39
  </filter>`.trim():`<filter>
37
40
  <feGaussianBlur in="SourceAlpha" stdDeviation="${i}" />
38
- <feOffset dx="${t}" dy="${n}" result="offsetblur" />
41
+ <feOffset dx="${e}" dy="${t}" result="offsetblur" />
39
42
  <feFlood flood-color="${r}" />
40
43
  <feComposite in2="offsetblur" operator="in" />
41
44
  <feComponentTransfer>
42
- <feFuncA type="linear" slope="${o}" />
45
+ <feFuncA type="linear" slope="${s}" />
43
46
  </feComponentTransfer>
44
47
  <feMerge>
45
48
  <feMergeNode/>
46
49
  <feMergeNode in="SourceGraphic"/>
47
50
  </feMerge>
48
- </filter>`.trim()}function ct(e={}){let t=u4(e.amount,1),n=.7152-.7152*(1-t);return`
51
+ </filter>`.trim()}function _q(n={}){const e=ht(n.amount,1),t=.2126+.7874*(1-e),r=.7152-.7152*(1-e),i=.0722-.0722*(1-e),s=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),l=.2126-.2126*(1-e),c=.0722+.9278*(1-e);return`
49
52
  <filter>
50
- <feColorMatrix type="matrix" values="${.2126+.7874*(1-t)} ${n} ${.0722-.0722*(1-t)} 0 0 ${.2126-.2126*(1-t)} ${.7152+.2848*(1-t)} ${.0722-.0722*(1-t)} 0 0 ${.2126-.2126*(1-t)} ${n} ${.0722+.9278*(1-t)} 0 0 0 0 0 1 0"/>
53
+ <feColorMatrix type="matrix" values="${t} ${r} ${i} 0 0 ${s} ${o} ${a} 0 0 ${l} ${r} ${c} 0 0 0 0 0 1 0"/>
51
54
  </filter>
52
- `.trim()}function cn(e={}){let t=u4(e.amount,1);return`
55
+ `.trim()}function Nq(n={}){const e=ht(n.amount,1),t=.393+.607*(1-e),r=.769-.769*(1-e),i=.189-.189*(1-e),s=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),l=.272-.272*(1-e),c=.534-.534*(1-e),u=.131+.869*(1-e);return`
53
56
  <filter>
54
- <feColorMatrix type="matrix" values="${.393+.607*(1-t)} ${.769-.769*(1-t)} ${.189-.189*(1-t)} 0 0 ${.349-.349*(1-t)} ${.686+.314*(1-t)} ${.168-.168*(1-t)} 0 0 ${.272-.272*(1-t)} ${.534-.534*(1-t)} ${.131+.869*(1-t)} 0 0 0 0 0 1 0"/>
57
+ <feColorMatrix type="matrix" values="${t} ${r} ${i} 0 0 ${s} ${o} ${a} 0 0 ${l} ${c} ${u} 0 0 0 0 0 1 0"/>
55
58
  </filter>
56
- `.trim()}function cr(e={}){let t=u4(e.amount,1);return`
59
+ `.trim()}function kq(n={}){return`
57
60
  <filter>
58
- <feColorMatrix type="saturate" values="${1-t}"/>
61
+ <feColorMatrix type="saturate" values="${1-ht(n.amount,1)}"/>
59
62
  </filter>
60
- `.trim()}function ci(e={}){let t=u4(e.angle,0);return`
63
+ `.trim()}function Iq(n={}){return`
61
64
  <filter>
62
- <feColorMatrix type="hueRotate" values="${t}"/>
65
+ <feColorMatrix type="hueRotate" values="${ht(n.angle,0)}"/>
63
66
  </filter>
64
- `.trim()}function co(e={}){let t=u4(e.amount,1),n=1-t;return`
67
+ `.trim()}function $q(n={}){const e=ht(n.amount,1),t=1-e;return`
65
68
  <filter>
66
69
  <feComponentTransfer>
67
- <feFuncR type="table" tableValues="${t} ${n}"/>
68
- <feFuncG type="table" tableValues="${t} ${n}"/>
69
- <feFuncB type="table" tableValues="${t} ${n}"/>
70
+ <feFuncR type="table" tableValues="${e} ${t}"/>
71
+ <feFuncG type="table" tableValues="${e} ${t}"/>
72
+ <feFuncB type="table" tableValues="${e} ${t}"/>
70
73
  </feComponentTransfer>
71
74
  </filter>
72
- `.trim()}function cs(e={}){let t=u4(e.amount,1);return`
75
+ `.trim()}function Lq(n={}){const e=ht(n.amount,1);return`
73
76
  <filter>
74
77
  <feComponentTransfer>
75
- <feFuncR type="linear" slope="${t}"/>
76
- <feFuncG type="linear" slope="${t}"/>
77
- <feFuncB type="linear" slope="${t}"/>
78
+ <feFuncR type="linear" slope="${e}"/>
79
+ <feFuncG type="linear" slope="${e}"/>
80
+ <feFuncB type="linear" slope="${e}"/>
78
81
  </feComponentTransfer>
79
82
  </filter>
80
- `.trim()}function cl(e={}){let t=u4(e.amount,1),n=.5-t/2;return`
83
+ `.trim()}function Rq(n={}){const e=ht(n.amount,1),t=.5-e/2;return`
81
84
  <filter>
82
85
  <feComponentTransfer>
83
- <feFuncR type="linear" slope="${t}" intercept="${n}"/>
84
- <feFuncG type="linear" slope="${t}" intercept="${n}"/>
85
- <feFuncB type="linear" slope="${t}" intercept="${n}"/>
86
+ <feFuncR type="linear" slope="${e}" intercept="${t}"/>
87
+ <feFuncG type="linear" slope="${e}" intercept="${t}"/>
88
+ <feFuncB type="linear" slope="${e}" intercept="${t}"/>
86
89
  </feComponentTransfer>
87
90
  </filter>
88
- `.trim()}(ee=tf||(tf={})).presets=Object.assign({},tG),ee.presets["flip-x"]=u1,ee.presets["flip-y"]=u2,ee.presets["flip-xy"]=u3,ee.registry=uY.create({type:"background pattern"}),ee.registry.register(ee.presets,!0),(et=tp||(tp={})).presets=tH,et.registry=uY.create({type:"filter"}),et.registry.register(et.presets,!0);let ca={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},cu={},cc={position:cI("x","width","origin")},ch={position:cI("y","height","origin")},cd={position:cI("x","width","corner")},cf={position:cI("y","height","corner")},cp={set:cL("width","width")},cg={set:cL("height","height")},cm={set:cL("rx","width")},cy={set:cL("ry","height")},cb={set:(e=>{let t=cL(e,"width"),n=cL(e,"height");return function(e,r){let i=r.refBBox;return n0(i.height>i.width?t:n,this,e,r)}})("r")},cv={set(e,{refBBox:t}){let n,r=parseFloat(e),i=lX(e);i&&(r/=100);let o=Math.sqrt(t.height*t.height+t.width*t.width);return Number.isFinite(r)&&(n=i||r>=0&&r<=1?r*o:Math.max(r+o,0)),{r:n}}},cx={set:cL("cx","width")},cw={set:cL("cy","height")},cC={set:c_({resetOffset:!0})},cE={set:c_({resetOffset:!1})},cS={set:cB({resetOffset:!0})},cP={set:cB({resetOffset:!1})},cO=cb,ck=cC,cA=cS,cM=cc,cT=ch,cN=cp,cj=cg;function cI(e,t,n){return(r,{refBBox:i})=>{let o;if(null==r)return null;let s=parseFloat(r),l=lX(r);if(l&&(s/=100),Number.isFinite(s)){let r=i[n];o=l||s>0&&s<1?r[e]+i[t]*s:r[e]+s}let a=new uA;return a[e]=o||0,a}}function cL(e,t){return function(n,{refBBox:r}){let i=parseFloat(n),o=lX(n);o&&(i/=100);let s={};if(Number.isFinite(i)){let n=o||i>=0&&i<=1?i*r[t]:Math.max(i+r[t],0);s[e]=n}return s}}function cR(e,t){let n="x6-shape",r=t&&t.resetOffset;return function(t,{elem:i,refBBox:o}){let s=aY(i,n);if(!s||s.value!==t){let r=e(t);aY(i,n,s={value:t,shape:r,shapeBBox:r.bbox()})}let l=s.shape.clone(),a=s.shapeBBox.clone(),u=a.getOrigin(),c=o.getOrigin();a.x=c.x,a.y=c.y;let h=o.getMaxScaleToFit(a,c),d=0===a.width||0===o.width?1:h.sx,f=0===a.height||0===o.height?1:h.sy;return l.scale(d,f,u),r&&l.translate(-u.x,-u.y),l}}function c_(e){let t=cR(function(e){return uX.parse(e)},e);return(e,n)=>({d:t(e,n).serialize()})}function cB(e){let t=cR(e=>new uD(e),e);return(e,n)=>({points:t(e,n).serialize()})}let cD={qualify:r5,set:(e,{view:t})=>`url(#${t.graph.defineGradient(e)})`},cz={qualify:r5,set(e,{view:t}){let n=t.cell,r=Object.assign({},e);if(n.isEdge()&&"linearGradient"===r.type){let e=t.sourcePoint,i=t.targetPoint;r.id=`gradient-${r.type}-${n.id}`,r.attrs=Object.assign(Object.assign({},r.attrs),{x1:e.x,y1:e.y,x2:i.x,y2:i.y,gradientUnits:"userSpaceOnUse"}),t.graph.defs.remove(r.id)}return`url(#${t.graph.defineGradient(r)})`}},cF={qualify:(e,{attrs:t})=>null==t.textWrap||!r5(t.textWrap),set(e,{view:t,elem:n,attrs:r}){let i="x6-text",o=aY(n,i),s=e=>{try{return JSON.parse(e)}catch(t){return e}},l={x:r.x,eol:r.eol,annotations:s(r.annotations),textPath:s(r["text-path"]||r.textPath),textVerticalAnchor:r["text-vertical-anchor"]||r.textVerticalAnchor,displayEmpty:"true"===(r["display-empty"]||r.displayEmpty),lineHeight:r["line-height"]||r.lineHeight},a=r["font-size"]||r.fontSize,u=JSON.stringify([e,l]);if(a&&n.setAttribute("font-size",a),null==o||o!==u){let r=l.textPath;if(null!=r&&"object"==typeof r){let e=r.selector;if("string"==typeof e){let n=t.find(e)[0];n instanceof SVGPathElement&&(ah(n),l.textPath=Object.assign({"xlink:href":`#${n.id}`},r))}}a2(n,`${e}`,l),aY(n,i,u)}}},cV={qualify:r5,set(e,{view:t,elem:n,attrs:r,refBBox:i}){let o;let s=e.width||0;lX(s)?i.width*=parseFloat(s)/100:s<=0?i.width+=s:i.width=s;let l=e.height||0;lX(l)?i.height*=parseFloat(l)/100:l<=0?i.height+=l:i.height=l;let a=e.text;null==a&&(a=r.text||(null==n?void 0:n.textContent)),o=null!=a?function e(t,n,r={},i={}){let o=n.width,s=n.height,l=i.eol||"\n",a=r.fontSize||14,u=Math.floor(s/(r.lineHeight?parseFloat(r.lineHeight):Math.ceil(1.4*a)));if(t.indexOf(l)>-1){let o=lH(),s=[];return t.split(l).map(t=>{let l=e(t,Object.assign(Object.assign({},n),{height:Number.MAX_SAFE_INTEGER}),r,Object.assign(Object.assign({},i),{eol:o}));l&&s.push(...l.split(o))}),s.slice(0,u).join(l)}let{width:c}=a3(t,r);if(c<o)return t;let h=[],d=t,f=c,p=i.ellipsis,g=0;p&&("string"!=typeof p&&(p="…"),g=a3(p,r).width);for(let e=0;e<u;e+=1)if(f>o){if(e===u-1){let[e]=a5(d,o-g,f,r);h.push(p?`${e}${p}`:e)}else{let[e,t]=a5(d,o,f,r);h.push(e),f=a3(d=t,r).width}}else{h.push(d);break}return h.join(l)}(`${a}`,i,{"font-weight":r["font-weight"]||r.fontWeight,"font-size":r["font-size"]||r.fontSize,"font-family":r["font-family"]||r.fontFamily,lineHeight:r.lineHeight},{ellipsis:e.ellipsis}):"",n0(cF.set,this,o,{view:t,elem:n,attrs:r,refBBox:i,cell:t.cell})}},c$=(e,{attrs:t})=>void 0!==t.text,cU={qualify:c$},cG={qualify:c$},cH={qualify:c$},cq={qualify:c$},cW={qualify:c$},cX={qualify:c$},cY={qualify:(e,{elem:t})=>t instanceof SVGElement,set(e,{elem:t}){let n="x6-title",r=`${e}`,i=aY(t,n);if(null==i||i!==r){aY(t,n,r);let e=t.firstChild;if(e&&"TITLE"===e.tagName.toUpperCase())e.textContent=r;else{let n=document.createElementNS(t.namespaceURI,"title");n.textContent=r,t.insertBefore(n,e)}}}},cJ={offset:cZ("x","width","right")},cQ={offset:cZ("y","height","bottom")},cK={offset:(e,{refBBox:t})=>e?{x:-t.x,y:-t.y}:{x:0,y:0}};function cZ(e,t,n){return(r,{refBBox:i})=>{let o;let s=new uA;return o="middle"===r?i[t]/2:r===n?i[t]:"number"==typeof r&&Number.isFinite(r)?r>-1&&r<1?-i[t]*r:-r:lX(r)?i[t]*parseFloat(r)/100:0,s[e]=-(i[e]+o),s}}let c0={qualify:r5,set(e,{elem:t}){aq(t,e)}},c1={set(e,{elem:t}){t.innerHTML=`${e}`}},c2={qualify:r5,set:(e,{view:t})=>`url(#${t.graph.defineFilter(e)})`},c3={set:e=>null!=e&&"object"==typeof e&&e.id?e.id:e};function c5(e,t,n){let r,i;"object"==typeof t?(r=t.x,i=t.y):(r=t,i=n);let o=uX.parse(e),s=o.bbox();if(s){let e=-s.height/2-s.y,t=-s.width/2-s.x;"number"==typeof r&&(t-=r),"number"==typeof i&&(e-=i),o.translate(t,e)}return o.serialize()}var c6=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let c4=e=>{var{size:t,width:n,height:r,offset:i,open:o}=e;return c9({size:t,width:n,height:r,offset:i},!0===o,!0,void 0,c6(e,["size","width","height","offset","open"]))},c8=e=>{var{size:t,width:n,height:r,offset:i,factor:o}=e;return c9({size:t,width:n,height:r,offset:i},!1,!1,o,c6(e,["size","width","height","offset","factor"]))};function c9(e,t,n,r=3/4,i={}){let o=e.size||10,s=e.width||o,l=e.height||o,a=new uX,u={};if(t)a.moveTo(s,0).lineTo(0,l/2).lineTo(s,l),u.fill="none";else{if(a.moveTo(0,l/2),a.lineTo(s,0),!n){let e=lW(r,0,1);a.lineTo(s*e,l/2)}a.lineTo(s,l),a.close()}return Object.assign(Object.assign(Object.assign({},u),i),{tagName:"path",d:c5(a.serialize(),{x:null!=e.offset?e.offset:-s/2})})}var c7=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let he=e=>{var{size:t,width:n,height:r,offset:i}=e,o=c7(e,["size","width","height","offset"]);let s=t||10,l=n||s,a=r||s,u=new uX;return u.moveTo(0,a/2).lineTo(l/2,0).lineTo(l,a/2).lineTo(l/2,a).close(),Object.assign(Object.assign({},o),{tagName:"path",d:c5(u.serialize(),null==i?-l/2:i)})};var ht=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let hn=e=>{var{d:t,offsetX:n,offsetY:r}=e;return Object.assign(Object.assign({},ht(e,["d","offsetX","offsetY"])),{tagName:"path",d:c5(t,n,r)})};var hr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let hi=e=>{var{size:t,width:n,height:r,offset:i}=e,o=hr(e,["size","width","height","offset"]);let s=t||10,l=n||s,a=r||s,u=new uX;return u.moveTo(0,0).lineTo(l,a).moveTo(0,a).lineTo(l,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:c5(u.serialize(),i||-l/2)})};var ho=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let hs=e=>{var{width:t,height:n,offset:r,open:i,flip:o}=e,s=ho(e,["width","height","offset","open","flip"]);let l=n||6,a=t||10,u=Object.assign(Object.assign({},s),{tagName:"path"});!0===o&&(l=-l);let c=new uX;return c.moveTo(0,l).lineTo(a,0),!0===i?u.fill="none":(c.lineTo(a,l),c.close()),u.d=c5(c.serialize(),{x:r||-a/2,y:l/2}),u};var hl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let ha=e=>{var{r:t}=e,n=hl(e,["r"]);let r=t||5;return Object.assign(Object.assign({cx:r},n),{tagName:"circle",r:r})},hu=e=>{var{r:t}=e,n=hl(e,["r"]);let r=t||5,i=new uX;return i.moveTo(r,0).lineTo(r,2*r),i.moveTo(0,r).lineTo(2*r,r),{children:[Object.assign(Object.assign({},ha({r:r})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:c5(i.serialize(),-r)})]}};var hc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let hh=e=>{var{rx:t,ry:n}=e,r=hc(e,["rx","ry"]);let i=t||5;return Object.assign(Object.assign({cx:i},r),{tagName:"ellipse",rx:i,ry:n||5})};(en=tg||(tg={})).presets=tq,en.registry=uY.create({type:"marker"}),en.registry.register(en.presets,!0),(tg||(tg={})).normalize=c5;var hd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function hf(e){return"string"==typeof e||r5(e)}let hp={qualify:hf,set:(e,{view:t,attrs:n})=>hy("marker-start",e,t,n)},hg={qualify:hf,set:(e,{view:t,attrs:n})=>hy("marker-end",e,t,n,{transform:"rotate(180)"})},hm={qualify:hf,set:(e,{view:t,attrs:n})=>hy("marker-mid",e,t,n)};function hy(e,t,n,r,i={}){let o="string"==typeof t?{name:t}:t,{name:s,args:l}=o,a=hd(o,["name","args"]),u=a;if(s&&"string"==typeof s){let e=tg.registry.get(s);if(!e)return tg.registry.onNotFound(s);u=e(Object.assign(Object.assign({},a),l))}let c=Object.assign(Object.assign(Object.assign({},function(e,t){let n={},r=e.stroke;"string"==typeof r&&(n.stroke=r,n.fill=r);let i=e.strokeOpacity;if(null==i&&(i=e["stroke-opacity"]),null==i&&(i=e.opacity),null!=i&&(n["stroke-opacity"]=i,n["fill-opacity"]=i),"marker-mid"!==t){let r=parseFloat(e.strokeWidth||e["stroke-width"]);if(Number.isFinite(r)&&r>1){let e=Math.ceil(r/2);n.refX="marker-start"===t?e:-e}}return n}(r,e)),i),u);return{[e]:`url(#${n.graph.defineMarker(c)})`}}let hb=(e,{view:t})=>t.cell.isEdge(),hv={qualify:hb,set(e,t){var n,r,i,o;let s;let l=t.view,a=e.reverse||!1,u=e.stubs||0;if(Number.isFinite(u)&&0!==u){if(a){let e,t;let a=l.getConnectionLength()||0;u<0?(e=(a+u)/2,t=-u):(e=u,t=a-2*u);let c=l.getConnection();s=null===(o=null===(i=null===(r=null===(n=null==c?void 0:c.divideAtLength(e))||void 0===n?void 0:n[1])||void 0===r?void 0:r.divideAtLength(t))||void 0===i?void 0:i[0])||void 0===o?void 0:o.serialize()}else{let e;e=u<0?((l.getConnectionLength()||0)+u)/2:u;let t=l.getConnection();if(t){let n=t.divideAtLength(e),r=t.divideAtLength(-e);n&&r&&(s=`${n[0].serialize()} ${r[1].serialize()}`)}}}return{d:s||l.getConnectionPathData()}}},hx={qualify:hb,set:hO("getTangentAtLength",{rotate:!0})},hw={qualify:hb,set:hO("getTangentAtLength",{rotate:!1})},hC={qualify:hb,set:hO("getTangentAtRatio",{rotate:!0})},hE={qualify:hb,set:hO("getTangentAtRatio",{rotate:!1})},hS=hx,hP=hC;function hO(e,t){let n={x:1,y:0};return(r,i)=>{let o,s;let l=i.view,a=l[e](Number(r));return(a?(s=t.rotate?a.vector().vectorAngle(n):0,o=a.start):(o=l.path.start,s=0),0===s)?{transform:`translate(${o.x},${o.y}')`}:{transform:`translate(${o.x},${o.y}') rotate(${s})`}}}(tm||(tm={})).isValidDefinition=function(e,t,n){return!!(null!=e&&("string"==typeof e||"function"!=typeof e.qualify||n0(e.qualify,this,t,n)))||!1},(er=tm||(tm={})).presets=Object.assign(Object.assign({},ca),tW),er.registry=uY.create({type:"attribute definition"}),er.registry.register(er.presets,!0);let hk={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix:e=>`${hk.prefixCls}-${e}`},hA=hk.prefix("highlighted"),hM={highlight(e,t,n){aa(t,n&&n.className||hA)},unhighlight(e,t,n){au(t,n&&n.className||hA)}},hT=hk.prefix("highlight-opacity"),hN={highlight(e,t){aa(t,hT)},unhighlight(e,t){au(t,hT)}};!function(e){let t=am("svg");function n(e,t){let n=(function(e,t){let n=ue.createSVGPoint();return n.x=e,n.y=t,n})(e.x,e.y).matrixTransform(t);return new uA(n.x,n.y)}e.normalizeMarker=c5,e.transformPoint=n;e.transformLine=function(e,t){return new uT(n(e.start,t),n(e.end,t))};function r(e,n){let r=t.createSVGPoint();r.x=e.x,r.y=e.y;let i=r.matrixTransform(n);r.x=e.x+e.width,r.y=e.y;let o=r.matrixTransform(n);r.x=e.x+e.width,r.y=e.y+e.height;let s=r.matrixTransform(n);r.x=e.x,r.y=e.y+e.height;let l=r.matrixTransform(n),a=Math.min(i.x,o.x,s.x,l.x),u=Math.max(i.x,o.x,s.x,l.x),c=Math.min(i.y,o.y,s.y,l.y),h=Math.max(i.y,o.y,s.y,l.y);return new uM(a,c,u-a,h-c)}e.transformPolyline=function(e,t){let r=e instanceof uD?e.points:e;return!Array.isArray(r)&&(r=[]),new uD(r.map(e=>n(e,t)))},e.transformRectangle=r;function i(e,t={}){let n;if(!e.ownerSVGElement||!ad(e)){if(ak(e)){let{left:t,top:n,width:r,height:i}=o(e);return new uM(t,n,r,i)}return new uM(0,0,0,0)}let s=t.target;if(!t.recursive){try{n=e.getBBox()}catch(t){n={x:e.clientLeft,y:e.clientTop,width:e.clientWidth,height:e.clientHeight}}return s?r(n,up(e,s)):uM.create(n)}{let t=e.childNodes,r=t.length;if(0===r)return i(e,{target:s});!s&&(s=e);for(let e=0;e<r;e+=1){let r;let o=t[e];r=0===o.childNodes.length?i(o,{target:s}):i(o,{target:s,recursive:!0}),n=n?n.union(r):r}return n}}function o(e){let t=0,n=0,r=0,i=0;if(e){let o=e;for(;o;)t+=o.offsetLeft,n+=o.offsetTop,(o=o.offsetParent)&&(t+=parseInt(a$(o,"borderLeft"),10),n+=parseInt(a$(o,"borderTop"),10));r=e.offsetWidth,i=e.offsetHeight}return{left:t,top:n,width:r,height:i}}function s(e){let t=t=>{let n=e.getAttribute(t),r=n?parseFloat(n):0;return Number.isNaN(r)?0:r};switch(e instanceof SVGElement&&e.nodeName.toLowerCase()){case"rect":return new uM(t("x"),t("y"),t("width"),t("height"));case"circle":return new uN(t("cx"),t("cy"),t("r"),t("r"));case"ellipse":return new uN(t("cx"),t("cy"),t("rx"),t("ry"));case"polyline":{let t=a8(e);return new uD(t)}case"polygon":{let t=a8(e);return t.length>1&&t.push(t[0]),new uD(t)}case"path":{let t=e.getAttribute("d");return!uX.isValid(t)&&(t=uX.normalize(t)),uX.parse(t)}case"line":return new uT(t("x1"),t("y1"),t("x2"),t("y2"))}return i(e)}e.bbox=function(e,t,n){let i;let o=e.ownerSVGElement;if(!o)return new uM(0,0,0,0);try{i=e.getBBox()}catch(t){i={x:e.clientLeft,y:e.clientTop,width:e.clientWidth,height:e.clientHeight}}return t?uM.create(i):r(i,up(e,n||o))},e.getBBox=i,e.getBoundingOffsetRect=o,e.toGeometryShape=s;function l(e){if(null==e)return null;let t=e;do{let e=t.tagName;if("string"!=typeof e)return null;if(e=e.toUpperCase(),al(t,"x6-port"))t=t.nextElementSibling;else if("G"===e)t=t.firstElementChild;else if("TITLE"===e)t=t.nextElementSibling;else break}while(t);return t}e.translateAndAutoOrient=function(e,t,n,r){let o=uA.create(t),s=uA.create(n);!r&&(r=e instanceof SVGSVGElement?e:e.ownerSVGElement);let l=uf(e);e.setAttribute("transform","");let a=i(e,{target:r}).scale(l.sx,l.sy),u=uo();u.setTranslate(-a.x-a.width/2,-a.y-a.height/2);let c=uo(),h=o.angleBetween(s,o.clone().translate(1,0));h&&c.setRotate(h,0,0);let d=uo(),f=o.clone().move(s,a.width/2);d.setTranslate(2*o.x-f.x,2*o.y-f.y);let p=up(e,r),g=uo();g.setMatrix(d.matrix.multiply(c.matrix.multiply(u.matrix.multiply(p.scale(l.sx,l.sy))))),e.setAttribute("transform",ul(g.matrix))},e.findShapeNode=l;e.getBBoxV2=function(e){let t=l(e);if(!ad(t)){if(ak(e)){let{left:t,top:n,width:r,height:i}=o(e);return new uM(t,n,r,i)}return new uM(0,0,0,0)}return s(t).bbox()||uM.create()}}(ty||(ty={}));let hj={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},hI={highlight(e,t,n){let r,i;let o=tb.getHighlighterId(t,n);if(tb.hasCache(o))return;n=ij({},n,hj);let s=aK.create(t);try{r=s.toPathData()}catch(e){i=ty.bbox(s.node,!0),r=a9(Object.assign(Object.assign({},n),i))}let l=am("path");if(aj(l,Object.assign({d:r,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?aL(n.attrs):null)),e.isEdgeElement(t))aj(l,"d",e.getConnectionPathData());else{let t=s.getTransformToElement(e.container),r=n.padding;if(r){null==i&&(i=ty.bbox(s.node,!0));let e=i.x+i.width/2,n=i.y+i.height/2,o=Math.max((i=ty.transformRectangle(i,t)).width,1),l=Math.max(i.height,1),a=(o+r)/o,u=(l+r)/l,c=ui({a:a,b:0,c:0,d:u,e:e-a*e,f:n-u*n});t=t.multiply(c)}uc(l,t)}aa(l,hk.prefix("highlight-stroke"));let a=e.cell,u=()=>tb.removeHighlighter(o);a.on("removed",u),a.model&&a.model.on("reseted",u),e.container.appendChild(l),tb.setCache(o,l)},unhighlight(e,t,n){tb.removeHighlighter(tb.getHighlighterId(t,n))}};function hL(e,t={}){return new uA(lY(t.x,e.width),lY(t.y,e.height))}function hR(e,t,n){return Object.assign({angle:t,position:e.toJSON()},n)}!function(e){e.getHighlighterId=function(e,t){return ah(e),e.id+JSON.stringify(t)};let t={};e.setCache=function(e,n){t[e]=n};e.hasCache=function(e){return null!=t[e]};e.removeHighlighter=function(e){let n=t[e];n&&(aw(n),delete t[e])}}(tb||(tb={})),(tv||(tv={})).check=function(e,t){if("function"!=typeof t.highlight)throw Error(`Highlighter '${e}' is missing required \`highlight()\` method`);if("function"!=typeof t.unhighlight)throw Error(`Highlighter '${e}' is missing required \`unhighlight()\` method`)},(ei=tv||(tv={})).presets=tX,ei.registry=uY.create({type:"highlighter"}),ei.registry.register(ei.presets,!0);let h_=(e,t)=>e.map(({x:e,y:n,angle:r})=>hR(hL(t,{x:e,y:n}),r||0)),hB=(e,t,n)=>{let r=n.start||0,i=n.step||20;return hz(e,t,r,(e,t)=>(e+.5-t/2)*i)},hD=(e,t,n)=>{let r=n.start||0,i=n.step||360/e.length;return hz(e,t,r,e=>e*i)};function hz(e,t,n,r){let i=t.getCenter(),o=t.getTopCenter(),s=t.width/t.height,l=uN.fromRect(t),a=e.length;return e.map((e,t)=>{let u=n+r(t,a),c=o.clone().rotate(-u,i).scale(s,1,i),h=e.compensateRotate?-l.tangentTheta(c):0;return(e.dx||e.dy)&&c.translate(e.dx||0,e.dy||0),e.dr&&c.move(i,e.dr),hR(c.round(),h,e)})}var hF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let hV=(e,t,n)=>{let r=hL(t,n.start||t.getOrigin());return hq(e,r,hL(t,n.end||t.getCorner()),n)},h$=(e,t,n)=>hq(e,t.getTopLeft(),t.getBottomLeft(),n),hU=(e,t,n)=>hq(e,t.getTopRight(),t.getBottomRight(),n),hG=(e,t,n)=>hq(e,t.getTopLeft(),t.getTopRight(),n),hH=(e,t,n)=>hq(e,t.getBottomLeft(),t.getBottomRight(),n);function hq(e,t,n,r){let i=new uT(t,n),o=e.length;return e.map((e,t)=>{var{strict:n}=e,s=hF(e,["strict"]);let l=n||r.strict?(t+1)/(o+1):(t+.5)/o,a=i.pointAt(l);return(s.dx||s.dy)&&a.translate(s.dx||0,s.dy||0),hR(a.round(),0,s)})}(eo=tx||(tx={})).presets=tY,eo.registry=uY.create({type:"port layout"}),eo.registry.register(eo.presets,!0);let hW={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function hX(e,t){let{x:n,y:r,angle:i,attrs:o}=t||{};return ij({},{angle:i,attrs:o,position:{x:n,y:r}},e,hW)}let hY=(e,t,n)=>hX({position:t.getTopLeft()},n),hJ=(e,t,n)=>hX({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),hQ=(e,t,n)=>hX({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),hK=(e,t,n)=>hX({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),hZ=(e,t,n)=>hX({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),h0=(e,t,n)=>h5(e,t,!1,n),h1=(e,t,n)=>h5(e,t,!0,n),h2=(e,t,n)=>h6(e,t,!1,n),h3=(e,t,n)=>h6(e,t,!0,n);function h5(e,t,n,r){let i,o,s,l;let a=null!=r.offset?r.offset:15,u=t.getCenter().theta(e),c=h4(t),h=0;return u<c[1]||u>c[2]?(i=".3em",o=a,s=0,l="start"):u<c[0]?(i="0",o=0,s=-a,n?(h=-90,l="start"):l="middle"):u<c[3]?(i=".3em",o=-a,s=0,l="end"):(i=".6em",o=0,s=a,n?(h=90,l="start"):l="middle"),hX({position:{x:Math.round(o),y:Math.round(s)},angle:h,attrs:{".":{y:i,"text-anchor":l}}},r)}function h6(e,t,n,r){let i,o,s,l;let a=null!=r.offset?r.offset:15,u=t.getCenter().theta(e),c=h4(t),h=0;return u<c[1]||u>c[2]?(i=".3em",o=-a,s=0,l="end"):u<c[0]?(i=".6em",o=0,s=a,n?(h=90,l="start"):l="middle"):u<c[3]?(i=".3em",o=a,s=0,l="start"):(i="0em",o=0,s=-a,n?(h=-90,l="start"):l="middle"),hX({position:{x:Math.round(o),y:Math.round(s)},angle:h,attrs:{".":{y:i,"text-anchor":l}}},r)}function h4(e){let t=e.getCenter(),n=t.theta(e.getTopLeft()),r=t.theta(e.getBottomLeft()),i=t.theta(e.getBottomRight());return[n,t.theta(e.getTopRight()),i,r]}let h8=(e,t,n)=>h7(e.diff(t.getCenter()),!1,n),h9=(e,t,n)=>h7(e.diff(t.getCenter()),!0,n);function h7(e,t,n){let r;let i=null!=n.offset?n.offset:20,o=new uA(0,0),s=-e.theta(o),l=e.clone().move(o,i).diff(e).round(),a=".3em",u=s;return(s+90)%180==0?(r=t?"end":"middle",!t&&-270===s&&(a="0em")):s>-270&&s<-90?(r="start",u=s-180):r="end",hX({position:l.round().toJSON(),angle:t?u:0,attrs:{".":{y:a,"text-anchor":r}}},n)}(es=tw||(tw={})).presets=tJ,es.registry=uY.create({type:"port label layout"}),es.registry.register(es.presets,!0);class de extends sp{get priority(){return 2}constructor(){super(),this.cid=tC.uniqueId(),de.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return aC(e),this}unmount(e=this.container){return aw(e),this}remove(e=this.container){return e===this.container&&(this.removeEventListeners(document),this.onRemove(),delete de.views[this.cid]),this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return aa(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return au(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return aq(t,e),this}setAttrs(e,t=this.container){return null!=e&&null!=t&&aj(t,e),this}findAttr(e,t=this.container){let n=t;for(;n&&1===n.nodeType;){let t=n.getAttribute(e);if(null!=t)return t;if(n===this.container)break;n=n.parentNode}return null}find(e,t=this.container,n=this.selectors){return de.find(e,t,n).elems}findOne(e,t=this.container,n=this.selectors){let r=this.find(e,t,n);return r.length>0?r[0]:null}findByAttr(e,t=this.container){let n=t;for(;n&&n.getAttribute;){let t=n.getAttribute(e);if((null!=t||n===this.container)&&"false"!==t)return n;n=n.parentNode}return null}getSelector(e,t){let n;if(e===this.container)return"string"==typeof t&&(n=`> ${t}`),n;if(e){let r=ab(e)+1;n=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(n+=` > ${t}`),n=this.getSelector(e.parentNode,n)}return n}prefixClassName(e){return hk.prefix(e)}delegateEvents(e,t){if(null==e)return this;!t&&this.undelegateEvents();let n=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(t=>{let r=t.match(n);if(null==r)return;let i=this.getEventHandler(e[t]);"function"==typeof i&&this.delegateEvent(r[1],r[2],i)}),this}undelegateEvents(){return ti.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,n){return ti.on(this.container,e+this.getEventNamespace(),t,n),this}undelegateEvent(e,t,n){let r=e+this.getEventNamespace();return null==t?ti.off(this.container,r):"string"==typeof t?ti.off(this.container,r,t,n):ti.off(this.container,r,t),this}addEventListeners(e,t,n){if(null==t)return this;let r=this.getEventNamespace();return Object.keys(t).forEach(i=>{let o=this.getEventHandler(t[i]);"function"==typeof o&&ti.on(e,i+r,n,o)}),this}removeEventListeners(e){return null!=e&&ti.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${hk.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if("string"==typeof e){let n=this[e];"function"==typeof n&&(t=(...e)=>n.call(this,...e))}else t=(...t)=>e.call(this,...t);return t}getEventTarget(e,t={}){let{target:n,type:r,clientX:i=0,clientY:o=0}=e;return t.fromPoint||"touchmove"===r||"touchend"===r?document.elementFromPoint(i,o):n}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return!0===this.getEventData(e).propagationStopped}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(null==e)throw TypeError("Event object required");let n=e.data,r=`__${this.cid}__`;if(null==t)return null==n?{}:n[r]||{};return null==n&&(n=e.data={}),null==n[r]?n[r]=Object.assign({},t):n[r]=Object.assign(Object.assign({},n[r]),t),n[r]}normalizeEvent(e){return de.normalizeEvent(e)}}(el=de||(de={})).createElement=function(e,t){return t?am(e||"g"):ag(e||"div")},el.find=function(e,t,n){if(!e||"."===e)return{elems:[t]};if(n){let t=n[e];if(t)return{elems:Array.isArray(t)?t:[t]}}if(hk.useCSSSelector){let n=e.includes(">")?`:scope ${e}`:e;return{isCSSSelector:!0,elems:Array.prototype.slice.call(t.querySelectorAll(n))}}return{elems:[]}},el.normalizeEvent=function(e){let t=e,n=e.originalEvent,r=n&&n.changedTouches&&n.changedTouches[0];if(r){for(let t in e)void 0===r[t]&&(r[t]=e[t]);t=r}return t},(ea=de||(de={})).views={},ea.getView=function(e){return ea.views[e]||null};eu=tC||(tC={}),r=0,eu.uniqueId=function(){let e=`v${r}`;return r+=1,e};class dt{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new uE,this.pathCache={}}get(e){return!this.elemCache.has(e)&&this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){let t=this.get(e);return!t.data&&(t.data={}),t.data}getMatrix(e){let t=this.get(e);if(null==t.matrix){let n=this.view.container;t.matrix=function(e,t){let n=ui();if(ad(t)&&ad(e)){let r=e,i=[];for(;r&&r!==t;){let e=us(r.getAttribute("transform")||null);i.push(e),r=r.parentNode}i.reverse().forEach(e=>{n=n.multiply(e)})}return n}(e,n)}return ui(t.matrix)}getShape(e){let t=this.get(e);return null==t.shape&&(t.shape=ty.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){let t=this.get(e);return null==t.boundingRect&&(t.boundingRect=ty.getBBoxV2(e)),t.boundingRect.clone()}}!function(e){function t(e){return null!=e&&"string"==typeof e}e.isJSONMarkup=function(e){return null!=e&&!t(e)},e.isStringMarkup=t;e.clone=function(e){return null==e||t(e)?e:ss(e)};function n(e,t={ns:af.svg}){let r=document.createDocumentFragment(),i={},o={},s=[{markup:Array.isArray(e)?e:[e],parent:r,ns:t.ns}];for(;s.length>0;){let e=s.pop(),t=e.ns||af.svg,n=e.markup,r=e.parent;n.forEach(e=>{let n=e.tagName;if(!n)throw TypeError("Invalid tagName");e.ns&&(t=e.ns);let l=t?ag(n,t):ap(n),a=e.attrs;a&&aj(l,aL(a));let u=e.style;u&&aq(l,u);let c=e.className;null!=c&&l.setAttribute("class",Array.isArray(c)?c.join(" "):c),e.textContent&&(l.textContent=e.textContent);let h=e.selector;if(null!=h){if(o[h])throw TypeError("Selector must be unique");o[h]=l}if(e.groupSelector){let t=e.groupSelector;!Array.isArray(t)&&(t=[t]),t.forEach(e=>{!i[e]&&(i[e]=[]),i[e].push(l)})}r.appendChild(l);let d=e.children;Array.isArray(d)&&s.push({ns:t,markup:d,parent:l})})}return Object.keys(i).forEach(e=>{if(o[e])throw Error("Ambiguous group selector");o[e]=i[e]}),{fragment:r,selectors:o,groups:i}}function r(e){return e instanceof SVGElement?am("g"):ap("div")}e.sanitize=function(e){return`${e}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")},e.parseJSONMarkup=n;e.renderMarkup=function(e){if(t(e)){let t=aK.createVectors(e),n=t.length;if(1===n)return{elem:t[0].node};if(n>1){let e=r(t[0].node);return t.forEach(t=>{e.appendChild(t.node)}),{elem:e}}return{}}let i=n(e),o=i.fragment,s=null;return o.childNodes.length>1?(s=r(o.firstChild)).appendChild(o):s=o.firstChild,{elem:s,selectors:i.selectors}};e.parseLabelStringMarkup=function(e){let t=aK.createVectors(e),n=document.createDocumentFragment();for(let e=0,r=t.length;e<r;e+=1){let r=t[e].node;n.appendChild(r)}return{fragment:n,selectors:{}}}}(tE||(tE={})),(tE||(tE={})).getSelector=function e(t,n,r){if(null!=t){let i;let o=t.tagName.toLowerCase();if(t===n)return i="string"==typeof r?`> ${o} > ${r}`:`> ${o}`;let s=t.parentNode;if(s&&s.childNodes.length>1){let e=ab(t)+1;i=`${o}:nth-child(${e})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,n,i)}return r},(ec=tE||(tE={})).getPortContainerMarkup=function(){return"g"},ec.getPortMarkup=function(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}},ec.getPortLabelMarkup=function(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}},(tE||(tE={})).getEdgeMarkup=function(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]},(tE||(tE={})).getForeignObjectMarkup=function(e=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:af.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:af.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:e?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}};class dn{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let n,r,i,o;let s=[];return Object.keys(t).forEach(r=>{let i=t[r],o=this.getDefinition(r),l=n0(tm.isValidDefinition,this.view,o,i,{elem:e,attrs:t,cell:this.cell,view:this.view});o&&l?"string"==typeof o?(null==n&&(n={}),n[o]=i):null!==i&&s.push({name:r,definition:o}):(null==n&&(n={}),n[aA.includes(r)?r:l$(r)]=i)}),s.forEach(({name:e,definition:n})=>{let s=t[e];"function"==typeof n.set&&(null==r&&(r={}),r[e]=s);"function"==typeof n.offset&&(null==i&&(i={}),i[e]=s);"function"==typeof n.position&&(null==o&&(o={}),o[e]=s)}),{raw:t,normal:n,set:r,offset:i,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);let n=e.normal&&e.normal.transform;null!=n&&t.normal&&(t.normal.transform=n),e.normal=t.normal}findAttrs(e,t,n,r){let i=[],o=new uE;return Object.keys(e).forEach(s=>{let l=e[s];if(!r5(l))return;let{isCSSSelector:a,elems:u}=de.find(s,t,r);n[s]=u;for(let e=0,t=u.length;e<t;e+=1){let n=u[e],c=r&&r[s]===n,h=o.get(n);if(h){!h.array&&(i.push(n),h.array=!0,h.attrs=[h.attrs],h.priority=[h.priority]);let e=h.attrs,r=h.priority;if(c)e.unshift(l),r.unshift(-1);else{let n=sK(r,a?-1:t);e.splice(n,0,l),r.splice(n,0,t)}}else o.set(n,{elem:n,attrs:l,priority:c?-1:t,array:!1})}}),i.forEach(e=>{let t=o.get(e),n=t.attrs;t.attrs=n.reduceRight((e,t)=>iM(e,t),{})}),o}updateRelativeAttrs(e,t,n){let r=t.raw||{},i=t.normal||{},o=t.set,s=t.position,l=t.offset,a=()=>({elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:n.clone()});if(null!=o&&Object.keys(o).forEach(e=>{let t=o[e],n=this.getDefinition(e);if(null!=n){let r=n0(n.set,this.view,t,a());"object"==typeof r?i=Object.assign(Object.assign({},i),r):null!=r&&(i[e]=r)}}),e instanceof HTMLElement){this.view.setAttrs(i,e);return}let u=i.transform,c=us(u?`${u}`:null),h=new uA(c.e,c.f);u&&(delete i.transform,c.e=0,c.f=0);let d=!1;null!=s&&Object.keys(s).forEach(e=>{let t=s[e],n=this.getDefinition(e);if(null!=n){let e=n0(n.position,this.view,t,a());null!=e&&(d=!0,h.translate(uA.create(e)))}}),this.view.setAttrs(i,e);let f=!1;if(null!=l){let t=this.view.getBoundingRectOfElement(e);if(t.width>0&&t.height>0){let n=ty.transformRectangle(t,c);Object.keys(l).forEach(t=>{let i=l[t],o=this.getDefinition(t);if(null!=o){let t=n0(o.offset,this.view,i,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:n});null!=t&&(f=!0,h.translate(uA.create(t)))}})}}(null!=u||d||f)&&(h.round(1),c.e=h.x,c.f=h.y,e.setAttribute("transform",ul(c)))}update(e,t,n){let r;let i={},o=this.findAttrs(n.attrs||t,e,i,n.selectors),s=n.attrs?this.findAttrs(t,e,i,n.selectors):o,l=[];o.each(t=>{let r=t.elem,o=t.attrs,a=this.processAttrs(r,o);if(null==a.set&&null==a.position&&null==a.offset)this.view.setAttrs(a.normal,r);else{let t;let u=s.get(r),c=u?u.attrs:null,h=c&&null==o.ref?c.ref:o.ref;if(h){if(!(t=(i[h]||this.view.find(h,e,n.selectors))[0]))throw Error(`"${h}" reference does not exist.`)}else t=null;let d={node:r,refNode:t,attributes:c,processedAttributes:a},f=l.findIndex(e=>e.refNode===r);f>-1?l.splice(f,0,d):l.push(d)}});let a=new uE;l.forEach(t=>{let i,o;let s=t.node,l=t.refNode,u=null!=l&&null!=n.rotatableNode&&ax(n.rotatableNode,l);if(l&&(i=a.get(l)),!i){let t=u?n.rotatableNode:e;i=l?ty.getBBox(l,{target:t}):n.rootBBox,l&&a.set(l,i)}n.attrs&&t.attributes?(o=this.processAttrs(s,t.attributes),this.mergeProcessedAttrs(o,t.processedAttributes)):o=t.processedAttributes;let c=i;u&&null!=n.rotatableNode&&!n.rotatableNode.contains(s)&&(!r&&(r=us(aj(n.rotatableNode,"transform"))),c=ty.transformRectangle(i,r)),this.updateRelativeAttrs(s,o,c)})}}class dr{get cell(){return this.view.cell}constructor(e,t,n=[]){this.view=e;let r={},i={},o=0;Object.keys(t).forEach(e=>{let n=t[e];!Array.isArray(n)&&(n=[n]),n.forEach(t=>{let n=r[t];!n&&(o+=1,n=r[t]=1<<o),i[e]|=n})});let s=n;if(!Array.isArray(s)&&(s=[s]),s.forEach(e=>{!r[e]&&(o+=1,r[e]=1<<o)}),o>25)throw Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=n}getFlag(e){let t=this.flags;return null==t?0:Array.isArray(e)?e.reduce((e,n)=>e|t[n],0):0|t[e]}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs?(Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e):e}}var di=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class ds extends de{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){let t=(e,t)=>null!=t?s_([...Array.isArray(e)?e:[e],...Array.isArray(t)?t:[t]]):Array.isArray(e)?[...e]:[e],n=ss(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:s}=e,l=di(e,["bootstrap","actions","events","documentEvents"]);return r&&(n.bootstrap=t(n.bootstrap,r)),i&&Object.entries(i).forEach(([e,r])=>{let i=n.actions[e];r&&i?n.actions[e]=t(i,r):r&&(n.actions[e]=t(r))}),o&&(n.events=Object.assign(Object.assign({},n.events),o)),e.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),s)),iM(n,l)}get[Symbol.toStringTag](){return ds.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new dn(this),this.flag=new dr(this,this.options.actions,this.options.bootstrap),this.cache=new dt(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(e){return this.getConstructor().getOptions(e)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return de.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,null!=this.options.events&&this.delegateEvents(this.options.events);let t=this.getContainerAttrs();null!=t&&this.setAttrs(t,e);let n=this.getContainerStyle();null!=n&&this.setStyle(n,e);let r=this.getContainerClassName();null!=r&&this.addClass(r,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,n,r){if(this.hasAction(e,t)){n();let i=[t];return r&&("string"==typeof r?i.push(r):i.push(...r)),this.removeAction(e,i)}return e}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:e}){this.onAttrsChange(e)}onAttrsChange(e){let t=this.flag.getChangedFlag();if(!e.updated&&!!t)e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),null!=this.graph&&this.graph.renderer.requestViewUpdate(this,t,e)}parseJSONMarkup(e,t){let n=tE.parseJSONMarkup(e),r=n.selectors,i=this.rootSelector;if(t&&i){if(r[i])throw Error("Invalid root selector");r[i]=t}return n}can(e){let t=this.graph.options.interacting;if("function"==typeof t&&(t=n0(t,this.graph,this)),"object"==typeof t){let n=t[e];return"function"==typeof n&&(n=n0(n,this.graph,this)),!1!==n}return"boolean"==typeof t&&t}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){let t=this.getBoundingRectOfElement(e),n=this.getMatrixOfElement(e),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return ty.transformRectangle(t,i.multiply(r).multiply(n))}getUnrotatedBBoxOfElement(e){let t=this.getBoundingRectOfElement(e),n=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return ty.transformRectangle(t,r.multiply(n))}getBBox(e={}){let t;if(e.useCellGeometry){let e=this.cell,n=e.isNode()?e.getAngle():0;t=e.getBBox().bbox(n)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){let e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return ui().translate(t.x,t.y)}getRootRotatedMatrix(){let e=ui(),t=this.cell,n=t.isNode()?t.getAngle():0;if(n){let r=t.getBBox(),i=r.width/2,o=r.height/2;e=e.translate(i,o).rotate(n).translate(-i,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,n={}){null==n.rootBBox&&(n.rootBBox=new uM),null==n.selectors&&(n.selectors=this.selectors),this.attr.update(e,t,n)}isEdgeElement(e){return this.cell.isEdge()&&(null==e||e===this.container)}prepareHighlight(e,t={}){let n=e||this.container;return t.partial=n===this.container,n}highlight(e,t={}){let n=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:n,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){let n=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:n,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,n,r,i){let o=this.cell,s=this.findAttr("port",e),l=e.getAttribute("data-selector"),a={cell:o.id};return null!=l&&(a.magnet=l),null!=s?(a.port=s,o.isNode()&&!o.hasPort(s)&&null==l&&(a.selector=this.getSelector(e))):null==l&&this.container!==e&&(a.selector=this.getSelector(e)),a}getMagnetFromEdgeTerminal(e){let t;let n=this.cell,r=this.container,i=e.port,o=e.magnet;return null!=i&&n.isNode()&&n.hasPort(i)?t=this.findPortElem(i,o)||r:(!o&&(o=e.selector),!o&&null!=i&&(o=`[port="${i}"]`),t=this.findOne(o,r,this.selectors)),t}hasTools(e){let t=this.tools;return null!=t&&(null==e||t.name===e)}addTools(e){if(this.removeTools(),e){if(!this.can("toolsAddable"))return this;let t=dl.isToolsView(e)?e:new dl(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){let e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,n){let r=this.cell;return null==t||null==n?{e,view:this,cell:r}:{e,x:t,y:n,view:this,cell:r}}onClick(e,t,n){this.notify("cell:click",this.getEventArgs(e,t,n))}onDblClick(e,t,n){this.notify("cell:dblclick",this.getEventArgs(e,t,n))}onContextMenu(e,t,n){this.notify("cell:contextmenu",this.getEventArgs(e,t,n))}onMouseDown(e,t,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,n))}onMouseUp(e,t,n){this.notify("cell:mouseup",this.getEventArgs(e,t,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,n){this.notify("cell:mousemove",this.getEventArgs(e,t,n))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,n,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,n)))}onCustomEvent(e,t,n,r){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,n,r))),this.notify(t,Object.assign({},this.getEventArgs(e,n,r)))}onMagnetMouseDown(e,t,n,r){}onMagnetDblClick(e,t,n,r){}onMagnetContextMenu(e,t,n,r){}onLabelMouseDown(e,t,n){}checkMouseleave(e){let t=this.getEventTarget(e,{fromPoint:!0}),n=this.graph.findViewByElem(t);if(n===this)return;if(this.onMouseLeave(e),!!n)n.onMouseEnter(e)}dispose(){this.cell.off("changed",this.onCellChanged,this)}}ds.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([ds.dispose()],ds.prototype,"dispose",null),(eh=ds||(ds={})).Flag=dr,eh.Attr=dn,(ed=ds||(ds={})).toStringTag=`X6.${ed.name}`,ed.isCellView=function(e){if(null==e)return!1;if(e instanceof ed)return!0;let t=e[Symbol.toStringTag];return(null==t||t===ed.toStringTag)&&"function"==typeof e.isNodeView&&"function"==typeof e.isEdgeView&&"function"==typeof e.confirmUpdate||!1},(ef=ds||(ds={})).priority=function(e){return function(t){t.config({priority:e})}},ef.bootstrap=function(e){return function(t){t.config({bootstrap:e})}},(ds||(ds={})).registry=uY.create({type:"view"});class dl extends de{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return dl.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){let n=e?de.createElement("g",!0):de.createElement("div",!1);return aa(n,this.prefixClassName("cell-tools")),t.className&&aa(n,t.className),n}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!ds.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(aa(this.svgContainer,this.prefixClassName("edge-tools")),aa(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(aa(this.svgContainer,this.prefixClassName("node-tools")),aa(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));let t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];let n=[];t.forEach(e=>{dl.ToolItem.isToolItem(e)?"vertices"===e.name?n.unshift(e):n.push(e):"vertices"===("object"==typeof e?e.name:e)?n.unshift(e):n.push(e)});for(let e=0;e<n.length;e+=1){let t;let r=n[e];if(dl.ToolItem.isToolItem(r))t=r;else{let e="object"==typeof r?r.name:r,n="object"==typeof r&&r.args||{};if(e){if(this.cell.isNode()){let r=tP.registry.get(e);if(!r)return tP.registry.onNotFound(e);t=new r(n)}else if(this.cell.isEdge()){let r=tO.registry.get(e);if(!r)return tO.registry.onNotFound(e);t=new r(n)}}}t&&(t.config(this.cellView,this),t.render(),(!1!==t.options.isSVGElement?this.svgContainer:this.htmlContainer).appendChild(t.container),this.tools.push(t))}return this}update(e={}){let t=this.tools;return t&&t.forEach(t=>{e.toolId!==t.cid&&t.isVisible()&&t.update()}),this}focus(e){let t=this.tools;return t&&t.forEach(t=>{e===t?t.show():t.hide()}),this}blur(e){let t=this.tools;return t&&t.forEach(t=>{t!==e&&!t.isVisible()&&(t.show(),t.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){let e=this.tools;return e&&(e.forEach(e=>e.remove()),this.tools=null),aw(this.svgContainer),aw(this.htmlContainer),super.remove()}mount(){let e=this.tools,t=this.cellView;if(t&&e){let n=e.some(e=>!1!==e.options.isSVGElement),r=e.some(e=>!1===e.options.isSVGElement);n&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),r&&this.graph.container.appendChild(this.htmlContainer)}return this}}(ep=dl||(dl={})).toStringTag=`X6.${ep.name}`,ep.isToolsView=function(e){if(null==e)return!1;if(e instanceof ep)return!0;let t=e[Symbol.toStringTag];return(null==t||t===ep.toStringTag)&&null!=e.graph&&null!=e.cell&&"function"==typeof e.config&&"function"==typeof e.update&&"function"==typeof e.focus&&"function"==typeof e.blur&&"function"==typeof e.show&&"function"==typeof e.hide||!1},!function(e){var t,n;let r;class i extends de{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){return iM(ss(this.getDefaults()),e)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return i.toStringTag}constructor(e={}){super(),this.visible=!0,this.options=this.getOptions(e),this.container=de.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),aa(this.container,this.prefixClassName("cell-tool")),"string"==typeof this.options.className&&aa(this.container,this.options.className),this.init()}init(){}getOptions(e){return this.constructor.getOptions(e)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(e,t){return this.cellView=e,this.parent=t,this.stamp(this.container),this.cell.isEdge()?aa(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&aa(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();let e=this.options.markup;if(e){let t=tE.parseJSONMarkup(e);this.container.appendChild(t.fragment),this.childNodes=t.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(e){e&&e.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){let e=this.options.focusOpacity;return null!=e&&Number.isFinite(e)&&(this.container.style.opacity=`${e}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(e){return null==this.graph||null==this.cellView||this.graph.view.guard(e,this.cellView)}}i.defaults={isSVGElement:!0,tagName:"g"},e.ToolItem=i;t=i=e.ToolItem||(e.ToolItem={}),r=0,t.define=function(e){var t;let n=su((t=e.name)?lU(t):(r+=1,`CustomTool${r}`),this);return n.config(e),n},(n=i=e.ToolItem||(e.ToolItem={})).toStringTag=`X6.${n.name}`,n.isToolItem=function(e){if(null==e)return!1;if(e instanceof n)return!0;let t=e[Symbol.toStringTag];return(null==t||t===n.toStringTag)&&null!=e.graph&&null!=e.cell&&"function"==typeof e.config&&"function"==typeof e.update&&"function"==typeof e.focus&&"function"==typeof e.blur&&"function"==typeof e.show&&"function"==typeof e.hide&&"function"==typeof e.isVisible||!1}}(dl||(dl={}));let da=e=>e;function du(e,t){return 0===t?"0%":`${Math.round(e/t*100)}%`}function dc(e){return(t,n,r,i)=>n.isEdgeElement(r)?function(e,t,n,r,i){let o=n.getConnection();if(!o)return t;let s=o.closestPointLength(i);if(e){let e=o.length();t.anchor={name:"ratio",args:{ratio:s/e}}}else t.anchor={name:"length",args:{length:s}};return t}(e,t,n,r,i):function(e,t,n,r,i){let o=n.cell,s=o.getAngle(),l=n.getUnrotatedBBoxOfElement(r),a=o.getBBox().getCenter(),u=uA.create(i).rotate(s,a),c=u.x-l.x,h=u.y-l.y;return e&&(c=du(c,l.width),h=du(h,l.height)),t.anchor={name:"topLeft",args:{dx:c,dy:h,rotate:!0}},t}(e,t,n,r,i)}let dh=dc(!0),dd=dc(!1);function df(e,t,n,r){return n0(tS.presets.pinRelative,this.graph,{},t,n,e,this.cell,r,{}).anchor}function dp(e,t){return t?e.cell.getBBox():e.cell.isEdge()?e.getConnection().bbox():e.getUnrotatedBBoxOfElement(e.container)}(eg=tS||(tS={})).presets=tQ,eg.registry=uY.create({type:"connection strategy"}),eg.registry.register(eg.presets,!0);class dg extends dl.ToolItem{onRender(){aa(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){let e=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();uc(this.container,e,{absolute:!0})}getNodeMatrix(){let e=this.cellView,t=this.options,{x:n=0,y:r=0}=t,{offset:i,useCellGeometry:o,rotate:s}=t,l=dp(e,o),a=e.cell.getAngle();!s&&(l=l.bbox(a));let u=0,c=0;"number"==typeof i?(u=i,c=i):"object"==typeof i&&(u=i.x,c=i.y),n=lY(n,l.width),r=lY(r,l.height);let h=ui().translate(l.x+l.width/2,l.y+l.height/2);return s&&(h=h.rotate(a)),h=h.translate(n+u-l.width/2,r+c-l.height/2)}getEdgeMatrix(){let e,t,n;let r=this.cellView,{offset:i=0,distance:o=0,rotate:s}=this.options,l=lY(o,1);(e=l>=0&&l<=1?r.getTangentAtRatio(l):r.getTangentAtLength(l))?(t=e.start,n=e.vector().vectorAngle(new uA(1,0))||0):(t=r.getConnection().start,n=0);let a=ui().translate(t.x,t.y).rotate(n);return a="object"==typeof i?a.translate(i.x||0,i.y||0):a.translate(0,i),!s&&(a=a.rotate(-n)),a}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();let t=this.options.onClick;"function"==typeof t&&n0(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}!function(e){e.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})}(dg||(dg={})),(em=dg||(dg={})).Remove=em.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}});var dm=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class dy extends dl.ToolItem{onRender(){if(aa(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){let e=this.options.attrs,{class:t}=e,n=dm(e,["class"]);aj(this.container,aL(n)),t&&aa(this.container,t)}this.update()}update(){let e=this.cellView,t=this.options,{useCellGeometry:n,rotate:r}=t,i=lJ(t.padding),o=dp(e,n).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom}),s=e.cell;if(s.isNode()){let e=s.getAngle();if(e){if(r){let t=s.getBBox().getCenter();ud(this.container,e,t.x,t.y,{absolute:!0})}else o=o.bbox(e)}}return aj(this.container,o.toJSON()),this}}!function(e){e.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})}(dy||(dy={}));class db extends dl.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){let e=this.handles;this.handles=[],e&&e.forEach(e=>{this.stopHandleListening(e),e.remove()})}renderHandles(){let e=this.vertices;for(let t=0,n=e.length;t<n;t+=1){let n=e[t],r=this.options.createHandle,i=this.options.processHandle,o=r({index:t,graph:this.graph,guard:e=>this.guard(e),attrs:this.options.attrs||{}});i&&i(o),o.updatePosition(n.x,n.y),this.stamp(o.container),this.container.appendChild(o.container),this.handles.push(o),this.startHandleListening(o)}}updateHandles(){let e=this.vertices;for(let t=0,n=e.length;t<n;t+=1){let n=e[t],r=this.handles[t];r&&r.updatePosition(n.x,n.y)}}updatePath(){let e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){let t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){let t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){let t=this.cellView,n=this.vertices,r=e>0?n[e-1]:t.sourceAnchor,i=e<n.length-1?n[e+1]:t.targetAnchor;return{prev:uA.create(r),next:uA.create(i)}}getMouseEventArgs(e){let t=this.normalizeEvent(e),{x:n,y:r}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:n,y:r}}onHandleChange({e}){this.focus();let t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){let{e:n,x:r,y:i}=this.getMouseEventArgs(e);this.eventData(n,{start:{x:r,y:i}}),t.notifyMouseDown(n,r,i)}}onHandleChanging({handle:e,e:t}){let n=this.cellView,r=e.options.index,{e:i,x:o,y:s}=this.getMouseEventArgs(t),l={x:o,y:s};this.snapVertex(l,r),n.cell.setVertexAt(r,l,{ui:!0,toolId:this.cid}),e.updatePosition(l.x,l.y),!this.options.stopPropagation&&n.notifyMouseMove(i,o,s)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){let t=this.options,n=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}n.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);let{e:r,x:i,y:o}=this.getMouseEventArgs(e);if(!this.options.stopPropagation){n.notifyMouseUp(r,i,o);let{start:e}=this.eventData(r);if(e){let{x:t,y:s}=e;t===i&&s===o&&n.onClick(r,i,o)}}n.checkMouseleave(r),t.onChanged&&t.onChanged({edge:n.cell,edgeView:n})}snapVertex(e,t){let n=this.options.snapRadius||0;if(n>0){let r=this.getNeighborPoints(t),i=r.prev,o=r.next;Math.abs(e.x-i.x)<n?e.x=i.x:Math.abs(e.x-o.x)<n&&(e.x=o.x),Math.abs(e.y-i.y)<n?e.y=r.prev.y:Math.abs(e.y-o.y)<n&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){let n=e.options.index,r=this.cellView;r.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){let t=this.guard(e),n=this.options.addable&&this.cellView.can("vertexAddable"),r=!this.options.modifiers||ta.isMatch(e,this.options.modifiers);return!t&&n&&r}onPathMouseDown(e){let t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();let n=this.normalizeEvent(e),r=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});let i=t.getVertexIndex(r.x,r.y);this.snapVertex(r,i),t.cell.insertVertex(r,i,{ui:!0,toolId:this.cid}),this.render();let o=this.handles[i];this.eventData(n,{vertexAdded:!0}),o.onMouseDown(n)}onRemove(){this.resetHandles()}}(ey=db||(db={})).Handle=class e extends de{get graph(){return this.options.graph}constructor(e){super(),this.options=e,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=de.createElement("circle",!0);let e=this.options.attrs;if("function"==typeof e){let t=ey.getDefaults();this.setAttrs(Object.assign(Object.assign({},t.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(e,t){this.setAttrs({cx:e,cy:t})}onMouseDown(e){if(!this.options.guard(e))e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},e.data),this.emit("change",{e:e,handle:this})}onMouseMove(e){this.emit("changing",{e:e,handle:this})}onMouseUp(e){this.emit("changed",{e:e,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(e){this.emit("remove",{e:e,handle:this})}},!function(e){let t=hk.prefix("edge-tool-vertex-path");e.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:t=>new e.Handle(t),markup:[{tagName:"path",selector:"connection",className:t,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${t}`]:"onPathMouseDown",[`touchstart .${t}`]:"onPathMouseDown"}})}(db||(db={}));class dv extends dl.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){aa(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();let e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let e=0,n=t.length;e<n-1;e+=1){let n=t[e],r=t[e+1],i=this.renderHandle(n,r,e);this.stamp(i.container),this.handles.push(i)}return this}renderHandle(e,t,n){let r=this.options.createHandle({index:n,graph:this.graph,guard:e=>this.guard(e),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(r),this.updateHandle(r,e,t),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){let e=this.handles;this.handles=[],e&&e.forEach(e=>{this.stopHandleListening(e),e.remove()})}shiftHandleIndexes(e){let t=this.handles;for(let n=0,r=t.length;n<r;n+=1)t[n].options.index+=e}resetAnchor(e,t){let n=this.cellView.cell,r={ui:!0,toolId:this.cid};t?n.prop([e,"anchor"],t,r):n.removeProp([e,"anchor"],r)}snapHandle(e,t,n){let r=e.options.axis,i=e.options.index,o=this.cellView.cell.getVertices(),s=o[i-2]||n.sourceAnchor,l=o[i+1]||n.targetAnchor,a=this.options.snapRadius;return Math.abs(t[r]-s[r])<a?t[r]=s[r]:Math.abs(t[r]-l[r])<a&&(t[r]=l[r]),t}onHandleChanging({handle:e,e:t}){let n=this.graph,r=this.options,i=this.cellView,o=r.anchor,s=e.options.axis,l=e.options.index-1,a=this.getEventData(t),u=this.normalizeEvent(t),c=n.snapToGrid(u.clientX,u.clientY),h=this.snapHandle(e,c.clone(),a),d=ss(this.vertices),f=d[l],p=d[l+1],g=i.sourceView,m=i.sourceBBox,y=!1,b=!1;if(f?0===l?m.containsPoint(f)?(d.shift(),this.shiftHandleIndexes(-1),y=!0):(f[s]=h[s],b=!0):f[s]=h[s]:((f=i.sourceAnchor.toJSON())[s]=h[s],m.containsPoint(f)?y=!0:(d.unshift(f),this.shiftHandleIndexes(1),b=!0)),"function"==typeof o&&g){if(y){let e=a.sourceAnchor.clone();e[s]=h[s];let t=n0(o,i,e,g,i.sourceMagnet||g.container,"source",i,this);this.resetAnchor("source",t)}b&&this.resetAnchor("source",a.sourceAnchorDef)}let v=i.targetView,x=i.targetBBox,w=!1,C=!1;if(p?l===d.length-2?x.containsPoint(p)?(d.pop(),w=!0):(p[s]=h[s],C=!0):p[s]=h[s]:((p=i.targetAnchor.toJSON())[s]=h[s],x.containsPoint(p)?w=!0:(d.push(p),C=!0)),"function"==typeof o&&v){if(w){let e=a.targetAnchor.clone();e[s]=h[s];let t=n0(o,i,e,v,i.targetMagnet||v.container,"target",i,this);this.resetAnchor("target",t)}C&&this.resetAnchor("target",a.targetAnchorDef)}!uA.equalPoints(d,this.vertices)&&this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(e,f,p,0),!r.stopPropagation&&i.notifyMouseMove(u,c.x,c.y)}onHandleChange({handle:e,e:t}){let n=this.options,r=this.handles,i=this.cellView,o=e.options.index;if(!!Array.isArray(r)){for(let e=0,t=r.length;e<t;e+=1)e!==o&&r[e].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:i.sourceAnchor.clone(),targetAnchor:i.targetAnchor.clone(),sourceAnchorDef:ss(this.cell.prop(["source","anchor"])),targetAnchorDef:ss(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){let e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);i.notifyMouseDown(e,n.x,n.y)}}}onHandleChanged({e}){let t=this.options,n=this.cellView;t.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});let r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),!t.stopPropagation&&n.notifyMouseUp(r,i.x,i.y),n.checkMouseleave(r),t.onChanged&&t.onChanged({edge:n.cell,edgeView:n})}updateHandle(e,t,n,r=0){let i=this.options.precision||0,o=Math.abs(t.x-n.x)<i,s=Math.abs(t.y-n.y)<i;if(o||s){let i=new uT(t,n);if(i.length()<this.options.threshold)e.hide();else{let t=i.getCenter(),n=o?"x":"y";t[n]+=r||0;let s=i.vector().vectorAngle(new uA(1,0));e.updatePosition(t.x,t.y,s,this.cellView),e.show(),e.options.axis=n}}else e.hide()}onRemove(){this.resetHandles()}}(eb=dv||(dv={})).Handle=class e extends de{constructor(e){super(),this.options=e,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=de.createElement("rect",!0);let e=this.options.attrs;if("function"==typeof e){let t=eb.getDefaults();this.setAttrs(Object.assign(Object.assign({},t.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(e,t,n,r){let i=r.getClosestPoint(new uA(e,t))||new uA(e,t),o=ui().translate(i.x,i.y);if(i.equals({x:e,y:t}))o=o.rotate(n);else{let n=new uT(e,t,i.x,i.y).vector().vectorAngle(new uA(1,0));0!==n&&(n+=90),o=o.rotate(n)}this.setAttrs({transform:ul(o),cursor:n%180==0?"row-resize":"col-resize"})}onMouseDown(e){if(!this.options.guard(e))this.trigger("change",{e:e,handle:this}),e.stopPropagation(),e.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},e.data)}onMouseMove(e){this.emit("changing",{e:e,handle:this})}onMouseUp(e){this.emit("changed",{e:e,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}},!function(e){e.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:t=>new e.Handle(t),anchor:df})}(dv||(dv={}));class dx extends dl.ToolItem{get type(){return this.options.type}onRender(){aa(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){let e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){let e=this.childNodes;if(!e)return;let t=e.anchor;if(!t)return;let n=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(n),s=r.cell.prop([n,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);let l=s?i.customAnchorAttrs:i.defaultAnchorAttrs;l&&Object.keys(l).forEach(e=>{t.setAttribute(e,l[e])})}updateArea(){let e=this.childNodes;if(!e)return;let t=e.area;if(!t)return;let n=this.type,r=this.cellView,i=r.getTerminalView(n);if(i){let e,o,s;let l=i.cell,a=r.getTerminalMagnet(n),u=this.options.areaPadding||0;!Number.isFinite(u)&&(u=0),i.isEdgeElement(a)?(e=i.getBBox(),o=0,s=e.getCenter()):(e=i.getUnrotatedBBoxOfElement(a),o=l.getAngle(),s=e.getCenter(),o&&s.rotate(-o,l.getBBox().getCenter())),e.inflate(u),aj(t,{x:-e.width/2,y:-e.height/2,width:e.width,height:e.height,transform:`translate(${s.x}, ${s.y}) rotate(${o})`})}}toggleArea(e){if(this.childNodes){let t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){if(!this.guard(e))e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid})}resetAnchor(e){let t=this.type,n=this.cell;e?n.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){let t;let n=this.type,r=this.cellView,i=r.getTerminalView(n);if(null==i)return;let o=this.normalizeEvent(e),s=i.cell,l=r.getTerminalMagnet(n),a=this.graph.coord.clientToLocalPoint(o.clientX,o.clientY),u=this.options.snap;if("function"==typeof u){let e=n0(u,r,a,i,l,n,r,this);a=uA.create(e)}if(this.options.restrictArea){if(i.isEdgeElement(l)){let e=i.getClosestPoint(a);e&&(a=e)}else{let e=i.getUnrotatedBBoxOfElement(l),t=s.getAngle(),n=s.getBBox().getCenter(),r=a.clone().rotate(t,n);!e.containsPoint(r)&&(a=e.getNearestPointToPoint(r).rotate(-t,n))}}let c=this.options.anchor;"function"==typeof c&&(t=n0(c,r,a,i,l,n,r,this)),this.resetAnchor(t),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);let t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){let e=this.options.resetAnchor;e&&this.resetAnchor(!0===e?void 0:e),this.update()}}!function(e){e.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:df,snap(e,t,n,r,i,o){let s=o.options.snapRadius||0,l="source"===r,a=this.cell.getVertexAt(l?0:-1)||this.getTerminalAnchor(l?"target":"source");return a&&(Math.abs(a.x-e.x)<s&&(e.x=a.x),Math.abs(a.y-e.y)<s&&(e.y=a.y)),e}})}(dx||(dx={}));let dw=dx.define({name:"source-anchor",type:"source"}),dC=dx.define({name:"target-anchor",type:"target"});var dE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class dS extends dl.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){let e=this.options.attrs,{class:t}=e,n=dE(e,["class"]);this.setAttrs(n,this.container),t&&aa(this.container,t)}}onRender(){aa(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){let e=this.ratio,t=this.cellView,n=t.getTangentAtRatio(e),r=n?n.start:t.getPointAtRatio(e),i=n&&n.vector().vectorAngle(new uA(1,0))||0;if(!r)return this;let o=ui().translate(r.x,r.y).rotate(i);return uc(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();let t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});let n=this.graph.snapToGrid(e.clientX,e.clientY),r=t.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,r),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){let t=this.normalizeEvent(e),n=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,n.x,n.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();let t=this.normalizeEvent(e),n=this.cellView,r=this.graph.snapToGrid(t.clientX,t.clientY);n.onMouseUp(t,r.x,r.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}!function(e){e.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})}(dS||(dS={}));let dP=dS.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),dO=dS.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class dk extends dl.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){let e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){let e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=dl.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){let{cell:e,editor:t}=this;if(!t)return;let{style:n}=t;e.isNode()?this.updateNodeEditorTransform():e.isEdge()&&this.updateEdgeEditorTransform();let{attrs:r}=this.options;n.fontSize=`${r.fontSize}px`,n.fontFamily=r.fontFamily,n.color=r.color,n.backgroundColor=r.backgroundColor;let i=this.getCellText()||"";return t.innerText=i,this.setCellText(""),this}updateNodeEditorTransform(){let{graph:e,cell:t,editor:n}=this;if(!n)return;let r=uA.create(),i=20,o="",{x:s,y:l}=this.options,{width:a,height:u}=this.options;if(void 0!==s&&void 0!==l){let e=t.getBBox();s=lY(s,e.width),l=lY(l,e.height),r=e.topLeft.translate(s,l),i=e.width-2*s}else{let e=t.getBBox();r=e.center,i=e.width-4,o="translate(-50%, -50%)"}let c=e.scale(),{style:h}=n;r=e.localToGraph(r),h.left=`${r.x}px`,h.top=`${r.y}px`,h.transform=`scale(${c.sx}, ${c.sy}) ${o}`,h.minWidth=`${i}px`,"number"==typeof a&&(h.width=`${a}px`),"number"==typeof u&&(h.height=`${u}px`)}updateEdgeEditorTransform(){if(!this.event)return;let{graph:e,editor:t}=this;if(!t)return;let n=uA.create(),r=20,{style:i}=t,o=this.event.target,s=o.parentElement;if(s&&al(s,this.prefixClassName("edge-label"))){let e=s.getAttribute("data-index")||"0";this.labelIndex=parseInt(e,10);let{translation:t}=ua(s.getAttribute("transform"));n=new uA(t.tx,t.ty),r=ty.getBBox(o).width}else{if(!this.options.labelAddable)return this;n=e.clientToLocal(uA.create(this.event.clientX,this.event.clientY));let t=this.cellView.path.closestPointLength(n);this.distance=t,this.labelIndex=-1}n=e.localToGraph(n);let l=e.scale();i.left=`${n.x}px`,i.top=`${n.y}px`,i.minWidth=`${r}px`,i.transform=`scale(${l.sx}, ${l.sy}) translate(-50%, -50%)`}onDocumentMouseUp(e){if(this.editor&&e.target!==this.editor){let e=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(""!==e?e:null),this.removeElement()}}onCellDblClick({e}){!this.editor&&(e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){let e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){let{getText:e}=this.options;if("function"==typeof e)return n0(e,this.cellView,{cell:this.cell,index:this.labelIndex});if("string"==typeof e){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&-1!==this.labelIndex)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){let t=this.options.setText;if("function"==typeof t){n0(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if("string"==typeof t){if(this.cell.isNode()){null!==e&&this.cell.attr(t,e);return}if(this.cell.isEdge()){let n=this.cell;if(-1===this.labelIndex){if(e){let r={position:{distance:this.distance},attrs:{}};sd(r,`attrs/${t}`,e),n.appendLabel(r)}}else null!==e?n.prop(`labels/${this.labelIndex}/attrs/${t}`,e):"number"==typeof this.labelIndex&&n.removeLabelAt(this.labelIndex)}}}onRemove(){let e=this.cellView;e&&e.off("cell:dblclick",this.dblClick),this.removeElement()}}!function(e){e.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}})}(dk||(dk={})),(ev=dk||(dk={})).NodeEditor=ev.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),ev.EdgeEditor=ev.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"});var dA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};(ex=tP||(tP={})).presets={boundary:dy,button:dg,"button-remove":dg.Remove,"node-editor":dk.NodeEditor},ex.registry=uY.create({type:"node tool",process(e,t){if("function"==typeof t)return t;let n=dl.ToolItem,{inherit:r}=t,i=dA(t,["inherit"]);if(r){let e=this.get(r);null==e?this.onNotFound(r,"inherited"):n=e}return null==i.name&&(i.name=e),n.define.call(n,i)}}),ex.registry.register(ex.presets,!0),(ew=tO||(tO={})).presets={boundary:dy,vertices:db,segments:dv,button:dg,"button-remove":dg.Remove,"source-anchor":dw,"target-anchor":dC,"source-arrowhead":dP,"target-arrowhead":dO,"edge-editor":dk.EdgeEditor},ew.registry=uY.create({type:"edge tool",process(e,t){if("function"==typeof t)return t;let n=dl.ToolItem,{inherit:r}=t,i=dA(t,["inherit"]);if(r){let e=this.get(r);null==e?this.onNotFound(r,"inherited"):n=e}return null==i.name&&(i.name=e),n.define.call(n,i)}}),ew.registry.register(ew.presets,!0);let dM=dD("center"),dT=dD("topCenter"),dN=dD("bottomCenter"),dj=dD("leftMiddle"),dI=dD("rightMiddle"),dL=dD("topLeft"),dR=dD("topRight"),d_=dD("bottomLeft"),dB=dD("bottomRight");function dD(e){return function(t,n,r,i={}){let o=i.rotate?t.getUnrotatedBBoxOfElement(n):t.getBBoxOfElement(n),s=o[e];s.x+=lY(i.dx,o.width),s.y+=lY(i.dy,o.height);let l=t.cell;return i.rotate?s.rotate(-l.getAngle(),l.getBBox().getCenter()):s}}function dz(e){return function(t,n,r,i){if(r instanceof Element){let o;let s=this.graph.findViewByElem(r);return o=s?s.isEdgeElement(r)?dF(s,null!=i.fixedAt?i.fixedAt:"50%"):s.getBBoxOfElement(r).getCenter():new uA,e.call(this,t,n,o,i)}return e.apply(this,arguments)}}function dF(e,t){let n=lX(t),r="string"==typeof t?parseFloat(t):t;return n?e.getPointAtRatio(r/100):e.getPointAtLength(r)}let dV=dz(function(e,t,n,r){let i=e.cell.getAngle(),o=e.getBBoxOfElement(t),s=o.getCenter(),l=o.getTopLeft(),a=o.getBottomRight(),u=r.padding;if(!Number.isFinite(u)&&(u=0),l.y+u<=n.y&&n.y<=a.y-u){let e=n.y-s.y;s.x+=0===i||180===i?0:1*e/Math.tan(th.toRad(i)),s.y+=e}else if(l.x+u<=n.x&&n.x<=a.x-u){let e=n.x-s.x;s.y+=90===i||270===i?0:e*Math.tan(th.toRad(i)),s.x+=e}return s}),d$=function(e,t,n,r,i){let o=e.cell.getConnectionPoint(this.cell,i);return(r.dx||r.dy)&&o.translate(r.dx||0,r.dy||0),o},dU=dz(function(e,t,n,r){let i,o,s;let l=0,a=e.cell;r.rotate?(i=e.getUnrotatedBBoxOfElement(t),o=a.getBBox().getCenter(),l=a.getAngle()):i=e.getBBoxOfElement(t);let u=r.padding;null!=u&&Number.isFinite(u)&&i.inflate(u),r.rotate&&n.rotate(l,o);let c=i.getNearestSideToPoint(n);switch(c){case"left":s=i.getLeftMiddle();break;case"right":s=i.getRightMiddle();break;case"top":s=i.getTopCenter();break;case"bottom":s=i.getBottomCenter()}let h=r.direction;return"H"===h?("top"===c||"bottom"===c)&&(s=n.x<=i.x+i.width?i.getLeftMiddle():i.getRightMiddle()):"V"===h&&(s=n.y<=i.y+i.height?i.getTopCenter():i.getBottomCenter()),r.rotate?s.rotate(-l,o):s});(eC=tk||(tk={})).presets=tK,eC.registry=uY.create({type:"node endpoint"}),eC.registry.register(eC.presets,!0);let dG=function(e,t,n,r){let i=null!=r.ratio?r.ratio:.5;return i>1&&(i/=100),e.getPointAtRatio(i)},dH=function(e,t,n,r){let i=null!=r.length?r.length:20;return e.getPointAtLength(i)},dq=function(e,t,n,r){let i=e.getClosestPoint(n);return null!=i?i:new uA},dW=dz(dq),dX=dz(function(e,t,n,r){let i=e.getConnection(),o=e.getConnectionSubdivisions(),s=new uT(n.clone().translate(0,1e6),n.clone().translate(0,-1e6)),l=new uT(n.clone().translate(1e6,0),n.clone().translate(-1e6,0)),a=s.intersect(i,{segmentSubdivisions:o}),u=l.intersect(i,{segmentSubdivisions:o}),c=[];return(a&&c.push(...a),u&&c.push(...u),c.length>0)?n.closest(c):null!=r.fallbackAt?dF(e,r.fallbackAt):n0(dq,this,e,t,n,r)});function dY(e,t,n){let r;if("object"==typeof n){if(Number.isFinite(n.y)){let{start:r,end:i}=new uT(t,e).parallel(n.y);t=r,e=i}r=n.x}else r=n;if(null==r||!Number.isFinite(r))return e;let i=e.distance(t);return 0===r&&i>0?e:e.move(t,-Math.min(r,i-1))}function dJ(e){let t=e.getAttribute("stroke-width");return null===t?0:parseFloat(t)||0}(eE=tA||(tA={})).presets=tZ,eE.registry=uY.create({type:"edge endpoint"}),eE.registry.register(eE.presets,!0);let dQ=function(e,t,n,r){let i=t.getBBoxOfElement(n);r.stroked&&i.inflate(dJ(n)/2);let o=e.intersect(i);return dY(o&&o.length?e.start.closest(o):e.end,e.start,r.offset)},dK=function(e,t,n,r,i){let o=t.cell,s=o.isNode()?o.getAngle():0;if(0===s)return n0(dQ,this,e,t,n,r,i);let l=t.getUnrotatedBBoxOfElement(n);r.stroked&&l.inflate(dJ(n)/2);let a=l.getCenter(),u=e.clone().rotate(s,a),c=u.setLength(1e6).intersect(l);return dY(c&&c.length?u.start.closest(c).rotate(-s,a):e.end,e.start,r.offset)},dZ=function(e,t,n,r){let i,o,s;let l=e.end,a=r.selector;if(!ad(i="string"==typeof a?t.findOne(a):Array.isArray(a)?sh(n,a):function(e){if(null==e)return null;let t=e;do{let e=t.tagName;if("string"!=typeof e)return null;if("G"===(e=e.toUpperCase()))t=t.firstElementChild;else if("TITLE"===e)t=t.nextElementSibling;else break}while(t);return t}(n))){if(i===n||!ad(n))return l;i=n}let u=t.getShapeOfElement(i),c=t.getMatrixOfElement(i),h=t.getRootTranslatedMatrix(),d=t.getRootRotatedMatrix(),f=h.multiply(d).multiply(c),p=f.inverse(),g=ty.transformLine(e,p),m=g.start.clone(),y=t.getDataOfElement(i);if(!1===r.insideout){null==y.shapeBBox&&(y.shapeBBox=u.bbox());let e=y.shapeBBox;if(null!=e&&e.containsPoint(m))return l}if(!0===r.extrapolate&&g.setLength(1e6),uX.isPath(u)){let e=r.precision||2;null==y.segmentSubdivisions&&(y.segmentSubdivisions=u.getSegmentSubdivisions({precision:e})),s={precision:e,segmentSubdivisions:y.segmentSubdivisions},o=g.intersect(u,s)}else o=g.intersect(u);o?Array.isArray(o)&&(o=m.closest(o)):!0===r.sticky&&(o=uM.isRectangle(u)?u.getNearestPointToPoint(m):uN.isEllipse(u)?u.intersectsWithLineFromCenterToPoint(m):u.closestPoint(m,s));let b=o?ty.transformPoint(o,f):l,v=r.offset||0;return!1!==r.stroked&&("object"==typeof v?(null==(v=Object.assign({},v)).x&&(v.x=0),v.x+=dJ(i)/2):v+=dJ(i)/2),dY(b,e.start,v)},d0=function(e,t,n,r){let{alignOffset:i,align:o}=r;return o&&!function(e,t,n=0){let r,i,o,s;let{start:l,end:a}=e;switch(t){case"left":s="x",r=a,i=l,o=-1;break;case"right":s="x",r=l,i=a,o=1;break;case"top":s="y",r=a,i=l,o=-1;break;case"bottom":s="y",r=l,i=a,o=1;break;default:return}l[s]<a[s]?r[s]=i[s]:i[s]=r[s],Number.isFinite(n)&&(r[s]+=o*n,i[s]+=o*n)}(e,o,i),dY(e.end,e.start,r.offset)};(eS=tM||(tM={})).presets=t0,eS.registry=uY.create({type:"connection point"}),eS.registry.register(eS.presets,!0);let d1=function(e){return[...e]},d2=function(e,t,n){let r,i,o;let s=t.side||"bottom",l=lJ(t.padding||40),a=n.sourceBBox,u=n.targetBBox,c=a.getCenter(),h=u.getCenter();switch(s){case"top":o=-1,r="y",i="height";break;case"left":o=-1,r="x",i="width";break;case"right":o=1,r="x",i="width";break;default:o=1,r="y",i="height"}return c[r]+=o*(a[i]/2+l[s]),h[r]+=o*(u[i]/2+l[s]),o*(c[r]-h[r])>0?h[r]=c[r]:c[r]=h[r],[c.toJSON(),...e,h.toJSON()]};function d3(e){return new uM(e.x,e.y,0,0)}function d5(e={}){let t=lJ(e.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function d6(e,t={}){return e.sourceBBox.clone().moveAndExpand(d5(t))}function d4(e,t={}){return e.targetBBox.clone().moveAndExpand(d5(t))}let d8=function(e,t,n){let r=d6(n,t),i=d4(n,t),o=function(e,t={}){return e.sourceAnchor?e.sourceAnchor:d6(e,t).getCenter()}(n,t),s=function(e,t={}){return e.targetAnchor?e.targetAnchor:d4(e,t).getCenter()}(n,t);r=r.union(d3(o)),i=i.union(d3(s));let l=e.map(e=>uA.create(e));l.unshift(o),l.push(s);let a=null,u=[];for(let e=0,n=l.length-1;e<n;e+=1){let o=null,s=l[e],c=l[e+1],h=null!=tT.getBearing(s,c);if(0===e)e+1===n?r.intersectsWithRect(i.clone().inflate(1))?o=tT.insideNode(s,c,r,i):!h&&(o=tT.nodeToNode(s,c,r,i)):r.containsPoint(c)?o=tT.insideNode(s,c,r,d3(c).moveAndExpand(d5(t))):!h&&(o=tT.nodeToVertex(s,c,r));else if(e+1===n){let e=h&&tT.getBearing(c,s)===a;i.containsPoint(s)||e?o=tT.insideNode(s,c,d3(s).moveAndExpand(d5(t)),i,a):!h&&(o=tT.vertexToNode(s,c,i,a))}else!h&&(o=tT.vertexToVertex(s,c,a));o?(u.push(...o.points),a=o.direction):a=tT.getBearing(s,c),e+1<n&&u.push(c)}return u};!function(e){let t={N:"S",S:"N",E:"W",W:"E"},n={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function r(e,t,n){let r=new uA(e.x,t.y);return n.containsPoint(r)&&(r=new uA(t.x,e.y)),r}function i(e,t){return e["W"===t||"E"===t?"width":"height"]}function o(e,t){return e.x===t.x?e.y>t.y?"N":"S":e.y===t.y?e.x>t.x?"W":"E":null}function s(e,n,r){let i=new uA(e.x,n.y),s=new uA(n.x,e.y),l=o(e,i),a=o(e,s),u=r?t[r]:null,c=l===r||l!==u&&(a===u||a!==r)?i:s;return{points:[c],direction:o(c,n)}}function l(e,t,n){let i=r(e,t,n);return{points:[i],direction:o(i,t)}}e.getBBoxSize=i,e.getBearing=o,e.vertexToVertex=s,e.nodeToVertex=l;e.vertexToNode=function(e,t,n,s){let l;let a=[new uA(e.x,t.y),new uA(t.x,e.y)],u=a.filter(e=>!n.containsPoint(e)),c=u.filter(t=>o(t,e)!==s);if(c.length>0)return{points:[l=(l=c.filter(t=>o(e,t)===s).pop())||c[0]],direction:o(l,t)};{l=sw(a,u)[0];let c=uA.create(t).move(l,-i(n,s)/2);return{points:[r(c,e,n),c],direction:o(c,t)}}};e.nodeToNode=function(e,t,n,r){let a=l(t,e,r),u=a.points[0];if(n.containsPoint(u)){let c=(a=l(e,t,n)).points[0];if(r.containsPoint(c)){let h=uA.create(e).move(c,-i(n,o(e,c))/2),d=uA.create(t).move(u,-i(r,o(t,u))/2),f=new uT(h,d).getCenter(),p=l(e,f,n),g=s(f,t,p.direction);a.points=[p.points[0],g.points[0]],a.direction=g.direction}}return a};e.insideNode=function(e,t,i,s,l){let a,u,c,h;let d=i.union(s).inflate(1),f=d.getCenter(),p=f.distance(t)>f.distance(e),g=p?t:e,m=p?e:t;return l?(a=uA.fromPolar(d.width+d.height,n[l],g),a=d.getNearestPointToPoint(a).move(a,-1)):a=d.getNearestPointToPoint(g).move(g,1),u=r(a,m,d),a.round().equals(u.round())?(u=uA.fromPolar(d.width+d.height,th.toRad(a.theta(g))+Math.PI/2,m),c=r(a,u=d.getNearestPointToPoint(u).move(m,1).round(),d),h=p?[u,c,a]:[a,c,u]):h=p?[u,a]:[a,u],{points:h,direction:p?o(a,t):o(u,t)}}}(tT||(tT={}));let d9={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return d7(this.step,this)},directions(){let e=d7(this.step,this),t=d7(this.cost,this);return[{cost:t,offsetX:e,offsetY:0},{cost:t,offsetX:-e,offsetY:0},{cost:t,offsetX:0,offsetY:e},{cost:t,offsetX:0,offsetY:-e}]},penalties(){let e=d7(this.step,this);return{0:0,45:e/2,90:e/2}},paddingBox(){let e=d7(this.step,this);return{x:-e,y:-e,width:2*e,height:2*e}},fallbackRouter:d8,draggingRouter:null,snapToGrid:!0};function d7(e,t){return"function"==typeof e?e.call(t):e}class fe{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){var n;this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=1,this.values[e]=t;let r=(n=this.items,sI(n,e,sM(e=>this.values[e],2)));this.items.splice(r,0,e)}pop(){let e=this.items.shift();return e&&(this.hash[e]=2),e}isOpen(e){return 1===this.hash[e]}isClose(e){return 2===this.hash[e]}isEmpty(){return 0===this.items.length}}class ft{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){let n=this.options,r=n.excludeTerminals.reduce((n,r)=>{let i=t[r];if(i){let t=e.getCell(i.cell);t&&n.push(t)}return n},[]),i=[],o=e.getCell(t.getSourceCellId());o&&(i=sq(i,o.getAncestors().map(e=>e.id)));let s=e.getCell(t.getTargetCellId());s&&(i=sq(i,s.getAncestors().map(e=>e.id)));let l=this.mapGridSize;return e.getNodes().reduce((e,t)=>{let o=r.some(e=>e.id===t.id),s=!!t.shape&&n.excludeShapes.includes(t.shape),a=n.excludeNodes.some(e=>"string"==typeof e?t.id===e:e===t),u=i.includes(t.id);if(t.isVisible()&&!(s||o||a||u)){let r=t.getBBox().moveAndExpand(n.paddingBox),i=r.getOrigin().snapToGrid(l),o=r.getCorner().snapToGrid(l);for(let t=i.x;t<=o.x;t+=l)for(let n=i.y;n<=o.y;n+=l){let i=new uA(t,n).toString();null==e[i]&&(e[i]=[]),e[i].push(r)}}return e},this.map),this}isAccessible(e){let t=e.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[t];return!n||n.every(t=>!t.containsPoint(e))}}function fn(e,t){let n=e.sourceBBox.clone();return t&&t.paddingBox?n.moveAndExpand(t.paddingBox):n}function fr(e,t){let n=e.targetBBox.clone();return t&&t.paddingBox?n.moveAndExpand(t.paddingBox):n}function fi(e,t){return e.sourceAnchor?e.sourceAnchor:fn(e,t).getCenter()}function fo(e,t,n,r,i){let o=360/n,s=e.theta(function(e,t,n,r){let i=r.step,o=t.x-e.x,s=t.y-e.y,l=o/n.x,a=s/n.y;return new uA(e.x+l*i,e.y+a*i)}(e,t,r,i)),l=th.normalize(s+o/2);return o*Math.floor(l/o)}function fs(e,t){let n=Math.abs(e-t);return n>180?360-n:n}function fl(e,t){if(!e)return t;let n=Math.abs(e),r=Math.round(n/t);return r?t+(n-r*t)/r:n}function fa(e,t){return e.round(t)}function fu(e,t,n){return fa(function(e,t){let n=t.source,r=td.snapToGrid(e.x-n.x,t.x)+n.x,i=td.snapToGrid(e.y-n.y,t.y)+n.y;return new uA(r,i)}(e.clone(),t),n)}function fc(e){return e.toString()}function fh(e){return new uA(0===e.x?0:Math.abs(e.x)/e.x,0===e.y?0:Math.abs(e.y)/e.y)}function fd(e,t){let n=1/0;for(let r=0,i=t.length;r<i;r+=1){let i=e.manhattanDistance(t[r]);i<n&&(n=i)}return n}function ff(e,t,n,r,i){let o=i.precision,s=i.directionMap,l=e.diff(t.getCenter()),a=Object.keys(s).reduce((i,a)=>{if(n.includes(a)){let n;let u=s[a],c=new uA(e.x+u.x*(Math.abs(l.x)+t.width),e.y+u.y*(Math.abs(l.y)+t.height)),h=new uT(e,c).intersect(t)||[],d=null;for(let t=0;t<h.length;t+=1){let r=h[t],i=e.squaredDistance(r);(null==n||i>n)&&(n=i,d=r)}if(d){let e=fu(d,r,o);t.containsPoint(e)&&(e=fu(e.translate(u.x*r.x,u.y*r.y),r,o)),i.push(e)}}return i},[]);return!t.containsPoint(e)&&a.push(fu(e,r,o)),a}let fp=function(e,t,n){let r,i;let o=function(e){let t=Object.keys(e).reduce((t,n)=>("fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]=e[n]:t[n]=d7(e[n],e),t),{});if(t.padding){let e=lJ(t.padding);t.paddingBox={x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}return t.directions.forEach(e=>{let t=new uA(0,0),n=new uA(e.offsetX,e.offsetY);e.angle=th.normalize(t.theta(n))}),t}(t),s=fn(n,o),l=fr(n,o),a=fi(n,o),u=new ft(o).build(n.graph.model,n.cell),c=e.map(e=>uA.create(e)),h=[],d=a;for(let t=0,f=c.length;t<=f;t+=1){let f=null;if(r=i||s,null==(i=c[t])){i=l;let e=n.cell;if((null==e.getSourceCellId()||null==e.getTargetCellId())&&"function"==typeof o.draggingRouter){let e=r===s?a:r,t=i.getOrigin();f=n0(o.draggingRouter,n,e,t,o)}}if(null==f&&(f=function(e,t,n,r,i){var o,s,l,a,u;let c,h,d,f;let p=i.precision;if(c=uM.isRectangle(t)?fa(fi(e,i).clone(),p):fa(t.clone(),p),uM.isRectangle(n)){;h=fa((o=e,s=i,o.targetAnchor?o.targetAnchor:fr(o,s).getCenter()).clone(),p)}else h=fa(n.clone(),p);let g=(l=i.step,a=c,u=h,{source:a.clone(),x:fl(u.x-a.x,l),y:fl(u.y-a.y,l)}),m=c,y=h;if(d=uM.isRectangle(t)?ff(m,t,i.startDirections,g,i):[m],f=uM.isRectangle(n)?ff(h,n,i.endDirections,g,i):[y],d=d.filter(e=>r.isAccessible(e)),f=f.filter(e=>r.isAccessible(e)),d.length>0&&f.length>0){let e,t;let n=new fe,o={},s={},l={};for(let e=0,t=d.length;e<t;e+=1){let t=d[e],r=fc(t);n.add(r,fd(t,f)),o[r]=t,l[r]=0}let a=i.previousDirectionAngle,u=void 0===a,c=function(e,t){let n=t.step;return t.directions.forEach(t=>{t.gridOffsetX=t.offsetX/n*e.x,t.gridOffsetY=t.offsetY/n*e.y}),t.directions}(g,i),h=c.length,b=f.reduce((e,t)=>{let n=fc(t);return e.push(n),e},[]),v=uA.equalPoints(d,f),x=i.maxLoopCount;for(;!n.isEmpty()&&x>0;){let d;let w=n.pop(),C=o[w],E=s[w],S=l[w],P=C.equals(m),O=null==E;if(d=O?u?P?null:fo(m,C,h,g,i):a:fo(E,C,h,g,i),!(O&&v)&&b.indexOf(w)>=0)return i.previousDirectionAngle=d,function(e,t,n,r,i){let o;let s=[],l=fh(i.diff(n)),a=fc(n),u=e[a];for(;u;){let n=fh((o=t[a]).diff(u));!n.equals(l)&&(s.unshift(o),l=n),u=e[a=fc(u)]}let c=t[a];return!fh(c.diff(r)).equals(l)&&s.unshift(c),s}(s,o,C,m,y);for(let a=0;a<h;a+=1){let m=(e=c[a]).angle;if(t=fs(d,m),!(u&&P)&&t>i.maxDirectionChange)continue;let v=fu(C.clone().translate(e.gridOffsetX||0,e.gridOffsetY||0),g,p),x=fc(v);if(n.isClose(x)||!r.isAccessible(v)||b.indexOf(x)>=0&&!v.equals(y)&&fs(m,fo(v,y,h,g,i))>i.maxDirectionChange)continue;let w=e.cost,E=S+w+(P?0:i.penalties[t]);(!n.isOpen(x)||E<l[x])&&(o[x]=v,s[x]=C,l[x]=E,n.add(x,E+fd(v,f)))}x-=1}}return i.fallbackRoute?n0(i.fallbackRoute,this,m,y,i):null}(n,r,i,u,o)),null===f)return console.warn("Unable to execute manhattan algorithm, use orth instead"),n0(o.fallbackRouter,this,e,o,n);let p=f[0];p&&p.equals(d)&&f.shift(),d=f[f.length-1]||d,h.push(...f)}return o.snapToGrid?function(e,t=10){if(e.length<=1)return e;for(let n=0,r=e.length;n<r-1;n+=1){let r=e[n],i=e[n+1];if(r.x===i.x){let e=t*Math.round(r.x/t);r.x!==e&&(r.x=e,i.x=e)}else if(r.y===i.y){let e=t*Math.round(r.y/t);r.y!==e&&(r.y=e,i.y=e)}}return e}(h,n.graph.grid.getGridSize()):h},fg=function(e,t,n){return n0(fp,this,e,Object.assign(Object.assign({},d9),t),n)},fm={maxDirectionChange:45,directions(){let e=d7(this.step,this),t=d7(this.cost,this),n=Math.ceil(Math.sqrt(e*e<<1));return[{cost:t,offsetX:e,offsetY:0},{cost:n,offsetX:e,offsetY:e},{cost:t,offsetX:0,offsetY:e},{cost:n,offsetX:-e,offsetY:e},{cost:t,offsetX:-e,offsetY:0},{cost:n,offsetX:-e,offsetY:-e},{cost:t,offsetX:0,offsetY:-e},{cost:n,offsetX:e,offsetY:-e}]},fallbackRoute(e,t,n){let r=e.theta(t),i=[],o={x:t.x,y:e.y},s={x:e.x,y:t.y};if(r%180>90){let e=o;o=s,s=e}let l=r%90<45?o:s,a=new uT(e,l),u=90*Math.ceil(r/90),c=uA.fromPolar(a.squaredLength(),th.toRad(u+135),l),h=new uT(t,c),d=a.intersectsWithLine(h),f=d||t,p=d?f:e,g=360/n.directions.length,m=p.theta(t),y=th.normalize(m+g/2),b=g*Math.floor(y/g);return n.previousDirectionAngle=b,f&&i.push(f.round()),i.push(t),i}},fy=function(e,t,n){return n0(fg,this,e,Object.assign(Object.assign({},fm),t),n)},fb=function(e,t,n){let r,i,o;let s=t.offset||32,l=null==t.min?16:t.min,a=0,u=t.direction,c=n.sourceBBox,h=n.targetBBox,d=c.getCenter(),f=h.getCenter();if("number"==typeof s&&(a=s),null==u){let e=h.left-c.right,t=h.top-c.bottom;e>=0&&t>=0?u=e>=t?"L":"T":e<=0&&t>=0?u=(e=c.left-h.right)>=0?e>=t?"R":"T":"T":e>=0&&t<=0?u=(t=c.top-h.bottom)>=0?e>=t?"L":"B":"L":(e=c.left-h.right,t=c.top-h.bottom,u=e>=0&&t>=0?e>=t?"R":"B":e<=0&&t>=0?"B":e>=0&&t<=0?"R":Math.abs(e)>Math.abs(t)?"R":"B")}"H"===u?u=f.x-d.x>=0?"L":"R":"V"===u&&(u=f.y-d.y>=0?"T":"B"),"center"===s&&("L"===u?a=(h.left-c.right)/2:"R"===u?a=(c.left-h.right)/2:"T"===u?a=(h.top-c.bottom)/2:"B"===u&&(a=(c.top-h.bottom)/2));let p="L"===u||"R"===u;if(p){if(f.y===d.y)return[...e];o="L"===u?1:-1,r="x",i="width"}else{if(f.x===d.x)return[...e];o="T"===u?1:-1,r="y",i="height"}let g=d.clone(),m=f.clone();if(g[r]+=o*(c[i]/2+a),m[r]-=o*(h[i]/2+a),p){let e=g.x,t=m.x,n=c.width/2+l,r=h.width/2+l;f.x>d.x?t<=e&&(g.x=Math.max(t,d.x+n),m.x=Math.min(e,f.x-r)):t>=e&&(g.x=Math.min(t,d.x-n),m.x=Math.max(e,f.x+r))}else{let e=g.y,t=m.y,n=c.height/2+l,r=h.height/2+l;f.y>d.y?t<=e&&(g.y=Math.max(t,d.y+n),m.y=Math.min(e,f.y-r)):t>=e&&(g.y=Math.min(t,d.y-n),m.y=Math.max(e,f.y+r))}return[g.toJSON(),...e,m.toJSON()]};function fv(e,t){if(null!=t&&!1!==t){let n="boolean"==typeof t?0:t;if(n>0){let t=uA.create(e[1]).move(e[2],n),r=uA.create(e[1]).move(e[0],n);return[t.toJSON(),...e,r.toJSON()]}{let t=e[1];return[Object.assign({},t),...e,Object.assign({},t)]}}return e}let fx=function(e,t,n){let r=t.width||50,i=(t.height||80)/2,o=t.angle||"auto",s=n.sourceAnchor,l=n.targetAnchor,a=n.sourceBBox,u=n.targetBBox;if(s.equals(l)){let e=e=>{let t=th.toRad(e),n=Math.sin(t),o=Math.cos(t),l=new uA(s.x+o*r,s.y+n*r),a=new uA(l.x-o*i,l.y-n*i),u=a.clone().rotate(-90,l),c=a.clone().rotate(90,l);return[u.toJSON(),l.toJSON(),c.toJSON()]},n=e=>{let t=s.clone().move(e,-1),n=new uT(t,e);return!a.containsPoint(e)&&!a.intersectsWithLine(n)},l=[0,90,180,270,45,135,225,315];if("number"==typeof o)return fv(e(o),t.merge);let u=a.getCenter();if(u.equals(s))return fv(e(0),t.merge);let c=u.angleBetween(s,u.clone().translate(1,0)),h=e(c);if(n(h[1]))return fv(h,t.merge);for(let t=1,r=l.length;t<r&&!n((h=e(c+l[t]))[1]);t+=1);return fv(h,t.merge)}{let e=new uT(s,l),o=e.parallel(-r),c=o.getCenter(),h=o.start.clone().move(o.end,i),d=o.end.clone().move(o.start,i),f=e.parallel(-1),p=new uT(f.start,c),g=new uT(f.end,c);if((a.containsPoint(c)||u.containsPoint(c)||a.intersectsWithLine(p)||a.intersectsWithLine(g)||u.intersectsWithLine(p)||u.intersectsWithLine(g))&&(c=(o=e.parallel(r)).getCenter(),h=o.start.clone().move(o.end,i),d=o.end.clone().move(o.start,i)),t.merge){let e=new uT(s,l),t=new uT(c,e.center).setLength(Number.MAX_SAFE_INTEGER),r=a.intersectsWithLine(t),i=u.intersectsWithLine(t),o=r?Array.isArray(r)?r:[r]:[];i&&(Array.isArray(i)?o.push(...i):o.push(i));let h=e.center.closest(o);h?(n.sourceAnchor=h.clone(),n.targetAnchor=h.clone()):(n.sourceAnchor=e.center.clone(),n.targetAnchor=e.center.clone())}return fv([h.toJSON(),c.toJSON(),d.toJSON()],t.merge)}};(eP=tN||(tN={})).presets=t1,eP.registry=uY.create({type:"router"}),eP.registry.register(eP.presets,!0);let fw=function(e,t,n,r={}){let i=[e,...n,t],o=new uD(i),s=new uX(o);return r.raw?s:s.serialize()},fC=function(e,t,n,r={}){let i=3===n.length?0:1,o=uA.create(n[0+i]),s=uA.create(n[2+i]),l=uA.create(n[1+i]);if(!uA.equals(e,t)){let n=new uA((e.x+t.x)/2,(e.y+t.y)/2),r=n.angleBetween(uA.create(e).rotate(90,n),l);r>1&&(o.rotate(180-r,n),s.rotate(180-r,n),l.rotate(180-r,n))}let a=`
89
- M ${e.x} ${e.y}
90
- Q ${o.x} ${o.y} ${l.x} ${l.y}
91
- Q ${s.x} ${s.y} ${t.x} ${t.y}
92
- `;return r.raw?uX.parse(a):a},fE=function(e,t,n,r={}){let i,o;let s=new uX;s.appendSegment(uX.createSegment("M",e));let l=1/3,a=2/3,u=r.radius||10;for(let r=0,c=n.length;r<c;r+=1){let c=uA.create(n[r]),h=n[r-1]||e,d=n[r+1]||t;i=o||c.distance(h)/2,o=c.distance(d)/2;let f=-Math.min(u,i),p=-Math.min(u,o),g=c.clone().move(h,f).round(),m=c.clone().move(d,p).round(),y=new uA(l*g.x+a*c.x,a*c.y+l*g.y),b=new uA(l*m.x+a*c.x,a*c.y+l*m.y);s.appendSegment(uX.createSegment("L",g)),s.appendSegment(uX.createSegment("C",y,b,m))}return s.appendSegment(uX.createSegment("L",t)),r.raw?s:s.serialize()},fS=function(e,t,n,r={}){let i;let o=r.direction;if(n&&0!==n.length){let r=[e,...n,t],o=uz.throughPoints(r);i=new uX(o)}else if((i=new uX).appendSegment(uX.createSegment("M",e)),!o&&(o=Math.abs(e.x-t.x)>=Math.abs(e.y-t.y)?"H":"V"),"H"===o){let n=(e.x+t.x)/2;i.appendSegment(uX.createSegment("C",n,e.y,n,t.y,t.x,t.y))}else{let n=(e.y+t.y)/2;i.appendSegment(uX.createSegment("C",e.x,n,t.x,n,t.x,t.y))}return r.raw?i:i.serialize()},fP=1/3,fO=2/3;function fk(e,t,n=[]){let r=[e,...n,t],i=[];return r.forEach((e,t)=>{let n=r[t+1];null!=n&&i.push(new uT(e,n))}),i}function fA(e,t){return new uT(e,t).squaredLength()}function fM(e,n,r,i){let o;let s=new uX;return o=uX.createSegment("M",e[0].start),s.appendSegment(o),e.forEach((l,a)=>{if(t.includes(l)){let e,t,i,a;if("arc"===r){let n;e=-90,((t=l.start.diff(l.end)).x<0||0===t.x&&t.y<0)&&(e+=180);let r=l.getCenter(),u=new uT(r,l.end).rotate(e,r);i=(n=new uT(l.start,r)).pointAt(2/3).rotate(e,l.start),a=u.pointAt(1/3).rotate(-e,u.end),o=uX.createSegment("C",i,a,u.end),s.appendSegment(o),n=new uT(r,l.end),i=u.pointAt(1/3).rotate(e,u.end),a=n.pointAt(1/3).rotate(-e,l.end),o=uX.createSegment("C",i,a,l.end),s.appendSegment(o)}else if("gap"===r)o=uX.createSegment("M",l.end),s.appendSegment(o);else if("cubic"===r){e=l.start.theta(l.end);let r=.6*n,u=1.35*n;((t=l.start.diff(l.end)).x<0||0===t.x&&t.y<0)&&(u*=-1),i=new uA(l.start.x+r,l.start.y+u).rotate(e,l.start),a=new uA(l.end.x-r,l.end.y+u).rotate(e,l.end),o=uX.createSegment("C",i,a,l.end),s.appendSegment(o)}}else{let n=e[a+1];0===i||!n||t.includes(n)?(o=uX.createSegment("L",l.end),s.appendSegment(o)):function(e,t,n,r,i){let o;let s=n.distance(r)/2,l=n.distance(i)/2,a=-Math.min(e,s),u=-Math.min(e,l),c=n.clone().move(r,a).round(),h=n.clone().move(i,u).round(),d=new uA(fP*c.x+fO*n.x,fO*n.y+fP*c.y),f=new uA(fP*h.x+fO*n.x,fO*n.y+fP*h.y);o=uX.createSegment("L",c),t.appendSegment(o),o=uX.createSegment("C",d,f,h),t.appendSegment(o)}(i,s,l.end,l.start,n.end)}}),s}let fT=function(e,r,i,o={}){t=[],n=[],!function(e){let t=e.graph._jumpOverUpdateList;if(null==t&&(t=e.graph._jumpOverUpdateList=[],e.graph.on("cell:mouseup",()=>{let t=e.graph._jumpOverUpdateList;setTimeout(()=>{for(let e=0;e<t.length;e+=1)t[e].update()})}),e.graph.on("model:reseted",()=>{t=e.graph._jumpOverUpdateList=[]})),0>t.indexOf(e)){t.push(e);let n=()=>t.splice(t.indexOf(e),1);e.cell.once("change:connector",n),e.cell.once("removed",n)}}(this);let s=o.size||5,l=o.type||"arc",a=o.radius||0,u=o.ignoreConnectors||["smooth"],c=this.graph,h=c.model.getEdges();if(1===h.length)return fM(fk(e,r,i),s,l,a);let d=this.cell,f=h.indexOf(d),p=c.options.connecting.connector||{},g=h.filter((e,t)=>{let n=e.getConnector()||p;return!u.includes(n.name)&&(!(t>f)||"jumpover"!==n.name)}),m=g.map(e=>c.findViewByCell(e)),y=fk(e,r,i),b=m.map(e=>null==e?[]:e===this?y:fk(e.sourcePoint,e.targetPoint,e.routePoints)),v=[];y.forEach(e=>{let r=g.reduce((t,n,r)=>{if(n!==d){let n=function(e,t){let n=[];return t.forEach(t=>{let r=e.intersectsWithLine(t);r&&n.push(r)}),n}(e,b[r]);t.push(...n)}return t},[]).sort((t,n)=>fA(e.start,t)-fA(e.start,n));if(r.length>0){var i,o,l;v.push(...(i=e,o=r,l=s,o.reduce((e,r,s)=>{if(n.includes(r))return e;let a=e.pop()||i,u=uA.create(r).move(a.start,-l),c=uA.create(r).move(a.start,+l),h=o[s+1];if(null!=h){let e=c.distance(h);e<=l&&(c=h.move(a.start,e),n.push(h))}else if(u.distance(a.end)<2*l+1)return e.push(a),e;if(c.distance(a.start)<2*l+1)return e.push(a),e;let d=new uT(u,c);return t.push(d),e.push(new uT(a.start,u),d,new uT(c,a.end)),e},[])))}else v.push(e)});let x=fM(v,s,l,a);return t=[],n=[],o.raw?x:x.serialize()};(eO=tj||(tj={})).presets=t2,eO.registry=uY.create({type:"connector"}),eO.registry.register(eO.presets,!0);class fN extends sp{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ss(e)),this.changed={}}mutate(e,t={}){let n=!0===t.unset,r=!0===t.silent,i=[],o=this.changing;this.changing=!0,!o&&(this.previous=ss(this.data),this.changed={});let s=this.data,l=this.previous,a=this.changed;if(Object.keys(e).forEach(t=>{let r=e[t];!sn(s[t],r)&&i.push(t),sn(l[t],r)?delete a[t]:a[t]=r,n?delete s[t]:s[t]=r}),!r&&i.length>0&&(this.pending=!0,this.pendingOptions=t,i.forEach(e=>{this.emit("change:*",{key:e,options:t,store:this,current:s[e],previous:l[e]})})),o)return this;if(!r)for(;this.pending;)this.pending=!1,this.emit("changed",{current:s,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(null==e)return this.data;let n=this.data[e];return null==n?t:n}getPrevious(e){if(this.previous){let t=this.previous[e];return null==t?void 0:t}}set(e,t,n){return null!=e&&("object"==typeof e?this.mutate(e,t):this.mutate({[e]:t},n)),this}remove(e,t){let n;let r=void 0,i={};if("string"==typeof e)i[e]=r,n=t;else if(Array.isArray(e))e.forEach(e=>i[e]=r),n=t;else{for(let e in this.data)i[e]=r;n=e}return this.mutate(i,Object.assign(Object.assign({},n),{unset:!0})),this}getByPath(e){return sh(this.data,e,"/")}setByPath(e,t,n={}){let r=Array.isArray(e)?[...e]:e.split("/"),i=Array.isArray(e)?e.join("/"):e,o=r[0],s=r.length;if(n.propertyPath=i,n.propertyValue=t,n.propertyPathArray=r,1===s)this.set(o,t,n);else{let i={},l=i,a=o;for(let e=1;e<s;e+=1){let t=r[e],n=Number.isFinite(Number(t));l=l[a]=n?[]:{},a=t}sd(i,r,t,"/");let u=ss(this.data);n.rewrite&&sf(u,e,"/");let c=iM(u,i);this.set(o,c[o],n)}return this}removeByPath(e,t){let n=Array.isArray(e)?e:e.split("/"),r=n[0];if(1===n.length)this.remove(r,t);else{let e=n.slice(1),i=ss(this.get(r));i&&sf(i,e),this.set(r,i,t)}return this}hasChanged(e){return null==e?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){let t;if(null==e)return this.hasChanged()?ss(this.changed):null;let n=this.changing?this.previous:this.data,r={};for(let i in e){let o=e[i];!sn(n[i],o)&&(r[i]=o,t=!0)}return t?ss(r):null}toJSON(){return ss(this.data)}clone(){return new this.constructor(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([sp.dispose()],fN.prototype,"dispose",null);class fj{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,n={},r="/"){let i=this.cell.getPropByPath(e),o=oX(n,fj.defaultOptions),s=this.getTiming(o.timing),l=this.getInterp(o.interp,i,t),a=0,u=Array.isArray(e)?e.join(r):e,c=Array.isArray(e)?e:e.split(r),h=()=>{let e=new Date().getTime();0===a&&(a=e);let t=(e-a)/o.duration;t<1?this.ids[u]=requestAnimationFrame(h):t=1;let r=l(s(t));this.cell.setPropByPath(c,r),n.progress&&n.progress(Object.assign({progress:t,currentValue:r},this.getArgs(u))),1===t&&(this.cell.notify("transition:complete",this.getArgs(u)),n.complete&&n.complete(this.getArgs(u)),this.cell.notify("transition:finish",this.getArgs(u)),n.finish&&n.finish(this.getArgs(u)),this.clean(u))};return setTimeout(()=>{this.stop(e,void 0,r),this.cache[u]={startValue:i,targetValue:t,options:o},this.ids[u]=requestAnimationFrame(h),this.cell.notify("transition:start",this.getArgs(u)),n.start&&n.start(this.getArgs(u))},n.delay),this.stop.bind(this,e,r,n)}stop(e,t={},n="/"){let r=Array.isArray(e)?e:e.split(n);return Object.keys(this.ids).filter(e=>sn(r,e.split(n).slice(0,r.length))).forEach(e=>{cancelAnimationFrame(this.ids[e]);let n=this.cache[e],r=this.getArgs(e),i=Object.assign(Object.assign({},n.options),t),o=i.jumpedToEnd;o&&null!=n.targetValue&&(this.cell.setPropByPath(e,n.targetValue),this.cell.notify("transition:end",Object.assign({},r)),this.cell.notify("transition:complete",Object.assign({},r)),i.complete&&i.complete(Object.assign({},r)));let s=Object.assign({jumpedToEnd:o},r);this.cell.notify("transition:stop",Object.assign({},s)),i.stop&&i.stop(Object.assign({},s)),this.cell.notify("transition:finish",Object.assign({},r)),i.finish&&i.finish(Object.assign({},r)),this.clean(e)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return"string"==typeof e?tu[e]:e}getInterp(e,t,n){if(e)return e(t,n);if("number"==typeof n)return tc.number(t,n);if("string"==typeof n)return"#"===n[0]?tc.color(t,n):tc.unit(t,n);return tc.object(t,n)}getArgs(e){let t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(fj||(fj={})).defaultOptions={delay:10,duration:100,timing:"linear"};var fI=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class fL extends sp{static config(e){let{markup:t,propHooks:n,attrHooks:r}=e,i=fI(e,["markup","propHooks","attrHooks"]);null!=t&&(this.markup=t),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):"function"==typeof n?this.propHooks.push(n):Object.values(n).forEach(e=>{"function"==typeof e&&this.propHooks.push(e)})),r&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),r)),this.defaults=iM({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:ss(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((t,n)=>n?n0(n,e,t):t,t)}get[Symbol.toStringTag](){return fL.toStringTag}constructor(e={}){super();let t=this.constructor.getDefaults(!0),n=iM({},this.preprocess(t),this.preprocess(e));this.id=n.id||lH(),this.store=new fN(n),this.animation=new fj(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){let n=e.id,r=this.constructor.applyPropHooks(this,e);return null==n&&!0!==t&&(r.id=lH()),r}postprocess(e){}setup(){this.store.on("change:*",e=>{let{key:t,current:n,previous:r,options:i}=e;this.notify("change:*",{key:t,options:i,current:n,previous:r,cell:this}),this.notify(`change:${t}`,{options:i,current:n,previous:r,cell:this});("source"===t||"target"===t)&&this.notify("change:terminal",{type:t,current:n,previous:r,options:i,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);let n=this.model;return n&&(n.notify(`cell:${e}`,t),this.isNode()?n.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&n.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return null==e?this.store.get():this.store.get(e,t)}setProp(e,t,n){if("string"==typeof e)this.store.set(e,t,n);else{let n=this.preprocess(e,!0);this.store.set(iM({},this.getProp(),n),t),this.postprocess(e)}return this}removeProp(e,t){return"string"==typeof e||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return null==e?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,n={}){return this.model&&("children"===e?this._children=t?t.map(e=>this.model.getCell(e)).filter(e=>null!=e):null:"parent"===e&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,n),this}removePropByPath(e,t={}){let n=Array.isArray(e)?e:e.split("/");return"attrs"===n[0]&&(t.dirty=!0),this.store.removeByPath(n,t),this}prop(e,t,n){if(null==e)return this.getProp();if("string"==typeof e||Array.isArray(e))return 1==arguments.length?this.getPropByPath(e):null==t?this.removePropByPath(e,n||{}):this.setPropByPath(e,t,n||{});return this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){null==e?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){let t=this.model;if(t){let n,r=t.getMaxZIndex();e.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0})).unshift(this):n=[this],r=r-n.length+1;let i=t.total(),o=t.indexOf(this)!==i-n.length;!o&&(o=n.some((e,t)=>e.getZIndex()!==r+t)),o&&this.batchUpdate("to-front",()=>{r+=n.length,n.forEach((t,n)=>{t.setZIndex(r+n,e)})})}return this}toBack(e={}){let t=this.model;if(t){let n,r=t.getMinZIndex();e.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0})).unshift(this):n=[this];let i=0!==t.indexOf(this);!i&&(i=n.some((e,t)=>e.getZIndex()!==r+t)),i&&this.batchUpdate("to-back",()=>{r-=n.length,n.forEach((t,n)=>{t.setZIndex(r+n,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){null==e?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return null==e&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){null==e?this.removeAttrs():this.setAttrs(e)}getAttrs(){let e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(null==e)this.removeAttrs(t);else{let n=e=>this.store.set("attrs",e,t);if(!0===t.overwrite)n(e);else{let r=this.getAttrs();n(!1===t.deep?Object.assign(Object.assign({},r),e):iM({},r,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;let t=this.constructor.getAttrHooks()||{},n=t[e]||tm.registry.get(e);if(!n){let r=lB(e);n=t[r]||tm.registry.get(r)}return n||null}getAttrByPath(e){return null==e||""===e?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,n={}){return this.setPropByPath(this.prefixAttrPath(e),t,n),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,n){if(null==e)return this.getAttrByPath();if("string"==typeof e||Array.isArray(e))return 1==arguments.length?this.getAttrByPath(e):null==t?this.removeAttrByPath(e,n||{}):this.setAttrByPath(e,t,n||{});return this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return!1!==this.store.get("visible")}show(e={}){return!this.isVisible()&&this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){let n="boolean"==typeof e?e:!this.isVisible(),r="boolean"==typeof e?t:e;return n?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(null==e)this.removeData(t);else{let n=e=>this.store.set("data",e,t);if(!0===t.overwrite)n(e);else{let r=this.getData();n(!1===t.deep?"object"==typeof e?Object.assign(Object.assign({},r),e):e:iM({},r,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){let e=this.getParentId();if(e&&this.model){let t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){let e=this.store.get("children");if(e&&e.length&&this.model){let t=e.map(e=>{var t;return null===(t=this.model)||void 0===t?void 0:t.getCell(e)}).filter(e=>null!=e);return this._children=t,[...t]}return null}hasParent(){return null!=this.parent}isParentOf(e){return null!=e&&e.getParent()===this}isChildOf(e){return null!=e&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return null==this.children?0:this.children.length}getChildIndex(e){return null==this.children?-1:this.children.indexOf(e)}getChildAt(e){return null!=this.children&&e>=0?this.children[e]:null}getAncestors(e={}){let t=[],n=this.getParent();for(;n;)t.push(n),n=!1!==e.deep?n.getParent():null;return t}getDescendants(e={}){if(!1!==e.deep){if(e.breadthFirst){let e=[],t=this.getChildren()||[];for(;t.length>0;){let n=t.shift(),r=n.getChildren();e.push(n),r&&t.push(...r)}return e}{let t=this.getChildren()||[];return t.forEach(n=>{t.push(...n.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(null==e)return!1;if(!1!==t.deep){let t=this.getParent();for(;t;){if(t===e)return!0;t=t.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return null!=e&&e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return fL.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,null!=e?this.store.set("children",e.map(e=>e.id),t):this.store.remove("children",t),this}unembed(e,t={}){let n=this.children;if(null!=n&&null!=e){let r=this.getChildIndex(e);-1!==r&&(n.splice(r,1),e.setParent(null,t),this.setChildren(n,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return fL.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,n={}){return e.insertChild(this,t,n),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,n={}){if(null!=e&&e!==this){let r=e.getParent(),i=this!==r,o=t;if(null==o&&(o=this.getChildCount(),!i&&(o-=1)),r){let t=r.getChildren();if(t){let i=t.indexOf(e);i>=0&&(e.setParent(null,n),t.splice(i,1),r.setChildren(t,n))}}let s=this.children;if(null==s?(s=[]).push(e):s.splice(o,0,e),e.setParent(this,n),this.setChildren(s,n),i&&this.model){let e=this.model.getIncomingEdges(this),t=this.model.getOutgoingEdges(this);e&&e.forEach(e=>e.updateParent(n)),t&&t.forEach(e=>e.updateParent(n))}this.model&&this.model.addCell(e,n)}return this}removeFromParent(e={}){let t=this.getParent();if(null!=t){let n=t.getChildIndex(this);t.removeChildAt(n,e)}return this}removeChild(e,t={}){let n=this.getChildIndex(e);return this.removeChildAt(n,t)}removeChildAt(e,t={}){let n=this.getChildAt(e);return null!=this.children&&null!=n&&(this.unembed(n,t),n.remove(t)),n}remove(e={}){return this.batchUpdate("remove",()=>{let t=this.getParent();t&&t.removeChild(this,e),!1!==e.deep&&this.eachChild(t=>t.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,n={},r="/"){return this.animation.start(e,t,n,r)}stopTransition(e,t,n="/"){return this.animation.stop(e,t,n),this}getTransitions(){return this.animation.get()}translate(e,t,n){return this}scale(e,t,n,r){return this}addTools(e,t,n){let r=Array.isArray(e)?e:[e],i="string"==typeof t?t:null,o="object"==typeof t?t:"object"==typeof n?n:{};if(o.reset)return this.setTools({name:i,items:r,local:o.local},o);let s=ss(this.getTools());if(null==s||null==i||s.name===i)return null==s&&(s={}),!s.items&&(s.items=[]),s.name=i,s.items=[...s.items,...r],this.setTools(Object.assign({},s),o)}setTools(e,t={}){return null==e?this.removeTools():this.store.set("tools",fL.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){let t=this.getTools();return null!=t&&(null==e||t.name===e)}hasTool(e){let t=this.getTools();return null!=t&&t.items.some(t=>"string"==typeof t?t===e:t.name===e)}removeTool(e,t={}){let n=ss(this.getTools());if(n){let r=!1,i=n.items.slice(),o=e=>{i.splice(e,1),r=!0};if("number"==typeof e)o(e);else for(let t=i.length-1;t>=0;t-=1){let n=i[t];("string"==typeof n?n===e:n.name===e)&&o(t)}r&&(n.items=i,this.setTools(n,t))}return this}getBBox(e){return new uM}getConnectionPoint(e,t){return new uA}toJSON(e={}){let t=Object.assign({},this.store.get()),n=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){let e=this.constructor;throw Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${e.name||n.call(e)}"`)}let i=this.constructor,o=!0===e.diff,s=t.attrs||{},l=i.getDefaults(!0),a=o?this.preprocess(l,!0):l,u=a.attrs||{},c={};Object.entries(t).forEach(([e,i])=>{if(null!=i&&!Array.isArray(i)&&"object"==typeof i&&!r5(i))throw Error(`Can only serialize ${r} with plain-object props, but got a "${n.call(i)}" type of key "${e}" on ${r} "${this.id}"`);"attrs"!==e&&"shape"!==e&&o&&sn(i,a[e])&&delete t[e]}),Object.keys(s).forEach(e=>{let t=s[e],n=u[e];Object.keys(t).forEach(r=>{let i=t[r],o=n?n[r]:null;null==i||"object"!=typeof i||Array.isArray(i)?(null==n||!sn(o,i))&&(null==c[e]&&(c[e]={}),c[e][r]=i):Object.keys(i).forEach(t=>{let s=i[t];(null==n||null==o||!nS(o)||!sn(o[t],s))&&(null==c[e]&&(c[e]={}),null==c[e][r]&&(c[e][r]={}),c[e][r][t]=s)})})});let h=Object.assign(Object.assign({},t),{attrs:ov(c)?void 0:c});return null==h.attrs&&delete h.attrs,0===h.angle&&delete h.angle,ss(h)}clone(e={}){if(!e.deep){let t=Object.assign({},this.store.get());return!e.keepId&&delete t.id,delete t.parent,delete t.children,new this.constructor(t)}return fL.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},n=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),n&&n.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},n=this.model){return n&&n.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,n){let r=this.model;this.startBatch(e,n,r);let i=t();return this.stopBatch(e,n,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}fL.defaults={},fL.attrHooks={},fL.propHooks=[],!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([sp.dispose()],fL.prototype,"dispose",null),(fL||(fL={})).normalizeTools=function(e){return"string"==typeof e?{items:[e]}:Array.isArray(e)?{items:e}:e.items?e:{items:[e]}},(ek=fL||(fL={})).toStringTag=`X6.${ek.name}`,ek.isCell=function(e){if(null==e)return!1;if(e instanceof ek)return!0;let t=e[Symbol.toStringTag];return(null==t||t===ek.toStringTag)&&"function"==typeof e.isNode&&"function"==typeof e.isEdge&&"function"==typeof e.prop&&"function"==typeof e.attr||!1},(eA=fL||(fL={})).getCommonAncestor=function(...e){let t=e.filter(e=>null!=e).map(e=>e.getAncestors()).sort((e,t)=>e.length-t.length);return t.shift().find(e=>t.every(t=>t.includes(e)))||null},eA.getCellsBBox=function(e,t={}){let n=null;for(let r=0,i=e.length;r<i;r+=1){let i=e[r],o=i.getBBox(t);if(o){if(i.isNode()){let e=i.getAngle();null!=e&&0!==e&&(o=o.bbox(e))}n=null==n?o:n.union(o)}}return n},eA.deepClone=function(e){let t=[e,...e.getDescendants({deep:!0})];return eA.cloneCells(t)},eA.cloneCells=function(e){let t=s_(e),n=t.reduce((e,t)=>(e[t.id]=t.clone(),e),{});return t.forEach(e=>{let t=n[e.id];if(t.isEdge()){let e=t.getSourceCellId(),r=t.getTargetCellId();e&&n[e]&&t.setSource(Object.assign(Object.assign({},t.getSource()),{cell:n[e].id})),r&&n[r]&&t.setTarget(Object.assign(Object.assign({},t.getTarget()),{cell:n[r].id}))}let r=e.getParent();r&&n[r.id]&&t.setParent(n[r.id]);let i=e.getChildren();if(i&&i.length){let e=i.reduce((e,t)=>(n[t.id]&&e.push(n[t.id]),e),[]);e.length>0&&t.setChildren(e)}}),n},!function(e){e.config({propHooks(t){var{tools:n}=t,r=fI(t,["tools"]);return n&&(r.tools=e.normalizeTools(n)),r}})}(fL||(fL={}));(eM=tI||(tI={})).exist=function(e,t){return t?null!=i&&i.exist(e):null!=o&&o.exist(e)},eM.setEdgeRegistry=function(e){i=e},eM.setNodeRegistry=function(e){o=e};class fR{constructor(e){this.ports=[],this.groups={},this.init(ss(e))}getPorts(){return this.ports}getGroup(e){return null!=e?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||null==t.group&&null==e)}getPortsLayoutByGroup(e,t){let n;let r=this.getPortsByGroup(e),i=e?this.getGroup(e):null,o=i?i.position:null,s=o?o.name:null;if(null!=s){let e=tx.registry.get(s);if(null==e)return tx.registry.onNotFound(s);n=e}else n=tx.presets.left;let l=r.map(e=>e&&e.position&&e.position.args||{});return n(l,t,o&&o.args||{}).map((e,n)=>{let i=r[n];return{portLayout:e,portId:i.id,portSize:i.size,portAttrs:i.attrs,labelSize:i.label.size,labelLayout:this.getPortLabelLayout(i,uA.create(e.position),t)}})}init(e){let{groups:t,items:n}=e;null!=t&&Object.keys(t).forEach(e=>{this.groups[e]=this.parseGroup(t[e])}),Array.isArray(n)&&n.forEach(e=>{this.ports.push(this.parsePort(e))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){let t=Object.assign({},e),n=this.getGroup(e.group)||{};return t.markup=t.markup||n.markup,t.attrs=iM({},n.attrs,t.attrs),t.position=this.createPosition(n,t),t.label=iM({},n.label,this.getLabel(t)),t.zIndex=this.getZIndex(n,t),t.size=Object.assign(Object.assign({},n.size),t.size),t}getZIndex(e,t){return"number"==typeof t.zIndex?t.zIndex:"number"==typeof e.zIndex||"auto"===e.zIndex?e.zIndex:"auto"}createPosition(e,t){return iM({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(null==e){if(t)return{name:"left",args:{}}}else{if("string"==typeof e)return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if("object"==typeof e)return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(null==e){if(t)return{name:"left",args:{}}}else{if("string"==typeof e)return{name:e,args:{}};if("object"==typeof e)return e}return{args:{}}}getLabel(e,t=!1){let n=e.label||{};return n.position=this.getPortLabelPosition(n.position,t),n}getPortLabelLayout(e,t,n){let r=e.label.position.name||"left",i=e.label.position.args||{},o=tw.registry.get(r)||tw.presets.left;return o?o(t,n,i):null}}var f_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class fB extends fL{get[Symbol.toStringTag](){return fB.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){let{x:n,y:r,width:i,height:o}=e,s=f_(e,["x","y","width","height"]);if(null!=n||null!=r){let e=s.position;s.position=Object.assign(Object.assign({},e),{x:null!=n?n:e?e.x:0,y:null!=r?r:e?e.y:0})}if(null!=i||null!=o){let e=s.size;s.size=Object.assign(Object.assign({},e),{width:null!=i?i:e?e.width:0,height:null!=o?o:e?e.height:0})}return super.preprocess(s,t)}isNode(){return!0}size(e,t,n){return void 0===e?this.getSize():"number"==typeof e?this.setSize(e,t,n):this.setSize(e,t)}getSize(){let e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,n){return"object"==typeof e?this.resize(e.width,e.height,t):this.resize(e,t,n),this}resize(e,t,n={}){this.startBatch("resize",n);let r=n.direction;if(r){let i;let o=this.getSize();switch(r){case"left":case"right":t=o.height;break;case"top":case"bottom":e=o.width}let s={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[r],l=th.normalize(this.getAngle()||0);n.absolute&&(s+=Math.floor((l+45)/90),s%=4);let a=this.getBBox(),u=(i=0===s?a.getBottomLeft():1===s?a.getCorner():2===s?a.getTopRight():a.getOrigin()).clone().rotate(-l,a.getCenter()),c=Math.sqrt(e*e+t*t)/2,h=s*Math.PI/2;h+=Math.atan(s%2==0?t/e:e/t),h-=th.toRad(l);let d=uA.fromPolar(c,h,u).clone().translate(-(e/2),-(t/2));this.store.set("size",{width:e,height:t},n),this.setPosition(d.x,d.y,n)}else this.store.set("size",{width:e,height:t},n);return this.stopBatch("resize",n),this}scale(e,t,n,r={}){let i=this.getBBox().scale(e,t,null==n?void 0:n);return this.startBatch("scale",r),this.setPosition(i.x,i.y,r),this.resize(i.width,i.height,r),this.stopBatch("scale"),this}position(e,t,n){return"number"==typeof e?this.setPosition(e,t,n):this.getPosition(e)}getPosition(e={}){if(e.relative){let e=this.getParent();if(null!=e&&e.isNode()){let t=this.getPosition(),n=e.getPosition();return{x:t.x-n.x,y:t.y-n.y}}}let t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,n={}){let r,i,o;if("object"==typeof e?(r=e.x,i=e.y,o=t||{}):(r=e,i=t,o=n||{}),o.relative){let e=this.getParent();if(null!=e&&e.isNode()){let t=e.getPosition();r+=t.x,i+=t.y}}if(o.deep){let e=this.getPosition();this.translate(r-e.x,i-e.y,o)}else this.store.set("position",{x:r,y:i},o);return this}translate(e=0,t=0,n={}){if(0===e&&0===t)return this;n.translateBy=n.translateBy||this.id;let r=this.getPosition();if(null!=n.restrict&&n.translateBy===this.id){let i=this.getBBox({deep:!0}),o=n.restrict,s=r.x-i.x,l=r.y-i.y,a=Math.max(o.x+s,Math.min(o.x+o.width+s-i.width,r.x+e)),u=Math.max(o.y+l,Math.min(o.y+o.height+l-i.height,r.y+t));e=a-r.x,t=u-r.y}let i={x:r.x+e,y:r.y+t};return n.tx=e,n.ty=t,n.transition?("object"!=typeof n.transition&&(n.transition={}),this.transition("position",i,Object.assign(Object.assign({},n.transition),{interp:tc.object})),this.eachChild(r=>{var i;!(null===(i=n.exclude)||void 0===i?void 0:i.includes(r))&&r.translate(e,t,n)})):(this.startBatch("translate",n),this.store.set("position",i,n),this.eachChild(r=>{var i;!(null===(i=n.exclude)||void 0===i?void 0:i.includes(r))&&r.translate(e,t,n)}),this.stopBatch("translate",n)),this}angle(e,t){return null==e?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){let n=this.getAngle();if(t.center){let r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(n-e,t.center);let s=o.x-r.width/2-i.x,l=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(i.x+s,i.y+l,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(n+e)%360,t);return this}getBBox(e={}){if(e.deep){let e=this.getDescendants({deep:!0,breadthFirst:!0});return e.push(this),fL.getCellsBBox(e)}return uM.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){let n=this.getBBox(),r=n.getCenter(),i=e.getTerminal(t);if(null==i)return r;let o=i.port;if(!o||!this.hasPort(o))return r;let s=this.getPort(o);if(!s||!s.group)return r;let l=this.getPortsPosition(s.group)[o].position,a=uA.create(l).translate(n.getOrigin()),u=this.getAngle();return u&&a.rotate(-u,r),a}fit(e={}){let t=(this.getChildren()||[]).filter(e=>e.isNode());if(0===t.length)return this;this.startBatch("fit-embeds",e),e.deep&&t.forEach(t=>t.fit(e));let{x:n,y:r,width:i,height:o}=fL.getCellsBBox(t),s=lJ(e.padding);return n-=s.left,r-=s.top,i+=s.left+s.right,o+=s.bottom+s.top,this.store.set({position:{x:n,y:r},size:{width:i,height:o}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||tE.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",tE.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||tE.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",tE.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||tE.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",tE.clone(e),t),this}get ports(){let e=this.store.get("ports",{items:[]});return null==e.items&&(e.items=[]),e}getPorts(){return ss(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return ss(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return -1!==this.getPortIndex(e)}getPortIndex(e){let t="string"==typeof e?e:e.id;return null!=t?this.ports.items.findIndex(e=>e.id===t):-1}getPortsPosition(e){let t=this.getSize();return this.port.getPortsLayoutByGroup(e,new uM(0,0,t.width,t.height)).reduce((e,t)=>{let n=t.portLayout;return e[t.portId]={position:Object.assign({},n.position),angle:n.angle||0},e},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,n,r){if("string"==typeof t||Array.isArray(t)){let i=this.prefixPortPath(e,t);return this.setPropByPath(i,n,r)}let i=this.prefixPortPath(e);return this.setPropByPath(i,t,n)}removePortProp(e,t,n){return"string"==typeof t||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),n):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,n,r){if(null==t)return this.getPortProp(e);if("string"==typeof t||Array.isArray(t))return 2==arguments.length?this.getPortProp(e,t):null==n?this.removePortProp(e,t,r):this.setPortProp(e,t,n,r);return this.setPortProp(e,t,n)}prefixPortPath(e,t){let n=this.getPortIndex(e);if(-1===n)throw Error(`Unable to find port with id: "${e}"`);return null==t||""===t?["ports","items",`${n}`]:Array.isArray(t)?["ports","items",`${n}`,...t]:`ports/items/${n}/${t}`}addPort(e,t){let n=[...this.ports.items];return n.push(e),this.setPropByPath("ports/items",n,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,n){let r=[...this.ports.items];return r.splice(e,0,t),this.setPropByPath("ports/items",r,n),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){let n=[...this.ports.items];n.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",n,t)}return this}removePorts(e,t){let n;if(Array.isArray(e)){if(n=t||{},e.length){n.rewrite=!0;let t=[...this.ports.items].filter(t=>!e.some(e=>{let n="string"==typeof e?e:e.id;return t.id===n}));this.setPropByPath("ports/items",t,n)}}else(n=e||{}).rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){let e=this.ports,t={};e.items.forEach(e=>{e.id&&(t[e.id]=!0)});let n={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(e=>{e.id&&!t[e.id]&&(n[e.id]=!0)});let r=this.model;r&&!ov(n)&&(r.getConnectedEdges(this,{incoming:!0}).forEach(e=>{let t=e.getTargetPortId();t&&n[t]&&e.remove()}),r.getConnectedEdges(this,{outgoing:!0}).forEach(e=>{let t=e.getSourcePortId();t&&n[t]&&e.remove()}))}validatePorts(){let e={},t=[];return this.ports.items.forEach(n=>{"object"!=typeof n&&t.push(`Invalid port ${n}.`),null==n.id&&(n.id=this.generatePortId()),e[n.id]&&t.push("Duplicitied port id."),e[n.id]=!0}),t}generatePortId(){return lH()}updatePortData(){let e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),Error(e.join(" "));let t=this.port?this.port.getPorts():null;this.port=new fR(this.ports);let n=this.port.getPorts(),r=t?n.filter(e=>t.find(t=>t.id===e.id)?null:e):[...n],i=t?t.filter(e=>n.find(t=>t.id===e.id)?null:e):[];r.length>0&&this.notify("ports:added",{added:r,cell:this,node:this}),i.length>0&&this.notify("ports:removed",{removed:i,cell:this,node:this})}}fB.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},(eT=fB||(fB={})).toStringTag=`X6.${eT.name}`,eT.isNode=function(e){if(null==e)return!1;if(e instanceof eT)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eT.toStringTag)&&"function"==typeof e.isNode&&"function"==typeof e.isEdge&&"function"==typeof e.prop&&"function"==typeof e.attr&&"function"==typeof e.size&&"function"==typeof e.position||!1},!function(e){e.config({propHooks(e){var{ports:t}=e,n=f_(e,["ports"]);return t&&(n.ports=Array.isArray(t)?{items:t}:t),n}})}(fB||(fB={})),(eN=fB||(fB={})).registry=uY.create({type:"node",process(e,t){if(tI.exist(e,!0))throw Error(`Node with name '${e}' was registered by anthor Edge`);if("function"==typeof t)return t.config({shape:e}),t;let n=eN,{inherit:r}=t,i=f_(t,["inherit"]);if(r){if("string"==typeof r){let e=this.get(r);null==e?this.onNotFound(r,"inherited"):n=e}else n=r}null==i.constructorName&&(i.constructorName=e);let o=n.define.call(n,i);return o.config({shape:e}),o}}),tI.setNodeRegistry(eN.registry);ej=fB||(fB={}),s=0,ej.define=function(e){var t;let{constructorName:n,overwrite:r}=e,i=f_(e,["constructorName","overwrite"]);let o=su((t=n||i.shape)?lU(t):(s+=1,`CustomNode${s}`),this);return o.config(i),i.shape&&ej.registry.register(i.shape,o,r),o},ej.create=function(e){let t=e.shape||"rect",n=ej.registry.get(t);return n?new n(e):ej.registry.onNotFound(t)};var fD=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class fz extends fL{get[Symbol.toStringTag](){return fz.toStringTag}constructor(e={}){super(e)}preprocess(e,t){let{source:n,sourceCell:r,sourcePort:i,sourcePoint:o,target:s,targetCell:l,targetPort:a,targetPoint:u}=e,c=fD(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]);if(null!=n){if(fL.isCell(n))c.source={cell:n.id};else{let e;if("string"==typeof(e=n)||"number"==typeof e)c.source={cell:n};else if(uA.isPoint(n))c.source=n.toJSON();else if(Array.isArray(n))c.source={x:n[0],y:n[1]};else{let e=n.cell;fL.isCell(e)?c.source=Object.assign(Object.assign({},n),{cell:e.id}):c.source=n}}}if(null!=r||null!=i){let e=c.source;if(null!=r){let t;let n="string"==typeof(t=r)||"number"==typeof t?r:r.id;e?e.cell=n:e=c.source={cell:n}}null!=i&&e&&(e.port=i)}else null!=o&&(c.source=uA.create(o).toJSON());if(null!=s){if(fL.isCell(s))c.target={cell:s.id};else{let e;if("string"==typeof(e=s)||"number"==typeof e)c.target={cell:s};else if(uA.isPoint(s))c.target=s.toJSON();else if(Array.isArray(s))c.target={x:s[0],y:s[1]};else{let e=s.cell;fL.isCell(e)?c.target=Object.assign(Object.assign({},s),{cell:e.id}):c.target=s}}}if(null!=l||null!=a){let e=c.target;if(null!=l){let t;let n="string"==typeof(t=l)||"number"==typeof t?l:l.id;e?e.cell=n:e=c.target={cell:n}}null!=a&&e&&(e.port=a)}else null!=u&&(c.target=uA.create(u).toJSON());return super.preprocess(c,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,n={}){return this.setTerminal("source",e,t,n)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,n={}){return this.setTerminal("target",e,t,n)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,n,r={}){return fL.isCell(t)?(this.store.set(e,iM({},n,{cell:t.id}),r),this):uA.isPoint(t)||null!=t.x&&null!=t.y?(this.store.set(e,iM({},n,{x:t.x,y:t.y}),r),this):(this.store.set(e,ss(t),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){let t=this[e];if(uA.isPointLike(t))return uA.create(t);let n=this.getTerminalCell(e);return n?n.getConnectionPoint(this,e):new uA}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){let t="source"===e?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this,n={};for(;t&&t.isEdge();){if(n[t.id])return null;n[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){null==e?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,n){return"object"==typeof e?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},n),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){null==e?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,n){return"object"==typeof e?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},n),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){let e=this.constructor;return ss(this.store.get("defaultLabel")||e.defaultLabel||{})}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,n={}){let r=this.getLabels(),i=r.length,o=null!=t&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(e)),this.setLabels(r,n)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){let t=this.getLabels();return null!=e&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,n={}){if(null!=e&&Number.isFinite(e)){let r=this.getLabels();r[e]=this.parseLabel(t),this.setLabels(r,n)}return this}removeLabelAt(e,t={}){let n=this.getLabels(),r=null!=e&&Number.isFinite(e)?e:-1,i=n.splice(r,1);return this.setLabels(n,t),i.length?i[0]:null}parseLabel(e){return"string"==typeof e?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){let n=e&&t?t.filter(t=>e.find(e=>t===e||sn(t,e))?null:t):t?[...t]:[],r=e&&t?e.filter(e=>t.find(t=>e===t||sn(e,t))?null:e):e?[...e]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),r.length>0&&this.notify("labels:removed",{removed:r,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){let n=Array.isArray(e)?e:[e];return this.store.set("vertices",n.map(e=>uA.toJSON(e)),t),this}insertVertex(e,t,n={}){let r=this.getVertices(),i=r.length,o=null!=t&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,uA.toJSON(e)),this.setVertices(r,n)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return null!=e&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,n={}){if(null!=e&&Number.isFinite(e)){let r=this.getVertices();r[e]=t,this.setVertices(r,n)}return this}removeVertexAt(e,t={}){let n=this.getVertices(),r=null!=e&&Number.isFinite(e)?e:-1;return n.splice(r,1),this.setVertices(n,t)}onVertexsChanged({previous:e,current:t}){let n=e&&t?t.filter(t=>e.find(e=>uA.equals(t,e))?null:t):t?[...t]:[],r=e&&t?e.filter(e=>t.find(t=>uA.equals(e,t))?null:e):e?[...e]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),r.length>0&&this.notify("vertexs:removed",{removed:r,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||tE.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,n={}){return n.translateBy=n.translateBy||this.id,n.tx=e,n.ty=t,this.applyToPoints(n=>({x:(n.x||0)+e,y:(n.y||0)+t}),n)}scale(e,t,n,r={}){return this.applyToPoints(r=>uA.create(r).scale(e,t,n).toJSON(),r)}applyToPoints(e,t={}){let n={},r=this.getSource(),i=this.getTarget();uA.isPointLike(r)&&(n.source=e(r)),uA.isPointLike(i)&&(n.target=e(i));let o=this.getVertices();return o.length>0&&(n.vertices=o.map(e)),this.store.set(n,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){let e=[this.getSourcePoint(),...this.getVertices().map(e=>uA.create(e)),this.getTargetPoint()];return new uD(e)}updateParent(e){let t=null,n=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return n&&r&&(t=n===r||n.isDescendantOf(r)?r:r.isDescendantOf(n)?n:fL.getCommonAncestor(n,r)),i&&t&&t.id!==i.id&&i.unembed(this,e),t&&(!i||i.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){let t=this.getSource(),n=this.getTarget(),r=t.cell,i=n.cell;if(!r||!i)return!1;let o=r===i;if(!o&&e.deep&&this._model){let t=this.getSourceCell(),n=this.getTargetCell();t&&n&&(o=t.isAncestorOf(n,e)||n.isAncestorOf(t,e))}return o}getFragmentAncestor(){let e=[this,this.getSourceNode(),this.getTargetNode()].filter(e=>null!=e);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){let t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}}fz.defaults={},(fz||(fz={})).equalTerminals=function(e,t){return e.cell===t.cell&&(e.port===t.port||null==e.port&&null==t.port)},(eI=fz||(fz={})).defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},eI.parseStringLabel=function(e){return{attrs:{label:{text:e}}}},(eL=fz||(fz={})).toStringTag=`X6.${eL.name}`,eL.isEdge=function(e){if(null==e)return!1;if(e instanceof eL)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eL.toStringTag)&&"function"==typeof e.isNode&&"function"==typeof e.isEdge&&"function"==typeof e.prop&&"function"==typeof e.attr&&"function"==typeof e.disconnect&&"function"==typeof e.getSource&&"function"==typeof e.getTarget||!1},(eR=fz||(fz={})).registry=uY.create({type:"edge",process(e,t){if(tI.exist(e,!1))throw Error(`Edge with name '${e}' was registered by anthor Node`);if("function"==typeof t)return t.config({shape:e}),t;let n=eR,{inherit:r="edge"}=t,i=fD(t,["inherit"]);if("string"==typeof r){let e=this.get(r||"edge");null==e&&r?this.onNotFound(r,"inherited"):n=e}else n=r;null==i.constructorName&&(i.constructorName=e);let o=n.define.call(n,i);return o.config({shape:e}),o}}),tI.setEdgeRegistry(eR.registry);e_=fz||(fz={}),l=0,e_.define=function(e){var t;let{constructorName:n,overwrite:r}=e,i=fD(e,["constructorName","overwrite"]);let o=su((t=n||i.shape)?lU(t):(l+=1,`CustomEdge${l}`),this);return o.config(i),i.shape&&e_.registry.register(i.shape,o,r),o},e_.create=function(e){let t=e.shape||"edge",n=e_.registry.get(t);return n?new n(e):e_.registry.onNotFound(t)},!function(e){let t="basic.edge";e.config({shape:t,propHooks(t){let{label:n,vertices:r}=t,i=fD(t,["label","vertices"]);if(n){null==i.labels&&(i.labels=[]);let t="string"==typeof n?e.parseStringLabel(n):n;i.labels.push(t)}return r&&Array.isArray(r)&&(i.vertices=r.map(e=>uA.create(e).toJSON())),i}}),e.registry.register(t,e)}(fz||(fz={}));class fF extends sp{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,n){let r,i;"number"==typeof t?(r=t,i=Object.assign({merge:!1},n)):(r=this.length,i=Object.assign({merge:!1},t)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);let o=Array.isArray(e)?e:[e],s=this.comparator&&"number"!=typeof t&&!1!==i.sort,l=this.comparator||null,a=!1,u=[],c=[];return o.forEach(e=>{let t=this.get(e);t?i.merge&&!e.isSameStore(t)&&(t.setProp(e.getProp(),n),c.push(t),s&&!a&&(a=null==l||"function"==typeof l?t.hasChanged():"string"==typeof l?t.hasChanged(l):l.some(e=>t.hasChanged(e)))):(u.push(e),this.reference(e))}),u.length&&(s&&(a=!0),this.cells.splice(r,0,...u),this.length=this.cells.length),a&&this.sort({silent:!0}),!i.silent&&(u.forEach((e,t)=>{let n={cell:e,index:r+t,options:i};this.trigger("added",n),!i.dryrun&&e.notify("added",Object.assign({},n))}),a&&this.trigger("sorted"),(u.length||c.length)&&this.trigger("updated",{added:u,merged:c,removed:[],options:i})),this}remove(e,t={}){let n=Array.isArray(e)?e:[e],r=this.removeCells(n,t);return!t.silent&&r.length>0&&this.trigger("updated",{options:t,removed:r,added:[],merged:[]}),Array.isArray(e)?r:r[0]}removeCells(e,t){let n=[];for(let r=0;r<e.length;r+=1){let i=this.get(e[r]);if(null==i)continue;let o=this.cells.indexOf(i);this.cells.splice(o,1),this.length-=1,delete this.map[i.id],n.push(i),this.unreference(i),!t.dryrun&&i.remove(),!t.silent&&(this.trigger("removed",{cell:i,index:o,options:t}),!t.dryrun&&i.notify("removed",{cell:i,index:o,options:t}))}return n}reset(e,t={}){let n=this.cells.slice();if(n.forEach(e=>this.unreference(e)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){let e=this.cells.slice();this.trigger("reseted",{options:t,previous:n,current:e});let r=[],i=[];e.forEach(e=>{!n.some(t=>t.id===e.id)&&r.push(e)}),n.forEach(t=>{!e.some(e=>e.id===t.id)&&i.push(t)}),this.trigger("updated",{options:t,added:r,removed:i,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){let t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){let t=this.at(0);return this.remove(t,e)}get(e){if(null==e)return null;let t="string"==typeof e||"number"==typeof e?e:e.id;return this.map[t]||null}has(e){return null!=this.get(e)}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return null!=this.comparator&&(this.cells=sH(this.cells,this.comparator),!e.silent&&this.trigger("sorted")),this}clone(){return new this.constructor(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){let n=t.cell;this.trigger(`cell:${e}`,t),n&&(n.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:n})):n.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([fF.dispose()],fF.prototype,"dispose",null);class fV extends sp{get[Symbol.toStringTag](){return fV.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new fF(e),this.setup()}notify(e,t){this.trigger(e,t);let n=this.graph;return n&&("sorted"===e||"reseted"===e||"updated"===e?n.trigger(`model:${e}`,t):n.trigger(e,t)),this}setup(){let e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",e=>this.notify("updated",e)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:e})=>{this.onCellAdded(e)}),e.on("removed",e=>{let t=e.cell;this.onCellRemoved(t,e.options),this.notify("cell:removed",e),t.isNode()?this.notify("node:removed",Object.assign(Object.assign({},e),{node:t})):t.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},e),{edge:t}))}),e.on("reseted",e=>{this.onReset(e.current),this.notify("reseted",e)}),e.on("edge:change:source",({edge:e})=>this.onEdgeTerminalChanged(e,"source")),e.on("edge:change:target",({edge:e})=>{this.onEdgeTerminalChanged(e,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){let t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){let n=e.id;if(e.isEdge()){delete this.edges[n];let t=e.getSource(),r=e.getTarget();if(t&&t.cell){let e=this.outgoings[t.cell],r=e?e.indexOf(n):-1;r>=0&&(e.splice(r,1),0===e.length&&delete this.outgoings[t.cell])}if(r&&r.cell){let e=this.incomings[r.cell],t=e?e.indexOf(n):-1;t>=0&&(e.splice(t,1),0===e.length&&delete this.incomings[r.cell])}}else delete this.nodes[n];!t.clear&&(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(e=>this.onCellAdded(e))}onEdgeTerminalChanged(e,t){let n="source"===t?this.outgoings:this.incomings,r=e.previous(t);if(r&&r.cell){let t=fL.isCell(r.cell)?r.cell.id:r.cell,i=n[t],o=i?i.indexOf(e.id):-1;o>=0&&(i.splice(o,1),0===i.length&&delete n[t])}let i=e.getTerminal(t);if(i&&i.cell){let t=fL.isCell(i.cell)?i.cell.id:i.cell,r=n[t]||[];-1===r.indexOf(e.id)&&r.push(e.id),n[t]=r}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),null==e.zIndex&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(e=>this.prepareCell(e,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(e=>this.prepareCell(e,{options:t})),this}clear(e={}){let t=this.getCells();if(0===t.length)return this;let n=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{let e=t.sort((e,t)=>{let n=e.isEdge()?1:2;return n-(t.isEdge()?1:2)});for(;e.length>0;){let t=e.shift();t&&t.remove(n)}},n),this}addNode(e,t={}){let n=fB.isNode(e)?e:this.createNode(e);return this.addCell(n,t),n}updateNode(e,t={}){let n=this.createNode(e),r=n.getProp();return n.dispose(),this.updateCell(r,t)}createNode(e){return fB.create(e)}addEdge(e,t={}){let n=fz.isEdge(e)?e:this.createEdge(e);return this.addCell(n,t),n}createEdge(e){return fz.create(e)}updateEdge(e,t={}){let n=this.createEdge(e),r=n.getProp();return n.dispose(),this.updateCell(r,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(e=>this.addCell(e,t)),this.addings.delete(e)),this)}addCells(e,t={}){let n=e.length;if(0===n)return this;let r=Object.assign(Object.assign({},t),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:e})),e.forEach(e=>{this.addCell(e,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:e})),this}updateCell(e,t={}){let n=e.id&&this.getCell(e.id);return!!n&&this.batchUpdate("update",()=>(Object.entries(e).forEach(([e,r])=>n.setProp(e,r,t)),!0),e)}removeCell(e,t={}){let n="string"==typeof e?this.getCell(e):e;return n&&this.has(n)?this.collection.remove(n,t):null}updateCellId(e,t){if(e.id===t)return;this.startBatch("update",{id:t}),e.prop("id",t);let n=e.clone({keepId:!0});return this.addCell(n),this.getConnectedEdges(e).forEach(n=>{let r=n.getSourceCell(),i=n.getTargetCell();r===e&&n.setSource(Object.assign(Object.assign({},n.getSource()),{cell:t})),i===e&&n.setTarget(Object.assign(Object.assign({},n.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),n}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(e=>this.removeCell(e,t))):[]}removeConnectedEdges(e,t={}){let n=this.getConnectedEdges(e);return n.forEach(e=>{e.remove(t)}),n}disconnectConnectedEdges(e,t={}){let n="string"==typeof e?e:e.id;this.getConnectedEdges(e).forEach(e=>{let r=e.getSourceCellId(),i=e.getTargetCellId();r===n&&e.setSource({x:0,y:0},t),i===n&&e.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){let e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){let e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(e=>this.getCell(e)).filter(e=>null!=e):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){let t="string"==typeof e?e:e.id,n=this.outgoings[t];return n?n.map(e=>this.getCell(e)).filter(e=>e&&e.isEdge()):null}getIncomingEdges(e){let t="string"==typeof e?e:e.id,n=this.incomings[t];return n?n.map(e=>this.getCell(e)).filter(e=>e&&e.isEdge()):null}getConnectedEdges(e,t={}){let n=[],r="string"==typeof e?this.getCell(e):e;if(null==r)return n;let i={},o=t.indirect,s=t.incoming,l=t.outgoing;null==s&&null==l&&(s=l=!0);let a=(e,t)=>{let r=t?this.getOutgoingEdges(e):this.getIncomingEdges(e);if(null!=r&&r.forEach(e=>{if(!i[e.id])n.push(e),i[e.id]=!0,o&&(s&&a(e,!1),l&&a(e,!0))}),o&&e.isEdge()){let r=t?e.getTargetCell():e.getSourceCell();r&&r.isEdge()&&!i[r.id]&&(n.push(r),a(r,t))}};if(l&&a(r,!0),s&&a(r,!1),t.deep){let e=r.getDescendants({deep:!0}),o={};e.forEach(e=>{e.isNode()&&(o[e.id]=!0)});let a=(e,r)=>{let s=r?this.getOutgoingEdges(e.id):this.getIncomingEdges(e.id);null!=s&&s.forEach(e=>{if(!i[e.id]){let r=e.getSourceCell(),s=e.getTargetCell();if(!!t.enclosed||!r||!o[r.id]||!s||!o[s.id])n.push(e),i[e.id]=!0}})};e.forEach(e=>{if(!e.isEdge())l&&a(e,!0),s&&a(e,!1)})}return n}isBoundary(e,t){let n="string"==typeof e?this.getCell(e):e,r=t?this.getIncomingEdges(n):this.getOutgoingEdges(n);return null==r||0===r.length}getBoundaryNodes(e){let t=[];return Object.keys(this.nodes).forEach(n=>{if(this.isBoundary(n,e)){let e=this.getCell(n);e&&t.push(e)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let n=t.incoming,r=t.outgoing;null==n&&null==r&&(n=r=!0);let i=this.getConnectedEdges(e,t).reduce((i,o)=>{let s=o.hasLoop(t),l=o.getSourceCell(),a=o.getTargetCell();return n&&l&&l.isNode()&&!i[l.id]&&(s||l!==e&&(!t.deep||!l.isDescendantOf(e)))&&(i[l.id]=l),r&&a&&a.isNode()&&!i[a.id]&&(s||a!==e&&(!t.deep||!a.isDescendantOf(e)))&&(i[a.id]=a),i},{});if(e.isEdge()){if(n){let t=e.getSourceCell();t&&t.isNode()&&!i[t.id]&&(i[t.id]=t)}if(r){let t=e.getTargetCell();t&&t.isNode()&&!i[t.id]&&(i[t.id]=t)}}return Object.keys(i).map(e=>i[e])}isNeighbor(e,t,n={}){let r=n.incoming,i=n.outgoing;return null==r&&null==i&&(r=i=!0),this.getConnectedEdges(e,n).some(e=>{let n=e.getSourceCell(),o=e.getTargetCell();return!!r&&!!n&&n.id===t.id||!!i&&!!o&&o.id===t.id||!1})}getSuccessors(e,t={}){let n=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&n.push(r)},Object.assign(Object.assign({},t),{outgoing:!0})),n}isSuccessor(e,t,n={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,n.distance))return r=!0,!1},Object.assign(Object.assign({},n),{outgoing:!0})),r}getPredecessors(e,t={}){let n=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&n.push(r)},Object.assign(Object.assign({},t),{incoming:!0})),n}isPredecessor(e,t,n={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,n.distance))return r=!0,!1},Object.assign(Object.assign({},n),{incoming:!0})),r}matchDistance(e,t){return null==t||("function"==typeof t?t(e):!!(Array.isArray(t)&&t.includes(e))||e===t)}getCommonAncestor(...e){let t=[];return e.forEach(e=>{e&&(Array.isArray(e)?t.push(...e):t.push(e))}),fL.getCommonAncestor(...t)}getSubGraph(e,t={}){let n=[],r={},i=[],o=[],s=e=>{!r[e.id]&&(n.push(e),r[e.id]=e,e.isEdge()&&o.push(e),e.isNode()&&i.push(e))};return e.forEach(e=>{s(e),t.deep&&e.getDescendants({deep:!0}).forEach(e=>s(e))}),o.forEach(e=>{let t=e.getSourceCell(),o=e.getTargetCell();t&&!r[t.id]&&(n.push(t),r[t.id]=t,t.isNode()&&i.push(t)),o&&!r[o.id]&&(n.push(o),r[o.id]=o,o.isNode()&&i.push(o))}),i.forEach(e=>{this.getConnectedEdges(e,t).forEach(e=>{let t=e.getSourceCell(),i=e.getTargetCell();!r[e.id]&&t&&r[t.id]&&i&&r[i.id]&&(n.push(e),r[e.id]=e)})}),n}cloneSubGraph(e,t={}){let n=this.getSubGraph(e,t);return this.cloneCells(n)}cloneCells(e){return fL.cloneCells(e)}getNodesFromPoint(e,t){let n="number"==typeof e?{x:e,y:t||0}:e;return this.getNodes().filter(e=>e.getBBox().containsPoint(n))}getNodesInArea(e,t,n,r,i){let o="number"==typeof e?new uM(e,t,n,r):uM.create(e),s="number"==typeof e?i:t,l=s&&s.strict;return this.getNodes().filter(e=>{let t=e.getBBox();return l?o.containsRect(t):o.isIntersectWithRect(t)})}getEdgesInArea(e,t,n,r,i){let o="number"==typeof e?new uM(e,t,n,r):uM.create(e),s="number"==typeof e?i:t,l=s&&s.strict;return this.getEdges().filter(e=>{let t=e.getBBox();return 0===t.width?t.inflate(1,0):0===t.height&&t.inflate(0,1),l?o.containsRect(t):o.isIntersectWithRect(t)})}getNodesUnderNode(e,t={}){let n=e.getBBox();return(null==t.by||"bbox"===t.by?this.getNodesInArea(n):this.getNodesFromPoint(n[t.by])).filter(t=>e.id!==t.id&&!t.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return fL.getCellsBBox(e,t)}search(e,t,n={}){n.breadthFirst?this.breadthFirstSearch(e,t,n):this.depthFirstSearch(e,t,n)}breadthFirstSearch(e,t,n={}){let r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){let e=r.shift();if(null==e||i[e.id])continue;if(i[e.id]=!0,!1!==n0(t,this,e,o[e.id]))this.getNeighbors(e,n).forEach(t=>{o[t.id]=o[e.id]+1,r.push(t)})}}depthFirstSearch(e,t,n={}){let r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){let e=r.pop();if(null==e||i[e.id])continue;if(i[e.id]=!0,!1===n0(t,this,e,o[e.id]))continue;let s=this.getNeighbors(e,n),l=r.length;s.forEach(t=>{o[t.id]=o[e.id]+1,r.splice(l,0,t)})}}getShortestPath(e,t,n={}){let r={};this.getEdges().forEach(e=>{let t=e.getSourceCellId(),i=e.getTargetCellId();t&&i&&(!r[t]&&(r[t]=[]),!r[i]&&(r[i]=[]),r[t].push(i),!n.directed&&r[i].push(t))});let i="string"==typeof e?e:e.id,o=tl.run(r,i,n.weight),s=[],l="string"==typeof t?t:t.id;for(o[l]&&s.push(l);l=o[l];)s.unshift(l);return s}translate(e,t,n){return this.getCells().filter(e=>!e.hasParent()).forEach(r=>r.translate(e,t,n)),this}resize(e,t,n){return this.resizeCells(e,t,this.getCells(),n)}resizeCells(e,t,n,r={}){let i=this.getCellsBBox(n);if(i){let o=Math.max(e/i.width,0),s=Math.max(t/i.height,0),l=i.getOrigin();n.forEach(e=>e.scale(o,s,l,r))}return this}toJSON(e={}){return fV.toJSON(this.getCells(),e)}parseJSON(e){return fV.fromJSON(e)}fromJSON(e,t={}){let n=this.parseJSON(e);return this.resetCells(n,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,n={}){this.startBatch(e,n);let r=t();return this.stopBatch(e,n),r}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(e=>this.batches[e]>0)}dispose(){this.collection.dispose()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([fV.dispose()],fV.prototype,"dispose",null),(eB=fV||(fV={})).toStringTag=`X6.${eB.name}`,eB.isModel=function(e){if(null==e)return!1;if(e instanceof eB)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eB.toStringTag)&&"function"==typeof e.addNode&&"function"==typeof e.addEdge&&null!=e.collection||!1},(eD=fV||(fV={})).toJSON=function(e,t={}){return{cells:e.map(e=>e.toJSON(t))}},eD.fromJSON=function(e){let t=[];return Array.isArray(e)?t.push(...e):(e.cells&&t.push(...e.cells),e.nodes&&e.nodes.forEach(e=>{null==e.shape&&(e.shape="rect"),t.push(e)}),e.edges&&e.edges.forEach(e=>{null==e.shape&&(e.shape="edge"),t.push(e)})),t.map(e=>{let t=e.shape;if(t){if(fB.registry.exist(t))return fB.create(e);if(fz.registry.exist(t))return fz.create(e)}throw Error("The `shape` should be specified when creating a node/edge instance")})};var f$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class fU extends fB{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return null==e?this.removeLabel():this.setAttrByPath("text/text",e,t),this}removeLabel(){return this.removeAttrByPath("text/text"),this}}(ez=fU||(fU={})).bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},ez.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},ez.config({attrs:{text:Object.assign({},ez.labelAttr)},propHooks(e){let{label:t}=e,n=f$(e,["label"]);return t&&sd(n,"attrs/text/text",t),n},visible:!0});var fG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function fH(e,t,n={}){let r={constructorName:e,markup:function(e,t="body"){return[{tagName:e,selector:t},{tagName:"text",selector:"label"}]}(e,n.selector),attrs:{[e]:Object.assign({},fU.bodyAttr)}};return(n.parent||fU).define(iM(r,t,{shape:e}))}fH("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});let fq=fz.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});fH("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var fW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class fX extends fU{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return null==e?this.removePoints():this.setAttrByPath("body/refPoints",fX.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}!function(e){function t(e){return"string"==typeof e?e:e.map(e=>Array.isArray(e)?e.join(","):uA.isPointLike(e)?`${e.x}, ${e.y}`:"").join(" ")}e.pointsToString=t,e.config({propHooks(e){let{points:n}=e,r=fW(e,["points"]);if(n){let e=t(n);e&&sd(r,"attrs/body/refPoints",e)}return r}})}(fX||(fX={})),fH("polygon",{},{parent:fX}),fH("polyline",{},{parent:fX});var fY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};fU.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(e){let{path:t}=e,n=fY(e,["path"]);return t&&sd(n,"attrs/body/refD",t),n}});var fJ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};fU.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},e4.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:af.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},fU.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(e){let{text:t}=e,n=fJ(e,["text"]);return t&&sd(n,"attrs/label/text",t),n},attrHooks:{text:{set(e,{cell:t,view:n,refBBox:r,elem:i,attrs:o}){if(i instanceof HTMLElement)i.textContent=e;else{let s=o.style||{},l=Object.assign({textVerticalAnchor:"middle"},s);return n0(tm.presets.textWrap.set,this,{text:e,width:-5,height:"100%"},{cell:t,view:n,elem:i,refBBox:r,attrs:l}),{fill:s.color||null}}},position(e,{refBBox:t,elem:n}){if(n instanceof SVGElement)return t.getCenter()}}}}),fH("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:function(e="xlink:href"){return t=>{let{imageUrl:n,imageWidth:r,imageHeight:i}=t,o=fG(t,["imageUrl","imageWidth","imageHeight"]);if(null!=n||null!=r||null!=i){let t=()=>{if(o.attrs){let t=o.attrs.image;null!=n&&(t[e]=n),null!=r&&(t.width=r),null!=i&&(t.height=i),o.attrs.image=t}};o.attrs?null==o.attrs.image&&(o.attrs.image={}):o.attrs={image:{}},t()}return o}}()},{selector:"image"}),fH("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class fQ extends ds{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return fQ.toStringTag}getContainerClassName(){let e=[super.getContainerClassName(),this.prefixClassName("node")];return!this.can("nodeMovable")&&e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){let t=e.target;if(t.hasAttribute("magnet")){let e=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?au(t,e):aa(t,e)}else{let e=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(e):this.addClass(e)}}isNodeView(){return!0}confirmUpdate(e,t={}){let n=e;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",()=>this.resize(),"update"),n=this.handleAction(n,"update",()=>this.update(),hk.useCSSSelector?"ports":null),n=this.handleAction(n,"translate",()=>this.translate()),n=this.handleAction(n,"rotate",()=>this.rotate()),n=this.handleAction(n,"ports",()=>this.renderPorts()),n=this.handleAction(n,"tools",()=>{this.getFlag("tools")===e?this.renderTools():this.updateTools(t)})),n}update(e){this.cleanCache(),hk.useCSSSelector&&this.removePorts();let t=this.cell,n=t.getSize(),r=t.getAttrs();this.updateAttrs(this.container,r,{attrs:e===r?null:e,rootBBox:new uM(0,0,n.width,n.height),selectors:this.selectors}),hk.useCSSSelector&&this.renderPorts()}renderMarkup(){let e=this.cell.markup;if(e){if("string"==typeof e)throw TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw TypeError("Invalid node markup.")}renderJSONMarkup(e){let t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),!hk.useCSSSelector&&this.renderPorts(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){let e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){let e=this.cell.getAngle();if(e){let t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString(),t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){let n=e?this.portsCache[e]:null;if(!n)return null;let r=n.portContentElement,i=n.portContentSelectors||{};return this.findOne(t,r,i)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{aw(e.portElement)})}renderPorts(){let e=this.container,t=[];e.childNodes.forEach(e=>{t.push(e)});let n=sJ(this.cell.getParsedPorts(),"zIndex"),r="auto";n[r]&&n[r].forEach(n=>{let r=this.getPortElement(n);e.append(r),t.push(r)}),Object.keys(n).forEach(e=>{if(e!==r){let r=parseInt(e,10);this.appendPorts(n[e],r,t)}}),this.updatePorts()}appendPorts(e,t,n){let r=e.map(e=>this.getPortElement(e));n[t]||t<0?aP(n[Math.max(t,0)],r):aE(this.container,r)}getPortElement(e){let t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t,n,r=tE.renderMarkup(this.cell.getPortContainerMarkup()),i=r.elem;if(null==i)throw Error("Invalid port container markup.");let o=(r=tE.renderMarkup(this.getPortMarkup(e))).elem,s=r.selectors;if(null==o)throw Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},o);let l="x6-port";e.group&&(l+=` x6-port-${e.group}`),aa(i,l),aa(i,"x6-port"),aa(o,"x6-port-body"),i.appendChild(o);let a=s;if(this.existPortLabel(e)){if(t=(r=tE.renderMarkup(this.getPortLabelMarkup(e.label))).elem,n=r.selectors,null==t)throw Error("Invalid port label markup.");if(s&&n){for(let e in n)if(s[e]&&e!==this.rootSelector)throw Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},s),n)}aa(t,"x6-port-label"),i.appendChild(t)}return this.portsCache[e.id]={portElement:i,portSelectors:a,portLabelElement:t,portLabelSelectors:n,portContentElement:o,portContentSelectors:s},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:i,selectors:a,labelContainer:t,labelSelectors:n,contentContainer:o,contentSelectors:s}),i}updatePorts(){let e=Object.keys(this.cell.getParsedGroups());0===e.length?this.updatePortGroup():e.forEach(e=>this.updatePortGroup(e))}updatePortGroup(e){let t=uM.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(e,t);for(let e=0,t=n.length;e<t;e+=1){let t=n[e],r=t.portId,i=this.portsCache[r]||{},o=t.portLayout;if(this.applyPortTransform(i.portElement,o),null!=t.portAttrs){let e={selectors:i.portSelectors||{}};t.portSize&&(e.rootBBox=uM.fromSize(t.portSize)),this.updateAttrs(i.portElement,t.portAttrs,e)}let s=t.labelLayout;if(s&&i.portLabelElement&&(this.applyPortTransform(i.portLabelElement,s,-(o.angle||0)),s.attrs)){let e={selectors:i.portLabelSelectors||{}};t.labelSize&&(e.rootBBox=uM.fromSize(t.labelSize)),this.updateAttrs(i.portLabelElement,s.attrs,e)}}}applyPortTransform(e,t,n=0){let r=t.angle,i=t.position;uc(e,ui().rotate(n).translate(i.x||0,i.y||0).rotate(r||0),{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,n){let r=this.cell;return null==t||null==n?{e,view:this,node:r,cell:r}:{e,x:t,y:n,view:this,node:r,cell:r}}getPortEventArgs(e,t,n){let r=this.cell;return n?{e,x:n.x,y:n.y,view:this,node:r,cell:r,port:t}:{e,view:this,node:r,cell:r,port:t}}notifyMouseDown(e,t,n){super.onMouseDown(e,t,n),this.notify("node:mousedown",this.getEventArgs(e,t,n))}notifyMouseMove(e,t,n){super.onMouseMove(e,t,n),this.notify("node:mousemove",this.getEventArgs(e,t,n))}notifyMouseUp(e,t,n){super.onMouseUp(e,t,n),this.notify("node:mouseup",this.getEventArgs(e,t,n))}notifyPortEvent(e,t,n){let r=this.findAttr("port",t.target);if(r){let i=t.type;"node:port:mouseenter"===e?t.type="mouseenter":"node:port:mouseleave"===e&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,r,n)),t.type=i}}onClick(e,t,n){super.onClick(e,t,n),this.notify("node:click",this.getEventArgs(e,t,n)),this.notifyPortEvent("node:port:click",e,{x:t,y:n})}onDblClick(e,t,n){super.onDblClick(e,t,n),this.notify("node:dblclick",this.getEventArgs(e,t,n)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:n})}onContextMenu(e,t,n){super.onContextMenu(e,t,n),this.notify("node:contextmenu",this.getEventArgs(e,t,n)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:n})}onMouseDown(e,t,n){if(!this.isPropagationStopped(e))this.notifyMouseDown(e,t,n),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:n}),this.startNodeDragging(e,t,n)}onMouseMove(e,t,n){let r=this.getEventData(e),i=r.action;if("magnet"===i)this.dragMagnet(e,t,n);else{if("move"===i){let i=r.targetView||this;i.dragNode(e,t,n),i.notify("node:moving",{e,x:t,y:n,view:i,cell:i.cell,node:i.cell})}this.notifyMouseMove(e,t,n),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:n})}this.setEventData(e,r)}onMouseUp(e,t,n){let r=this.getEventData(e),i=r.action;"magnet"===i?this.stopMagnetDragging(e,t,n):(this.notifyMouseUp(e,t,n),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:n}),"move"===i&&(r.targetView||this).stopNodeDragging(e,t,n));let o=r.targetMagnet;o&&this.onMagnetClick(e,o,t,n),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,n,r){super.onMouseWheel(e,t,n,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,n)))}onMagnetClick(e,t,n,r){let i=this.graph;if(!(i.view.getMouseMovedCount(e)>i.options.clickThreshold))this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,n,r)))}onMagnetDblClick(e,t,n,r){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,n,r)))}onMagnetContextMenu(e,t,n,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,n,r)))}onMagnetMouseDown(e,t,n,r){this.startMagnetDragging(e,n,r)}onCustomEvent(e,t,n,r){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,n,r))),super.onCustomEvent(e,t,n,r)}prepareEmbedding(e){let t=this.graph,n=this.getEventData(e).cell||this.cell,r=t.findViewByCell(n),i=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:n,view:r,cell:n,x:i.x,y:i.y,currentParent:n.getParent()})}processEmbedding(e,t){let n=t.cell||this.cell,r=t.graph||this.graph,i=r.options.embedding,o=i.findParent,s="function"==typeof o?n0(o,r,{view:this,node:this.cell}).filter(e=>fL.isCell(e)&&this.cell.id!==e.id&&!e.isDescendantOf(this.cell)):r.model.getNodesUnderNode(n,{by:o});if(i.frontOnly&&s.length>0){var l;let e=sJ(s,"zIndex");let t=(l=Object.keys(e).map(e=>parseInt(e,10)))&&l.length?sB(l,ix,sD):void 0;t&&(s=e[t])}s=s.filter(e=>e.visible);let a=null,u=t.candidateEmbedView,c=i.validate;for(let e=s.length-1;e>=0;e-=1){let t=s[e];if(u&&u.cell.id===t.id){a=u;break}{let e=t.findView(r);if(c&&n0(c,r,{child:this.cell,parent:e.cell,childView:this,parentView:e})){a=e;break}}}this.clearEmbedding(t),a&&a.highlight(null,{type:"embedding"}),t.candidateEmbedView=a;let h=r.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:n,node:n,view:r.findViewByCell(n),x:h.x,y:h.y,currentParent:n.getParent(),candidateParent:a?a.cell:null})}clearEmbedding(e){let t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");let n=t.cell||this.cell,r=t.graph||this.graph,i=r.findViewByCell(n),o=n.getParent(),s=t.candidateEmbedView;if(s?(s.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null,(null==o||o.id!==s.cell.id)&&s.cell.insertChild(n,void 0,{ui:!0})):o&&o.unembed(n,{ui:!0}),r.model.getConnectedEdges(n,{deep:!0}).forEach(e=>{e.updateParent({ui:!0})}),i&&s){let t=r.snapToGrid(e.clientX,e.clientY);i.notify("node:embedded",{e,cell:n,x:t.x,y:t.y,node:n,view:r.findViewByCell(n),previousParent:o,currentParent:n.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){;if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,n){if("passive"!==t.getAttribute("magnet")){let r=this.graph.options.connecting.validateMagnet;return!r||n0(r,this.graph,{e:n,magnet:t,view:e,cell:e.cell})}return!1}startMagnetDragging(e,t,n){if(!this.can("magnetConnectable"))return;e.stopPropagation();let r=e.currentTarget,i=this.graph;this.setEventData(e,{targetMagnet:r}),this.validateMagnet(this,r,e)?(i.options.magnetThreshold<=0&&this.startConnectting(e,r,t,n),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,n),i.view.delegateDragEvents(e,this)}startConnectting(e,t,n,r){this.graph.model.startBatch("add-edge");let i=this.createEdgeFromMagnet(t,n,r);i.setEventData(e,i.prepareArrowheadDragging("target",{x:n,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:i}),i.notifyMouseDown(e,n,r)}getDefaultEdge(e,t){let n;let r=this.graph.options.connecting.createEdge;return r&&(n=n0(r,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),n}createEdgeFromMagnet(e,t,n){let r=this.graph,i=r.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,n,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:n})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(e,t,n){let r=this.getEventData(e),i=r.edgeView;if(i)i.onMouseMove(e,t,n),this.autoScrollGraph(e.clientX,e.clientY);else{let i=this.graph,o=i.options.magnetThreshold,s=this.getEventTarget(e),l=r.targetMagnet;if("onleave"===o){if(l===s||l.contains(s))return}else if(i.view.getMouseMovedCount(e)<=o)return;this.startConnectting(e,l,t,n)}}stopMagnetDragging(e,t,n){let r=this.eventData(e).edgeView;r&&(r.onMouseUp(e,t,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,n){this.notify("node:unhandled:mousedown",{e,x:t,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,n,r,i){let o=[i],s=this.graph.getPlugin("selection");if(s&&s.isSelectionMovable()){let e=s.getSelectedCells();e.includes(i)&&(o=e.filter(e=>e.isNode()))}o.forEach(i=>{this.notify(e,{e:t,x:n,y:r,cell:i,node:i,view:i.findView(this.graph)})})}getRestrictArea(e){let t=this.graph.options.translating.restrict,n="function"==typeof t?n0(t,this.graph,e):t;return"number"==typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}startNodeDragging(e,t,n){let r=this.getDelegatedView();if(null==r||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,n);this.setEventData(e,{targetView:r,action:"move"});let i=uA.create(r.cell.getPosition());r.setEventData(e,{moving:!1,offset:i.diff(t,n),restrict:this.getRestrictArea(r)})}dragNode(e,t,n){let r=this.cell,i=this.graph,o=i.getGridSize(),s=this.getEventData(e),l=s.offset,a=s.restrict;!s.moving&&(s.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,n,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);let u=td.snapToGrid(t+l.x,o),c=td.snapToGrid(n+l.y,o);r.setPosition(u,c,{restrict:a,deep:!0,ui:!0}),i.options.embedding.enabled&&(!s.embedding&&(this.prepareEmbedding(e),s.embedding=!0),this.processEmbedding(e,s))}stopNodeDragging(e,t,n){let r=this.getEventData(e);r.embedding&&this.finalizeEmbedding(e,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,n,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(e,t){let n=this.graph.getPlugin("scroller");n&&n.autoScroll(e,t)}}(eF=fQ||(fQ={})).toStringTag=`X6.${eF.name}`,eF.isNodeView=function(e){if(null==e)return!1;if(e instanceof eF)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eF.toStringTag)&&"function"==typeof e.isNodeView&&"function"==typeof e.isEdgeView&&"function"==typeof e.confirmUpdate&&"function"==typeof e.update&&"function"==typeof e.findPortElem&&"function"==typeof e.resize&&"function"==typeof e.rotate&&"function"==typeof e.translate||!1},fQ.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),fQ.registry.register("node",fQ,!0);class fK extends ds{constructor(){super(...arguments),this.POINT_ROUNDING=2}get[Symbol.toStringTag](){return fK.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){let e=this.sourceView;if(!e){let e=this.cell.getSource();return new uM(e.x,e.y)}let t=this.sourceMagnet;return e.isEdgeElement(t)?new uM(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){let e=this.targetView;if(!e){let e=this.cell.getTarget();return new uM(e.x,e.y)}let t=this.targetMagnet;return e.isEdgeElement(t)?new uM(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let n=e;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}return this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","labels","tools"])):(n=this.handleAction(n,"update",()=>this.update(t)),n=this.handleAction(n,"labels",()=>this.onLabelsChange(t)),n=this.handleAction(n,"tools",()=>this.renderTools()))}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){let e=this.cell.markup;if(e){if("string"==typeof e)throw TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw TypeError("Invalid edge markup.")}renderJSONMarkup(e){let t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){let e=this.cell,t=e.labels;for(let n=0,r=t.length;n<r;n+=1){let r=t[n],i=this.labelCache[n],o=this.labelSelectors[n],s=this.graph.options.onEdgeLabelRendered;s&&s({edge:e,label:r,container:i,selectors:o})}}}renderLabels(){let e=this.cell,t=e.getLabels(),n=t.length,r=this.labelContainer;if(this.labelCache={},this.labelSelectors={},n<=0)return r&&r.parentNode&&r.parentNode.removeChild(r),this;r?this.empty(r):(r=am("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.labelContainer=r);for(let n=0,i=t.length;n<i;n+=1){let i,o;let s=t[n],l=this.normalizeLabelMarkup(this.parseLabelMarkup(s.markup));if(l)i=l.node,o=l.selectors;else{let t=e.getDefaultLabel(),n=this.normalizeLabelMarkup(this.parseLabelMarkup(t.markup));i=n.node,o=n.selectors}i.setAttribute("data-index",`${n}`),r.appendChild(i);let a=this.rootSelector;if(o[a])throw Error("Ambiguous label root selector.");o[a]=i,this.labelCache[n]=i,this.labelSelectors[n]=o}return null==r.parentNode&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){let t=this.cell.previous("labels");if(null==t)return!0;if("propertyPathArray"in e&&"propertyValue"in e){let n=e.propertyPathArray||[],r=n.length;if(r>1&&t[n[1]]){if(2===r)return"object"==typeof e.propertyValue&&so(e.propertyValue,"markup");if("markup"!==n[2])return!1}}return!0}parseLabelMarkup(e){if(e)return"string"==typeof e?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e);return null}parseLabelStringMarkup(e){let t=aK.createVectors(e),n=document.createDocumentFragment();for(let e=0,r=t.length;e<r;e+=1){let r=t[e].node;n.appendChild(r)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(e){let t;if(null==e)return;let n=e.fragment;if(!(n instanceof DocumentFragment)||!n.hasChildNodes())throw Error("Invalid label markup.");let r=n.childNodes;return(t=r.length>1||"G"!==r[0].nodeName.toUpperCase()?aK.create("g").append(n):aK.create(r[0])).addClass(this.prefixClassName("edge-label")),{node:t.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){let e=this.cell,t=e.labels,n=this.can("edgeLabelMovable"),r=e.getDefaultLabel();for(let e=0,i=t.length;e<i;e+=1){let i=this.labelCache[e],o=this.labelSelectors[e];i.setAttribute("cursor",n?"move":"default");let s=t[e],l=iM({},r.attrs,s.attrs);this.updateAttrs(i,l,{selectors:o,rootBBox:s.size?uM.fromSize(s.size):void 0})}}}renderTools(){let e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);let t=this.cell.getAttrs();return null!=t&&this.updateAttrs(this.container,t,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){let t=this.cell,n=t.getVertices(),r=[this.sourceAnchor,...n,this.targetAnchor],i=r.length,o=new uD(r);o.simplify({threshold:.01});let s=o.points.map(e=>e.toJSON()),l=s.length;return i===l?0:(t.setVertices(s.slice(1,l-1),e),i-l)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return uA.create(this.sourceAnchor);case"target":return uA.create(this.targetAnchor);default:throw Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return uA.create(this.sourcePoint);case"target":return uA.create(this.targetPoint);default:throw Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;let e=this.sourceView;if(!e)return null;return this.sourceMagnet||e.container}case"target":{if(t.raw)return this.targetMagnet;let e=this.targetView;if(!e)return null;return this.targetMagnet||e.container}default:throw Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){let t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){let t=e.tx||0,n=e.ty||0;this.routePoints=new uD(this.routePoints).translate(t,n).points,this.translateConnectionPoints(t,n),this.path.translate(t,n)}else{let e=t.getVertices(),n=this.findAnchors(e);this.sourceAnchor=n.source,this.targetAnchor=n.target,this.routePoints=this.findRoutePoints(e);let r=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=r.source,this.targetPoint=r.target;let i=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,i.source||this.sourcePoint,i.target||this.targetPoint)}this.cleanCache()}findAnchors(e){let t=this.cell,n=t.source,r=t.target,i=e[0],o=e[e.length-1];return r.priority&&!n.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(e,t,n,r){let i,o;let s=this.cell,l=s[e],a=s[n],u=this.getTerminalView(e),c=this.getTerminalView(n),h=this.getTerminalMagnet(e),d=this.getTerminalMagnet(n);if(u){let n;n=t?uA.create(t):c?d:uA.create(a),i=this.getAnchor(l.anchor,u,h,n,e)}else i=uA.create(l);if(c){let e=uA.create(r||i);o=this.getAnchor(a.anchor,c,d,e,n)}else o=uA.isPointLike(a)?uA.create(a):new uA;return{[e]:i,[n]:o}}getAnchor(e,t,n,r,i){let o;let s=t.isEdgeElement(n),l=this.graph.options.connecting,a="string"==typeof e?{name:e}:e;if(!a){let e=s?("source"===i?l.sourceEdgeAnchor:l.targetEdgeAnchor)||l.edgeAnchor:("source"===i?l.sourceAnchor:l.targetAnchor)||l.anchor;a="string"==typeof e?{name:e}:e}if(!a)throw Error("Anchor should be specified.");let u=a.name;if(s){let e=tA.registry.get(u);if("function"!=typeof e)return tA.registry.onNotFound(u);o=n0(e,this,t,n,r,a.args||{},i)}else{let e=tk.registry.get(u);if("function"!=typeof e)return tk.registry.onNotFound(u);o=n0(e,this,t,n,r,a.args||{},i)}return o?o.round(this.POINT_ROUNDING):new uA}findRoutePoints(e=[]){let t;let n=this.graph.options.connecting.router||tN.presets.normal,r=this.cell.getRouter()||n;if("function"==typeof r)t=n0(r,this,e,{},this);else{let n="string"==typeof r?r:r.name,i="string"==typeof r?{}:r.args||{},o=n?tN.registry.get(n):tN.presets.normal;if("function"!=typeof o)return tN.registry.onNotFound(n);t=n0(o,this,e,i,this)}return null==t?e.map(e=>uA.create(e)):t.map(e=>uA.create(e))}findConnectionPoints(e,t,n){let r,i;let o=this.cell,s=this.graph.options.connecting,l=o.getSource(),a=o.getTarget(),u=this.sourceView,c=this.targetView,h=e[0],d=e[e.length-1];if(u&&!u.isEdgeElement(this.sourceMagnet)){let e=this.sourceMagnet||u.container,i=new uT(h||n,t),o=l.connectionPoint||s.sourceConnectionPoint||s.connectionPoint;r=this.getConnectionPoint(o,u,e,i,"source")}else r=t;if(c&&!c.isEdgeElement(this.targetMagnet)){let e=this.targetMagnet||c.container,r=a.connectionPoint||s.targetConnectionPoint||s.connectionPoint,o=new uT(d||t,n);i=this.getConnectionPoint(r,c,e,o,"target")}else i=n;return{source:r,target:i}}getConnectionPoint(e,t,n,r,i){let o=r.end;if(null==e)return o;let s="string"==typeof e?e:e.name,l="string"==typeof e?{}:e.args,a=tM.registry.get(s);if("function"!=typeof a)return tM.registry.onNotFound(s);let u=n0(a,this,r,t,n,l||{},i);return u?u.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,n){let r,i;let o=e=>{let t=this.cell.getAttrs(),n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=t[n[r]];if(i[`${e}Marker`]||i[`${e}-marker`]){let e=i.strokeWidth||i["stroke-width"];if(e)return parseFloat(e);break}}return null},s=e[0],l=e[e.length-1],a=o("source");a&&(r=t.clone().move(s||n,-a));let u=o("target");return u&&(i=n.clone().move(l||t,-u)),this.sourceMarkerPoint=r||t.clone(),this.targetMarkerPoint=i||n.clone(),{source:r,target:i}}findPath(e,t,n){let r,i,o;let s=this.cell.getConnector()||this.graph.options.connecting.connector;if("string"==typeof s?r=s:(r=s.name,i=s.args),r){let e=tj.registry.get(r);if("function"!=typeof e)return tj.registry.onNotFound(r);o=e}else o=tj.presets.normal;let l=n0(o,this,t,n,e,Object.assign(Object.assign({},i),{raw:!0}),this);return"string"==typeof l?uX.parse(l):l}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(null==this.labelContainer||!this.path)return this;let e=this.cell,t=e.getLabels();if(0===t.length)return this;let n=e.getDefaultLabel(),r=this.normalizeLabelPosition(n.position);for(let e=0,n=t.length;e<n;e+=1){let n=t[e],i=this.labelCache[e];if(!i)continue;let o=iM({},r,this.normalizeLabelPosition(n.position)),s=this.getLabelTransformationMatrix(o);i.setAttribute("transform",ul(s))}return this}updateTerminalProperties(e){let t=this.cell,n=this.graph,r=t[e],i=r&&r.cell,o=`${e}View`;if(!i)return this[o]=null,this.updateTerminalMagnet(e),!0;let s=n.getCellById(i);if(!s)throw Error(`Edge's ${e} node with id "${i}" not exists`);let l=s.findView(n);return!!l&&(this[o]=l,this.updateTerminalMagnet(e),!0)}updateTerminalMagnet(e){let t=`${e}Magnet`,n=this.getTerminalView(e);if(n){let r=n.getMagnetFromEdgeTerminal(this.cell[e]);r===n.container&&(r=null),this[t]=r}else this[t]=null}getLabelPositionAngle(e){let t=this.cell.getLabelAt(e);return t&&t.position&&"object"==typeof t.position&&t.position.angle||0}getLabelPositionArgs(e){let t=this.cell.getLabelAt(e);if(t&&t.position&&"object"==typeof t.position)return t.position.options}getDefaultLabelPositionArgs(){let e=this.cell.getDefaultLabel();if(e&&e.position&&"object"==typeof e.position)return e.position.options}mergeLabelPositionArgs(e,t){if(null===e)return null;if(void 0===e)return null===t?null:t;return iM({},t,e)}getConnection(){return null!=this.path?this.path.clone():null}getConnectionPathData(){if(null==this.path)return"";let e=this.cache.pathCache;return!so(e,"data")&&(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(null==this.path)return null;let e=this.cache.pathCache;return!so(e,"segmentSubdivisions")&&(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;let e=this.cache.pathCache;return!so(e,"length")&&(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return null==this.path?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return null==this.path?null:(lX(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return null==this.path?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return null==this.path?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return null==this.path?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return null==this.path?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return null==this.path?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,n,r){let i,o,s;let l={distance:0},a=0;"number"==typeof n?(a=n,i=r):i=n,null!=i&&(l.options=i);let u=i&&i.absoluteOffset,c=!(i&&i.absoluteDistance),h=i&&i.absoluteDistance&&i.reverseDistance,d=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},p=new uA(e,t),g=d.closestPointT(p,f),m=this.getConnectionLength()||0,y=d.lengthAtT(g,f);if(c&&(y=m>0?y/m:0),h&&(y=-1*(m-y)||1),l.distance=y,!u&&(o=d.tangentAtT(g)),o)s=o.pointOffset(p);else{let e=d.pointAtT(g),t=p.diff(e);s={x:t.x,y:t.y}}return l.offset=s,l.angle=a,l}normalizeLabelPosition(e){return"number"==typeof e?{distance:e}:e}getLabelTransformationMatrix(e){let t;let n=this.normalizeLabelPosition(e),r=n.options||{},i=n.angle||0,o=n.distance,s=o>0&&o<=1,l=0,a={x:0,y:0},u=n.offset;u&&("number"==typeof u?l=u:(null!=u.x&&(a.x=u.x),null!=u.y&&(a.y=u.y)));let c=0!==a.x||0!==a.y||0===l,h=r.keepGradient,d=r.ensureLegibility,f=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},g=s?o*this.getConnectionLength():o,m=f.tangentAtLength(g,p),y=i;if(m){if(c)(t=m.start).translate(a);else{let e=m.clone();e.rotate(-90,m.start),e.setLength(l),t=e.end}h&&(y=m.angle()+i,d&&(y=th.normalize((y+90)%180-90)))}else t=f.start,c&&t.translate(a);return ui().translate(t.x,t.y).rotate(y)}getVertexIndex(e,t){let n=this.cell.getVertices(),r=this.getClosestPointLength(new uA(e,t)),i=0;if(null!=r)for(let e=n.length;i<e;i+=1){let e=n[i],t=this.getClosestPointLength(e);if(null!=t&&r<t)break}return i}getEventArgs(e,t,n){let r=this.cell;return null==t||null==n?{e,view:this,edge:r,cell:r}:{e,x:t,y:n,view:this,edge:r,cell:r}}notifyUnhandledMouseDown(e,t,n){this.notify("edge:unhandled:mousedown",{e,x:t,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,n){super.onMouseDown(e,t,n),this.notify("edge:mousedown",this.getEventArgs(e,t,n))}notifyMouseMove(e,t,n){super.onMouseMove(e,t,n),this.notify("edge:mousemove",this.getEventArgs(e,t,n))}notifyMouseUp(e,t,n){super.onMouseUp(e,t,n),this.notify("edge:mouseup",this.getEventArgs(e,t,n))}onClick(e,t,n){super.onClick(e,t,n),this.notify("edge:click",this.getEventArgs(e,t,n))}onDblClick(e,t,n){super.onDblClick(e,t,n),this.notify("edge:dblclick",this.getEventArgs(e,t,n))}onContextMenu(e,t,n){super.onContextMenu(e,t,n),this.notify("edge:contextmenu",this.getEventArgs(e,t,n))}onMouseDown(e,t,n){this.notifyMouseDown(e,t,n),this.startEdgeDragging(e,t,n)}onMouseMove(e,t,n){let r=this.getEventData(e);switch(r.action){case"drag-label":this.dragLabel(e,t,n);break;case"drag-arrowhead":this.dragArrowhead(e,t,n);break;case"drag-edge":this.dragEdge(e,t,n)}return this.notifyMouseMove(e,t,n),r}onMouseUp(e,t,n){let r=this.getEventData(e);switch(r.action){case"drag-label":this.stopLabelDragging(e,t,n);break;case"drag-arrowhead":this.stopArrowheadDragging(e,t,n);break;case"drag-edge":this.stopEdgeDragging(e,t,n)}return this.notifyMouseUp(e,t,n),this.checkMouseleave(e),r}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,n,r){super.onMouseWheel(e,t,n,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,n)))}onCustomEvent(e,t,n,r){if(av(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if("edge:remove"===t){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,n,r)))}this.notifyMouseDown(e,n,r)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,n,r))),super.onCustomEvent(e,t,n,r)}onLabelMouseDown(e,t,n){this.notifyMouseDown(e,t,n),this.startLabelDragging(e,t,n),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,n){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,n);return}this.setEventData(e,{x:t,y:n,moving:!1,action:"drag-edge"})}dragEdge(e,t,n){let r=this.getEventData(e);!r.moving&&(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-r.x,n-r.y,{ui:!0}),this.setEventData(e,{x:t,y:n}),this.notify("edge:moving",{e,x:t,y:n,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,n){let r=this.getEventData(e);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:n,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(e,t){let n=this.getTerminalMagnet(e),r={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:!0===t.isNewEdge,terminalType:e,initialMagnet:n,initialTerminal:oy(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(e){let t;let n=[];n[4]=e,n[5]=this;let r=0,i=0;"source"===e?(r=2,t="target"):(i=2,t="source");let o=this.cell[t],s=o.cell;if(s){let e;let t=n[r]=this.graph.findViewByCell(s);t&&(e=t.getMagnetFromEdgeTerminal(o))===t.container&&(e=void 0),n[r+1]=e}return(e,t)=>(n[i]=e,n[i+1]=e.container===t?void 0:t,n)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();let t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){null!=e.zIndex&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null),this.container.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,n,r,i,o,s){let l=this.graph.options.connecting,a=l.allowLoop,u=l.allowNode,c=l.allowEdge,h=l.allowPort,d=l.allowMulti,f=l.validateConnection,p=o?o.cell:null,g="target"===i?n:e,m="target"===i?r:t,y=!0,b=l=>{let a="source"===i?s?s.port:null:p?p.getSourcePortId():null,u="target"===i?s?s.port:null:p?p.getTargetPortId():null;return n0(l,this.graph,{edge:p,edgeView:o,sourceView:e,targetView:n,sourcePort:a,targetPort:u,sourceMagnet:t,targetMagnet:r,sourceCell:e?e.cell:null,targetCell:n?n.cell:null,type:i})};if(null!=a&&("boolean"==typeof a?!a&&e===n&&(y=!1):y=b(a)),y&&null!=h&&("boolean"==typeof h?!h&&m&&(y=!1):y=b(h)),y&&null!=c&&("boolean"==typeof c?!c&&fK.isEdgeView(g)&&(y=!1):y=b(c)),y&&null!=u&&null==m&&("boolean"==typeof u?!u&&fQ.isNodeView(g)&&(y=!1):y=b(u)),y&&null!=d&&o){let e=o.cell,t="source"===i?s:e.getSource(),n="target"===i?s:e.getTarget(),r=s?this.graph.getCellById(s.cell):null;if(t&&n&&t.cell&&n.cell&&r){if("function"==typeof d)y=b(d);else{let e=this.graph.model.getConnectedEdges(r,{outgoing:"source"===i,incoming:"target"===i});e.length&&("withPort"===d?e.some(e=>{let r=e.getSource(),i=e.getTarget();return r&&i&&r.cell===t.cell&&i.cell===n.cell&&null!=r.port&&r.port===t.port&&null!=i.port&&i.port===n.port})&&(y=!1):!d&&e.some(e=>{let r=e.getSource(),i=e.getTarget();return r&&i&&r.cell===t.cell&&i.cell===n.cell})&&(y=!1))}}}return y&&null!=f&&(y=b(f)),y}allowConnectToBlank(e){let t=this.graph,n=t.options.connecting.allowBlank;if("function"!=typeof n)return!!n;let r=t.findViewByCell(e),i=e.getSourceCell(),o=e.getTargetCell(),s=t.findViewByCell(i),l=t.findViewByCell(o);return n0(n,t,{edge:e,edgeView:r,sourceCell:i,targetCell:o,sourceView:s,targetView:l,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:r.sourceMagnet,targetMagnet:r.targetMagnet})}validateEdge(e,t,n){let r=this.graph;if(!this.allowConnectToBlank(e)){let t=e.getSourceCellId(),n=e.getTargetCellId();if(!(t&&n))return!1}let i=r.options.connecting.validateEdge;return!i||n0(i,r,{edge:e,type:t,previous:n})}arrowheadDragging(e,t,n,r){r.x=t,r.y=n,r.currentTarget!==e&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.findViewByElem(e),r.currentView?(r.currentMagnet=r.currentView.findMagnet(e),r.currentMagnet&&this.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,t,n,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=e,this.cell.prop(r.terminalType,{x:t,y:n},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(e,t,n){let r=e.currentView,i=e.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});let o=e.terminalType,s=r.getEdgeTerminal(i,t,n,this.cell,o);this.cell.setTerminal(o,s,{ui:!0})}snapArrowhead(e,t,n){let r,i;let o=this.graph,{snap:s,allowEdge:l}=o.options.connecting,a="object"==typeof s&&s.radius||50,u=o.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(l){let n=o.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(e=>e!==this);u.push(...n)}let c=n.closestView||null,h=n.closestMagnet||null;n.closestView=null,n.closestMagnet=null;let d=Number.MAX_SAFE_INTEGER,f=new uA(e,t);u.forEach(i=>{if("false"!==i.container.getAttribute("magnet")){if(i.isNodeView())r=i.cell.getBBox().getCenter().distance(f);else if(i.isEdgeView()){let e=i.getClosestPoint(f);r=e?e.distance(f):Number.MAX_SAFE_INTEGER}r<a&&r<d&&(h===i.container||this.validateConnection(...n.getValidateConnectionArgs(i,null),i.getEdgeTerminal(i.container,e,t,this.cell,n.terminalType)))&&(d=r,n.closestView=i,n.closestMagnet=i.container)}i.container.querySelectorAll("[magnet]").forEach(o=>{if("false"!==o.getAttribute("magnet")){let s=i.getBBoxOfElement(o);(r=f.distance(s.getCenter()))<a&&r<d&&(h===o||this.validateConnection(...n.getValidateConnectionArgs(i,o),i.getEdgeTerminal(o,e,t,this.cell,n.terminalType)))&&(d=r,n.closestView=i,n.closestMagnet=o)}})});let p=n.terminalType,g=n.closestView,m=n.closestMagnet,y=h!==m;if(c&&y&&c.unhighlight(h,{type:"magnetAdsorbed"}),g){if(!y)return;g.highlight(m,{type:"magnetAdsorbed"}),i=g.getEdgeTerminal(m,e,t,this.cell,p)}else i={x:e,y:t};this.cell.setTerminal(p,i,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(e){let t=e.closestView,n=e.closestMagnet;t&&n&&(t.unhighlight(n,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(n)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){if("remove"===e.fallbackAction)this.cell.remove({ui:!0});else this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0})}notifyConnectionEvent(e,t){let n=e.terminalType,r=e.initialTerminal,i=this.cell[n];if(i&&!fz.equalTerminals(r,i)){let o=this.graph,s=r.cell?o.getCellById(r.cell):null,l=r.port,a=s?o.findViewByCell(s):null,u=s||e.isNewEdge?null:uA.create(r).toJSON(),c=i.cell?o.getCellById(i.cell):null,h=i.port,d=c?o.findViewByCell(c):null,f=c?null:uA.create(i).toJSON();this.notify("edge:connected",{e:t,previousCell:s,previousPort:l,previousView:a,previousPoint:u,currentCell:c,currentView:d,currentPort:h,currentPoint:f,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:n,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){let t=this.graph,n=t.model.getCells();e.marked={};for(let r=0,i=n.length;r<i;r+=1){let i=t.findViewByCell(n[r]);if(!i||i.cell.id===this.cell.id)continue;let o=Array.prototype.slice.call(i.container.querySelectorAll("[magnet]"));"false"!==i.container.getAttribute("magnet")&&o.push(i.container);let s=o.filter(t=>this.validateConnection(...e.getValidateConnectionArgs(i,t),i.getEdgeTerminal(t,e.x,e.y,this.cell,e.terminalType)));if(s.length>0){for(let e=0,t=s.length;e<t;e+=1)i.highlight(s[e],{type:"magnetAvailable"});i.highlight(null,{type:"nodeAvailable"}),e.marked[i.cell.id]=s}}}unhighlightAvailableMagnets(e){let t=e.marked||{};Object.keys(t).forEach(e=>{let n=this.graph.findViewByCell(e);n&&(t[e].forEach(e=>{n.unhighlight(e,{type:"magnetAvailable"})}),n.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,n){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,n);return}let r=e.target.getAttribute("data-terminal"),i=this.prepareArrowheadDragging(r,{x:t,y:n});this.setEventData(e,i)}dragArrowhead(e,t,n){let r=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,n,r):this.arrowheadDragging(this.getEventTarget(e),t,n,r)}stopArrowheadDragging(e,t,n){let r=this.graph,i=this.getEventData(e);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,t,n),this.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,e)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(e,t,n){if(this.can("edgeLabelMovable")){let t=parseInt(e.currentTarget.getAttribute("data-index"),10),n=this.getLabelPositionAngle(t),r=this.getLabelPositionArgs(t),i=this.getDefaultLabelPositionArgs(),o=this.mergeLabelPositionArgs(r,i);this.setEventData(e,{index:t,positionAngle:n,positionArgs:o,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,n){let r=this.getEventData(e),i=iM({},this.cell.getLabelAt(r.index),{position:this.getLabelPosition(t,n,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,i)}stopLabelDragging(e,t,n){}}(eV=fK||(fK={})).toStringTag=`X6.${eV.name}`,eV.isEdgeView=function(e){if(null==e)return!1;if(e instanceof eV)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eV.toStringTag)&&"function"==typeof e.isNodeView&&"function"==typeof e.isEdgeView&&"function"==typeof e.confirmUpdate&&"function"==typeof e.update&&"function"==typeof e.getConnection||!1},fK.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),fK.registry.register("edge",fK,!0);class fZ extends de{get options(){return this.graph.options}constructor(e){super(),this.graph=e;let{selectors:t,fragment:n}=tE.parseJSONMarkup(fZ.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=fZ.snapshoot(this.container),aa(this.container,this.prefixClassName("graph")),aE(this.container,n),this.delegateEvents()}delegateEvents(){let e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return!!("mousedown"===e.type&&2===e.button||this.options.guard&&this.options.guard(e,t))||(e.data&&void 0!==e.data.guarded?e.data.guarded:!(t&&t.cell&&fL.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))&&!0)}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();let t=this.normalizeEvent(e),n=this.findView(t.target);if(this.guard(t,n))return;let r=this.graph.snapToGrid(t.clientX,t.clientY);n?n.onDblClick(t,r.x,r.y):this.graph.trigger("blank:dblclick",{e:t,x:r.x,y:r.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){let t=this.normalizeEvent(e),n=this.findView(t.target);if(this.guard(t,n))return;let r=this.graph.snapToGrid(t.clientX,t.clientY);n?n.onClick(t,r.x,r.y):this.graph.trigger("blank:click",{e:t,x:r.x,y:r.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return"function"==typeof t&&(t=n0(t,this.graph,{view:e})),t}onContextMenu(e){let t=this.normalizeEvent(e),n=this.findView(t.target);if(this.isPreventDefaultContextMenu(n)&&e.preventDefault(),this.guard(t,n))return;let r=this.graph.snapToGrid(t.clientX,t.clientY);n?n.onContextMenu(t,r.x,r.y):this.graph.trigger("blank:contextmenu",{e:t,x:r.x,y:r.y})}delegateDragEvents(e,t){null==e.data&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});let n=this.constructor;this.delegateDocumentEvents(n.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){let t=this.normalizeEvent(e),n=this.findView(t.target);if(this.guard(t,n))return;this.options.preventDefaultMouseDown&&e.preventDefault();let r=this.graph.snapToGrid(t.clientX,t.clientY);n?n.onMouseDown(t,r.x,r.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:r.x,y:r.y})),this.delegateDragEvents(t,n)}onMouseMove(e){let t=this.getEventData(e),n=t.startPosition;if(n&&n.x===e.clientX&&n.y===e.clientY)return;if(null==t.mouseMovedCount&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold)return;let r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY),o=t.currentView;o?o.onMouseMove(r,i.x,i.y):this.graph.trigger("blank:mousemove",{e:r,x:i.x,y:i.y}),this.setEventData(r,t)}onMouseUp(e){this.undelegateDocumentEvents();let t=this.normalizeEvent(e),n=this.graph.snapToGrid(t.clientX,t.clientY),r=this.getEventData(e).currentView;if(r?r.onMouseUp(t,n.x,n.y):this.graph.trigger("blank:mouseup",{e:t,x:n.x,y:n.y}),!e.isPropagationStopped()){let t=new ug(e,{type:"click",data:e.data});this.onClick(t)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){let t=this.normalizeEvent(e),n=this.findView(t.target);if(!this.guard(t,n))if(n)n.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){let t=this.normalizeEvent(e),n=this.findView(t.target);if(!this.guard(t,n))if(n)n.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){let t=this.normalizeEvent(e),n=this.findView(t.target);if(this.guard(t,n))return;let r=this.graph.findViewByElem(t.relatedTarget);if(n){if(r===n)return;n.onMouseEnter(t)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){let t=this.normalizeEvent(e),n=this.findView(t.target);if(this.guard(t,n))return;let r=this.graph.findViewByElem(t.relatedTarget);if(n){if(r===n)return;n.onMouseLeave(t)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){let t=this.normalizeEvent(e),n=this.findView(t.target);if(this.guard(t,n))return;let r=t.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));n?n.onMouseWheel(t,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:i.x,y:i.y})}onCustomEvent(e){let t=e.currentTarget,n=t.getAttribute("event")||t.getAttribute("data-event");if(n){let r=this.findView(t);if(r){let t=this.normalizeEvent(e);if(this.guard(t,r))return;let i=this.graph.snapToGrid(t.clientX,t.clientY);r.onCustomEvent(t,n,i.x,i.y)}}}handleMagnetEvent(e,t){let n=e.currentTarget,r=n.getAttribute("magnet");if(r&&"false"!==r.toLowerCase()){let r=this.findView(n);if(r){let i=this.normalizeEvent(e);if(this.guard(i,r))return;let o=this.graph.snapToGrid(i.clientX,i.clientY);n0(t,this.graph,r,i,n,o.x,o.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(e,t,n,r,i)=>{e.onMagnetMouseDown(t,n,r,i)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(e,t,n,r,i)=>{e.onMagnetDblClick(t,n,r,i)})}onMagnetContextMenu(e){let t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(e,t,n,r,i)=>{e.onMagnetContextMenu(t,n,r,i)})}onLabelMouseDown(e){let t=e.currentTarget,n=this.findView(t);if(n){let t=this.normalizeEvent(e);if(this.guard(t,n))return;let r=this.graph.snapToGrid(t.clientX,t.clientY);n.onLabelMouseDown(t,r.x,r.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([de.dispose()],fZ.prototype,"dispose",null),!function(e){let t=`${hk.prefixCls}-graph`;e.markup=[{ns:af.xhtml,tagName:"div",selector:"background",className:`${t}-background`},{ns:af.xhtml,tagName:"div",selector:"grid",className:`${t}-grid`},{ns:af.svg,tagName:"svg",selector:"svg",className:`${t}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":af.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${t}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${t}-svg-primer`},{tagName:"g",selector:"stage",className:`${t}-svg-stage`},{tagName:"g",selector:"decorator",className:`${t}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${t}-svg-overlay`}]}]}];e.snapshoot=function(e){let t=e.cloneNode();return e.childNodes.forEach(e=>t.appendChild(e)),()=>{for(aC(e);e.attributes.length>0;)e.removeAttribute(e.attributes[0].name);for(let n=0,r=t.attributes.length;n<r;n+=1){let r=t.attributes[n];e.setAttribute(r.name,r.value)}t.childNodes.forEach(t=>e.appendChild(t))}}}(fZ||(fZ={})),!function(e){let t=hk.prefixCls;e.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${t}-cell`]:"onMouseEnter",[`mouseleave .${t}-cell`]:"onMouseLeave",[`mouseenter .${t}-cell-tools`]:"onMouseEnter",[`mouseleave .${t}-cell-tools`]:"onMouseLeave",[`mousedown .${t}-cell [event]`]:"onCustomEvent",[`touchstart .${t}-cell [event]`]:"onCustomEvent",[`mousedown .${t}-cell [data-event]`]:"onCustomEvent",[`touchstart .${t}-cell [data-event]`]:"onCustomEvent",[`dblclick .${t}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${t}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${t}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${t}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${t}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${t}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${t}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${t}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${t}-cell image`]:"onImageDragStart",[`mousedown .${t}-edge .${t}-edge-label`]:"onLabelMouseDown",[`touchstart .${t}-edge .${t}-edge-label`]:"onLabelMouseDown"},e.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(fZ||(fZ={}));let f0=`.x6-graph {
91
+ `.trim()}const jq=Object.freeze(Object.defineProperty({__proto__:null,blur:Mq,brightness:Lq,contrast:Rq,dropShadow:Tq,grayScale:_q,highlight:Oq,hueRotate:Iq,invert:$q,outline:Aq,saturate:kq,sepia:Nq},Symbol.toStringTag,{value:"Module"}));var bs;(function(n){n.presets=jq,n.registry=Ue.create({type:"filter"}),n.registry.register(n.presets,!0)})(bs||(bs={}));const Dq={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},Bq={},q1={position:Wl("x","width","origin")},G1={position:Wl("y","height","origin")},zq={position:Wl("x","width","corner")},Fq={position:Wl("y","height","corner")},H1={set:kr("width","width")},U1={set:kr("height","height")},Vq={set:kr("rx","width")},qq={set:kr("ry","height")},W1={set:(n=>{const e=kr(n,"width"),t=kr(n,"height");return function(r,i){const s=i.refBBox,o=s.height>s.width?e:t;return Y(o,this,r,i)}})("r")},Gq={set(n,{refBBox:e}){let t=parseFloat(n);const r=er(n);r&&(t/=100);const i=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(t)&&(r||t>=0&&t<=1?s=t*i:s=Math.max(t+i,0)),{r:s}}},Hq={set:kr("cx","width")},Uq={set:kr("cy","height")},X1={set:J1({resetOffset:!0})},Wq={set:J1({resetOffset:!1})},Y1={set:Q1({resetOffset:!0})},Xq={set:Q1({resetOffset:!1})},Yq=W1,Kq=X1,Jq=Y1,Qq=q1,Zq=G1,e4=H1,t4=U1;function Wl(n,e,t){return(r,{refBBox:i})=>{if(r==null)return null;let s=parseFloat(r);const o=er(r);o&&(s/=100);let a;if(Number.isFinite(s)){const c=i[t];o||s>0&&s<1?a=c[n]+i[e]*s:a=c[n]+s}const l=new P;return l[n]=a||0,l}}function kr(n,e){return function(t,{refBBox:r}){let i=parseFloat(t);const s=er(t);s&&(i/=100);const o={};if(Number.isFinite(i)){const a=s||i>=0&&i<=1?i*r[e]:Math.max(i+r[e],0);o[n]=a}return o}}function K1(n,e){const t="x6-shape",r=e&&e.resetOffset;return function(i,{elem:s,refBBox:o}){let a=Ci(s,t);if(!a||a.value!==i){const p=n(i);a={value:i,shape:p,shapeBBox:p.bbox()},Ci(s,t,a)}const l=a.shape.clone(),c=a.shapeBBox.clone(),u=c.getOrigin(),h=o.getOrigin();c.x=h.x,c.y=h.y;const f=o.getMaxScaleToFit(c,h),d=c.width===0||o.width===0?1:f.sx,g=c.height===0||o.height===0?1:f.sy;return l.scale(d,g,u),r&&l.translate(-u.x,-u.y),l}}function J1(n){function e(r){return X.parse(r)}const t=K1(e,n);return(r,i)=>({d:t(r,i).serialize()})}function Q1(n){const e=K1(t=>new He(t),n);return(t,r)=>({points:e(t,r).serialize()})}const n4={qualify:Dn,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},r4={qualify:Dn,set(n,{view:e}){const t=e.cell,r=Object.assign({},n);if(t.isEdge()&&r.type==="linearGradient"){const i=e,s=i.sourcePoint,o=i.targetPoint;r.id=`gradient-${r.type}-${t.id}`,r.attrs=Object.assign(Object.assign({},r.attrs),{x1:s.x,y1:s.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(r.id)}return`url(#${e.graph.defineGradient(r)})`}},Z1={qualify(n,{attrs:e}){return e.textWrap==null||!Dn(e.textWrap)},set(n,{view:e,elem:t,attrs:r}){const i="x6-text",s=Ci(t,i),o=u=>{try{return JSON.parse(u)}catch(h){return u}},a={x:r.x,eol:r.eol,annotations:o(r.annotations),textPath:o(r["text-path"]||r.textPath),textVerticalAnchor:r["text-vertical-anchor"]||r.textVerticalAnchor,displayEmpty:(r["display-empty"]||r.displayEmpty)==="true",lineHeight:r["line-height"]||r.lineHeight},l=r["font-size"]||r.fontSize,c=JSON.stringify([n,a]);if(l&&t.setAttribute("font-size",l),s==null||s!==c){const u=a.textPath;if(u!=null&&typeof u=="object"){const h=u.selector;if(typeof h=="string"){const f=e.find(h)[0];f instanceof SVGPathElement&&(Hh(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},u))}}O1(t,`${n}`,a),Ci(t,i,c)}}},i4={qualify:Dn,set(n,{view:e,elem:t,attrs:r,refBBox:i}){const s=n,o=s.width||0;er(o)?i.width*=parseFloat(o)/100:o<=0?i.width+=o:i.width=o;const a=s.height||0;er(a)?i.height*=parseFloat(a)/100:a<=0?i.height+=a:i.height=a;let l,c=s.text;c==null&&(c=r.text||(t==null?void 0:t.textContent)),c!=null?l=T1(`${c}`,i,{"font-weight":r["font-weight"]||r.fontWeight,"font-size":r["font-size"]||r.fontSize,"font-family":r["font-family"]||r.fontFamily,lineHeight:r.lineHeight},{ellipsis:s.ellipsis}):l="",Y(Z1.set,this,l,{view:e,elem:t,attrs:r,refBBox:i,cell:e.cell})}},ws=(n,{attrs:e})=>e.text!==void 0,s4={qualify:ws},o4={qualify:ws},a4={qualify:ws},l4={qualify:ws},c4={qualify:ws},u4={qualify:ws},h4={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",r=`${n}`,i=Ci(e,t);if(i==null||i!==r){Ci(e,t,r);const s=e.firstChild;if(s&&s.tagName.toUpperCase()==="TITLE"){const o=s;o.textContent=r}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=r,e.insertBefore(o,s)}}}},f4={offset:ew("x","width","right")},d4={offset:ew("y","height","bottom")},g4={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ew(n,e,t){return(r,{refBBox:i})=>{const s=new P;let o;return r==="middle"?o=i[e]/2:r===t?o=i[e]:typeof r=="number"&&Number.isFinite(r)?o=r>-1&&r<1?-i[e]*r:-r:er(r)?o=i[e]*parseFloat(r)/100:o=0,s[n]=-(i[n]+o),s}}const p4={qualify:Dn,set(n,{elem:e}){me(e,n)}},m4={set(n,{elem:e}){e.innerHTML=`${n}`}},y4={qualify:Dn,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},v4={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Ir(n,e,t){let r,i;typeof e=="object"?(r=e.x,i=e.y):(r=e,i=t);const s=X.parse(n),o=s.bbox();if(o){let a=-o.height/2-o.y,l=-o.width/2-o.x;typeof r=="number"&&(l-=r),typeof i=="number"&&(a-=i),s.translate(l,a)}return s.serialize()}var tw=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const b4=n=>{var{size:e,width:t,height:r,offset:i,open:s}=n,o=tw(n,["size","width","height","offset","open"]);return nw({size:e,width:t,height:r,offset:i},s===!0,!0,void 0,o)},w4=n=>{var{size:e,width:t,height:r,offset:i,factor:s}=n,o=tw(n,["size","width","height","offset","factor"]);return nw({size:e,width:t,height:r,offset:i},!1,!1,s,o)};function nw(n,e,t,r=3/4,i={}){const s=n.size||10,o=n.width||s,a=n.height||s,l=new X,c={};if(e)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!t){const u=en(r,0,1);l.lineTo(o*u,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),i),{tagName:"path",d:Ir(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var x4=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const C4=n=>{var{size:e,width:t,height:r,offset:i}=n,s=x4(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new X;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:Ir(c.serialize(),i==null?-a/2:i)})};var S4=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const P4=n=>{var{d:e,offsetX:t,offsetY:r}=n,i=S4(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:Ir(e,t,r)})};var E4=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const A4=n=>{var{size:e,width:t,height:r,offset:i}=n,s=E4(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new X;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:Ir(c.serialize(),i||-a/2)})};var O4=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const M4=n=>{var{width:e,height:t,offset:r,open:i,flip:s}=n,o=O4(n,["width","height","offset","open","flip"]);let a=t||6;const l=e||10,c=i===!0,u=s===!0,h=Object.assign(Object.assign({},o),{tagName:"path"});u&&(a=-a);const f=new X;return f.moveTo(0,a).lineTo(l,0),c?h.fill="none":(f.lineTo(l,a),f.close()),h.d=Ir(f.serialize(),{x:r||-l/2,y:a/2}),h};var rw=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const iw=n=>{var{r:e}=n,t=rw(n,["r"]);const r=e||5;return Object.assign(Object.assign({cx:r},t),{tagName:"circle",r})},T4=n=>{var{r:e}=n,t=rw(n,["r"]);const r=e||5,i=new X;return i.moveTo(r,0).lineTo(r,r*2),i.moveTo(0,r).lineTo(r*2,r),{children:[Object.assign(Object.assign({},iw({r})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Ir(i.serialize(),-r)})]}};var _4=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const N4=Object.freeze(Object.defineProperty({__proto__:null,async:M4,block:b4,circle:iw,circlePlus:T4,classic:w4,cross:A4,diamond:C4,ellipse:n=>{var{rx:e,ry:t}=n,r=_4(n,["rx","ry"]);const i=e||5,s=t||5;return Object.assign(Object.assign({cx:i},r),{tagName:"ellipse",rx:i,ry:s})},path:P4},Symbol.toStringTag,{value:"Module"}));var $r;(function(n){n.presets=N4,n.registry=Ue.create({type:"marker"}),n.registry.register(n.presets,!0)})($r||($r={})),function(n){n.normalize=Ir}($r||($r={}));var k4=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function lf(n){return typeof n=="string"||Dn(n)}const I4={qualify:lf,set(n,{view:e,attrs:t}){return cf("marker-start",n,e,t)}},$4={qualify:lf,set(n,{view:e,attrs:t}){return cf("marker-end",n,e,t,{transform:"rotate(180)"})}},L4={qualify:lf,set(n,{view:e,attrs:t}){return cf("marker-mid",n,e,t)}};function cf(n,e,t,r,i={}){const s=typeof e=="string"?{name:e}:e,{name:o,args:a}=s,l=k4(s,["name","args"]);let c=l;if(o&&typeof o=="string"){const h=$r.registry.get(o);if(h)c=h(Object.assign(Object.assign({},l),a));else return $r.registry.onNotFound(o)}const u=Object.assign(Object.assign(Object.assign({},R4(r,n)),i),c);return{[n]:`url(#${t.graph.defineMarker(u)})`}}function R4(n,e){const t={},r=n.stroke;typeof r=="string"&&(t.stroke=r,t.fill=r);let i=n.strokeOpacity;if(i==null&&(i=n["stroke-opacity"]),i==null&&(i=n.opacity),i!=null&&(t["stroke-opacity"]=i,t["fill-opacity"]=i),e!=="marker-mid"){const s=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(s)&&s>1){const o=Math.ceil(s/2);t.refX=e==="marker-start"?o:-o}}return t}const Go=(n,{view:e})=>e.cell.isEdge(),j4={qualify:Go,set(n,e){var t,r,i,s;const o=e.view,a=n.reverse||!1,l=n.stubs||0;let c;if(Number.isFinite(l)&&l!==0)if(a){let u,h;const f=o.getConnectionLength()||0;l<0?(u=(f+l)/2,h=-l):(u=l,h=f-l*2);const d=o.getConnection();c=(s=(i=(r=(t=d==null?void 0:d.divideAtLength(u))===null||t===void 0?void 0:t[1])===null||r===void 0?void 0:r.divideAtLength(h))===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.serialize()}else{let u;l<0?u=((o.getConnectionLength()||0)+l)/2:u=l;const h=o.getConnection();if(h){const f=h.divideAtLength(u),d=h.divideAtLength(-u);f&&d&&(c=`${f[0].serialize()} ${d[1].serialize()}`)}}return{d:c||o.getConnectionPathData()}}},sw={qualify:Go,set:Xl("getTangentAtLength",{rotate:!0})},D4={qualify:Go,set:Xl("getTangentAtLength",{rotate:!1})},ow={qualify:Go,set:Xl("getTangentAtRatio",{rotate:!0})},B4={qualify:Go,set:Xl("getTangentAtRatio",{rotate:!1})},z4=sw,F4=ow;function Xl(n,e){const t={x:1,y:0};return(r,i)=>{let s,o;const a=i.view,l=a[n](Number(r));return l?(o=e.rotate?l.vector().vectorAngle(t):0,s=l.start):(s=a.path.start,o=0),o===0?{transform:`translate(${s.x},${s.y}')`}:{transform:`translate(${s.x},${s.y}') rotate(${o})`}}}const V4=Object.freeze(Object.defineProperty({__proto__:null,annotations:l4,atConnectionLength:z4,atConnectionLengthIgnoreGradient:D4,atConnectionLengthKeepGradient:sw,atConnectionRatio:F4,atConnectionRatioIgnoreGradient:B4,atConnectionRatioKeepGradient:ow,connection:j4,displayEmpty:u4,eol:c4,fill:n4,filter:y4,html:m4,lineHeight:s4,port:v4,ref:Bq,refCx:Hq,refCy:Uq,refD:Kq,refDKeepOffset:Wq,refDResetOffset:X1,refDx:zq,refDy:Fq,refHeight:U1,refHeight2:t4,refPoints:Jq,refPointsKeepOffset:Xq,refPointsResetOffset:Y1,refR:Yq,refRCircumscribed:Gq,refRInscribed:W1,refRx:Vq,refRy:qq,refWidth:H1,refWidth2:e4,refX:q1,refX2:Qq,refY:G1,refY2:Zq,resetOffset:g4,sourceMarker:I4,stroke:r4,style:p4,targetMarker:$4,text:Z1,textPath:a4,textVerticalAnchor:o4,textWrap:i4,title:h4,vertexMarker:L4,xAlign:f4,yAlign:d4},Symbol.toStringTag,{value:"Module"}));var Vn;(function(n){function e(t,r,i){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||Y(t.qualify,this,r,i)))}n.isValidDefinition=e})(Vn||(Vn={})),function(n){n.presets=Object.assign(Object.assign({},Dq),V4),n.registry=Ue.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Vn||(Vn={}));const on={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${on.prefixCls}-${n}`}},aw=on.prefix("highlighted"),q4={highlight(n,e,t){const r=t&&t.className||aw;K(e,r)},unhighlight(n,e,t){const r=t&&t.className||aw;mt(e,r)}},lw=on.prefix("highlight-opacity"),G4={highlight(n,e){K(e,lw)},unhighlight(n,e){mt(e,lw)}};var de;(function(n){const e=tr("svg");n.normalizeMarker=Ir;function t(d,g){const p=nq(d.x,d.y).matrixTransform(g);return new P(p.x,p.y)}n.transformPoint=t;function r(d,g){return new F(t(d.start,g),t(d.end,g))}n.transformLine=r;function i(d,g){let p=d instanceof He?d.points:d;return Array.isArray(p)||(p=[]),new He(p.map(b=>t(b,g)))}n.transformPolyline=i;function s(d,g){const p=e.createSVGPoint();p.x=d.x,p.y=d.y;const b=p.matrixTransform(g);p.x=d.x+d.width,p.y=d.y;const m=p.matrixTransform(g);p.x=d.x+d.width,p.y=d.y+d.height;const v=p.matrixTransform(g);p.x=d.x,p.y=d.y+d.height;const y=p.matrixTransform(g),w=Math.min(b.x,m.x,v.x,y.x),x=Math.max(b.x,m.x,v.x,y.x),C=Math.min(b.y,m.y,v.y,y.y),S=Math.max(b.y,m.y,v.y,y.y);return new D(w,C,x-w,S-C)}n.transformRectangle=s;function o(d,g,p){let b;const m=d.ownerSVGElement;if(!m)return new D(0,0,0,0);try{b=d.getBBox()}catch(y){b={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(g)return D.create(b);const v=Lo(d,p||m);return s(b,v)}n.bbox=o;function a(d,g={}){let p;if(!d.ownerSVGElement||!Mr(d)){if(p1(d)){const{left:y,top:w,width:x,height:C}=l(d);return new D(y,w,x,C)}return new D(0,0,0,0)}let m=g.target;if(!g.recursive){try{p=d.getBBox()}catch(w){p={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(!m)return D.create(p);const y=Lo(d,m);return s(p,y)}{const y=d.childNodes,w=y.length;if(w===0)return a(d,{target:m});m||(m=d);for(let x=0;x<w;x+=1){const C=y[x];let S;C.childNodes.length===0?S=a(C,{target:m}):S=a(C,{target:m,recursive:!0}),p?p=p.union(S):p=S}return p}}n.getBBox=a;function l(d){let g=0,p=0,b=0,m=0;if(d){let v=d;for(;v;)g+=v.offsetLeft,p+=v.offsetTop,v=v.offsetParent,v&&(g+=parseInt(S1(v,"borderLeft"),10),p+=parseInt(S1(v,"borderTop"),10));b=d.offsetWidth,m=d.offsetHeight}return{left:g,top:p,width:b,height:m}}n.getBoundingOffsetRect=l;function c(d){const g=p=>{const b=d.getAttribute(p),m=b?parseFloat(b):0;return Number.isNaN(m)?0:m};switch(d instanceof SVGElement&&d.nodeName.toLowerCase()){case"rect":return new D(g("x"),g("y"),g("width"),g("height"));case"circle":return new xn(g("cx"),g("cy"),g("r"),g("r"));case"ellipse":return new xn(g("cx"),g("cy"),g("rx"),g("ry"));case"polyline":{const p=zl(d);return new He(p)}case"polygon":{const p=zl(d);return p.length>1&&p.push(p[0]),new He(p)}case"path":{let p=d.getAttribute("d");return X.isValid(p)||(p=X.normalize(p)),X.parse(p)}case"line":return new F(g("x1"),g("y1"),g("x2"),g("y2"))}return a(d)}n.toGeometryShape=c;function u(d,g,p,b){const m=P.create(g),v=P.create(p);b||(b=d instanceof SVGSVGElement?d:d.ownerSVGElement);const y=nf(d);d.setAttribute("transform","");const w=a(d,{target:b}).scale(y.sx,y.sy),x=Io();x.setTranslate(-w.x-w.width/2,-w.y-w.height/2);const C=Io(),S=m.angleBetween(v,m.clone().translate(1,0));S&&C.setRotate(S,0,0);const E=Io(),A=m.clone().move(v,w.width/2);E.setTranslate(2*m.x-A.x,2*m.y-A.y);const M=Lo(d,b),O=Io();O.setMatrix(E.matrix.multiply(C.matrix.multiply(x.matrix.multiply(M.scale(y.sx,y.sy))))),d.setAttribute("transform",ps(O.matrix))}n.translateAndAutoOrient=u;function h(d){if(d==null)return null;let g=d;do{let p=g.tagName;if(typeof p!="string")return null;if(p=p.toUpperCase(),gs(g,"x6-port"))g=g.nextElementSibling;else if(p==="G")g=g.firstElementChild;else if(p==="TITLE")g=g.nextElementSibling;else break}while(g);return g}n.findShapeNode=h;function f(d){const g=h(d);if(!Mr(g)){if(p1(d)){const{left:m,top:v,width:y,height:w}=l(d);return new D(m,v,y,w)}return new D(0,0,0,0)}return c(g).bbox()||D.create()}n.getBBoxV2=f})(de||(de={}));const H4={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},U4={highlight(n,e,t){const r=Lr.getHighlighterId(e,t);if(Lr.hasCache(r))return;t=Nb({},t,H4);const i=Z.create(e);let s,o;try{s=i.toPathData()}catch(u){o=de.bbox(i.node,!0),s=N1(Object.assign(Object.assign({},t),o))}const a=tr("path");if(fe(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?No(t.attrs):null)),n.isEdgeElement(e))fe(a,"d",n.getConnectionPathData());else{let u=i.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=de.bbox(i.node,!0));const f=o.x+o.width/2,d=o.y+o.height/2;o=de.transformRectangle(o,u);const g=Math.max(o.width,1),p=Math.max(o.height,1),b=(g+h)/g,m=(p+h)/p,v=ut({a:b,b:0,c:0,d:m,e:f-b*f,f:d-m*d});u=u.multiply(v)}ms(a,u)}K(a,on.prefix("highlight-stroke"));const l=n.cell,c=()=>Lr.removeHighlighter(r);l.on("removed",c),l.model&&l.model.on("reseted",c),n.container.appendChild(a),Lr.setCache(r,a)},unhighlight(n,e,t){Lr.removeHighlighter(Lr.getHighlighterId(e,t))}};var Lr;(function(n){function e(o,a){return Hh(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function r(o,a){t[o]=a}n.setCache=r;function i(o){return t[o]!=null}n.hasCache=i;function s(o){const a=t[o];a&&(nr(a),delete t[o])}n.removeHighlighter=s})(Lr||(Lr={}));const W4=Object.freeze(Object.defineProperty({__proto__:null,className:q4,opacity:G4,stroke:U4},Symbol.toStringTag,{value:"Module"}));var sr;(function(n){function e(t,r){if(typeof r.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof r.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(sr||(sr={})),function(n){n.presets=W4,n.registry=Ue.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(sr||(sr={}));function uf(n,e={}){return new P(Vt(e.x,n.width),Vt(e.y,n.height))}function hf(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const X4=(n,e)=>n.map(({x:t,y:r,angle:i})=>hf(uf(e,{x:t,y:r}),i||0)),Y4=(n,e,t)=>{const r=t.start||0,i=t.step||20;return cw(n,e,r,(s,o)=>(s+.5-o/2)*i)},K4=(n,e,t)=>{const r=t.start||0,i=t.step||360/n.length;return cw(n,e,r,s=>s*i)};function cw(n,e,t,r){const i=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=xn.fromRect(e),l=n.length;return n.map((c,u)=>{const h=t+r(u,l),f=s.clone().rotate(-h,i).scale(o,1,i),d=c.compensateRotate?-a.tangentTheta(f):0;return(c.dx||c.dy)&&f.translate(c.dx||0,c.dy||0),c.dr&&f.move(i,c.dr),hf(f.round(),d,c)})}var J4=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const Q4=(n,e,t)=>{const r=uf(e,t.start||e.getOrigin()),i=uf(e,t.end||e.getCorner());return Ho(n,r,i,t)},Z4=(n,e,t)=>Ho(n,e.getTopLeft(),e.getBottomLeft(),t),e6=(n,e,t)=>Ho(n,e.getTopRight(),e.getBottomRight(),t),t6=(n,e,t)=>Ho(n,e.getTopLeft(),e.getTopRight(),t),n6=(n,e,t)=>Ho(n,e.getBottomLeft(),e.getBottomRight(),t);function Ho(n,e,t,r){const i=new F(e,t),s=n.length;return n.map((o,a)=>{var{strict:l}=o,c=J4(o,["strict"]);const u=l||r.strict?(a+1)/(s+1):(a+.5)/s,h=i.pointAt(u);return(c.dx||c.dy)&&h.translate(c.dx||0,c.dy||0),hf(h.round(),0,c)})}const r6=Object.freeze(Object.defineProperty({__proto__:null,absolute:X4,bottom:n6,ellipse:Y4,ellipseSpread:K4,left:Z4,line:Q4,right:e6,top:t6},Symbol.toStringTag,{value:"Module"}));var Ai;(function(n){n.presets=r6,n.registry=Ue.create({type:"port layout"}),n.registry.register(n.presets,!0)})(Ai||(Ai={}));const i6={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Rr(n,e){const{x:t,y:r,angle:i,attrs:s}=e||{};return Nb({},{angle:i,attrs:s,position:{x:t,y:r}},n,i6)}const s6=(n,e,t)=>Rr({position:e.getTopLeft()},t),o6=(n,e,t)=>Rr({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),a6=(n,e,t)=>Rr({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),l6=(n,e,t)=>Rr({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),c6=(n,e,t)=>Rr({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),u6=(n,e,t)=>uw(n,e,!1,t),h6=(n,e,t)=>uw(n,e,!0,t),f6=(n,e,t)=>hw(n,e,!1,t),d6=(n,e,t)=>hw(n,e,!0,t);function uw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=fw(e);let a,l,c,u,h=0;return s<o[1]||s>o[2]?(a=".3em",l=i,c=0,u="start"):s<o[0]?(a="0",l=0,c=-i,t?(h=-90,u="start"):u="middle"):s<o[3]?(a=".3em",l=-i,c=0,u="end"):(a=".6em",l=0,c=i,t?(h=90,u="start"):u="middle"),Rr({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function hw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=fw(e);let a,l,c,u,h=0;return s<o[1]||s>o[2]?(a=".3em",l=-i,c=0,u="end"):s<o[0]?(a=".6em",l=0,c=i,t?(h=90,u="start"):u="middle"):s<o[3]?(a=".3em",l=i,c=0,u="start"):(a="0em",l=0,c=-i,t?(h=-90,u="start"):u="middle"),Rr({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function fw(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),r=e.theta(n.getBottomLeft()),i=e.theta(n.getBottomRight()),s=e.theta(n.getTopRight());return[t,s,i,r]}const g6=(n,e,t)=>dw(n.diff(e.getCenter()),!1,t),p6=(n,e,t)=>dw(n.diff(e.getCenter()),!0,t);function dw(n,e,t){const r=t.offset!=null?t.offset:20,i=new P(0,0),s=-n.theta(i),o=n.clone().move(i,r).diff(n).round();let a=".3em",l,c=s;return(s+90)%180===0?(l=e?"end":"middle",!e&&s===-270&&(a="0em")):s>-270&&s<-90?(l="start",c=s-180):l="end",Rr({position:o.round().toJSON(),angle:e?c:0,attrs:{".":{y:a,"text-anchor":l}}},t)}const m6=Object.freeze(Object.defineProperty({__proto__:null,bottom:c6,inside:f6,insideOriented:d6,left:o6,manual:s6,outside:u6,outsideOriented:h6,radial:g6,radialOriented:p6,right:a6,top:l6},Symbol.toStringTag,{value:"Module"}));var xs;(function(n){n.presets=m6,n.registry=Ue.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(xs||(xs={}));class ge extends pt{get priority(){return 2}constructor(){super(),this.cid=ff.uniqueId(),ge.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return To(e),this}unmount(e=this.container){return nr(e),this}remove(e=this.container){return e===this.container&&(this.removeEventListeners(document),this.onRemove(),delete ge.views[this.cid]),this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return K(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return mt(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return me(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&fe(t,e),this}findAttr(e,t=this.container){let r=t;for(;r&&r.nodeType===1;){const i=r.getAttribute(e);if(i!=null)return i;if(r===this.container)return null;r=r.parentNode}return null}find(e,t=this.container,r=this.selectors){return ge.find(e,t,r).elems}findOne(e,t=this.container,r=this.selectors){const i=this.find(e,t,r);return i.length>0?i[0]:null}findByAttr(e,t=this.container){let r=t;for(;r&&r.getAttribute;){const i=r.getAttribute(e);if((i!=null||r===this.container)&&i!=="false")return r;r=r.parentNode}return null}getSelector(e,t){let r;if(e===this.container)return typeof t=="string"&&(r=`> ${t}`),r;if(e){const i=Wh(e)+1;r=`${e.tagName.toLowerCase()}:nth-child(${i})`,t&&(r+=` > ${t}`),r=this.getSelector(e.parentNode,r)}return r}prefixClassName(e){return on.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const r=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(i=>{const s=i.match(r);if(s==null)return;const o=this.getEventHandler(e[i]);typeof o=="function"&&this.delegateEvent(s[1],s[2],o)}),this}undelegateEvents(){return Se.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,r){return Se.on(this.container,e+this.getEventNamespace(),t,r),this}undelegateEvent(e,t,r){const i=e+this.getEventNamespace();return t==null?Se.off(this.container,i):typeof t=="string"?Se.off(this.container,i,t,r):Se.off(this.container,i,t),this}addEventListeners(e,t,r){if(t==null)return this;const i=this.getEventNamespace();return Object.keys(t).forEach(s=>{const o=this.getEventHandler(t[s]);typeof o=="function"&&Se.on(e,s+i,r,o)}),this}removeEventListeners(e){return e!=null&&Se.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${on.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const r=this[e];typeof r=="function"&&(t=(...i)=>r.call(this,...i))}else t=(...r)=>e.call(this,...r);return t}getEventTarget(e,t={}){const{target:r,type:i,clientX:s=0,clientY:o=0}=e;return t.fromPoint||i==="touchmove"||i==="touchend"?document.elementFromPoint(s,o):r}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let r=e.data;const i=`__${this.cid}__`;return t==null?r==null?{}:r[i]||{}:(r==null&&(r=e.data={}),r[i]==null?r[i]=Object.assign({},t):r[i]=Object.assign(Object.assign({},r[i]),t),r[i])}normalizeEvent(e){return ge.normalizeEvent(e)}}(function(n){function e(i,s){return s?tr(i||"g"):Uh(i||"div")}n.createElement=e;function t(i,s,o){if(!i||i===".")return{elems:[s]};if(o){const a=o[i];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=i.includes(">")?`:scope ${i}`:i;return{isCSSSelector:!0,elems:Array.prototype.slice.call(s.querySelectorAll(a))}}}n.find=t;function r(i){let s=i;const o=i.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const l in i)a[l]===void 0&&(a[l]=i[l]);s=a}return s}n.normalizeEvent=r})(ge||(ge={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(ge||(ge={}));var ff;(function(n){let e=0;function t(){const r=`v${e}`;return e+=1,r}n.uniqueId=t})(ff||(ff={}));class y6{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new sf,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const r=this.view.container;t.matrix=aq(e,r)}return ut(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=de.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=de.getBBoxV2(e)),t.boundingRect.clone()}}var Pe;(function(n){function e(c){return c!=null&&!t(c)}n.isJSONMarkup=e;function t(c){return c!=null&&typeof c=="string"}n.isStringMarkup=t;function r(c){return c==null||t(c)?c:ze(c)}n.clone=r;function i(c){return`${c}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=i;function s(c,u={ns:ct.svg}){const h=document.createDocumentFragment(),f={},d={},g=[{markup:Array.isArray(c)?c:[c],parent:h,ns:u.ns}];for(;g.length>0;){const p=g.pop();let b=p.ns||ct.svg;const m=p.markup,v=p.parent;m.forEach(y=>{const w=y.tagName;if(!w)throw new TypeError("Invalid tagName");y.ns&&(b=y.ns);const x=b?Uh(w,b):h1(w),C=y.attrs;C&&fe(x,No(C));const S=y.style;S&&me(x,S);const E=y.className;E!=null&&x.setAttribute("class",Array.isArray(E)?E.join(" "):E),y.textContent&&(x.textContent=y.textContent);const A=y.selector;if(A!=null){if(d[A])throw new TypeError("Selector must be unique");d[A]=x}if(y.groupSelector){let O=y.groupSelector;Array.isArray(O)||(O=[O]),O.forEach(I=>{f[I]||(f[I]=[]),f[I].push(x)})}v.appendChild(x);const M=y.children;Array.isArray(M)&&g.push({ns:b,markup:M,parent:x})})}return Object.keys(f).forEach(p=>{if(d[p])throw new Error("Ambiguous group selector");d[p]=f[p]}),{fragment:h,selectors:d,groups:f}}n.parseJSONMarkup=s;function o(c){return c instanceof SVGElement?tr("g"):h1("div")}function a(c){if(t(c)){const d=Z.createVectors(c),g=d.length;if(g===1)return{elem:d[0].node};if(g>1){const p=o(d[0].node);return d.forEach(b=>{p.appendChild(b.node)}),{elem:p}}return{}}const u=s(c),h=u.fragment;let f=null;return h.childNodes.length>1?(f=o(h.firstChild),f.appendChild(h)):f=h.firstChild,{elem:f,selectors:u.selectors}}n.renderMarkup=a;function l(c){const u=Z.createVectors(c),h=document.createDocumentFragment();for(let f=0,d=u.length;f<d;f+=1){const g=u[f].node;h.appendChild(g)}return{fragment:h,selectors:{}}}n.parseLabelStringMarkup=l})(Pe||(Pe={})),function(n){function e(t,r,i){if(t!=null){let s;const o=t.tagName.toLowerCase();if(t===r)return typeof i=="string"?s=`> ${o} > ${i}`:s=`> ${o}`,s;const a=t.parentNode;if(a&&a.childNodes.length>1){const l=Wh(t)+1;s=`${o}:nth-child(${l})`}else s=o;return i&&(s+=` > ${i}`),e(t.parentNode,r,s)}return i}n.getSelector=e}(Pe||(Pe={})),function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function r(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=r}(Pe||(Pe={})),function(n){function e(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=e}(Pe||(Pe={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:ct.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:ct.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(Pe||(Pe={}));class gw{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let r,i,s,o;const a=[];return Object.keys(t).forEach(l=>{const c=t[l],u=this.getDefinition(l),h=Y(Vn.isValidDefinition,this.view,u,c,{elem:e,attrs:t,cell:this.cell,view:this.view});if(u&&h)typeof u=="string"?(r==null&&(r={}),r[u]=c):c!==null&&a.push({name:l,definition:u});else{r==null&&(r={});const f=m1.includes(l)?l:Ub(l);r[f]=c}}),a.forEach(({name:l,definition:c})=>{const u=t[l];typeof c.set=="function"&&(i==null&&(i={}),i[l]=u),typeof c.offset=="function"&&(s==null&&(s={}),s[l]=u),typeof c.position=="function"&&(o==null&&(o={}),o[l]=u)}),{raw:t,normal:r,set:i,offset:s,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const r=e.normal&&e.normal.transform;r!=null&&t.normal&&(t.normal.transform=r),e.normal=t.normal}findAttrs(e,t,r,i){const s=[],o=new sf;return Object.keys(e).forEach(a=>{const l=e[a];if(!Dn(l))return;const{isCSSSelector:c,elems:u}=ge.find(a,t,i);r[a]=u;for(let h=0,f=u.length;h<f;h+=1){const d=u[h],g=i&&i[a]===d,p=o.get(d);if(p){p.array||(s.push(d),p.array=!0,p.attrs=[p.attrs],p.priority=[p.priority]);const b=p.attrs,m=p.priority;if(g)b.unshift(l),m.unshift(-1);else{const v=iV(m,c?-1:f);b.splice(v,0,l),m.splice(v,0,f)}}else o.set(d,{elem:d,attrs:l,priority:g?-1:f,array:!1})}}),s.forEach(a=>{const l=o.get(a),c=l.attrs;l.attrs=c.reduceRight((u,h)=>Ie(u,h),{})}),o}updateRelativeAttrs(e,t,r){const i=t.raw||{};let s=t.normal||{};const o=t.set,a=t.position,l=t.offset,c=()=>({elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:r.clone()});if(o!=null&&Object.keys(o).forEach(b=>{const m=o[b],v=this.getDefinition(b);if(v!=null){const y=Y(v.set,this.view,m,c());typeof y=="object"?s=Object.assign(Object.assign({},s),y):y!=null&&(s[b]=y)}}),e instanceof HTMLElement){this.view.setAttrs(s,e);return}const u=s.transform,h=u?`${u}`:null,f=$o(h),d=new P(f.e,f.f);u&&(delete s.transform,f.e=0,f.f=0);let g=!1;a!=null&&Object.keys(a).forEach(b=>{const m=a[b],v=this.getDefinition(b);if(v!=null){const y=Y(v.position,this.view,m,c());y!=null&&(g=!0,d.translate(P.create(y)))}}),this.view.setAttrs(s,e);let p=!1;if(l!=null){const b=this.view.getBoundingRectOfElement(e);if(b.width>0&&b.height>0){const m=de.transformRectangle(b,f);Object.keys(l).forEach(v=>{const y=l[v],w=this.getDefinition(v);if(w!=null){const x=Y(w.offset,this.view,y,{elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:m});x!=null&&(p=!0,d.translate(P.create(x)))}})}}(u!=null||g||p)&&(d.round(1),f.e=d.x,f.f=d.y,e.setAttribute("transform",ps(f)))}update(e,t,r){const i={},s=this.findAttrs(r.attrs||t,e,i,r.selectors),o=r.attrs?this.findAttrs(t,e,i,r.selectors):s,a=[];s.each(u=>{const h=u.elem,f=u.attrs,d=this.processAttrs(h,f);if(d.set==null&&d.position==null&&d.offset==null)this.view.setAttrs(d.normal,h);else{const g=o.get(h),p=g?g.attrs:null,b=p&&f.ref==null?p.ref:f.ref;let m;if(b){if(m=(i[b]||this.view.find(b,e,r.selectors))[0],!m)throw new Error(`"${b}" reference does not exist.`)}else m=null;const v={node:h,refNode:m,attributes:p,processedAttributes:d},y=a.findIndex(w=>w.refNode===h);y>-1?a.splice(y,0,v):a.push(v)}});const l=new sf;let c;a.forEach(u=>{const h=u.node,f=u.refNode;let d;const g=f!=null&&r.rotatableNode!=null&&d1(r.rotatableNode,f);if(f&&(d=l.get(f)),!d){const m=g?r.rotatableNode:e;d=f?de.getBBox(f,{target:m}):r.rootBBox,f&&l.set(f,d)}let p;r.attrs&&u.attributes?(p=this.processAttrs(h,u.attributes),this.mergeProcessedAttrs(p,u.processedAttributes)):p=u.processedAttributes;let b=d;g&&r.rotatableNode!=null&&!r.rotatableNode.contains(h)&&(c||(c=$o(fe(r.rotatableNode,"transform"))),b=de.transformRectangle(d,c)),this.updateRelativeAttrs(h,p,b)})}}class pw{get cell(){return this.view.cell}constructor(e,t,r=[]){this.view=e;const i={},s={};let o=0;Object.keys(t).forEach(l=>{let c=t[l];Array.isArray(c)||(c=[c]),c.forEach(u=>{let h=i[u];h||(o+=1,h=i[u]=1<<o),s[l]|=h})});let a=r;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{i[l]||(o+=1,i[l]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=s,this.bootstrap=r}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((r,i)=>r|t[i],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var v6=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},b6=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class We extends ge{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(c,u)=>u!=null?Bb([...Array.isArray(c)?c:[c],...Array.isArray(u)?u:[u]]):Array.isArray(c)?[...c]:[c],r=ze(this.getDefaults()),{bootstrap:i,actions:s,events:o,documentEvents:a}=e,l=b6(e,["bootstrap","actions","events","documentEvents"]);return i&&(r.bootstrap=t(r.bootstrap,i)),s&&Object.entries(s).forEach(([c,u])=>{const h=r.actions[c];u&&h?r.actions[c]=t(h,u):u&&(r.actions[c]=t(u))}),o&&(r.events=Object.assign(Object.assign({},r.events),o)),e.documentEvents&&(r.documentEvents=Object.assign(Object.assign({},r.documentEvents),a)),Ie(r,l)}get[Symbol.toStringTag](){return We.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new gw(this),this.flag=new pw(this,this.options.actions,this.options.bootstrap),this.cache=new y6(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(e){return this.getConstructor().getOptions(e)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return ge.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const r=this.getContainerStyle();r!=null&&this.setStyle(r,e);const i=this.getContainerClassName();i!=null&&this.addClass(i,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,r,i){if(this.hasAction(e,t)){r();const s=[t];return i&&(typeof i=="string"?s.push(i):s.push(...i)),this.removeAction(e,s)}return e}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:e}){this.onAttrsChange(e)}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const r=Pe.parseJSONMarkup(e),i=r.selectors,s=this.rootSelector;if(t&&s){if(i[s])throw new Error("Invalid root selector");i[s]=t}return r}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=Y(t,this.graph,this)),typeof t=="object"){let r=t[e];return typeof r=="function"&&(r=Y(r,this.graph,this)),r!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootRotatedMatrix(),s=this.getRootTranslatedMatrix();return de.transformRectangle(t,s.multiply(i).multiply(r))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootTranslatedMatrix();return de.transformRectangle(t,i.multiply(r))}getBBox(e={}){let t;if(e.useCellGeometry){const r=this.cell,i=r.isNode()?r.getAngle():0;t=r.getBBox().bbox(i)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return ut().translate(t.x,t.y)}getRootRotatedMatrix(){let e=ut();const t=this.cell,r=t.isNode()?t.getAngle():0;if(r){const i=t.getBBox(),s=i.width/2,o=i.height/2;e=e.translate(s,o).rotate(r).translate(-s,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,r={}){r.rootBBox==null&&(r.rootBBox=new D),r.selectors==null&&(r.selectors=this.selectors),this.attr.update(e,t,r)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const r=e||this.container;return t.partial=r===this.container,r}highlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,r,i,s){const o=this.cell,a=this.findAttr("port",e),l=e.getAttribute("data-selector"),c={cell:o.id};return l!=null&&(c.magnet=l),a!=null?(c.port=a,o.isNode()&&!o.hasPort(a)&&l==null&&(c.selector=this.getSelector(e))):l==null&&this.container!==e&&(c.selector=this.getSelector(e)),c}getMagnetFromEdgeTerminal(e){const t=this.cell,r=this.container,i=e.port;let s=e.magnet,o;return i!=null&&t.isNode()&&t.hasPort(i)?o=this.findPortElem(i,s)||r:(s||(s=e.selector),!s&&i!=null&&(s=`[port="${i}"]`),o=this.findOne(s,r,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(this.removeTools(),e){if(!this.can("toolsAddable"))return this;const t=et.isToolsView(e)?e:new et(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,r){const i=this,s=i.cell;return t==null||r==null?{e,view:i,cell:s}:{e,x:t,y:r,view:i,cell:s}}onClick(e,t,r){this.notify("cell:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){this.notify("cell:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){this.notify("cell:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,r))}onMouseUp(e,t,r){this.notify("cell:mouseup",this.getEventArgs(e,t,r)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,r){this.notify("cell:mousemove",this.getEventArgs(e,t,r))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),this.notify(t,Object.assign({},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){}onMagnetDblClick(e,t,r,i){}onMagnetContextMenu(e,t,r,i){}onLabelMouseDown(e,t,r){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),r=this.graph.findViewByElem(t);r!==this&&(this.onMouseLeave(e),r&&r.onMouseEnter(e))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}We.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},v6([We.dispose()],We.prototype,"dispose",null),function(n){n.Flag=pw,n.Attr=gw}(We||(We={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"}n.isCellView=e}(We||(We={})),function(n){function e(r){return function(i){i.config({priority:r})}}n.priority=e;function t(r){return function(i){i.config({bootstrap:r})}}n.bootstrap=t}(We||(We={})),function(n){n.registry=Ue.create({type:"view"})}(We||(We={}));class et extends ge{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return et.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const r=e?ge.createElement("g",!0):ge.createElement("div",!1);return K(r,this.prefixClassName("cell-tools")),t.className&&K(r,t.className),r}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!We.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(K(this.svgContainer,this.prefixClassName("edge-tools")),K(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(K(this.svgContainer,this.prefixClassName("node-tools")),K(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const r=[];t.forEach(i=>{et.ToolItem.isToolItem(i)?i.name==="vertices"?r.unshift(i):r.push(i):(typeof i=="object"?i.name:i)==="vertices"?r.unshift(i):r.push(i)});for(let i=0;i<r.length;i+=1){const s=r[i];let o;if(et.ToolItem.isToolItem(s))o=s;else{const a=typeof s=="object"?s.name:s,l=typeof s=="object"?s.args||{}:{};if(a){if(this.cell.isNode()){const c=Ss.registry.get(a);if(c)o=new c(l);else return Ss.registry.onNotFound(a)}else if(this.cell.isEdge()){const c=Ps.registry.get(a);if(c)o=new c(l);else return Ps.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(e={}){const t=this.tools;return t&&t.forEach(r=>{e.toolId!==r.cid&&r.isVisible()&&r.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(r=>{e===r?r.show():r.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(r=>{r!==e&&!r.isVisible()&&(r.show(),r.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),nr(this.svgContainer),nr(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const r=e.some(s=>s.options.isSVGElement!==!1),i=e.some(s=>s.options.isSVGElement===!1);r&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),i&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&i.graph!=null&&i.cell!=null&&typeof i.config=="function"&&typeof i.update=="function"&&typeof i.focus=="function"&&typeof i.blur=="function"&&typeof i.show=="function"&&typeof i.hide=="function"}n.isToolsView=e})(et||(et={})),function(n){class e extends ge{static getDefaults(){return this.defaults}static config(r){this.defaults=this.getOptions(r)}static getOptions(r){return Ie(ze(this.getDefaults()),r)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}constructor(r={}){super(),this.visible=!0,this.options=this.getOptions(r),this.container=ge.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),K(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&K(this.container,this.options.className),this.init()}init(){}getOptions(r){return this.constructor.getOptions(r)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(r,i){return this.cellView=r,this.parent=i,this.stamp(this.container),this.cell.isEdge()?K(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&K(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const r=this.options.markup;if(r){const i=Pe.parseJSONMarkup(r);this.container.appendChild(i.fragment),this.childNodes=i.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(r){r&&r.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const r=this.options.focusOpacity;return r!=null&&Number.isFinite(r)&&(this.container.style.opacity=`${r}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(r){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(r,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,function(t){let r=0;function i(o){return o?zh(o):(r+=1,`CustomTool${r}`)}function s(o){const a=Dh(i(o.name),this);return a.config(o),a}t.define=s}(e=n.ToolItem||(n.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`;function r(i){if(i==null)return!1;if(i instanceof t)return!0;const s=i[Symbol.toStringTag],o=i;return(s==null||s===t.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}t.isToolItem=r}(e=n.ToolItem||(n.ToolItem={}))}(et||(et={}));const w6=n=>n;function mw(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function yw(n){return(t,r,i,s)=>r.isEdgeElement(i)?C6(n,t,r,i,s):x6(n,t,r,i,s)}function x6(n,e,t,r,i){const s=t.cell,o=s.getAngle(),a=t.getUnrotatedBBoxOfElement(r),l=s.getBBox().getCenter(),c=P.create(i).rotate(o,l);let u=c.x-a.x,h=c.y-a.y;return n&&(u=mw(u,a.width),h=mw(h,a.height)),e.anchor={name:"topLeft",args:{dx:u,dy:h,rotate:!0}},e}function C6(n,e,t,r,i){const s=t.getConnection();if(!s)return e;const o=s.closestPointLength(i);if(n){const a=s.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const S6=yw(!0),P6=yw(!1),E6=Object.freeze(Object.defineProperty({__proto__:null,noop:w6,pinAbsolute:P6,pinRelative:S6},Symbol.toStringTag,{value:"Module"}));var df;(function(n){n.presets=E6,n.registry=Ue.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(df||(df={}));function vw(n,e,t,r){return Y(df.presets.pinRelative,this.graph,{},e,t,n,this.cell,r,{}).anchor}function bw(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class jr extends et.ToolItem{onRender(){K(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();ms(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:r=0,y:i=0}=t;const{offset:s,useCellGeometry:o,rotate:a}=t;let l=bw(e,o);const c=e.cell.getAngle();a||(l=l.bbox(c));let u=0,h=0;typeof s=="number"?(u=s,h=s):typeof s=="object"&&(u=s.x,h=s.y),r=Vt(r,l.width),i=Vt(i,l.height);let f=ut().translate(l.x+l.width/2,l.y+l.height/2);return a&&(f=f.rotate(c)),f=f.translate(r+u-l.width/2,i+h-l.height/2),f}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:r=0,distance:i=0,rotate:s}=t;let o,a,l;const c=Vt(i,1);c>=0&&c<=1?o=e.getTangentAtRatio(c):o=e.getTangentAtLength(c),o?(a=o.start,l=o.vector().vectorAngle(new P(1,0))||0):(a=e.getConnection().start,l=0);let u=ut().translate(a.x,a.y).rotate(l);return typeof r=="object"?u=u.translate(r.x||0,r.y||0):u=u.translate(0,r),s||(u=u.rotate(-l)),u}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&Y(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(jr||(jr={})),function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})}(jr||(jr={}));var A6=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Yl extends et.ToolItem{onRender(){if(K(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,r=A6(e,["class"]);fe(this.container,No(r)),t&&K(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:r,rotate:i}=t,s=Bn(t.padding);let o=bw(e,r).moveAndExpand({x:-s.left,y:-s.top,width:s.left+s.right,height:s.top+s.bottom});const a=e.cell;if(a.isNode()){const l=a.getAngle();if(l)if(i){const c=a.getBBox().getCenter();tf(this.container,l,c.x,c.y,{absolute:!0})}else o=o.bbox(l)}return fe(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(Yl||(Yl={}));class Uo extends et.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.options.createHandle,o=this.options.processHandle,a=s({index:t,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(i.x,i.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.handles[t];s&&s.updatePosition(i.x,i.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,r=this.vertices,i=e>0?r[e-1]:t.sourceAnchor,s=e<r.length-1?r[e+1]:t.targetAnchor;return{prev:P.create(i),next:P.create(s)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:r,y:i}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:r,y:i}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:r,x:i,y:s}=this.getMouseEventArgs(e);this.eventData(r,{start:{x:i,y:s}}),t.notifyMouseDown(r,i,s)}}onHandleChanging({handle:e,e:t}){const r=this.cellView,i=e.options.index,{e:s,x:o,y:a}=this.getMouseEventArgs(t),l={x:o,y:a};this.snapVertex(l,i),r.cell.setVertexAt(i,l,{ui:!0,toolId:this.cid}),e.updatePosition(l.x,l.y),this.options.stopPropagation||r.notifyMouseMove(s,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,r=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}r.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:s,x:o,y:a}=this.getMouseEventArgs(e);if(!this.options.stopPropagation){r.notifyMouseUp(s,o,a);const{start:l}=this.eventData(s);if(l){const{x:c,y:u}=l;c===o&&u===a&&r.onClick(s,o,a)}}r.checkMouseleave(s),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}snapVertex(e,t){const r=this.options.snapRadius||0;if(r>0){const i=this.getNeighborPoints(t),s=i.prev,o=i.next;Math.abs(e.x-s.x)<r?e.x=s.x:Math.abs(e.x-o.x)<r&&(e.x=o.x),Math.abs(e.y-s.y)<r?e.y=i.prev.y:Math.abs(e.y-o.y)<r&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const r=e.options.index,i=this.cellView;i.cell.removeVertexAt(r,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),r=this.options.addable&&this.cellView.can("vertexAddable"),i=this.options.modifiers?ir.isMatch(e,this.options.modifiers):!0;return!t&&r&&i}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const s=t.getVertexIndex(i.x,i.y);this.snapVertex(i,s),t.cell.insertVertex(i,s,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[s];this.eventData(r,{vertexAdded:!0}),o.onMouseDown(r)}onRemove(){this.resetHandles()}}(function(n){class e extends ge{get graph(){return this.options.graph}constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=ge.createElement("circle",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(r,i){this.setAttrs({cx:r,cy:i})}onMouseDown(r){this.options.guard(r)||(r.stopPropagation(),r.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data),this.emit("change",{e:r,handle:this}))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(r){this.emit("remove",{e:r,handle:this})}}n.Handle=e})(Uo||(Uo={})),function(n){const e=on.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(Uo||(Uo={}));class Wo extends et.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){K(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let r=0,i=t.length;r<i-1;r+=1){const s=t[r],o=t[r+1],a=this.renderHandle(s,o,r);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,r){const i=this.options.createHandle({index:r,graph:this.graph,guard:s=>this.guard(s),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.updateHandle(i,e,t),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let r=0,i=t.length;r<i;r+=1)t[r].options.index+=e}resetAnchor(e,t){const r=this.cellView.cell,i={ui:!0,toolId:this.cid};t?r.prop([e,"anchor"],t,i):r.removeProp([e,"anchor"],i)}snapHandle(e,t,r){const i=e.options.axis,s=e.options.index,l=this.cellView.cell.getVertices(),c=l[s-2]||r.sourceAnchor,u=l[s+1]||r.targetAnchor,h=this.options.snapRadius;return Math.abs(t[i]-c[i])<h?t[i]=c[i]:Math.abs(t[i]-u[i])<h&&(t[i]=u[i]),t}onHandleChanging({handle:e,e:t}){const r=this.graph,i=this.options,s=this.cellView,o=i.anchor,a=e.options.axis,l=e.options.index-1,c=this.getEventData(t),u=this.normalizeEvent(t),h=r.snapToGrid(u.clientX,u.clientY),f=this.snapHandle(e,h.clone(),c),d=ze(this.vertices);let g=d[l],p=d[l+1];const b=s.sourceView,m=s.sourceBBox;let v=!1,y=!1;if(g?l===0?m.containsPoint(g)?(d.shift(),this.shiftHandleIndexes(-1),v=!0):(g[a]=f[a],y=!0):g[a]=f[a]:(g=s.sourceAnchor.toJSON(),g[a]=f[a],m.containsPoint(g)?v=!0:(d.unshift(g),this.shiftHandleIndexes(1),y=!0)),typeof o=="function"&&b){if(v){const E=c.sourceAnchor.clone();E[a]=f[a];const A=Y(o,s,E,b,s.sourceMagnet||b.container,"source",s,this);this.resetAnchor("source",A)}y&&this.resetAnchor("source",c.sourceAnchorDef)}const w=s.targetView,x=s.targetBBox;let C=!1,S=!1;if(p?l===d.length-2?x.containsPoint(p)?(d.pop(),C=!0):(p[a]=f[a],S=!0):p[a]=f[a]:(p=s.targetAnchor.toJSON(),p[a]=f[a],x.containsPoint(p)?C=!0:(d.push(p),S=!0)),typeof o=="function"&&w){if(C){const E=c.targetAnchor.clone();E[a]=f[a];const A=Y(o,s,E,w,s.targetMagnet||w.container,"target",s,this);this.resetAnchor("target",A)}S&&this.resetAnchor("target",c.targetAnchorDef)}P.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(e,g,p,0),i.stopPropagation||s.notifyMouseMove(u,h.x,h.y)}onHandleChange({handle:e,e:t}){const r=this.options,i=this.handles,s=this.cellView,o=e.options.index;if(Array.isArray(i)){for(let a=0,l=i.length;a<l;a+=1)a!==o&&i[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:s.sourceAnchor.clone(),targetAnchor:s.targetAnchor.clone(),sourceAnchorDef:ze(this.cell.prop(["source","anchor"])),targetAnchorDef:ze(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!r.stopPropagation){const a=this.normalizeEvent(t),l=this.graph.snapToGrid(a.clientX,a.clientY);s.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e}){const t=this.options,r=this.cellView;t.removeRedundancies&&r.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(e),s=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||r.notifyMouseUp(i,s.x,s.y),r.checkMouseleave(i),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}updateHandle(e,t,r,i=0){const s=this.options.precision||0,o=Math.abs(t.x-r.x)<s,a=Math.abs(t.y-r.y)<s;if(o||a){const l=new F(t,r);if(l.length()<this.options.threshold)e.hide();else{const u=l.getCenter(),h=o?"x":"y";u[h]+=i||0;const f=l.vector().vectorAngle(new P(1,0));e.updatePosition(u.x,u.y,f,this.cellView),e.show(),e.options.axis=h}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends ge{constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=ge.createElement("rect",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(r,i,s,o){const a=o.getClosestPoint(new P(r,i))||new P(r,i);let l=ut().translate(a.x,a.y);if(a.equals({x:r,y:i}))l=l.rotate(s);else{let u=new F(r,i,a.x,a.y).vector().vectorAngle(new P(1,0));u!==0&&(u+=90),l=l.rotate(u)}this.setAttrs({transform:ps(l),cursor:s%180===0?"row-resize":"col-resize"})}onMouseDown(r){this.options.guard(r)||(this.trigger("change",{e:r,handle:this}),r.stopPropagation(),r.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=e})(Wo||(Wo={})),function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new n.Handle(e),anchor:vw})}(Wo||(Wo={}));class Kl extends et.ToolItem{get type(){return this.options.type}onRender(){K(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const r=this.type,i=this.cellView,s=this.options,o=i.getTerminalAnchor(r),a=i.cell.prop([r,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const l=a?s.customAnchorAttrs:s.defaultAnchorAttrs;l&&Object.keys(l).forEach(c=>{t.setAttribute(c,l[c])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const r=this.type,i=this.cellView,s=i.getTerminalView(r);if(s){const o=s.cell,a=i.getTerminalMagnet(r);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let c,u,h;s.isEdgeElement(a)?(c=s.getBBox(),u=0,h=c.getCenter()):(c=s.getUnrotatedBBoxOfElement(a),u=o.getAngle(),h=c.getCenter(),u&&h.rotate(-u,o.getBBox().getCenter())),c.inflate(l),fe(t,{x:-c.width/2,y:-c.height/2,width:c.width,height:c.height,transform:`translate(${h.x}, ${h.y}) rotate(${u})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(e){const t=this.type,r=this.cell;e?r.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):r.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,r=this.cellView,i=r.getTerminalView(t);if(i==null)return;const s=this.normalizeEvent(e),o=i.cell,a=r.getTerminalMagnet(t);let l=this.graph.coord.clientToLocalPoint(s.clientX,s.clientY);const c=this.options.snap;if(typeof c=="function"){const f=Y(c,r,l,i,a,t,r,this);l=P.create(f)}if(this.options.restrictArea)if(i.isEdgeElement(a)){const f=i.getClosestPoint(l);f&&(l=f)}else{const f=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),g=o.getBBox().getCenter(),p=l.clone().rotate(d,g);f.containsPoint(p)||(l=f.getNearestPointToPoint(p).rotate(-d,g))}let u;const h=this.options.anchor;typeof h=="function"&&(u=Y(h,r,l,i,a,t,r,this)),this.resetAnchor(u),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:vw,snap(e,t,r,i,s,o){const a=o.options.snapRadius||0,l=i==="source",c=l?0:-1,u=this.cell.getVertexAt(c)||this.getTerminalAnchor(l?"target":"source");return u&&(Math.abs(u.x-e.x)<a&&(e.x=u.x),Math.abs(u.y-e.y)<a&&(e.y=u.y)),e}})})(Kl||(Kl={}));const O6=Kl.define({name:"source-anchor",type:"source"}),M6=Kl.define({name:"target-anchor",type:"target"});var T6=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Jl extends et.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,r=T6(e,["class"]);this.setAttrs(r,this.container),t&&K(this.container,t)}}onRender(){K(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,r=t.getTangentAtRatio(e),i=r?r.start:t.getPointAtRatio(e),s=r&&r.vector().vectorAngle(new P(1,0))||0;if(!i)return this;const o=ut().translate(i.x,i.y).rotate(s);return ms(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const r=this.graph.snapToGrid(e.clientX,e.clientY),i=t.prepareArrowheadDragging(this.type,{x:r.x,y:r.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,i),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,r.x,r.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.cellView,i=this.graph.snapToGrid(t.clientX,t.clientY);r.onMouseUp(t,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",r.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(Jl||(Jl={}));const _6=Jl.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),N6=Jl.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Cs extends et.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=et.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:e,editor:t}=this;if(!t)return;const{style:r}=t;e.isNode()?this.updateNodeEditorTransform():e.isEdge()&&this.updateEdgeEditorTransform();const{attrs:i}=this.options;r.fontSize=`${i.fontSize}px`,r.fontFamily=i.fontFamily,r.color=i.color,r.backgroundColor=i.backgroundColor;const s=this.getCellText()||"";return t.innerText=s,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:r}=this;if(!r)return;let i=P.create(),s=20,o="",{x:a,y:l}=this.options;const{width:c,height:u}=this.options;if(typeof a!="undefined"&&typeof l!="undefined"){const d=t.getBBox();a=Vt(a,d.width),l=Vt(l,d.height),i=d.topLeft.translate(a,l),s=d.width-a*2}else{const d=t.getBBox();i=d.center,s=d.width-4,o="translate(-50%, -50%)"}const h=e.scale(),{style:f}=r;i=e.localToGraph(i),f.left=`${i.x}px`,f.top=`${i.y}px`,f.transform=`scale(${h.sx}, ${h.sy}) ${o}`,f.minWidth=`${s}px`,typeof c=="number"&&(f.width=`${c}px`),typeof u=="number"&&(f.height=`${u}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let r=P.create(),i=20;const{style:s}=t,o=this.event.target,a=o.parentElement;if(a&&gs(a,this.prefixClassName("edge-label"))){const u=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(u,10);const h=a.getAttribute("transform"),{translation:f}=Vl(h);r=new P(f.tx,f.ty),i=de.getBBox(o).width}else{if(!this.options.labelAddable)return this;r=e.clientToLocal(P.create(this.event.clientX,this.event.clientY));const h=this.cellView.path.closestPointLength(r);this.distance=h,this.labelIndex=-1}r=e.localToGraph(r);const c=e.scale();s.left=`${r.x}px`,s.top=`${r.y}px`,s.minWidth=`${i}px`,s.transform=`scale(${c.sx}, ${c.sy}) translate(-50%, -50%)`}onDocumentMouseUp(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){this.editor||(e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return Y(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){Y(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const r=this.cell;if(this.labelIndex===-1){if(e){const i={position:{distance:this.distance},attrs:{}};hs(i,`attrs/${t}`,e),r.appendLabel(i)}}else e!==null?r.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&r.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}})})(Cs||(Cs={})),function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})}(Cs||(Cs={}));var ww=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Ss;(function(n){n.presets={boundary:Yl,button:jr,"button-remove":jr.Remove,"node-editor":Cs.NodeEditor},n.registry=Ue.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let r=et.ToolItem;const{inherit:i}=t,s=ww(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(Ss||(Ss={}));var Ps;(function(n){n.presets={boundary:Yl,vertices:Uo,segments:Wo,button:jr,"button-remove":jr.Remove,"source-anchor":O6,"target-anchor":M6,"source-arrowhead":_6,"target-arrowhead":N6,"edge-editor":Cs.EdgeEditor},n.registry=Ue.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let r=et.ToolItem;const{inherit:i}=t,s=ww(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(Ps||(Ps={}));const k6=or("center"),I6=or("topCenter"),$6=or("bottomCenter"),L6=or("leftMiddle"),R6=or("rightMiddle"),j6=or("topLeft"),D6=or("topRight"),B6=or("bottomLeft"),z6=or("bottomRight");function or(n){return function(e,t,r,i={}){const s=i.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=s[n];o.x+=Vt(i.dx,s.width),o.y+=Vt(i.dy,s.height);const a=e.cell;return i.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function Ql(n){return function(e,t,r,i){if(r instanceof Element){const s=this.graph.findViewByElem(r);let o;if(s)if(s.isEdgeElement(r)){const a=i.fixedAt!=null?i.fixedAt:"50%";o=xw(s,a)}else o=s.getBBoxOfElement(r).getCenter();else o=new P;return n.call(this,e,t,o,i)}return n.apply(this,arguments)}}function xw(n,e){const t=er(e),r=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(r/100):n.getPointAtLength(r)}const F6=Ql(function(n,e,t,r){const i=n.cell.getAngle(),s=n.getBBoxOfElement(e),o=s.getCenter(),a=s.getTopLeft(),l=s.getBottomRight();let c=r.padding;if(Number.isFinite(c)||(c=0),a.y+c<=t.y&&t.y<=l.y-c){const u=t.y-o.y;o.x+=i===0||i===180?0:u*1/Math.tan(ve.toRad(i)),o.y+=u}else if(a.x+c<=t.x&&t.x<=l.x-c){const u=t.x-o.x;o.y+=i===90||i===270?0:u*Math.tan(ve.toRad(i)),o.x+=u}return o}),V6=function(n,e,t,r,i){const s=n.cell.getConnectionPoint(this.cell,i);return(r.dx||r.dy)&&s.translate(r.dx||0,r.dy||0),s},q6=Ql(function(n,e,t,r){let i,s=0,o;const a=n.cell;r.rotate?(i=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),s=a.getAngle()):i=n.getBBoxOfElement(e);const l=r.padding;l!=null&&Number.isFinite(l)&&i.inflate(l),r.rotate&&t.rotate(s,o);const c=i.getNearestSideToPoint(t);let u;switch(c){case"left":u=i.getLeftMiddle();break;case"right":u=i.getRightMiddle();break;case"top":u=i.getTopCenter();break;case"bottom":u=i.getBottomCenter();break}const h=r.direction;return h==="H"?(c==="top"||c==="bottom")&&(t.x<=i.x+i.width?u=i.getLeftMiddle():u=i.getRightMiddle()):h==="V"&&(t.y<=i.y+i.height?u=i.getTopCenter():u=i.getBottomCenter()),r.rotate?u.rotate(-s,o):u}),G6=Object.freeze(Object.defineProperty({__proto__:null,bottom:$6,bottomLeft:B6,bottomRight:z6,center:k6,left:L6,midSide:q6,nodeCenter:V6,orth:F6,right:R6,top:I6,topLeft:j6,topRight:D6},Symbol.toStringTag,{value:"Module"}));var Es;(function(n){n.presets=G6,n.registry=Ue.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(Es||(Es={}));const H6=function(n,e,t,r){let i=r.ratio!=null?r.ratio:.5;return i>1&&(i/=100),n.getPointAtRatio(i)},U6=function(n,e,t,r){const i=r.length!=null?r.length:20;return n.getPointAtLength(i)},Cw=function(n,e,t,r){const i=n.getClosestPoint(t);return i!=null?i:new P},W6=Ql(Cw),X6=Ql(function(n,e,t,r){const s=n.getConnection(),o=n.getConnectionSubdivisions(),a=new F(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),l=new F(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),c=a.intersect(s,{segmentSubdivisions:o}),u=l.intersect(s,{segmentSubdivisions:o}),h=[];return c&&h.push(...c),u&&h.push(...u),h.length>0?t.closest(h):r.fallbackAt!=null?xw(n,r.fallbackAt):Y(Cw,this,n,e,t,r)}),Y6=Object.freeze(Object.defineProperty({__proto__:null,closest:W6,length:U6,orth:X6,ratio:H6},Symbol.toStringTag,{value:"Module"}));var As;(function(n){n.presets=Y6,n.registry=Ue.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(As||(As={}));function Zl(n,e,t){let r;if(typeof t=="object"){if(Number.isFinite(t.y)){const s=new F(e,n),{start:o,end:a}=s.parallel(t.y);e=o,n=a}r=t.x}else r=t;if(r==null||!Number.isFinite(r))return n;const i=n.distance(e);return r===0&&i>0?n:n.move(e,-Math.min(r,i-1))}function ec(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function K6(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const Sw=function(n,e,t,r){const i=e.getBBoxOfElement(t);r.stroked&&i.inflate(ec(t)/2);const s=n.intersect(i),o=s&&s.length?n.start.closest(s):n.end;return Zl(o,n.start,r.offset)},J6=function(n,e,t,r,i){const s=e.cell,o=s.isNode()?s.getAngle():0;if(o===0)return Y(Sw,this,n,e,t,r,i);const a=e.getUnrotatedBBoxOfElement(t);r.stroked&&a.inflate(ec(t)/2);const l=a.getCenter(),c=n.clone().rotate(o,l),u=c.setLength(1e6).intersect(a),h=u&&u.length?c.start.closest(u).rotate(-o,l):n.end;return Zl(h,n.start,r.offset)},Q6=function(n,e,t,r){let i,s;const o=n.end,a=r.selector;if(typeof a=="string"?i=e.findOne(a):Array.isArray(a)?i=Bh(t,a):i=K6(t),!Mr(i)){if(i===t||!Mr(t))return o;i=t}const l=e.getShapeOfElement(i),c=e.getMatrixOfElement(i),u=e.getRootTranslatedMatrix(),h=e.getRootRotatedMatrix(),f=u.multiply(h).multiply(c),d=f.inverse(),g=de.transformLine(n,d),p=g.start.clone(),b=e.getDataOfElement(i);if(r.insideout===!1){b.shapeBBox==null&&(b.shapeBBox=l.bbox());const w=b.shapeBBox;if(w!=null&&w.containsPoint(p))return o}r.extrapolate===!0&&g.setLength(1e6);let m;if(X.isPath(l)){const w=r.precision||2;b.segmentSubdivisions==null&&(b.segmentSubdivisions=l.getSegmentSubdivisions({precision:w})),m={precision:w,segmentSubdivisions:b.segmentSubdivisions},s=g.intersect(l,m)}else s=g.intersect(l);s?Array.isArray(s)&&(s=p.closest(s)):r.sticky===!0&&(D.isRectangle(l)?s=l.getNearestPointToPoint(p):xn.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(p):s=l.closestPoint(p,m));const v=s?de.transformPoint(s,f):o;let y=r.offset||0;return r.stroked!==!1&&(typeof y=="object"?(y=Object.assign({},y),y.x==null&&(y.x=0),y.x+=ec(i)/2):y+=ec(i)/2),Zl(v,n.start,y)};function Z6(n,e,t=0){const{start:r,end:i}=n;let s,o,a,l;switch(e){case"left":l="x",s=i,o=r,a=-1;break;case"right":l="x",s=r,o=i,a=1;break;case"top":l="y",s=i,o=r,a=-1;break;case"bottom":l="y",s=r,o=i,a=1;break;default:return}r[l]<i[l]?s[l]=o[l]:o[l]=s[l],Number.isFinite(t)&&(s[l]+=a*t,o[l]+=a*t)}const e5=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,r){const{alignOffset:i,align:s}=r;return s&&Z6(n,s,i),Zl(n.end,n.start,r.offset)},bbox:Sw,boundary:Q6,rect:J6},Symbol.toStringTag,{value:"Module"}));var Os;(function(n){n.presets=e5,n.registry=Ue.create({type:"connection point"}),n.registry.register(n.presets,!0)})(Os||(Os={}));const t5=function(n){return[...n]},n5=function(n,e,t){const r=e.side||"bottom",i=Bn(e.padding||40),s=t.sourceBBox,o=t.targetBBox,a=s.getCenter(),l=o.getCenter();let c,u,h;switch(r){case"top":h=-1,c="y",u="height";break;case"left":h=-1,c="x",u="width";break;case"right":h=1,c="x",u="width";break;case"bottom":default:h=1,c="y",u="height";break}return a[c]+=h*(s[u]/2+i[r]),l[c]+=h*(o[u]/2+i[r]),h*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...n,l.toJSON()]};function tc(n){return new D(n.x,n.y,0,0)}function nc(n={}){const e=Bn(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Pw(n,e={}){return n.sourceBBox.clone().moveAndExpand(nc(e))}function Ew(n,e={}){return n.targetBBox.clone().moveAndExpand(nc(e))}function r5(n,e={}){return n.sourceAnchor?n.sourceAnchor:Pw(n,e).getCenter()}function i5(n,e={}){return n.targetAnchor?n.targetAnchor:Ew(n,e).getCenter()}const Aw=function(n,e,t){let r=Pw(t,e),i=Ew(t,e);const s=r5(t,e),o=i5(t,e);r=r.union(tc(s)),i=i.union(tc(o));const a=n.map(u=>P.create(u));a.unshift(s),a.push(o);let l=null;const c=[];for(let u=0,h=a.length-1;u<h;u+=1){let f=null;const d=a[u],g=a[u+1],p=an.getBearing(d,g)!=null;if(u===0)u+1===h?r.intersectsWithRect(i.clone().inflate(1))?f=an.insideNode(d,g,r,i):p||(f=an.nodeToNode(d,g,r,i)):r.containsPoint(g)?f=an.insideNode(d,g,r,tc(g).moveAndExpand(nc(e))):p||(f=an.nodeToVertex(d,g,r));else if(u+1===h){const b=p&&an.getBearing(g,d)===l;i.containsPoint(d)||b?f=an.insideNode(d,g,tc(d).moveAndExpand(nc(e)),i,l):p||(f=an.vertexToNode(d,g,i,l))}else p||(f=an.vertexToVertex(d,g,l));f?(c.push(...f.points),l=f.direction):l=an.getBearing(d,g),u+1<h&&c.push(g)}return c};var an;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function r(h,f,d){let g=new P(h.x,f.y);return d.containsPoint(g)&&(g=new P(f.x,h.y)),g}function i(h,f){return h[f==="W"||f==="E"?"width":"height"]}n.getBBoxSize=i;function s(h,f){return h.x===f.x?h.y>f.y?"N":"S":h.y===f.y?h.x>f.x?"W":"E":null}n.getBearing=s;function o(h,f,d){const g=new P(h.x,f.y),p=new P(f.x,h.y),b=s(h,g),m=s(h,p),v=d?e[d]:null,y=b===d||b!==v&&(m===v||m!==d)?g:p;return{points:[y],direction:s(y,f)}}n.vertexToVertex=o;function a(h,f,d){const g=r(h,f,d);return{points:[g],direction:s(g,f)}}n.nodeToVertex=a;function l(h,f,d,g){const p=[new P(h.x,f.y),new P(f.x,h.y)],b=p.filter(y=>!d.containsPoint(y)),m=b.filter(y=>s(y,h)!==g);let v;if(m.length>0)return v=m.filter(y=>s(h,y)===g).pop(),v=v||m[0],{points:[v],direction:s(v,f)};{v=NF(p,b)[0];const y=P.create(f).move(v,-i(d,g)/2);return{points:[r(y,h,d),y],direction:s(y,f)}}}n.vertexToNode=l;function c(h,f,d,g){let p=a(f,h,g);const b=p.points[0];if(d.containsPoint(b)){p=a(h,f,d);const m=p.points[0];if(g.containsPoint(m)){const v=P.create(h).move(m,-i(d,s(h,m))/2),y=P.create(f).move(b,-i(g,s(f,b))/2),w=new F(v,y).getCenter(),x=a(h,w,d),C=o(w,f,x.direction);p.points=[x.points[0],C.points[0]],p.direction=C.direction}}return p}n.nodeToNode=c;function u(h,f,d,g,p){const b=d.union(g).inflate(1),m=b.getCenter(),v=m.distance(f)>m.distance(h),y=v?f:h,w=v?h:f;let x,C,S;p?(x=P.fromPolar(b.width+b.height,t[p],y),x=b.getNearestPointToPoint(x).move(x,-1)):x=b.getNearestPointToPoint(y).move(y,1),C=r(x,w,b);let E;x.round().equals(C.round())?(C=P.fromPolar(b.width+b.height,ve.toRad(x.theta(y))+Math.PI/2,w),C=b.getNearestPointToPoint(C).move(w,1).round(),S=r(x,C,b),E=v?[C,S,x]:[x,S,C]):E=v?[C,x]:[x,C];const A=s(v?x:C,f);return{points:E,direction:A}}n.insideNode=u})(an||(an={}));const s5={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Dr(this.step,this)},directions(){const n=Dr(this.step,this),e=Dr(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=Dr(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Dr(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:Aw,draggingRouter:null,snapToGrid:!0};function Dr(n,e){return typeof n=="function"?n.call(e):n}function o5(n){const e=Object.keys(n).reduce((t,r)=>{const i=t;return r==="fallbackRouter"||r==="draggingRouter"||r==="fallbackRoute"?i[r]=n[r]:i[r]=Dr(n[r],n),t},{});if(e.padding){const t=Bn(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const r=new P(0,0),i=new P(t.offsetX,t.offsetY);t.angle=ve.normalize(r.theta(i))}),e}const Ow=1,Mw=2;class a5{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=Ow,this.values[e]=t;const r=sV(this.items,e,i=>this.values[i]);this.items.splice(r,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Mw),e}isOpen(e){return this.hash[e]===Ow}isClose(e){return this.hash[e]===Mw}isEmpty(){return this.items.length===0}}class l5{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const r=this.options,i=r.excludeTerminals.reduce((c,u)=>{const h=t[u];if(h){const f=e.getCell(h.cell);f&&c.push(f)}return c},[]);let s=[];const o=e.getCell(t.getSourceCellId());o&&(s=Db(s,o.getAncestors().map(c=>c.id)));const a=e.getCell(t.getTargetCellId());a&&(s=Db(s,a.getAncestors().map(c=>c.id)));const l=this.mapGridSize;return e.getNodes().reduce((c,u)=>{const h=i.some(b=>b.id===u.id),f=u.shape?r.excludeShapes.includes(u.shape):!1,d=r.excludeNodes.some(b=>typeof b=="string"?u.id===b:b===u),g=s.includes(u.id),p=f||h||d||g;if(u.isVisible()&&!p){const b=u.getBBox().moveAndExpand(r.paddingBox),m=b.getOrigin().snapToGrid(l),v=b.getCorner().snapToGrid(l);for(let y=m.x;y<=v.x;y+=l)for(let w=m.y;w<=v.y;w+=l){const x=new P(y,w).toString();c[x]==null&&(c[x]=[]),c[x].push(b)}}return c},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),r=this.map[t];return r?r.every(i=>!i.containsPoint(e)):!0}}function Tw(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function _w(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Nw(n,e){return n.sourceAnchor?n.sourceAnchor:Tw(n,e).getCenter()}function c5(n,e){return n.targetAnchor?n.targetAnchor:_w(n,e).getCenter()}function gf(n,e,t,r,i){const s=360/t,o=n.theta(u5(n,e,r,i)),a=ve.normalize(o+s/2);return s*Math.floor(a/s)}function u5(n,e,t,r){const i=r.step,s=e.x-n.x,o=e.y-n.y,a=s/t.x,l=o/t.y,c=a*i,u=l*i;return new P(n.x+c,n.y+u)}function kw(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function h5(n,e){const t=e.step;return e.directions.forEach(r=>{r.gridOffsetX=r.offsetX/t*n.x,r.gridOffsetY=r.offsetY/t*n.y}),e.directions}function f5(n,e,t){return{source:e.clone(),x:Iw(t.x-e.x,n),y:Iw(t.y-e.y,n)}}function Iw(n,e){if(!n)return e;const t=Math.abs(n),r=Math.round(t/e);if(!r)return t;const i=r*e,o=(t-i)/r;return e+o}function d5(n,e){const t=e.source,r=we.snapToGrid(n.x-t.x,e.x)+t.x,i=we.snapToGrid(n.y-t.y,e.y)+t.y;return new P(r,i)}function Xo(n,e){return n.round(e)}function rc(n,e,t){return Xo(d5(n.clone(),e),t)}function Yo(n){return n.toString()}function pf(n){return new P(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function $w(n,e){let t=1/0;for(let r=0,i=e.length;r<i;r+=1){const s=n.manhattanDistance(e[r]);s<t&&(t=s)}return t}function Lw(n,e,t,r,i){const s=i.precision,o=i.directionMap,a=n.diff(e.getCenter()),l=Object.keys(o).reduce((c,u)=>{if(t.includes(u)){const h=o[u],f=new P(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new F(n,f).intersect(e)||[];let p,b=null;for(let m=0;m<g.length;m+=1){const v=g[m],y=n.squaredDistance(v);(p==null||y>p)&&(p=y,b=v)}if(b){let m=rc(b,r,s);e.containsPoint(m)&&(m=rc(m.translate(h.x*r.x,h.y*r.y),r,s)),c.push(m)}}return c},[]);return e.containsPoint(n)||l.push(rc(n,r,s)),l}function g5(n,e,t,r,i){const s=[];let o=pf(i.diff(t)),a=Yo(t),l=n[a],c;for(;l;){c=e[a];const f=pf(c.diff(l));f.equals(o)||(s.unshift(c),o=f),a=Yo(l),l=n[a]}const u=e[a];return pf(u.diff(r)).equals(o)||s.unshift(u),s}function p5(n,e,t,r,i){const s=i.precision;let o,a;D.isRectangle(e)?o=Xo(Nw(n,i).clone(),s):o=Xo(e.clone(),s),D.isRectangle(t)?a=Xo(c5(n,i).clone(),s):a=Xo(t.clone(),s);const l=f5(i.step,o,a),c=o,u=a;let h,f;if(D.isRectangle(e)?h=Lw(c,e,i.startDirections,l,i):h=[c],D.isRectangle(t)?f=Lw(a,t,i.endDirections,l,i):f=[u],h=h.filter(d=>r.isAccessible(d)),f=f.filter(d=>r.isAccessible(d)),h.length>0&&f.length>0){const d=new a5,g={},p={},b={};for(let M=0,O=h.length;M<O;M+=1){const I=h[M],q=Yo(I);d.add(q,$w(I,f)),g[q]=I,b[q]=0}const m=i.previousDirectionAngle,v=m===void 0;let y,w;const x=h5(l,i),C=x.length,S=f.reduce((M,O)=>{const I=Yo(O);return M.push(I),M},[]),E=P.equalPoints(h,f);let A=i.maxLoopCount;for(;!d.isEmpty()&&A>0;){const M=d.pop(),O=g[M],I=p[M],q=b[M],U=O.equals(c),T=I==null;let k;if(T?v?U?k=null:k=gf(c,O,C,l,i):k=m:k=gf(I,O,C,l,i),!(T&&E)&&S.indexOf(M)>=0)return i.previousDirectionAngle=k,g5(p,g,O,c,u);for(let j=0;j<C;j+=1){y=x[j];const z=y.angle;if(w=kw(k,z),!(v&&U)&&w>i.maxDirectionChange)continue;const H=rc(O.clone().translate(y.gridOffsetX||0,y.gridOffsetY||0),l,s),te=Yo(H);if(d.isClose(te)||!r.isAccessible(H))continue;if(S.indexOf(te)>=0&&!H.equals(u)){const Ke=gf(H,u,C,l,i);if(kw(z,Ke)>i.maxDirectionChange)continue}const _e=y.cost,In=U?0:i.penalties[w],rt=q+_e+In;(!d.isOpen(te)||rt<b[te])&&(g[te]=H,p[te]=O,b[te]=rt,d.add(te,rt+$w(H,f)))}A-=1}}return i.fallbackRoute?Y(i.fallbackRoute,this,c,u,i):null}function m5(n,e=10){if(n.length<=1)return n;for(let t=0,r=n.length;t<r-1;t+=1){const i=n[t],s=n[t+1];if(i.x===s.x){const o=e*Math.round(i.x/e);i.x!==o&&(i.x=o,s.x=o)}else if(i.y===s.y){const o=e*Math.round(i.y/e);i.y!==o&&(i.y=o,s.y=o)}}return n}const y5=function(n,e,t){const r=o5(e),i=Tw(t,r),s=_w(t,r),o=Nw(t,r),a=new l5(r).build(t.graph.model,t.cell),l=n.map(d=>P.create(d)),c=[];let u=o,h,f;for(let d=0,g=l.length;d<=g;d+=1){let p=null;if(h=f||i,f=l[d],f==null){f=s;const m=t.cell;if((m.getSourceCellId()==null||m.getTargetCellId()==null)&&typeof r.draggingRouter=="function"){const y=h===i?o:h,w=f.getOrigin();p=Y(r.draggingRouter,t,y,w,r)}}if(p==null&&(p=p5(t,h,f,a,r)),p===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),Y(r.fallbackRouter,this,n,r,t);const b=p[0];b&&b.equals(u)&&p.shift(),u=p[p.length-1]||u,c.push(...p)}return r.snapToGrid?m5(c,t.graph.grid.getGridSize()):c},Rw=function(n,e,t){return Y(y5,this,n,Object.assign(Object.assign({},s5),e),t)},v5={maxDirectionChange:45,directions(){const n=Dr(this.step,this),e=Dr(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const r=n.theta(e),i=[];let s={x:e.x,y:n.y},o={x:n.x,y:e.y};if(r%180>90){const y=s;s=o,o=y}const a=r%90<45?s:o,l=new F(n,a),c=90*Math.ceil(r/90),u=P.fromPolar(l.squaredLength(),ve.toRad(c+135),a),h=new F(e,u),f=l.intersectsWithLine(h),d=f||e,g=f?d:n,p=360/t.directions.length,b=g.theta(e),m=ve.normalize(b+p/2),v=p*Math.floor(m/p);return t.previousDirectionAngle=v,d&&i.push(d.round()),i.push(e),i}},b5=function(n,e,t){return Y(Rw,this,n,Object.assign(Object.assign({},v5),e),t)},w5=function(n,e,t){const r=e.offset||32,i=e.min==null?16:e.min;let s=0,o=e.direction;const a=t.sourceBBox,l=t.targetBBox,c=a.getCenter(),u=l.getCenter();if(typeof r=="number"&&(s=r),o==null){let m=l.left-a.right,v=l.top-a.bottom;m>=0&&v>=0?o=m>=v?"L":"T":m<=0&&v>=0?(m=a.left-l.right,m>=0?o=m>=v?"R":"T":o="T"):m>=0&&v<=0?(v=a.top-l.bottom,v>=0?o=m>=v?"L":"B":o="L"):(m=a.left-l.right,v=a.top-l.bottom,m>=0&&v>=0?o=m>=v?"R":"B":m<=0&&v>=0?o="B":m>=0&&v<=0?o="R":o=Math.abs(m)>Math.abs(v)?"R":"B")}o==="H"?o=u.x-c.x>=0?"L":"R":o==="V"&&(o=u.y-c.y>=0?"T":"B"),r==="center"&&(o==="L"?s=(l.left-a.right)/2:o==="R"?s=(a.left-l.right)/2:o==="T"?s=(l.top-a.bottom)/2:o==="B"&&(s=(a.top-l.bottom)/2));let h,f,d;const g=o==="L"||o==="R";if(g){if(u.y===c.y)return[...n];d=o==="L"?1:-1,h="x",f="width"}else{if(u.x===c.x)return[...n];d=o==="T"?1:-1,h="y",f="height"}const p=c.clone(),b=u.clone();if(p[h]+=d*(a[f]/2+s),b[h]-=d*(l[f]/2+s),g){const m=p.x,v=b.x,y=a.width/2+i,w=l.width/2+i;u.x>c.x?v<=m&&(p.x=Math.max(v,c.x+y),b.x=Math.min(m,u.x-w)):v>=m&&(p.x=Math.min(v,c.x-y),b.x=Math.max(m,u.x+w))}else{const m=p.y,v=b.y,y=a.height/2+i,w=l.height/2+i;u.y>c.y?v<=m&&(p.y=Math.max(v,c.y+y),b.y=Math.min(m,u.y-w)):v>=m&&(p.y=Math.min(v,c.y-y),b.y=Math.max(m,u.y+w))}return[p.toJSON(),...n,b.toJSON()]};function Ms(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const r=P.create(n[1]).move(n[2],t),i=P.create(n[1]).move(n[0],t);return[r.toJSON(),...n,i.toJSON()]}{const r=n[1];return[Object.assign({},r),...n,Object.assign({},r)]}}return n}const x5=Object.freeze(Object.defineProperty({__proto__:null,er:w5,loop:function(n,e,t){const r=e.width||50,s=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,l=t.targetAnchor,c=t.sourceBBox,u=t.targetBBox;if(a.equals(l)){const h=m=>{const v=ve.toRad(m),y=Math.sin(v),w=Math.cos(v),x=new P(a.x+w*r,a.y+y*r),C=new P(x.x-w*s,x.y-y*s),S=C.clone().rotate(-90,x),E=C.clone().rotate(90,x);return[S.toJSON(),x.toJSON(),E.toJSON()]},f=m=>{const v=a.clone().move(m,-1),y=new F(v,m);return!c.containsPoint(m)&&!c.intersectsWithLine(y)},d=[0,90,180,270,45,135,225,315];if(typeof o=="number")return Ms(h(o),e.merge);const g=c.getCenter();if(g.equals(a))return Ms(h(0),e.merge);const p=g.angleBetween(a,g.clone().translate(1,0));let b=h(p);if(f(b[1]))return Ms(b,e.merge);for(let m=1,v=d.length;m<v;m+=1)if(b=h(p+d[m]),f(b[1]))return Ms(b,e.merge);return Ms(b,e.merge)}{const h=new F(a,l);let f=h.parallel(-r),d=f.getCenter(),g=f.start.clone().move(f.end,s),p=f.end.clone().move(f.start,s);const b=h.parallel(-1),m=new F(b.start,d),v=new F(b.end,d);if((c.containsPoint(d)||u.containsPoint(d)||c.intersectsWithLine(m)||c.intersectsWithLine(v)||u.intersectsWithLine(m)||u.intersectsWithLine(v))&&(f=h.parallel(r),d=f.getCenter(),g=f.start.clone().move(f.end,s),p=f.end.clone().move(f.start,s)),e.merge){const y=new F(a,l),w=new F(d,y.center).setLength(Number.MAX_SAFE_INTEGER),x=c.intersectsWithLine(w),C=u.intersectsWithLine(w),S=x?Array.isArray(x)?x:[x]:[];C&&(Array.isArray(C)?S.push(...C):S.push(C));const E=y.center.closest(S);E?(t.sourceAnchor=E.clone(),t.targetAnchor=E.clone()):(t.sourceAnchor=y.center.clone(),t.targetAnchor=y.center.clone())}return Ms([g.toJSON(),d.toJSON(),p.toJSON()],e.merge)}},manhattan:Rw,metro:b5,normal:t5,oneSide:n5,orth:Aw},Symbol.toStringTag,{value:"Module"}));var Br;(function(n){n.presets=x5,n.registry=Ue.create({type:"router"}),n.registry.register(n.presets,!0)})(Br||(Br={}));const C5=function(n,e,t,r={}){const i=[n,...t,e],s=new He(i),o=new X(s);return r.raw?o:o.serialize()},S5=function(n,e,t,r={}){const i=t.length===3?0:1,s=P.create(t[0+i]),o=P.create(t[2+i]),a=P.create(t[1+i]);if(!P.equals(n,e)){const c=new P((n.x+e.x)/2,(n.y+e.y)/2),u=c.angleBetween(P.create(n).rotate(90,c),a);u>1&&(s.rotate(180-u,c),o.rotate(180-u,c),a.rotate(180-u,c))}const l=`
92
+ M ${n.x} ${n.y}
93
+ Q ${s.x} ${s.y} ${a.x} ${a.y}
94
+ Q ${o.x} ${o.y} ${e.x} ${e.y}
95
+ `;return r.raw?X.parse(l):l},P5=function(n,e,t,r={}){const i=new X;i.appendSegment(X.createSegment("M",n));const s=1/3,o=2/3,a=r.radius||10;let l,c;for(let u=0,h=t.length;u<h;u+=1){const f=P.create(t[u]),d=t[u-1]||n,g=t[u+1]||e;l=c||f.distance(d)/2,c=f.distance(g)/2;const p=-Math.min(a,l),b=-Math.min(a,c),m=f.clone().move(d,p).round(),v=f.clone().move(g,b).round(),y=new P(s*m.x+o*f.x,o*f.y+s*m.y),w=new P(s*v.x+o*f.x,o*f.y+s*v.y);i.appendSegment(X.createSegment("L",m)),i.appendSegment(X.createSegment("C",y,w,v))}return i.appendSegment(X.createSegment("L",e)),r.raw?i:i.serialize()},E5=function(n,e,t,r={}){let i,s=r.direction;if(t&&t.length!==0){const o=[n,...t,e],a=Fe.throughPoints(o);i=new X(a)}else if(i=new X,i.appendSegment(X.createSegment("M",n)),s||(s=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),s==="H"){const o=(n.x+e.x)/2;i.appendSegment(X.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;i.appendSegment(X.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return r.raw?i:i.serialize()},jw=1,ic=1/3,sc=2/3;function A5(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let r=0;r<t.length;r+=1)t[r].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function mf(n,e,t=[]){const r=[n,...t,e],i=[];return r.forEach((s,o)=>{const a=r[o+1];a!=null&&i.push(new F(s,a))}),i}function O5(n,e){const t=[];return e.forEach(r=>{const i=n.intersectsWithLine(r);i&&t.push(i)}),t}function Dw(n,e){return new F(n,e).squaredLength()}function M5(n,e,t){return e.reduce((r,i,s)=>{if(oc.includes(i))return r;const o=r.pop()||n,a=P.create(i).move(o.start,-t);let l=P.create(i).move(o.start,+t);const c=e[s+1];if(c!=null){const f=l.distance(c);f<=t&&(l=c.move(o.start,f),oc.push(c))}else if(a.distance(o.end)<t*2+jw)return r.push(o),r;if(l.distance(o.start)<t*2+jw)return r.push(o),r;const h=new F(a,l);return Ko.push(h),r.push(new F(o.start,a),h,new F(l,o.end)),r},[])}function Bw(n,e,t,r){const i=new X;let s;return s=X.createSegment("M",n[0].start),i.appendSegment(s),n.forEach((o,a)=>{if(Ko.includes(o)){let l,c,u,h;if(t==="arc"){l=-90,c=o.start.diff(o.end),(c.x<0||c.x===0&&c.y<0)&&(l+=180);const d=o.getCenter(),g=new F(d,o.end).rotate(l,d);let p;p=new F(o.start,d),u=p.pointAt(2/3).rotate(l,o.start),h=g.pointAt(1/3).rotate(-l,g.end),s=X.createSegment("C",u,h,g.end),i.appendSegment(s),p=new F(d,o.end),u=g.pointAt(1/3).rotate(l,g.end),h=p.pointAt(1/3).rotate(-l,o.end),s=X.createSegment("C",u,h,o.end),i.appendSegment(s)}else if(t==="gap")s=X.createSegment("M",o.end),i.appendSegment(s);else if(t==="cubic"){l=o.start.theta(o.end);const f=e*.6;let d=e*1.35;c=o.start.diff(o.end),(c.x<0||c.x===0&&c.y<0)&&(d*=-1),u=new P(o.start.x+f,o.start.y+d).rotate(l,o.start),h=new P(o.end.x-f,o.end.y+d).rotate(l,o.end),s=X.createSegment("C",u,h,o.end),i.appendSegment(s)}}else{const l=n[a+1];r===0||!l||Ko.includes(l)?(s=X.createSegment("L",o.end),i.appendSegment(s)):T5(r,i,o.end,o.start,l.end)}}),i}function T5(n,e,t,r,i){const s=t.distance(r)/2,o=t.distance(i)/2,a=-Math.min(n,s),l=-Math.min(n,o),c=t.clone().move(r,a).round(),u=t.clone().move(i,l).round(),h=new P(ic*c.x+sc*t.x,sc*t.y+ic*c.y),f=new P(ic*u.x+sc*t.x,sc*t.y+ic*u.y);let d;d=X.createSegment("L",c),e.appendSegment(d),d=X.createSegment("C",h,f,u),e.appendSegment(d)}let Ko,oc;const _5=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,r={}){Ko=[],oc=[],A5(this);const i=r.size||5,s=r.type||"arc",o=r.radius||0,a=r.ignoreConnectors||["smooth"],l=this.graph,u=l.model.getEdges();if(u.length===1)return Bw(mf(n,e,t),i,s,o);const h=this.cell,f=u.indexOf(h),d=l.options.connecting.connector||{},g=u.filter((w,x)=>{const C=w.getConnector()||d;return a.includes(C.name)?!1:x>f?C.name!=="jumpover":!0}),p=g.map(w=>l.findViewByCell(w)),b=mf(n,e,t),m=p.map(w=>w==null?[]:w===this?b:mf(w.sourcePoint,w.targetPoint,w.routePoints)),v=[];b.forEach(w=>{const x=g.reduce((C,S,E)=>{if(S!==h){const A=O5(w,m[E]);C.push(...A)}return C},[]).sort((C,S)=>Dw(w.start,C)-Dw(w.start,S));x.length>0?v.push(...M5(w,x,i)):v.push(w)});const y=Bw(v,i,s,o);return Ko=[],oc=[],r.raw?y:y.serialize()},loop:S5,normal:C5,rounded:P5,smooth:E5},Symbol.toStringTag,{value:"Module"}));var Oi;(function(n){n.presets=_5,n.registry=Ue.create({type:"connector"}),n.registry.register(n.presets,!0)})(Oi||(Oi={}));var N5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class zw extends pt{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ze(e)),this.changed={}}mutate(e,t={}){const r=t.unset===!0,i=t.silent===!0,s=[],o=this.changing;this.changing=!0,o||(this.previous=ze(this.data),this.changed={});const a=this.data,l=this.previous,c=this.changed;if(Object.keys(e).forEach(u=>{const h=u,f=e[h];Zn(a[h],f)||s.push(h),Zn(l[h],f)?delete c[h]:c[h]=f,r?delete a[h]:a[h]=f}),!i&&s.length>0&&(this.pending=!0,this.pendingOptions=t,s.forEach(u=>{this.emit("change:*",{key:u,options:t,store:this,current:a[u],previous:l[u]})})),o)return this;if(!i)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const r=this.data[e];return r==null?t:r}getPrevious(e){if(this.previous){const t=this.previous[e];return t==null?void 0:t}}set(e,t,r){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},r)),this}remove(e,t){const i={};let s;if(typeof e=="string")i[e]=void 0,s=t;else if(Array.isArray(e))e.forEach(o=>i[o]=void 0),s=t;else{for(const o in this.data)i[o]=void 0;s=e}return this.mutate(i,Object.assign(Object.assign({},s),{unset:!0})),this}getByPath(e){return Bh(this.data,e,"/")}setByPath(e,t,r={}){const i="/",s=Array.isArray(e)?[...e]:e.split(i),o=Array.isArray(e)?e.join(i):e,a=s[0],l=s.length;if(r.propertyPath=o,r.propertyValue=t,r.propertyPathArray=s,l===1)this.set(a,t,r);else{const c={};let u=c,h=a;for(let g=1;g<l;g+=1){const p=s[g],b=Number.isFinite(Number(p));u=u[h]=b?[]:{},h=p}hs(c,s,t,i);const f=ze(this.data);r.rewrite&&Gb(f,e,i);const d=Ie(f,c);this.set(a,d[a],r)}return this}removeByPath(e,t){const r=Array.isArray(e)?e:e.split("/"),i=r[0];if(r.length===1)this.remove(i,t);else{const s=r.slice(1),o=ze(this.get(i));o&&Gb(o,s),this.set(i,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?ze(this.changed):null;const t=this.changing?this.previous:this.data,r={};let i;for(const s in e){const o=e[s];Zn(t[s],o)||(r[s]=o,i=!0)}return i?ze(r):null}toJSON(){return ze(this.data)}clone(){const e=this.constructor;return new e(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}N5([pt.dispose()],zw.prototype,"dispose",null);class Jo{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,r={},i="/"){const s=this.cell.getPropByPath(e),o=EF(r,Jo.defaultOptions),a=this.getTiming(o.timing),l=this.getInterp(o.interp,s,t);let c=0;const u=Array.isArray(e)?e.join(i):e,h=Array.isArray(e)?e:e.split(i),f=()=>{const d=new Date().getTime();c===0&&(c=d);let p=(d-c)/o.duration;p<1?this.ids[u]=requestAnimationFrame(f):p=1;const b=l(a(p));this.cell.setPropByPath(h,b),r.progress&&r.progress(Object.assign({progress:p,currentValue:b},this.getArgs(u))),p===1&&(this.cell.notify("transition:complete",this.getArgs(u)),r.complete&&r.complete(this.getArgs(u)),this.cell.notify("transition:finish",this.getArgs(u)),r.finish&&r.finish(this.getArgs(u)),this.clean(u))};return setTimeout(()=>{this.stop(e,void 0,i),this.cache[u]={startValue:s,targetValue:t,options:o},this.ids[u]=requestAnimationFrame(f),this.cell.notify("transition:start",this.getArgs(u)),r.start&&r.start(this.getArgs(u))},r.delay),this.stop.bind(this,e,i,r)}stop(e,t={},r="/"){const i=Array.isArray(e)?e:e.split(r);return Object.keys(this.ids).filter(s=>Zn(i,s.split(r).slice(0,i.length))).forEach(s=>{cancelAnimationFrame(this.ids[s]);const o=this.cache[s],a=this.getArgs(s),l=Object.assign(Object.assign({},o.options),t),c=l.jumpedToEnd;c&&o.targetValue!=null&&(this.cell.setPropByPath(s,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),l.complete&&l.complete(Object.assign({},a)));const u=Object.assign({jumpedToEnd:c},a);this.cell.notify("transition:stop",Object.assign({},u)),l.stop&&l.stop(Object.assign({},u)),this.cell.notify("transition:finish",Object.assign({},a)),l.finish&&l.finish(Object.assign({},a)),this.clean(s)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?Pi[e]:e}getInterp(e,t,r){return e?e(t,r):typeof r=="number"?Ei.number(t,r):typeof r=="string"?r[0]==="#"?Ei.color(t,r):Ei.unit(t,r):Ei.object(t,r)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(Jo||(Jo={}));var k5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Fw=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class le extends pt{static config(e){const{markup:t,propHooks:r,attrHooks:i}=e,s=Fw(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),r&&(this.propHooks=this.propHooks.slice(),Array.isArray(r)?this.propHooks.push(...r):typeof r=="function"?this.propHooks.push(r):Object.values(r).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=Ie({},this.defaults,s)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:ze(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((r,i)=>i?Y(i,e,r):r,t)}get[Symbol.toStringTag](){return le.toStringTag}constructor(e={}){super();const r=this.constructor.getDefaults(!0),i=Ie({},this.preprocess(r),this.preprocess(e));this.id=i.id||Il(),this.store=new zw(i),this.animation=new Jo(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const r=e.id,s=this.constructor.applyPropHooks(this,e);return r==null&&t!==!0&&(s.id=Il()),s}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:r,previous:i,options:s}=e;this.notify("change:*",{key:t,options:s,current:r,previous:i,cell:this}),this.notify(`change:${t}`,{options:s,current:r,previous:i,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:r,previous:i,options:s,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const r=this.model;return r&&(r.notify(`cell:${e}`,t),this.isNode()?r.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&r.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,r){if(typeof e=="string")this.store.set(e,t,r);else{const i=this.preprocess(e,!0);this.store.set(Ie({},this.getProp(),i),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,r={}){return this.model&&(e==="children"?this._children=t?t.map(i=>this.model.getCell(i)).filter(i=>i!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,r),this}removePropByPath(e,t={}){const r=Array.isArray(e)?e:e.split("/");return r[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(r,t),this}prop(e,t,r){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,r||{}):this.setPropByPath(e,t,r||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let r=t.getMaxZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this],r=r-i.length+1;const s=t.total();let o=t.indexOf(this)!==s-i.length;o||(o=i.some((a,l)=>a.getZIndex()!==r+l)),o&&this.batchUpdate("to-front",()=>{r+=i.length,i.forEach((a,l)=>{a.setZIndex(r+l,e)})})}return this}toBack(e={}){const t=this.model;if(t){let r=t.getMinZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this];let s=t.indexOf(this)!==0;s||(s=i.some((o,a)=>o.getZIndex()!==r+a)),s&&this.batchUpdate("to-back",()=>{r-=i.length,i.forEach((o,a)=>{o.setZIndex(r+a,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const r=i=>this.store.set("attrs",i,t);if(t.overwrite===!0)r(e);else{const i=this.getAttrs();t.deep===!1?r(Object.assign(Object.assign({},i),e)):r(Ie({},i,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const r=this.constructor.getAttrHooks()||{};let i=r[e]||Vn.registry.get(e);if(!i){const s=Al(e);i=r[s]||Vn.registry.get(s)}return i||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,r={}){return this.setPropByPath(this.prefixAttrPath(e),t,r),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,r){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,r||{}):this.setAttrByPath(e,t,r||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const r=typeof e=="boolean"?e:!this.isVisible(),i=typeof e=="boolean"?t:e;return r?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const r=i=>this.store.set("data",i,t);if(t.overwrite===!0)r(e);else{const i=this.getData();t.deep===!1?r(typeof e=="object"?Object.assign(Object.assign({},i),e):e):r(Ie({},i,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(r=>{var i;return(i=this.model)===null||i===void 0?void 0:i.getCell(r)}).filter(r=>r!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let r=this.getParent();for(;r;)t.push(r),r=e.deep!==!1?r.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],r=this.getChildren()||[];for(;r.length>0;){const i=r.shift(),s=i.getChildren();t.push(i),s&&r.push(...s)}return t}{const t=this.getChildren()||[];return t.forEach(r=>{t.push(...r.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let r=this.getParent();for(;r;){if(r===e)return!0;r=r.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return le.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(r=>r.id),t):this.store.remove("children",t),this}unembed(e,t={}){const r=this.children;if(r!=null&&e!=null){const i=this.getChildIndex(e);i!==-1&&(r.splice(i,1),e.setParent(null,t),this.setChildren(r,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return le.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,r={}){return e.insertChild(this,t,r),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,r={}){if(e!=null&&e!==this){const i=e.getParent(),s=this!==i;let o=t;if(o==null&&(o=this.getChildCount(),s||(o-=1)),i){const l=i.getChildren();if(l){const c=l.indexOf(e);c>=0&&(e.setParent(null,r),l.splice(c,1),i.setChildren(l,r))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,r),this.setChildren(a,r),s&&this.model){const l=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);l&&l.forEach(u=>u.updateParent(r)),c&&c.forEach(u=>u.updateParent(r))}this.model&&this.model.addCell(e,r)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const r=t.getChildIndex(this);t.removeChildAt(r,e)}return this}removeChild(e,t={}){const r=this.getChildIndex(e);return this.removeChildAt(r,t)}removeChildAt(e,t={}){const r=this.getChildAt(e);return this.children!=null&&r!=null&&(this.unembed(r,t),r.remove(t)),r}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(r=>r.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,r={},i="/"){return this.animation.start(e,t,r,i)}stopTransition(e,t,r="/"){return this.animation.stop(e,t,r),this}getTransitions(){return this.animation.get()}translate(e,t,r){return this}scale(e,t,r,i){return this}addTools(e,t,r){const i=Array.isArray(e)?e:[e],s=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof r=="object"?r:{};if(o.reset)return this.setTools({name:s,items:i,local:o.local},o);let a=ze(this.getTools());if(a==null||s==null||a.name===s)return a==null&&(a={}),a.items||(a.items=[]),a.name=s,a.items=[...a.items,...i],this.setTools(Object.assign({},a),o)}setTools(e,t={}){return e==null?this.removeTools():this.store.set("tools",le.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(r=>typeof r=="string"?r===e:r.name===e)}removeTool(e,t={}){const r=ze(this.getTools());if(r){let i=!1;const s=r.items.slice(),o=a=>{s.splice(a,1),i=!0};if(typeof e=="number")o(e);else for(let a=s.length-1;a>=0;a-=1){const l=s[a];(typeof l=="string"?l===e:l.name===e)&&o(a)}i&&(r.items=s,this.setTools(r,t))}return this}getBBox(e){return new D}getConnectionPoint(e,t){return new P}toJSON(e={}){const t=Object.assign({},this.store.get()),r=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const g=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${g.name||r.call(g)}"`)}const s=this.constructor,o=e.diff===!0,a=t.attrs||{},l=s.getDefaults(!0),c=o?this.preprocess(l,!0):l,u=c.attrs||{},h={};Object.entries(t).forEach(([g,p])=>{if(p!=null&&!Array.isArray(p)&&typeof p=="object"&&!Dn(p))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${r.call(p)}" type of key "${g}" on ${i} "${this.id}"`);if(g!=="attrs"&&g!=="shape"&&o){const b=c[g];Zn(p,b)&&delete t[g]}}),Object.keys(a).forEach(g=>{const p=a[g],b=u[g];Object.keys(p).forEach(m=>{const v=p[m],y=b?b[m]:null;v!=null&&typeof v=="object"&&!Array.isArray(v)?Object.keys(v).forEach(w=>{const x=v[w];if(b==null||y==null||!Ze(y)||!Zn(y[w],x)){h[g]==null&&(h[g]={}),h[g][m]==null&&(h[g][m]={});const C=h[g][m];C[w]=x}}):(b==null||!Zn(y,v))&&(h[g]==null&&(h[g]={}),h[g][m]=v)})});const f=Object.assign(Object.assign({},t),{attrs:Ib(h)?void 0:h});f.attrs==null&&delete f.attrs;const d=f;return d.angle===0&&delete d.angle,ze(d)}clone(e={}){if(!e.deep){const r=Object.assign({},this.store.get());e.keepId||delete r.id,delete r.parent,delete r.children;const i=this.constructor;return new i(r)}return le.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},r=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),r&&r.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},r=this.model){return r&&r.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,r){const i=this.model;this.startBatch(e,r,i);const s=t();return this.stopBatch(e,r,i),s}dispose(){this.removeFromParent(),this.store.dispose()}}le.defaults={},le.attrHooks={},le.propHooks=[],k5([pt.dispose()],le.prototype,"dispose",null),function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e}(le||(le={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"}n.isCell=e}(le||(le={})),function(n){function e(...s){const o=s.filter(l=>l!=null).map(l=>l.getAncestors()).sort((l,c)=>l.length-c.length);return o.shift().find(l=>o.every(c=>c.includes(l)))||null}n.getCommonAncestor=e;function t(s,o={}){let a=null;for(let l=0,c=s.length;l<c;l+=1){const u=s[l];let h=u.getBBox(o);if(h){if(u.isNode()){const f=u.getAngle();f!=null&&f!==0&&(h=h.bbox(f))}a=a==null?h:a.union(h)}}return a}n.getCellsBBox=t;function r(s){const o=[s,...s.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=r;function i(s){const o=Bb(s),a=o.reduce((l,c)=>(l[c.id]=c.clone(),l),{});return o.forEach(l=>{const c=a[l.id];if(c.isEdge()){const f=c.getSourceCellId(),d=c.getTargetCellId();f&&a[f]&&c.setSource(Object.assign(Object.assign({},c.getSource()),{cell:a[f].id})),d&&a[d]&&c.setTarget(Object.assign(Object.assign({},c.getTarget()),{cell:a[d].id}))}const u=l.getParent();u&&a[u.id]&&c.setParent(a[u.id]);const h=l.getChildren();if(h&&h.length){const f=h.reduce((d,g)=>(a[g.id]&&d.push(a[g.id]),d),[]);f.length>0&&c.setChildren(f)}}),a}n.cloneCells=i}(le||(le={})),function(n){n.config({propHooks(e){var{tools:t}=e,r=Fw(e,["tools"]);return t&&(r.tools=n.normalizeTools(t)),r}})}(le||(le={}));var Ts;(function(n){let e,t;function r(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=r;function i(o){e=o}n.setEdgeRegistry=i;function s(o){t=o}n.setNodeRegistry=s})(Ts||(Ts={}));class I5{constructor(e){this.ports=[],this.groups={},this.init(ze(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const r=this.getPortsByGroup(e),i=e?this.getGroup(e):null,s=i?i.position:null,o=s?s.name:null;let a;if(o!=null){const h=Ai.registry.get(o);if(h==null)return Ai.registry.onNotFound(o);a=h}else a=Ai.presets.left;const l=r.map(h=>h&&h.position&&h.position.args||{}),c=s&&s.args||{};return a(l,t,c).map((h,f)=>{const d=r[f];return{portLayout:h,portId:d.id,portSize:d.size,portAttrs:d.attrs,labelSize:d.label.size,labelLayout:this.getPortLabelLayout(d,P.create(h.position),t)}})}init(e){const{groups:t,items:r}=e;t!=null&&Object.keys(t).forEach(i=>{this.groups[i]=this.parseGroup(t[i])}),Array.isArray(r)&&r.forEach(i=>{this.ports.push(this.parsePort(i))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),r=this.getGroup(e.group)||{};return t.markup=t.markup||r.markup,t.attrs=Ie({},r.attrs,t.attrs),t.position=this.createPosition(r,t),t.label=Ie({},r.label,this.getLabel(t)),t.zIndex=this.getZIndex(r,t),t.size=Object.assign(Object.assign({},r.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return Ie({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const r=e.label||{};return r.position=this.getPortLabelPosition(r.position,t),r}getPortLabelLayout(e,t,r){const i=e.label.position.name||"left",s=e.label.position.args||{},o=xs.registry.get(i)||xs.presets.left;return o?o(t,r,s):null}}var ac=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let Xe=class BM extends le{get[Symbol.toStringTag](){return BM.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:r,y:i,width:s,height:o}=e,a=ac(e,["x","y","width","height"]);if(r!=null||i!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:r!=null?r:l?l.x:0,y:i!=null?i:l?l.y:0})}if(s!=null||o!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:s!=null?s:l?l.width:0,height:o!=null?o:l?l.height:0})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,r){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,r):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,r){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,r),this}resize(e,t,r={}){this.startBatch("resize",r);const i=r.direction;if(i){const s=this.getSize();switch(i){case"left":case"right":t=s.height;break;case"top":case"bottom":e=s.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[i];const l=ve.normalize(this.getAngle()||0);r.absolute&&(a+=Math.floor((l+45)/90),a%=4);const c=this.getBBox();let u;a===0?u=c.getBottomLeft():a===1?u=c.getCorner():a===2?u=c.getTopRight():u=c.getOrigin();const h=u.clone().rotate(-l,c.getCenter()),f=Math.sqrt(e*e+t*t)/2;let d=a*Math.PI/2;d+=Math.atan(a%2===0?t/e:e/t),d-=ve.toRad(l);const p=P.fromPolar(f,d,h).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},r),this.setPosition(p.x,p.y,r)}else this.store.set("size",{width:e,height:t},r);return this.stopBatch("resize",r),this}scale(e,t,r,i={}){const s=this.getBBox().scale(e,t,r==null?void 0:r);return this.startBatch("scale",i),this.setPosition(s.x,s.y,i),this.resize(s.width,s.height,i),this.stopBatch("scale"),this}position(e,t,r){return typeof e=="number"?this.setPosition(e,t,r):this.getPosition(e)}getPosition(e={}){if(e.relative){const r=this.getParent();if(r!=null&&r.isNode()){const i=this.getPosition(),s=r.getPosition();return{x:i.x-s.x,y:i.y-s.y}}}const t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,r={}){let i,s,o;if(typeof e=="object"?(i=e.x,s=e.y,o=t||{}):(i=e,s=t,o=r||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();i+=l.x,s+=l.y}}if(o.deep){const a=this.getPosition();this.translate(i-a.x,s-a.y,o)}else this.store.set("position",{x:i,y:s},o);return this}translate(e=0,t=0,r={}){if(e===0&&t===0)return this;r.translateBy=r.translateBy||this.id;const i=this.getPosition();if(r.restrict!=null&&r.translateBy===this.id){const o=this.getBBox({deep:!0}),a=r.restrict,l=i.x-o.x,c=i.y-o.y,u=Math.max(a.x+l,Math.min(a.x+a.width+l-o.width,i.x+e)),h=Math.max(a.y+c,Math.min(a.y+a.height+c-o.height,i.y+t));e=u-i.x,t=h-i.y}const s={x:i.x+e,y:i.y+t};return r.tx=e,r.ty=t,r.transition?(typeof r.transition!="object"&&(r.transition={}),this.transition("position",s,Object.assign(Object.assign({},r.transition),{interp:Ei.object})),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)})):(this.startBatch("translate",r),this.store.set("position",s,r),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)}),this.stopBatch("translate",r)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const r=this.getAngle();if(t.center){const i=this.getSize(),s=this.getPosition(),o=this.getBBox().getCenter();o.rotate(r-e,t.center);const a=o.x-i.width/2-s.x,l=o.y-i.height/2-s.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(s.x+a,s.y+l,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(r+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),le.getCellsBBox(t)}return D.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const r=this.getBBox(),i=r.getCenter(),s=e.getTerminal(t);if(s==null)return i;const o=s.port;if(!o||!this.hasPort(o))return i;const a=this.getPort(o);if(!a||!a.group)return i;const c=this.getPortsPosition(a.group)[o].position,u=P.create(c).translate(r.getOrigin()),h=this.getAngle();return h&&u.rotate(-h,i),u}fit(e={}){const r=(this.getChildren()||[]).filter(c=>c.isNode());if(r.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&r.forEach(c=>c.fit(e));let{x:i,y:s,width:o,height:a}=le.getCellsBBox(r);const l=Bn(e.padding);return i-=l.left,s-=l.top,o+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:i,y:s},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Pe.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",Pe.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Pe.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",Pe.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Pe.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",Pe.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return ze(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return ze(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(r=>r.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new D(0,0,t.width,t.height)).reduce((i,s)=>{const o=s.portLayout;return i[s.portId]={position:Object.assign({},o.position),angle:o.angle||0},i},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,r,i){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),l=r;return this.setPropByPath(a,l,i)}const s=this.prefixPortPath(e),o=t;return this.setPropByPath(s,o,r)}removePortProp(e,t,r){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),r):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,r,i){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):r==null?this.removePortProp(e,t,i):this.setPortProp(e,t,r,i):this.setPortProp(e,t,r)}prefixPortPath(e,t){const r=this.getPortIndex(e);if(r===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${r}`]:Array.isArray(t)?["ports","items",`${r}`,...t]:`ports/items/${r}/${t}`}addPort(e,t){const r=[...this.ports.items];return r.push(e),this.setPropByPath("ports/items",r,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,r){const i=[...this.ports.items];return i.splice(e,0,t),this.setPropByPath("ports/items",i,r),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const r=[...this.ports.items];r.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",r,t)}return this}removePorts(e,t){let r;if(Array.isArray(e)){if(r=t||{},e.length){r.rewrite=!0;const s=[...this.ports.items].filter(o=>!e.some(a=>{const l=typeof a=="string"?a:a.id;return o.id===l}));this.setPropByPath("ports/items",s,r)}}else r=e||{},r.rewrite=!0,this.setPropByPath("ports/items",[],r);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const r={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(r[o.id]=!0)});const s=this.model;s&&!Ib(r)&&(s.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const c=l.getTargetPortId();c&&r[c]&&l.remove()}),s.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const c=l.getSourcePortId();c&&r[c]&&l.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(r=>{typeof r!="object"&&t.push(`Invalid port ${r}.`),r.id==null&&(r.id=this.generatePortId()),e[r.id]&&t.push("Duplicitied port id."),e[r.id]=!0}),t}generatePortId(){return Il()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new I5(this.ports);const r=this.port.getPorts(),i=t?r.filter(o=>t.find(a=>a.id===o.id)?null:o):[...r],s=t?t.filter(o=>r.find(a=>a.id===o.id)?null:o):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),s.length>0&&this.notify("ports:removed",{removed:s,cell:this,node:this})}};Xe.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.size=="function"&&typeof i.position=="function"}n.isNode=e}(Xe||(Xe={})),function(n){n.config({propHooks(e){var{ports:t}=e,r=ac(e,["ports"]);return t&&(r.ports=Array.isArray(t)?{items:t}:t),r}})}(Xe||(Xe={})),function(n){n.registry=Ue.create({type:"node",process(e,t){if(Ts.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i}=t,s=ac(t,["inherit"]);if(i)if(typeof i=="string"){const a=this.get(i);a==null?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),Ts.setNodeRegistry(n.registry)}(Xe||(Xe={})),function(n){let e=0;function t(s){return s?zh(s):(e+=1,`CustomNode${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=ac(s,["constructorName","overwrite"]),c=Dh(t(o||l.shape),this);return c.config(l),l.shape&&n.registry.register(l.shape,c,a),c}n.define=r;function i(s){const o=s.shape||"rect",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i}(Xe||(Xe={}));var lc=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let Ve=class zM extends le{get[Symbol.toStringTag](){return zM.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:r,sourceCell:i,sourcePort:s,sourcePoint:o,target:a,targetCell:l,targetPort:c,targetPoint:u}=e,f=lc(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),d=g=>typeof g=="string"||typeof g=="number";if(r!=null)if(le.isCell(r))f.source={cell:r.id};else if(d(r))f.source={cell:r};else if(P.isPoint(r))f.source=r.toJSON();else if(Array.isArray(r))f.source={x:r[0],y:r[1]};else{const g=r.cell;le.isCell(g)?f.source=Object.assign(Object.assign({},r),{cell:g.id}):f.source=r}if(i!=null||s!=null){let g=f.source;if(i!=null){const p=d(i)?i:i.id;g?g.cell=p:g=f.source={cell:p}}s!=null&&g&&(g.port=s)}else o!=null&&(f.source=P.create(o).toJSON());if(a!=null)if(le.isCell(a))f.target={cell:a.id};else if(d(a))f.target={cell:a};else if(P.isPoint(a))f.target=a.toJSON();else if(Array.isArray(a))f.target={x:a[0],y:a[1]};else{const g=a.cell;le.isCell(g)?f.target=Object.assign(Object.assign({},a),{cell:g.id}):f.target=a}if(l!=null||c!=null){let g=f.target;if(l!=null){const p=d(l)?l:l.id;g?g.cell=p:g=f.target={cell:p}}c!=null&&g&&(g.port=c)}else u!=null&&(f.target=P.create(u).toJSON());return super.preprocess(f,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,r={}){return this.setTerminal("source",e,t,r)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,r={}){return this.setTerminal("target",e,t,r)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,r,i={}){if(le.isCell(t))return this.store.set(e,Ie({},r,{cell:t.id}),i),this;const s=t;return P.isPoint(t)||s.x!=null&&s.y!=null?(this.store.set(e,Ie({},r,{x:s.x,y:s.y}),i),this):(this.store.set(e,ze(t),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(P.isPointLike(t))return P.create(t);const r=this.getTerminalCell(e);return r?r.getConnectionPoint(this,e):new P}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const r={};for(;t&&t.isEdge();){if(r[t.id])return null;r[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,r){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},r),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,r){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},r),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return ze(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,r={}){const i=this.getLabels(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,this.parseLabel(e)),this.setLabels(i,r)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getLabels();i[e]=this.parseLabel(t),this.setLabels(i,r)}return this}removeLabelAt(e,t={}){const r=this.getLabels(),i=e!=null&&Number.isFinite(e)?e:-1,s=r.splice(i,1);return this.setLabels(r,t),s.length?s[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>s===o||Zn(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>s===o||Zn(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("labels:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const r=Array.isArray(e)?e:[e];return this.store.set("vertices",r.map(i=>P.toJSON(i)),t),this}insertVertex(e,t,r={}){const i=this.getVertices(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,P.toJSON(e)),this.setVertices(i,r)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getVertices();i[e]=t,this.setVertices(i,r)}return this}removeVertexAt(e,t={}){const r=this.getVertices(),i=e!=null&&Number.isFinite(e)?e:-1;return r.splice(i,1),this.setVertices(r,t)}onVertexsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>P.equals(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>P.equals(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("vertexs:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Pe.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,r={}){return r.translateBy=r.translateBy||this.id,r.tx=e,r.ty=t,this.applyToPoints(i=>({x:(i.x||0)+e,y:(i.y||0)+t}),r)}scale(e,t,r,i={}){return this.applyToPoints(s=>P.create(s).scale(e,t,r).toJSON(),i)}applyToPoints(e,t={}){const r={},i=this.getSource(),s=this.getTarget();P.isPointLike(i)&&(r.source=e(i)),P.isPointLike(s)&&(r.target=e(s));const o=this.getVertices();return o.length>0&&(r.vertices=o.map(e)),this.store.set(r,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>P.create(t)),this.getTargetPoint()];return new He(e)}updateParent(e){let t=null;const r=this.getSourceCell(),i=this.getTargetCell(),s=this.getParent();return r&&i&&(r===i||r.isDescendantOf(i)?t=i:i.isDescendantOf(r)?t=r:t=le.getCommonAncestor(r,i)),s&&t&&t.id!==s.id&&s.unembed(this,e),t&&(!s||s.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),r=this.getTarget(),i=t.cell,s=r.cell;if(!i||!s)return!1;let o=i===s;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(o=a.isAncestorOf(l,e)||l.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};Ve.defaults={},function(n){function e(t,r){const i=t,s=r;return i.cell===s.cell?i.port===s.port||i.port==null&&s.port==null:!1}n.equalTerminals=e}(Ve||(Ve={})),function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e}(Ve||(Ve={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.disconnect=="function"&&typeof i.getSource=="function"&&typeof i.getTarget=="function"}n.isEdge=e}(Ve||(Ve={})),function(n){n.registry=Ue.create({type:"edge",process(e,t){if(Ts.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i="edge"}=t,s=lc(t,["inherit"]);if(typeof i=="string"){const a=this.get(i||"edge");a==null&&i?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),Ts.setEdgeRegistry(n.registry)}(Ve||(Ve={})),function(n){let e=0;function t(s){return s?zh(s):(e+=1,`CustomEdge${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=lc(s,["constructorName","overwrite"]),c=Dh(t(o||l.shape),this);return c.config(l),l.shape&&n.registry.register(l.shape,c,a),c}n.define=r;function i(s){const o=s.shape||"edge",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i}(Ve||(Ve={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:r,vertices:i}=t,s=lc(t,["label","vertices"]);if(r){s.labels==null&&(s.labels=[]);const o=typeof r=="string"?n.parseStringLabel(r):r;s.labels.push(o)}return i&&Array.isArray(i)&&(s.vertices=i.map(o=>P.create(o).toJSON())),s}}),n.registry.register(e,n)}(Ve||(Ve={}));var $5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class cc extends pt{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,r){let i,s;typeof t=="number"?(i=t,s=Object.assign({merge:!1},r)):(i=this.length,s=Object.assign({merge:!1},t)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&s.sort!==!1,l=this.comparator||null;let c=!1;const u=[],h=[];return o.forEach(f=>{const d=this.get(f);d?s.merge&&!f.isSameStore(d)&&(d.setProp(f.getProp(),r),h.push(d),a&&!c&&(l==null||typeof l=="function"?c=d.hasChanged():typeof l=="string"?c=d.hasChanged(l):c=l.some(g=>d.hasChanged(g)))):(u.push(f),this.reference(f))}),u.length&&(a&&(c=!0),this.cells.splice(i,0,...u),this.length=this.cells.length),c&&this.sort({silent:!0}),s.silent||(u.forEach((f,d)=>{const g={cell:f,index:i+d,options:s};this.trigger("added",g),s.dryrun||f.notify("added",Object.assign({},g))}),c&&this.trigger("sorted"),(u.length||h.length)&&this.trigger("updated",{added:u,merged:h,removed:[],options:s})),this}remove(e,t={}){const r=Array.isArray(e)?e:[e],i=this.removeCells(r,t);return!t.silent&&i.length>0&&this.trigger("updated",{options:t,removed:i,added:[],merged:[]}),Array.isArray(e)?i:i[0]}removeCells(e,t){const r=[];for(let i=0;i<e.length;i+=1){const s=this.get(e[i]);if(s==null)continue;const o=this.cells.indexOf(s);this.cells.splice(o,1),this.length-=1,delete this.map[s.id],r.push(s),this.unreference(s),t.dryrun||s.remove(),t.silent||(this.trigger("removed",{cell:s,index:o,options:t}),t.dryrun||s.notify("removed",{cell:s,index:o,options:t}))}return r}reset(e,t={}){const r=this.cells.slice();if(r.forEach(i=>this.unreference(i)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const i=this.cells.slice();this.trigger("reseted",{options:t,previous:r,current:i});const s=[],o=[];i.forEach(a=>{r.some(c=>c.id===a.id)||s.push(a)}),r.forEach(a=>{i.some(c=>c.id===a.id)||o.push(a)}),this.trigger("updated",{options:t,added:s,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Lb(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const r=t.cell;this.trigger(`cell:${e}`,t),r&&(r.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:r})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}$5([cc.dispose()],cc.prototype,"dispose",null);var L5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Cn extends pt{get[Symbol.toStringTag](){return Cn.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new cc(e),this.setup()}notify(e,t){this.trigger(e,t);const r=this.graph;return r&&(e==="sorted"||e==="reseted"||e==="updated"?r.trigger(`model:${e}`,t):r.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const r=t.cell;this.onCellRemoved(r,t.options),this.notify("cell:removed",t),r.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:r}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const r=e.id;if(e.isEdge()){delete this.edges[r];const i=e.getSource(),s=e.getTarget();if(i&&i.cell){const o=this.outgoings[i.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[i.cell])}if(s&&s.cell){const o=this.incomings[s.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[s.cell])}}else delete this.nodes[r];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const r=t==="source"?this.outgoings:this.incomings,i=e.previous(t);if(i&&i.cell){const o=le.isCell(i.cell)?i.cell.id:i.cell,a=r[o],l=a?a.indexOf(e.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete r[o])}const s=e.getTerminal(t);if(s&&s.cell){const o=le.isCell(s.cell)?s.cell.id:s.cell,a=r[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),r[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(r=>this.prepareCell(r,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(r=>this.prepareCell(r,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const r=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const i=t.sort((s,o)=>{const a=s.isEdge()?1:2,l=o.isEdge()?1:2;return a-l});for(;i.length>0;){const s=i.shift();s&&s.remove(r)}},r),this}addNode(e,t={}){const r=Xe.isNode(e)?e:this.createNode(e);return this.addCell(r,t),r}updateNode(e,t={}){const r=this.createNode(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}createNode(e){return Xe.create(e)}addEdge(e,t={}){const r=Ve.isEdge(e)?e:this.createEdge(e);return this.addCell(r,t),r}createEdge(e){return Ve.create(e)}updateEdge(e,t={}){const r=this.createEdge(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(r=>this.addCell(r,t)),this.addings.delete(e)),this)}addCells(e,t={}){const r=e.length;if(r===0)return this;const i=Object.assign(Object.assign({},t),{position:r-1,maxPosition:r-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:e})),e.forEach(s=>{this.addCell(s,i),i.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:e})),this}updateCell(e,t={}){const r=e.id&&this.getCell(e.id);return r?this.batchUpdate("update",()=>(Object.entries(e).forEach(([i,s])=>r.setProp(i,s,t)),!0),e):!1}removeCell(e,t={}){const r=typeof e=="string"?this.getCell(e):e;return r&&this.has(r)?this.collection.remove(r,t):null}updateCellId(e,t){if(e.id===t)return;this.startBatch("update",{id:t}),e.prop("id",t);const r=e.clone({keepId:!0});return this.addCell(r),this.getConnectedEdges(e).forEach(s=>{const o=s.getSourceCell(),a=s.getTargetCell();o===e&&s.setSource(Object.assign(Object.assign({},s.getSource()),{cell:t})),a===e&&s.setTarget(Object.assign(Object.assign({},s.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),r}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(r=>this.removeCell(r,t))):[]}removeConnectedEdges(e,t={}){const r=this.getConnectedEdges(e);return r.forEach(i=>{i.remove(t)}),r}disconnectConnectedEdges(e,t={}){const r=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(i=>{const s=i.getSourceCellId(),o=i.getTargetCellId();s===r&&i.setSource({x:0,y:0},t),o===r&&i.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,r=this.outgoings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,r=this.incomings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getConnectedEdges(e,t={}){const r=[],i=typeof e=="string"?this.getCell(e):e;if(i==null)return r;const s={},o=t.indirect;let a=t.incoming,l=t.outgoing;a==null&&l==null&&(a=l=!0);const c=(u,h)=>{const f=h?this.getOutgoingEdges(u):this.getIncomingEdges(u);if(f!=null&&f.forEach(d=>{s[d.id]||(r.push(d),s[d.id]=!0,o&&(a&&c(d,!1),l&&c(d,!0)))}),o&&u.isEdge()){const d=h?u.getTargetCell():u.getSourceCell();d&&d.isEdge()&&(s[d.id]||(r.push(d),c(d,h)))}};if(l&&c(i,!0),a&&c(i,!1),t.deep){const u=i.getDescendants({deep:!0}),h={};u.forEach(d=>{d.isNode()&&(h[d.id]=!0)});const f=(d,g)=>{const p=g?this.getOutgoingEdges(d.id):this.getIncomingEdges(d.id);p!=null&&p.forEach(b=>{if(!s[b.id]){const m=b.getSourceCell(),v=b.getTargetCell();if(!t.enclosed&&m&&h[m.id]&&v&&h[v.id])return;r.push(b),s[b.id]=!0}})};u.forEach(d=>{d.isEdge()||(l&&f(d,!0),a&&f(d,!1))})}return r}isBoundary(e,t){const r=typeof e=="string"?this.getCell(e):e,i=t?this.getIncomingEdges(r):this.getOutgoingEdges(r);return i==null||i.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(r=>{if(this.isBoundary(r,e)){const i=this.getCell(r);i&&t.push(i)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let r=t.incoming,i=t.outgoing;r==null&&i==null&&(r=i=!0);const o=this.getConnectedEdges(e,t).reduce((a,l)=>{const c=l.hasLoop(t),u=l.getSourceCell(),h=l.getTargetCell();return r&&u&&u.isNode()&&!a[u.id]&&(c||u!==e&&(!t.deep||!u.isDescendantOf(e)))&&(a[u.id]=u),i&&h&&h.isNode()&&!a[h.id]&&(c||h!==e&&(!t.deep||!h.isDescendantOf(e)))&&(a[h.id]=h),a},{});if(e.isEdge()){if(r){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(i){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,r={}){let i=r.incoming,s=r.outgoing;return i==null&&s==null&&(i=s=!0),this.getConnectedEdges(e,r).some(o=>{const a=o.getSourceCell(),l=o.getTargetCell();return!!(i&&a&&a.id===t.id||s&&l&&l.id===t.id)})}getSuccessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{outgoing:!0})),r}isSuccessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{outgoing:!0})),i}getPredecessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{incoming:!0})),r}isPredecessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{incoming:!0})),i}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(r=>{r&&(Array.isArray(r)?t.push(...r):t.push(r))}),le.getCommonAncestor(...t)}getSubGraph(e,t={}){const r=[],i={},s=[],o=[],a=l=>{i[l.id]||(r.push(l),i[l.id]=l,l.isEdge()&&o.push(l),l.isNode()&&s.push(l))};return e.forEach(l=>{a(l),t.deep&&l.getDescendants({deep:!0}).forEach(u=>a(u))}),o.forEach(l=>{const c=l.getSourceCell(),u=l.getTargetCell();c&&!i[c.id]&&(r.push(c),i[c.id]=c,c.isNode()&&s.push(c)),u&&!i[u.id]&&(r.push(u),i[u.id]=u,u.isNode()&&s.push(u))}),s.forEach(l=>{this.getConnectedEdges(l,t).forEach(u=>{const h=u.getSourceCell(),f=u.getTargetCell();!i[u.id]&&h&&i[h.id]&&f&&i[f.id]&&(r.push(u),i[u.id]=u)})}),r}cloneSubGraph(e,t={}){const r=this.getSubGraph(e,t);return this.cloneCells(r)}cloneCells(e){return le.cloneCells(e)}getNodesFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(i=>i.getBBox().containsPoint(r))}getNodesInArea(e,t,r,i,s){const o=typeof e=="number"?new D(e,t,r,i):D.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getNodes().filter(c=>{const u=c.getBBox();return l?o.containsRect(u):o.isIntersectWithRect(u)})}getEdgesInArea(e,t,r,i,s){const o=typeof e=="number"?new D(e,t,r,i):D.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getEdges().filter(c=>{const u=c.getBBox();return u.width===0?u.inflate(1,0):u.height===0&&u.inflate(0,1),l?o.containsRect(u):o.isIntersectWithRect(u)})}getNodesUnderNode(e,t={}){const r=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(r):this.getNodesFromPoint(r[t.by])).filter(s=>e.id!==s.id&&!s.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return le.getCellsBBox(e,t)}search(e,t,r={}){r.breadthFirst?this.breadthFirstSearch(e,t,r):this.depthFirstSearch(e,t,r)}breadthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.shift();if(a==null||s[a.id]||(s[a.id]=!0,Y(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,r).forEach(c=>{o[c.id]=o[a.id]+1,i.push(c)})}}depthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.pop();if(a==null||s[a.id]||(s[a.id]=!0,Y(t,this,a,o[a.id])===!1))continue;const l=this.getNeighbors(a,r),c=i.length;l.forEach(u=>{o[u.id]=o[a.id]+1,i.splice(c,0,u)})}}getShortestPath(e,t,r={}){const i={};this.getEdges().forEach(c=>{const u=c.getSourceCellId(),h=c.getTargetCellId();u&&h&&(i[u]||(i[u]=[]),i[h]||(i[h]=[]),i[u].push(h),r.directed||i[h].push(u))});const s=typeof e=="string"?e:e.id,o=rf.run(i,s,r.weight),a=[];let l=typeof t=="string"?t:t.id;for(o[l]&&a.push(l);l=o[l];)a.unshift(l);return a}translate(e,t,r){return this.getCells().filter(i=>!i.hasParent()).forEach(i=>i.translate(e,t,r)),this}resize(e,t,r){return this.resizeCells(e,t,this.getCells(),r)}resizeCells(e,t,r,i={}){const s=this.getCellsBBox(r);if(s){const o=Math.max(e/s.width,0),a=Math.max(t/s.height,0),l=s.getOrigin();r.forEach(c=>c.scale(o,a,l,i))}return this}toJSON(e={}){return Cn.toJSON(this.getCells(),e)}parseJSON(e){return Cn.fromJSON(e)}fromJSON(e,t={}){const r=this.parseJSON(e);return this.resetCells(r,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,r={}){this.startBatch(e,r);const i=t();return this.stopBatch(e,r),i}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(r=>this.batches[r]>0)}dispose(){this.collection.dispose()}}L5([Cn.dispose()],Cn.prototype,"dispose",null),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.addNode=="function"&&typeof i.addEdge=="function"&&i.collection!=null}n.isModel=e}(Cn||(Cn={})),function(n){function e(r,i={}){return{cells:r.map(s=>s.toJSON(i))}}n.toJSON=e;function t(r){const i=[];return Array.isArray(r)?i.push(...r):(r.cells&&i.push(...r.cells),r.nodes&&r.nodes.forEach(s=>{s.shape==null&&(s.shape="rect"),i.push(s)}),r.edges&&r.edges.forEach(s=>{s.shape==null&&(s.shape="edge"),i.push(s)})),i.map(s=>{const o=s.shape;if(o){if(Xe.registry.exist(o))return Xe.create(s);if(Ve.registry.exist(o))return Ve.create(s)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(Cn||(Cn={}));var R5=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let zr=class extends Xe{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(e){const{label:t}=e,r=R5(e,["label"]);return t&&hs(r,"attrs/text/text",t),r},visible:!0})})(zr||(zr={}));var j5=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function D5(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function B5(n="xlink:href"){return t=>{const{imageUrl:r,imageWidth:i,imageHeight:s}=t,o=j5(t,["imageUrl","imageWidth","imageHeight"]);if(r!=null||i!=null||s!=null){const a=()=>{if(o.attrs){const l=o.attrs.image;r!=null&&(l[n]=r),i!=null&&(l.width=i),s!=null&&(l.height=s),o.attrs.image=l}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function _s(n,e,t={}){const r={constructorName:n,markup:D5(n,t.selector),attrs:{[n]:Object.assign({},zr.bodyAttr)}};return(t.parent||zr).define(Ie(r,e,{shape:n}))}_s("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const z5=Ve.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});_s("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var F5=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Ns extends zr{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",Ns.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(r=>Array.isArray(r)?r.join(","):P.isPointLike(r)?`${r.x}, ${r.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:r}=t,i=F5(t,["points"]);if(r){const s=e(r);s&&hs(i,"attrs/body/refPoints",s)}return i}})})(Ns||(Ns={})),_s("polygon",{},{parent:Ns}),_s("polyline",{},{parent:Ns});var V5=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};zr.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:e}=n,t=V5(n,["path"]);return e&&hs(t,"attrs/body/refD",e),t}});var q5=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};zr.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},nn.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:ct.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},zr.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=q5(n,["text"]);return e&&hs(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,refBBox:r,elem:i,attrs:s}){if(i instanceof HTMLElement)i.textContent=n;else{const o=s.style||{},a={text:n,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o),c=Vn.presets.textWrap;return Y(c.set,this,a,{cell:e,view:t,elem:i,refBBox:r,attrs:l}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),_s("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:B5()},{selector:"image"}),_s("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class kt extends We{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return kt.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const r=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?mt(t,r):K(t,r)}else{const r=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(r):this.addClass(r)}}isNodeView(){return!0}confirmUpdate(e,t={}){let r=e;return this.hasAction(r,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","resize","translate","rotate","ports","tools"])):(r=this.handleAction(r,"resize",()=>this.resize(),"update"),r=this.handleAction(r,"update",()=>this.update(),"ports"),r=this.handleAction(r,"translate",()=>this.translate()),r=this.handleAction(r,"rotate",()=>this.rotate()),r=this.handleAction(r,"ports",()=>this.renderPorts()),r=this.handleAction(r,"tools",()=>{this.getFlag("tools")===e?this.renderTools():this.updateTools(t)})),r}update(e){this.cleanCache(),this.removePorts();const t=this.cell,r=t.getSize(),i=t.getAttrs();this.updateAttrs(this.container,i,{attrs:e===i?null:e,rootBBox:new D(0,0,r.width,r.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const r=e?this.portsCache[e]:null;if(!r)return null;const i=r.portContentElement,s=r.portContentSelectors||{};return this.findOne(t,i,s)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{nr(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const r=this.cell.getParsedPorts(),i=kb(r,"zIndex"),s="auto";i[s]&&i[s].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(i).forEach(o=>{if(o!==s){const a=parseInt(o,10);this.appendPorts(i[o],a,t)}}),this.updatePorts()}appendPorts(e,t,r){const i=e.map(s=>this.getPortElement(s));r[t]||t<0?_o(r[Math.max(t,0)],i):zn(this.container,i)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=Pe.renderMarkup(this.cell.getPortContainerMarkup());const r=t.elem;if(r==null)throw new Error("Invalid port container markup.");t=Pe.renderMarkup(this.getPortMarkup(e));const i=t.elem,s=t.selectors;if(i==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},i);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),K(r,o),K(r,"x6-port"),K(i,"x6-port-body"),r.appendChild(i);let a=s,l,c;if(this.existPortLabel(e)){if(t=Pe.renderMarkup(this.getPortLabelMarkup(e.label)),l=t.elem,c=t.selectors,l==null)throw new Error("Invalid port label markup.");if(s&&c){for(const h in c)if(s[h]&&h!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},s),c)}K(l,"x6-port-label"),r.appendChild(l)}return this.portsCache[e.id]={portElement:r,portSelectors:a,portLabelElement:l,portLabelSelectors:c,portContentElement:i,portContentSelectors:s},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:r,selectors:a,labelContainer:l,labelSelectors:c,contentContainer:i,contentSelectors:s}),r}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(r=>this.updatePortGroup(r))}updatePortGroup(e){const t=D.fromSize(this.cell.getSize()),r=this.cell.getPortsLayoutByGroup(e,t);for(let i=0,s=r.length;i<s;i+=1){const o=r[i],a=o.portId,l=this.portsCache[a]||{},c=o.portLayout;if(this.applyPortTransform(l.portElement,c),o.portAttrs!=null){const h={selectors:l.portSelectors||{}};o.portSize&&(h.rootBBox=D.fromSize(o.portSize)),this.updateAttrs(l.portElement,o.portAttrs,h)}const u=o.labelLayout;if(u&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,u,-(c.angle||0)),u.attrs)){const h={selectors:l.portLabelSelectors||{}};o.labelSize&&(h.rootBBox=D.fromSize(o.labelSize)),this.updateAttrs(l.portLabelElement,u.attrs,h)}}}applyPortTransform(e,t,r=0){const i=t.angle,s=t.position,o=ut().rotate(r).translate(s.x||0,s.y||0).rotate(i||0);ms(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,node:s,cell:o}:{e,x:t,y:r,view:i,node:s,cell:o}}getPortEventArgs(e,t,r){const i=this,s=i.cell,o=s;return r?{e,x:r.x,y:r.y,view:i,node:s,cell:o,port:t}:{e,view:i,node:s,cell:o,port:t}}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("node:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("node:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("node:mouseup",this.getEventArgs(e,t,r))}notifyPortEvent(e,t,r){const i=this.findAttr("port",t.target);if(i){const s=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,i,r)),t.type=s}}onClick(e,t,r){super.onClick(e,t,r),this.notify("node:click",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:click",e,{x:t,y:r})}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("node:dblclick",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:r})}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("node:contextmenu",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:r})}onMouseDown(e,t,r){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,r),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:r}),this.startNodeDragging(e,t,r))}onMouseMove(e,t,r){const i=this.getEventData(e),s=i.action;if(s==="magnet")this.dragMagnet(e,t,r);else{if(s==="move"){const a=i.targetView||this;a.dragNode(e,t,r),a.notify("node:moving",{e,x:t,y:r,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,r),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:r})}this.setEventData(e,i)}onMouseUp(e,t,r){const i=this.getEventData(e),s=i.action;s==="magnet"?this.stopMagnetDragging(e,t,r):(this.notifyMouseUp(e,t,r),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:r}),s==="move"&&(i.targetView||this).stopNodeDragging(e,t,r));const o=i.targetMagnet;o&&this.onMagnetClick(e,o,t,r),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onMagnetClick(e,t,r,i){const s=this.graph;s.view.getMouseMovedCount(e)>s.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetDblClick(e,t,r,i){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetContextMenu(e,t,r,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){this.startMagnetDragging(e,r,i)}onCustomEvent(e,t,r,i){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}prepareEmbedding(e){const t=this.graph,i=this.getEventData(e).cell||this.cell,s=t.findViewByCell(i),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:i,view:s,cell:i,x:o.x,y:o.y,currentParent:i.getParent()})}processEmbedding(e,t){const r=t.cell||this.cell,i=t.graph||this.graph,s=i.options.embedding,o=s.findParent;let a=typeof o=="function"?Y(o,i,{view:this,node:this.cell}).filter(f=>le.isCell(f)&&this.cell.id!==f.id&&!f.isDescendantOf(this.cell)):i.model.getNodesUnderNode(r,{by:o});if(s.frontOnly&&a.length>0){const f=kb(a,"zIndex"),d=UF(Object.keys(f).map(g=>parseInt(g,10)));d&&(a=f[d])}a=a.filter(f=>f.visible);let l=null;const c=t.candidateEmbedView,u=s.validate;for(let f=a.length-1;f>=0;f-=1){const d=a[f];if(c&&c.cell.id===d.id){l=c;break}else{const g=d.findView(i);if(u&&Y(u,i,{child:this.cell,parent:g.cell,childView:this,parentView:g})){l=g;break}}}this.clearEmbedding(t),l&&l.highlight(null,{type:"embedding"}),t.candidateEmbedView=l;const h=i.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:r,node:r,view:i.findViewByCell(r),x:h.x,y:h.y,currentParent:r.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const r=t.cell||this.cell,i=t.graph||this.graph,s=i.findViewByCell(r),o=r.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(r,void 0,{ui:!0})):o&&o.unembed(r,{ui:!0}),i.model.getConnectedEdges(r,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),s&&a){const l=i.snapToGrid(e.clientX,e.clientY);s.notify("node:embedded",{e,cell:r,x:l.x,y:l.y,node:r,view:i.findViewByCell(r),previousParent:o,currentParent:r.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,r){if(t.getAttribute("magnet")!=="passive"){const i=this.graph.options.connecting.validateMagnet;return i?Y(i,this.graph,{e:r,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,r){if(!this.can("magnetConnectable"))return;e.stopPropagation();const i=e.currentTarget,s=this.graph;this.setEventData(e,{targetMagnet:i}),this.validateMagnet(this,i,e)?(s.options.magnetThreshold<=0&&this.startConnectting(e,i,t,r),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,r),s.view.delegateDragEvents(e,this)}startConnectting(e,t,r,i){this.graph.model.startBatch("add-edge");const s=this.createEdgeFromMagnet(t,r,i);s.setEventData(e,s.prepareArrowheadDragging("target",{x:r,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:s}),s.notifyMouseDown(e,r,i)}getDefaultEdge(e,t){let r;const i=this.graph.options.connecting.createEdge;return i&&(r=Y(i,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),r}createEdgeFromMagnet(e,t,r){const i=this.graph,s=i.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,r,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:r})),o.addTo(s,{async:!1,ui:!0}),o.findView(i)}dragMagnet(e,t,r){const i=this.getEventData(e),s=i.edgeView;if(s)s.onMouseMove(e,t,r),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,l=this.getEventTarget(e),c=i.targetMagnet;if(a==="onleave"){if(c===l||c.contains(l))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,c,t,r)}}stopMagnetDragging(e,t,r){const s=this.eventData(e).edgeView;s&&(s.onMouseUp(e,t,r),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,r){this.notify("node:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,r,i,s){let o=[s];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(s)&&(o=l.filter(c=>c.isNode()))}o.forEach(l=>{this.notify(e,{e:t,x:r,y:i,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,r=typeof t=="function"?Y(t,this.graph,e):t;return typeof r=="number"?this.graph.transform.getGraphArea().inflate(r):r===!0?this.graph.transform.getGraphArea():r||null}startNodeDragging(e,t,r){const i=this.getDelegatedView();if(i==null||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,r);this.setEventData(e,{targetView:i,action:"move"});const s=P.create(i.cell.getPosition());i.setEventData(e,{moving:!1,offset:s.diff(t,r),restrict:this.getRestrictArea(i)})}dragNode(e,t,r){const i=this.cell,s=this.graph,o=s.getGridSize(),a=this.getEventData(e),l=a.offset,c=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,r,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const u=we.snapToGrid(t+l.x,o),h=we.snapToGrid(r+l.y,o);i.setPosition(u,h,{restrict:c,deep:!0,ui:!0}),s.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,r){const i=this.getEventData(e);i.embedding&&this.finalizeEmbedding(e,i),i.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,r,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");r&&r.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.findPortElem=="function"&&typeof i.resize=="function"&&typeof i.rotate=="function"&&typeof i.translate=="function"}n.isNodeView=e})(kt||(kt={})),kt.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),kt.registry.register("node",kt,!0);class ar extends We{constructor(){super(...arguments),this.POINT_ROUNDING=2}get[Symbol.toStringTag](){return ar.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const r=this.cell.getSource();return new D(r.x,r.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new D(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const r=this.cell.getTarget();return new D(r.x,r.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new D(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let r=e;if(this.hasAction(r,"source")){if(!this.updateTerminalProperties("source"))return r;r=this.removeAction(r,"source")}if(this.hasAction(r,"target")){if(!this.updateTerminalProperties("target"))return r;r=this.removeAction(r,"target")}return this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","labels","tools"]),r):(r=this.handleAction(r,"update",()=>this.update(t)),r=this.handleAction(r,"labels",()=>this.onLabelsChange(t)),r=this.handleAction(r,"tools",()=>this.renderTools()),r)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let r=0,i=t.length;r<i;r+=1){const s=t[r],o=this.labelCache[r],a=this.labelSelectors[r],l=this.graph.options.onEdgeLabelRendered;l&&l({edge:e,label:s,container:o,selectors:a})}}}renderLabels(){const e=this.cell,t=e.getLabels(),r=t.length;let i=this.labelContainer;if(this.labelCache={},this.labelSelectors={},r<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=tr("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.labelContainer=i);for(let s=0,o=t.length;s<o;s+=1){const a=t[s],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let c,u;if(l)c=l.node,u=l.selectors;else{const f=e.getDefaultLabel(),d=this.normalizeLabelMarkup(this.parseLabelMarkup(f.markup));c=d.node,u=d.selectors}c.setAttribute("data-index",`${s}`),i.appendChild(c);const h=this.rootSelector;if(u[h])throw new Error("Ambiguous label root selector.");u[h]=c,this.labelCache[s]=c,this.labelSelectors[s]=u}return i.parentNode==null&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const r=e.propertyPathArray||[],i=r.length;if(i>1){const s=r[1];if(t[s]){if(i===2)return typeof e.propertyValue=="object"&&kl(e.propertyValue,"markup");if(r[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=Z.createVectors(e),r=document.createDocumentFragment();for(let i=0,s=t.length;i<s;i+=1){const o=t[i].node;r.appendChild(o)}return{fragment:r,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let r;const i=t.childNodes;return i.length>1||i[0].nodeName.toUpperCase()!=="G"?r=Z.create("g").append(t):r=Z.create(i[0]),r.addClass(this.prefixClassName("edge-label")),{node:r.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,r=this.can("edgeLabelMovable"),i=e.getDefaultLabel();for(let s=0,o=t.length;s<o;s+=1){const a=this.labelCache[s],l=this.labelSelectors[s];a.setAttribute("cursor",r?"move":"default");const c=t[s],u=Ie({},i.attrs,c.attrs);this.updateAttrs(a,u,{selectors:l,rootBBox:c.size?D.fromSize(c.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs();return t!=null&&this.updateAttrs(this.container,t,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,r=t.getVertices(),i=[this.sourceAnchor,...r,this.targetAnchor],s=i.length,o=new He(i);o.simplify({threshold:.01});const a=o.points.map(c=>c.toJSON()),l=a.length;return s===l?0:(t.setVertices(a.slice(1,l-1),e),s-l)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return P.create(this.sourceAnchor);case"target":return P.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return P.create(this.sourcePoint);case"target":return P.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const r=this.sourceView;return r?this.sourceMagnet||r.container:null}case"target":{if(t.raw)return this.targetMagnet;const r=this.targetView;return r?this.targetMagnet||r.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const r=e.tx||0,i=e.ty||0;this.routePoints=new He(this.routePoints).translate(r,i).points,this.translateConnectionPoints(r,i),this.path.translate(r,i)}else{const r=t.getVertices(),i=this.findAnchors(r);this.sourceAnchor=i.source,this.targetAnchor=i.target,this.routePoints=this.findRoutePoints(r);const s=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=s.source,this.targetPoint=s.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(e){const t=this.cell,r=t.source,i=t.target,s=e[0],o=e[e.length-1];return i.priority&&!r.priority?this.findAnchorsOrdered("target",o,"source",s):this.findAnchorsOrdered("source",s,"target",o)}findAnchorsOrdered(e,t,r,i){let s,o;const a=this.cell,l=a[e],c=a[r],u=this.getTerminalView(e),h=this.getTerminalView(r),f=this.getTerminalMagnet(e),d=this.getTerminalMagnet(r);if(u){let g;t?g=P.create(t):h?g=d:g=P.create(c),s=this.getAnchor(l.anchor,u,f,g,e)}else s=P.create(l);if(h){const g=P.create(i||s);o=this.getAnchor(c.anchor,h,d,g,r)}else o=P.isPointLike(c)?P.create(c):new P;return{[e]:s,[r]:o}}getAnchor(e,t,r,i,s){const o=t.isEdgeElement(r),a=this.graph.options.connecting;let l=typeof e=="string"?{name:e}:e;if(!l){const h=o?(s==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(s==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof h=="string"?{name:h}:h}if(!l)throw new Error("Anchor should be specified.");let c;const u=l.name;if(o){const h=As.registry.get(u);if(typeof h!="function")return As.registry.onNotFound(u);c=Y(h,this,t,r,i,l.args||{},s)}else{const h=Es.registry.get(u);if(typeof h!="function")return Es.registry.onNotFound(u);c=Y(h,this,t,r,i,l.args||{},s)}return c?c.round(this.POINT_ROUNDING):new P}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Br.presets.normal,r=this.cell.getRouter()||t;let i;if(typeof r=="function")i=Y(r,this,e,{},this);else{const s=typeof r=="string"?r:r.name,o=typeof r=="string"?{}:r.args||{},a=s?Br.registry.get(s):Br.presets.normal;if(typeof a!="function")return Br.registry.onNotFound(s);i=Y(a,this,e,o,this)}return i==null?e.map(s=>P.create(s)):i.map(s=>P.create(s))}findConnectionPoints(e,t,r){const i=this.cell,s=this.graph.options.connecting,o=i.getSource(),a=i.getTarget(),l=this.sourceView,c=this.targetView,u=e[0],h=e[e.length-1];let f;if(l&&!l.isEdgeElement(this.sourceMagnet)){const g=this.sourceMagnet||l.container,p=u||r,b=new F(p,t),m=o.connectionPoint||s.sourceConnectionPoint||s.connectionPoint;f=this.getConnectionPoint(m,l,g,b,"source")}else f=t;let d;if(c&&!c.isEdgeElement(this.targetMagnet)){const g=this.targetMagnet||c.container,p=a.connectionPoint||s.targetConnectionPoint||s.connectionPoint,b=h||t,m=new F(b,r);d=this.getConnectionPoint(p,c,g,m,"target")}else d=r;return{source:f,target:d}}getConnectionPoint(e,t,r,i,s){const o=i.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,l=typeof e=="string"?{}:e.args,c=Os.registry.get(a);if(typeof c!="function")return Os.registry.onNotFound(a);const u=Y(c,this,i,t,r,l||{},s);return u?u.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,r){const i=h=>{const f=this.cell.getAttrs(),d=Object.keys(f);for(let g=0,p=d.length;g<p;g+=1){const b=f[d[g]];if(b[`${h}Marker`]||b[`${h}-marker`]){const m=b.strokeWidth||b["stroke-width"];if(m)return parseFloat(m);break}}return null},s=e[0],o=e[e.length-1];let a,l;const c=i("source");c&&(a=t.clone().move(s||r,-c));const u=i("target");return u&&(l=r.clone().move(o||t,-u)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=l||r.clone(),{source:a,target:l}}findPath(e,t,r){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let s,o,a;if(typeof i=="string"?s=i:(s=i.name,o=i.args),s){const c=Oi.registry.get(s);if(typeof c!="function")return Oi.registry.onNotFound(s);a=c}else a=Oi.presets.normal;const l=Y(a,this,t,r,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof l=="string"?X.parse(l):l}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,r=t.getLabels();if(r.length===0)return this;const i=t.getDefaultLabel(),s=this.normalizeLabelPosition(i.position);for(let o=0,a=r.length;o<a;o+=1){const l=r[o],c=this.labelCache[o];if(!c)continue;const u=this.normalizeLabelPosition(l.position),h=Ie({},s,u),f=this.getLabelTransformationMatrix(h);c.setAttribute("transform",ps(f))}return this}updateTerminalProperties(e){const t=this.cell,r=this.graph,i=t[e],s=i&&i.cell,o=`${e}View`;if(!s)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=r.getCellById(s);if(!a)throw new Error(`Edge's ${e} node with id "${s}" not exists`);const l=a.findView(r);return l?(this[o]=l,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,r=this.getTerminalView(e);if(r){let i=r.getMagnetFromEdgeTerminal(this.cell[e]);i===r.container&&(i=null),this[t]=i}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:Ie({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return kl(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return kl(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return kl(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(er(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,r,i){const s={distance:0};let o=0,a;typeof r=="number"?(o=r,a=i):a=r,a!=null&&(s.options=a);const l=a&&a.absoluteOffset,c=!(a&&a.absoluteDistance),u=a&&a.absoluteDistance&&a.reverseDistance,h=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},d=new P(e,t),g=h.closestPointT(d,f),p=this.getConnectionLength()||0;let b=h.lengthAtT(g,f);c&&(b=p>0?b/p:0),u&&(b=-1*(p-b)||1),s.distance=b;let m;l||(m=h.tangentAtT(g));let v;if(m)v=m.pointOffset(d);else{const y=h.pointAtT(g),w=d.diff(y);v={x:w.x,y:w.y}}return s.offset=v,s.angle=o,s}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),r=t.options||{},i=t.angle||0,s=t.distance,o=s>0&&s<=1;let a=0;const l={x:0,y:0},c=t.offset;c&&(typeof c=="number"?a=c:(c.x!=null&&(l.x=c.x),c.y!=null&&(l.y=c.y)));const u=l.x!==0||l.y!==0||a===0,h=r.keepGradient,f=r.ensureLegibility,d=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},p=o?s*this.getConnectionLength():s,b=d.tangentAtLength(p,g);let m,v=i;if(b){if(u)m=b.start,m.translate(l);else{const y=b.clone();y.rotate(-90,b.start),y.setLength(a),m=y.end}h&&(v=b.angle()+i,f&&(v=ve.normalize((v+90)%180-90)))}else m=d.start,u&&m.translate(l);return ut().translate(m.x,m.y).rotate(v)}getVertexIndex(e,t){const i=this.cell.getVertices(),s=this.getClosestPointLength(new P(e,t));let o=0;if(s!=null)for(const a=i.length;o<a;o+=1){const l=i[o],c=this.getClosestPointLength(l);if(c!=null&&s<c)break}return o}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,edge:s,cell:o}:{e,x:t,y:r,view:i,edge:s,cell:o}}notifyUnhandledMouseDown(e,t,r){this.notify("edge:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("edge:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("edge:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("edge:mouseup",this.getEventArgs(e,t,r))}onClick(e,t,r){super.onClick(e,t,r),this.notify("edge:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("edge:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("edge:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startEdgeDragging(e,t,r)}onMouseMove(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.dragLabel(e,t,r);break}case"drag-arrowhead":{this.dragArrowhead(e,t,r);break}case"drag-edge":{this.dragEdge(e,t,r);break}}return this.notifyMouseMove(e,t,r),i}onMouseUp(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.stopLabelDragging(e,t,r);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,r);break}case"drag-edge":{this.stopEdgeDragging(e,t,r);break}}return this.notifyMouseUp(e,t,r),this.checkMouseleave(e),i}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){if(f1(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i)))}this.notifyMouseDown(e,r,i)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}onLabelMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startLabelDragging(e,t,r),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,r){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,r);return}this.setEventData(e,{x:t,y:r,moving:!1,action:"drag-edge"})}dragEdge(e,t,r){const i=this.getEventData(e);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-i.x,r-i.y,{ui:!0}),this.setEventData(e,{x:t,y:r}),this.notify("edge:moving",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,r){const i=this.getEventData(e);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(e,t){const r=this.getTerminalMagnet(e),i={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:r,initialTerminal:Mh(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let r,i=0,s=0;e==="source"?(i=2,r="target"):(s=2,r="source");const o=this.cell[r],a=o.cell;if(a){let l;const c=t[i]=this.graph.findViewByCell(a);c&&(l=c.getMagnetFromEdgeTerminal(o),l===c.container&&(l=void 0)),t[i+1]=l}return(l,c)=>(t[s]=l,t[s+1]=l.container===c?void 0:c,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,r,i,s,o,a){const l=this.graph.options.connecting,c=l.allowLoop,u=l.allowNode,h=l.allowEdge,f=l.allowPort,d=l.allowMulti,g=l.validateConnection,p=o?o.cell:null,b=s==="target"?r:e,m=s==="target"?i:t;let v=!0;const y=w=>{const x=s==="source"?a?a.port:null:p?p.getSourcePortId():null,C=s==="target"?a?a.port:null:p?p.getTargetPortId():null;return Y(w,this.graph,{edge:p,edgeView:o,sourceView:e,targetView:r,sourcePort:x,targetPort:C,sourceMagnet:t,targetMagnet:i,sourceCell:e?e.cell:null,targetCell:r?r.cell:null,type:s})};if(c!=null&&(typeof c=="boolean"?!c&&e===r&&(v=!1):v=y(c)),v&&f!=null&&(typeof f=="boolean"?!f&&m&&(v=!1):v=y(f)),v&&h!=null&&(typeof h=="boolean"?!h&&ar.isEdgeView(b)&&(v=!1):v=y(h)),v&&u!=null&&m==null&&(typeof u=="boolean"?!u&&kt.isNodeView(b)&&(v=!1):v=y(u)),v&&d!=null&&o){const w=o.cell,x=s==="source"?a:w.getSource(),C=s==="target"?a:w.getTarget(),S=a?this.graph.getCellById(a.cell):null;if(x&&C&&x.cell&&C.cell&&S)if(typeof d=="function")v=y(d);else{const E=this.graph.model.getConnectedEdges(S,{outgoing:s==="source",incoming:s==="target"});E.length&&(d==="withPort"?E.some(M=>{const O=M.getSource(),I=M.getTarget();return O&&I&&O.cell===x.cell&&I.cell===C.cell&&O.port!=null&&O.port===x.port&&I.port!=null&&I.port===C.port})&&(v=!1):d||E.some(M=>{const O=M.getSource(),I=M.getTarget();return O&&I&&O.cell===x.cell&&I.cell===C.cell})&&(v=!1))}}return v&&g!=null&&(v=y(g)),v}allowConnectToBlank(e){const t=this.graph,i=t.options.connecting.allowBlank;if(typeof i!="function")return!!i;const s=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),l=t.findViewByCell(o),c=t.findViewByCell(a);return Y(i,t,{edge:e,edgeView:s,sourceCell:o,targetCell:a,sourceView:l,targetView:c,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:s.sourceMagnet,targetMagnet:s.targetMagnet})}validateEdge(e,t,r){const i=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const s=i.options.connecting.validateEdge;return s?Y(s,i,{edge:e,type:t,previous:r}):!0}arrowheadDragging(e,t,r,i){i.x=t,i.y=r,i.currentTarget!==e&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.findViewByElem(e),i.currentView?(i.currentMagnet=i.currentView.findMagnet(e),i.currentMagnet&&this.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,t,r,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=e,this.cell.prop(i.terminalType,{x:t,y:r},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(e,t,r){const i=e.currentView,s=e.currentMagnet;if(!s||!i)return;i.unhighlight(s,{type:"magnetAdsorbed"});const o=e.terminalType,a=i.getEdgeTerminal(s,t,r,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,r){const i=this.graph,{snap:s,allowEdge:o}=i.options.connecting,a=typeof s=="object"&&s.radius||50,l=i.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const y=i.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(w=>w!==this);l.push(...y)}const c=r.closestView||null,u=r.closestMagnet||null;r.closestView=null,r.closestMagnet=null;let h,f=Number.MAX_SAFE_INTEGER;const d=new P(e,t);l.forEach(y=>{if(y.container.getAttribute("magnet")!=="false"){if(y.isNodeView())h=y.cell.getBBox().getCenter().distance(d);else if(y.isEdgeView()){const w=y.getClosestPoint(d);w?h=w.distance(d):h=Number.MAX_SAFE_INTEGER}h<a&&h<f&&(u===y.container||this.validateConnection(...r.getValidateConnectionArgs(y,null),y.getEdgeTerminal(y.container,e,t,this.cell,r.terminalType)))&&(f=h,r.closestView=y,r.closestMagnet=y.container)}y.container.querySelectorAll("[magnet]").forEach(w=>{if(w.getAttribute("magnet")!=="false"){const x=y.getBBoxOfElement(w);h=d.distance(x.getCenter()),h<a&&h<f&&(u===w||this.validateConnection(...r.getValidateConnectionArgs(y,w),y.getEdgeTerminal(w,e,t,this.cell,r.terminalType)))&&(f=h,r.closestView=y,r.closestMagnet=w)}})});let g;const p=r.terminalType,b=r.closestView,m=r.closestMagnet,v=u!==m;if(c&&v&&c.unhighlight(u,{type:"magnetAdsorbed"}),b){if(!v)return;b.highlight(m,{type:"magnetAdsorbed"}),g=b.getEdgeTerminal(m,e,t,this.cell,p)}else g={x:e,y:t};this.cell.setTerminal(p,g,{},Object.assign(Object.assign({},r.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,r=e.closestMagnet;t&&r&&(t.unhighlight(r,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(r)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const r=e.terminalType,i=e.initialTerminal,s=this.cell[r];if(s&&!Ve.equalTerminals(i,s)){const a=this.graph,l=i,c=l.cell?a.getCellById(l.cell):null,u=l.port,h=c?a.findViewByCell(c):null,f=c||e.isNewEdge?null:P.create(i).toJSON(),d=s,g=d.cell?a.getCellById(d.cell):null,p=d.port,b=g?a.findViewByCell(g):null,m=g?null:P.create(s).toJSON();this.notify("edge:connected",{e:t,previousCell:c,previousPort:u,previousView:h,previousPoint:f,currentCell:g,currentView:b,currentPort:p,currentPoint:m,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:r,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,r=t.model.getCells();e.marked={};for(let i=0,s=r.length;i<s;i+=1){const o=t.findViewByCell(r[i]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const l=a.filter(c=>this.validateConnection(...e.getValidateConnectionArgs(o,c),o.getEdgeTerminal(c,e.x,e.y,this.cell,e.terminalType)));if(l.length>0){for(let c=0,u=l.length;c<u;c+=1)o.highlight(l[c],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=l}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(r=>{const i=this.graph.findViewByCell(r);i&&(t[r].forEach(o=>{i.unhighlight(o,{type:"magnetAvailable"})}),i.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,r){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,r);return}const s=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(s,{x:t,y:r});this.setEventData(e,o)}dragArrowhead(e,t,r){const i=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,r,i):this.arrowheadDragging(this.getEventTarget(e),t,r,i)}stopArrowheadDragging(e,t,r){const i=this.graph,s=this.getEventData(e);i.options.connecting.snap?this.snapArrowheadEnd(s):this.arrowheadDragged(s,t,r),this.validateEdge(this.cell,s.terminalType,s.initialTerminal)?(this.finishEmbedding(s),this.notifyConnectionEvent(s,e)):this.fallbackConnection(s),this.afterArrowheadDragging(s)}startLabelDragging(e,t,r){if(this.can("edgeLabelMovable")){const i=e.currentTarget,s=parseInt(i.getAttribute("data-index"),10),o=this.getLabelPositionAngle(s),a=this.getLabelPositionArgs(s),l=this.getDefaultLabelPositionArgs(),c=this.mergeLabelPositionArgs(a,l);this.setEventData(e,{index:s,positionAngle:o,positionArgs:c,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,r){const i=this.getEventData(e),s=this.cell.getLabelAt(i.index),o=Ie({},s,{position:this.getLabelPosition(t,r,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,o)}stopLabelDragging(e,t,r){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.getConnection=="function"}n.isEdgeView=e})(ar||(ar={})),ar.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),ar.registry.register("edge",ar,!0);var G5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Sn extends ge{get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:r}=Pe.parseJSONMarkup(Sn.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=Sn.snapshoot(this.container),K(this.container,this.prefixClassName("graph")),zn(this.container,r),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&le.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onDblClick(t,i.x,i.y):this.graph.trigger("blank:dblclick",{e:t,x:i.x,y:i.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onClick(t,i.x,i.y):this.graph.trigger("blank:click",{e:t,x:i.x,y:i.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=Y(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.isPreventDefaultContextMenu(r)&&e.preventDefault(),this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onContextMenu(t,i.x,i.y):this.graph.trigger("blank:contextmenu",{e:t,x:i.x,y:i.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const r=this.constructor;this.delegateDocumentEvents(r.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;this.options.preventDefaultMouseDown&&e.preventDefault();const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onMouseDown(t,i.x,i.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:i.x,y:i.y})),this.delegateDragEvents(t,r)}onMouseMove(e){const t=this.getEventData(e),r=t.startPosition;if(r&&r.x===e.clientX&&r.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const s=this.normalizeEvent(e),o=this.graph.snapToGrid(s.clientX,s.clientY),a=t.currentView;a?a.onMouseMove(s,o.x,o.y):this.graph.trigger("blank:mousemove",{e:s,x:o.x,y:o.y}),this.setEventData(s,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY),s=this.getEventData(e).currentView;if(s?s.onMouseUp(t,r.x,r.y):this.graph.trigger("blank:mouseup",{e:t,x:r.x,y:r.y}),!e.isPropagationStopped()){const o=new Fn(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseEnter(t)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseLeave(t)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=t.originalEvent,s=this.graph.snapToGrid(i.clientX,i.clientY),o=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));r?r.onMouseWheel(t,s.x,s.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:s.x,y:s.y})}onCustomEvent(e){const t=e.currentTarget,r=t.getAttribute("event")||t.getAttribute("data-event");if(r){const i=this.findView(t);if(i){const s=this.normalizeEvent(e);if(this.guard(s,i))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);i.onCustomEvent(s,r,o.x,o.y)}}}handleMagnetEvent(e,t){const r=e.currentTarget,i=r.getAttribute("magnet");if(i&&i.toLowerCase()!=="false"){const s=this.findView(r);if(s){const o=this.normalizeEvent(e);if(this.guard(o,s))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);Y(t,this.graph,s,o,r,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetMouseDown(r,i,s,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetDblClick(r,i,s,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(r,i,s,o,a)=>{r.onMagnetContextMenu(i,s,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const s=this.graph.snapToGrid(i.clientX,i.clientY);r.onLabelMouseDown(i,s.x,s.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}G5([ge.dispose()],Sn.prototype,"dispose",null),function(n){const e=`${on.prefixCls}-graph`;n.markup=[{ns:ct.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:ct.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:ct.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":ct.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(r){const i=r.cloneNode();return r.childNodes.forEach(s=>i.appendChild(s)),()=>{for(To(r);r.attributes.length>0;)r.removeAttribute(r.attributes[0].name);for(let s=0,o=i.attributes.length;s<o;s+=1){const a=i.attributes[s];r.setAttribute(a.name,a.value)}i.childNodes.forEach(s=>r.appendChild(s))}}n.snapshoot=t}(Sn||(Sn={})),function(n){const e=on.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(Sn||(Sn={}));const H5=`.x6-graph {
93
96
  position: relative;
94
97
  overflow: hidden;
95
98
  outline: none;
@@ -248,7 +251,7 @@
248
251
  border: 1px solid #275fc5;
249
252
  border-radius: 2px;
250
253
  }
251
- `;class f1 extends nC{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}class f2 extends f1{init(){hk.autoInsertCSS&&uP("core",f0)}dispose(){uO("core")}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([f2.dispose()],f2.prototype,"dispose",null);var f3=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};(e$=tL||(tL={})).get=function(e){let{grid:t,panning:n,mousewheel:r,embedding:i}=e,o=f3(e,["grid","panning","mousewheel","embedding"]),s=e.container;if(null!=s)null==o.width&&(o.width=s.clientWidth),null==o.height&&(o.height=s.clientHeight);else throw Error("Ensure the container of the graph is specified and valid");let l=iM({},e$.defaults,o),a={size:10,visible:!1};return"number"==typeof t?l.grid={size:t,visible:!1}:"boolean"==typeof t?l.grid=Object.assign(Object.assign({},a),{visible:t}):l.grid=Object.assign(Object.assign({},a),t),["panning","mousewheel","embedding"].forEach(t=>{let n=e[t];"boolean"==typeof n?l[t].enabled=n:l[t]=Object.assign(Object.assign({},l[t]),n)}),l},(tL||(tL={})).defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:hk.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:hk.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection:({type:e,sourceView:t,targetView:n})=>null!=("target"===e?n:t),createEdge:()=>new fq},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1};var f5=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class f6 extends f1{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){let t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();let n=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(e)?e:[e];this.patterns.forEach((e,o)=>{let s=`pattern_${o}`,l=n.a||1,a=n.d||1,{update:u,markup:c}=e,h=Object.assign(Object.assign(Object.assign({},f5(e,["update","markup"])),i[o]),{sx:l,sy:a,ox:n.e||0,oy:n.f||0,width:t*l,height:t*a});!r.has(s)&&r.add(s,aK.create("pattern",{id:s,patternUnits:"userSpaceOnUse"},aK.createVectors(c)).node);let d=r.get(s);"function"==typeof u&&u(d.childNodes[0],h);let f=h.ox%h.width;f<0&&(f+=h.width);let p=h.oy%h.height;p<0&&(p+=h.height),aj(d,{x:f,y:p,width:h.width,height:h.height})});let o=new XMLSerializer().serializeToString(r.root),s=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=s}getInstance(){return!this.instance&&(this.instance=new u0),this.instance}resolveGrid(e){if(!e)return[];let t=e.type;if(null==t)return[Object.assign(Object.assign({},u0.presets.dot),e.args)];let n=u0.registry.get(t);if(n){let t=e.args||[];return!Array.isArray(t)&&(t=[t]),Array.isArray(n)?n.map((e,n)=>Object.assign(Object.assign({},e),t[n])):[Object.assign(Object.assign({},n),t[0])]}return u0.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([f1.dispose()],f6.prototype,"dispose",null);class f4 extends f1{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){let e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),ui(this.viewportMatrix)}setMatrix(e){let t=ui(e),n=ul(t);this.viewport.setAttribute("transform",n),this.viewportMatrix=t,this.viewportTransformString=n}resize(e,t){let n=void 0===e?this.options.width:e,r=void 0===t?this.options.height:t;this.options.width=n,this.options.height=r,"number"==typeof n&&(n=Math.round(n)),"number"==typeof r&&(r=Math.round(r)),this.container.style.width=null==n?"":`${n}px`,this.container.style.height=null==r?"":`${r}px`;let i=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},i)),this}getComputedSize(){let e=this.options.width,t=this.options.height;return!lq(e)&&(e=this.container.clientWidth),!lq(t)&&(t=this.container.clientHeight),{width:e,height:t}}getScale(){var e;let t,n,r,i;return(e=this.getMatrix())?(t=null==e.a?1:e.a,i=null==e.d?1:e.d,n=e.b,r=e.c):t=i=1,{sx:n?Math.sqrt(t*t+n*n):t,sy:r?Math.sqrt(r*r+i*i):i}}scale(e,t=e,n=0,r=0){if(e=this.clampScale(e),t=this.clampScale(t),n||r){let i=this.getTranslation(),o=i.tx-n*(e-1),s=i.ty-r*(t-1);(o!==i.tx||s!==i.ty)&&this.translate(o,s)}let i=this.getMatrix();return i.a=e,i.d=t,this.setMatrix(i),this.graph.trigger("scale",{sx:e,sy:t,ox:n,oy:r}),this}clampScale(e){let t=this.graph.options.scaling;return lW(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let n=e,r=e,i=this.getScale(),o=this.getComputedSize(),s=o.width/2,l=o.height/2;if(!t.absolute&&(n+=i.sx,r+=i.sy),t.scaleGrid&&(n=Math.round(n/t.scaleGrid)*t.scaleGrid,r=Math.round(r/t.scaleGrid)*t.scaleGrid),t.maxScale&&(n=Math.min(t.maxScale,n),r=Math.min(t.maxScale,r)),t.minScale&&(n=Math.max(t.minScale,n),r=Math.max(t.minScale,r)),t.center&&(s=t.center.x,l=t.center.y),n=this.clampScale(n),r=this.clampScale(r),s||l){let e=this.getTranslation(),t=s-(s-e.tx)*(n/i.sx),o=l-(l-e.ty)*(r/i.sy);(t!==e.tx||o!==e.ty)&&this.translate(t,o)}return this.scale(n,r),this}getRotation(){return function(e){let t={x:0,y:1};e&&(t=uu(e,t));let n=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:n%360+(n<0?360:0)}}(this.getMatrix())}rotate(e,t,n){if(null==t||null==n){let e=ty.getBBox(this.stage);t=e.width/2,n=e.height/2}let r=this.getMatrix().translate(t,n).rotate(e).translate(-t,-n);return this.setMatrix(r),this}getTranslation(){var e;return{tx:(e=this.getMatrix())&&e.e||0,ty:e&&e.f||0}}translate(e,t){let n=this.getMatrix();n.e=e||0,n.f=t||0,this.setMatrix(n);let r=this.getTranslation();return this.options.x=r.tx,this.options.y=r.ty,this.graph.trigger("translate",Object.assign({},r)),this}setOrigin(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,n,r){if("object"==typeof e){let i=e;e=i.gridWidth||1,t=i.gridHeight||1,n=i.padding||0,r=i}else e=e||1,t=t||1,n=n||0,null==r&&(r={});let i=lJ(n),o=r.border||0,s=r.contentArea?uM.create(r.contentArea):this.getContentArea(r);o>0&&s.inflate(o);let l=this.getScale(),a=this.getTranslation(),u=l.sx,c=l.sy;s.x*=u,s.y*=c,s.width*=u,s.height*=c;let h=Math.max(Math.ceil((s.width+s.x)/e),1)*e,d=Math.max(Math.ceil((s.height+s.y)/t),1)*t,f=0,p=0;("negative"===r.allowNewOrigin&&s.x<0||"positive"===r.allowNewOrigin&&s.x>=0||"any"===r.allowNewOrigin)&&(h+=f=Math.ceil(-s.x/e)*e+i.left),("negative"===r.allowNewOrigin&&s.y<0||"positive"===r.allowNewOrigin&&s.y>=0||"any"===r.allowNewOrigin)&&(d+=p=Math.ceil(-s.y/t)*t+i.top),h+=i.right,d+=i.bottom,h=Math.max(h,r.minWidth||0),d=Math.max(d,r.minHeight||0),h=Math.min(h,r.maxWidth||Number.MAX_SAFE_INTEGER),d=Math.min(d,r.maxHeight||Number.MAX_SAFE_INTEGER);let g=this.getComputedSize(),m=h!==g.width||d!==g.height;return(f!==a.tx||p!==a.ty)&&this.translate(f,p),m&&this.resize(h,d),new uM(-f/u,-p/c,h/u,d/c)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let n,r,i;if(e.contentArea){let t=e.contentArea;n=this.graph.localToGraph(t),r=uA.create(t)}else n=this.getContentBBox(e),r=this.graph.graphToLocal(n);if(!n.width||!n.height)return;let o=lJ(e.padding),s=e.minScale||0,l=e.maxScale||Number.MAX_SAFE_INTEGER,a=e.minScaleX||s,u=e.maxScaleX||l,c=e.minScaleY||s,h=e.maxScaleY||l;if(e.viewportArea)i=e.viewportArea;else{let e=this.getComputedSize(),t=this.getTranslation();i={x:t.tx,y:t.ty,width:e.width,height:e.height}}i=uM.create(i).moveAndExpand({x:o.left,y:o.top,width:-o.left-o.right,height:-o.top-o.bottom});let d=this.getScale(),f=i.width/n.width*d.sx,p=i.height/n.height*d.sy;!1!==e.preserveAspectRatio&&(f=p=Math.min(f,p));let g=e.scaleGrid;if(g&&(f=g*Math.floor(f/g),p=g*Math.floor(p/g)),f=lW(f,a,u),p=lW(p,c,h),this.scale(f,p),t){let e=this.options,t=i.x-r.x*f-e.x,n=i.y-r.y*p-e.y;this.translate(t,n)}}getContentArea(e={}){return!1!==e.useCellGeometry?this.model.getAllCellsBBox()||new uM:ty.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){let e=uM.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){let n=uM.create(e),r=this.graph;t.contentArea=n,null==t.viewportArea&&(t.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);let i=n.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){let n=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=n.width/2,s=n.height/2;e="number"==typeof e?e:o,t="number"==typeof t?t:s,e=o-e*r.sx,t=s-t*r.sy,(i.tx!==e||i.ty!==t)&&this.translate(e,t)}centerContent(e){let t=this.graph.getContentArea(e).getCenter();this.centerPoint(t.x,t.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,n){let r=this.getComputedSize();(t=lY(t,Math.max(0,r.width)))<0&&(t=r.width+t),(n=lY(n,Math.max(0,r.height)))<0&&(n=r.height+n);let i=this.getTranslation(),o=this.getScale(),s=t-e.x*o.sx,l=n-e.y*o.sy;(i.tx!==s||i.ty!==l)&&this.translate(s,l)}positionRect(e,t){let n=uM.create(e);switch(t){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(e,t){let n=e.getBBox();return this.positionRect(n,t)}positionContent(e,t){let n=this.graph.getContentArea(t);return this.positionRect(n,e)}}class f8 extends f1{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(e={}){let t=e.size||"auto auto",n=e.position||"center",r=this.graph.transform.getScale(),i=this.graph.translate();if("object"==typeof n){let e=i.tx+r.sx*(n.x||0),t=i.ty+r.sy*(n.y||0);n=`${e}px ${t}px`}"object"==typeof t&&(t=uM.fromSize(t).scale(r.sx,r.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=n}drawBackgroundImage(e,t={}){let n;if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}let r=this.optionsCache;if(r&&r.image!==t.image)return;let i=t.opacity,o=t.size,s=t.repeat||"no-repeat",l=tf.registry.get(s);if("function"==typeof l){let r=t.quality||1;e.width*=r,e.height*=r;let i=l(e,t);if(!(i instanceof HTMLCanvasElement))throw Error("Background pattern must return an HTML Canvas instance");n=i.toDataURL("image/png"),s=t.repeat&&s!==t.repeat?t.repeat:"repeat","object"==typeof o?(o.width*=i.width/e.width,o.height*=i.height/e.height):void 0===o&&(t.size={width:i.width/r,height:i.height/r})}else n=e.src,void 0===o&&(t.size={width:e.width,height:e.height});null!=r&&"object"==typeof t.size&&t.image===r.image&&t.repeat===r.repeat&&t.quality===r.quality&&(r.size=oy(t.size));let a=this.elem.style;a.backgroundImage=`url(${n})`,a.backgroundRepeat=s,a.opacity=null==i||i>=1?"":`${i}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){let t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=oy(t);let n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,e),n.setAttribute("crossorigin","anonymous"),n.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([f1.dispose()],f8.prototype,"dispose",null);class f9 extends f1{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&!0===this.widgetOptions.enabled}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),ti.on(this.graph.container,"mousedown",this.onRightMouseDown),this.mousewheelHandle=new uy(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),ti.off(this.graph.container,"mousedown",this.onRightMouseDown),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return this.pannable&&ta.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){let t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),ti.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ti.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){let t=this.view.normalizeEvent(e),n=t.clientX-this.clientX,r=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(n,r)}stopPanning(e){this.panning=!1,this.updateClassName(),ti.off(document.body,".panning"),ti.off(window,".panning")}updateClassName(){let e=this.view.container,t=this.view.prefixClassName("graph-panning"),n=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(aa(e,t),au(e,n)):(au(e,t),aa(e,n)):(au(e,t),au(e,n))}onMouseDown({e}){if(!this.allowBlankMouseDown(e))return;let t=this.graph.getPlugin("selection"),n=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!n)&&this.startPanning(e)}onRightMouseDown(e){let t=this.widgetOptions.eventTypes;if(!!((null==t?void 0:t.includes("rightMouseDown"))&&2===e.button))this.allowPanning(e,!0)&&this.startPanning(e)}onMouseWheel(e,t,n){this.graph.translateBy(-t,-n)}allowBlankMouseDown(e){let t=this.widgetOptions.eventTypes;return(null==t?void 0:t.includes("leftMouseDown"))&&0===e.button||(null==t?void 0:t.includes("mouseWheelDown"))&&1===e.button}allowMouseWheel(e){var t;return this.pannable&&!e.ctrlKey&&(null===(t=this.widgetOptions.eventTypes)||void 0===t?void 0:t.includes("mouseWheel"))}autoPanning(e,t){let n=this.graph.getGraphArea(),r=0,i=0;e<=n.left+10&&(r=-10),t<=n.top+10&&(i=-10),e>=n.right-10&&(r=10),t>=n.bottom-10&&(i=10),(0!==r||0!==i)&&this.graph.translateBy(-r,-i)}enablePanning(){!this.pannable&&(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([f1.dispose()],f9.prototype,"dispose",null);class f7 extends f1{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new uy(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return!0!==this.widgetOptions.enabled}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){!this.disabled&&(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){let t=this.widgetOptions.guard;return(null==t||t(e))&&ta.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){let t=this.widgetOptions.guard;if((null==t||t(e))&&ta.isMatch(e,this.widgetOptions.modifiers)){let t=this.widgetOptions.factor||1.2;null==this.currentScale&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*t*20)/20/this.currentScale,1===this.cumulatedFactor&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/t)*20)/20/this.currentScale,1===this.cumulatedFactor&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);let n=this.currentScale,r=this.graph.transform.clampScale(n*this.cumulatedFactor),i=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER;if((r=lW(r,i,this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER))!==n){if(this.widgetOptions.zoomAtMousePosition){let e=this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(r,{absolute:!0,center:e.clone()})}else this.graph.zoom(r,{absolute:!0})}this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([nC.dispose()],f7.prototype,"dispose",null);class pe extends f1{init(){this.resetRenderArea=nK(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){let e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([f1.dispose()],pe.prototype,"dispose",null);class pt{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&tR.PRIOR)e.cb();else{let t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){let e;this.isFlushPending=!1,this.isFlushing=!0;let t=this.getCurrentTime();for(;(e=this.queue.shift())&&(e.cb(),!(this.getCurrentTime()-t>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){let e;for(this.isFlushPending=!1,this.isFlushing=!0;e=this.queue.shift();)try{e.cb()}catch(e){console.log(e)}this.isFlushing=!1}findInsertionIndex(e){let t=0,n=this.queue.length,r=n-1,i=e.priority;for(;t<=r;){let e=(r-t>>1)+t;i<=this.queue[e].priority?t=e+1:(n=e,r=e-1)}return n}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?this.scheduleId&&window.cancelIdleCallback(this.scheduleId):this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0}getCurrentTime(){return"object"==typeof performance&&"function"==typeof performance.now?performance.now():Date.now()-this.initialTime}}(eU=tR||(tR={}))[eU.Update=2]="Update",eU[eU.RenderEdge=4]="RenderEdge",eU[eU.RenderNode=8]="RenderNode",eU[eU.PRIOR=1048576]="PRIOR";class pn extends nC{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new pt,this.graph=e,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();let t=this.model.getCells();this.renderViews(t,Object.assign(Object.assign({},e),{queue:t.map(e=>e.id)}))}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){let n=this.views[e.id];n&&this.requestViewUpdate(n.view,pn.FLAG_INSERT,t,tR.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,n={},r=tR.Update,i=!0){let o=e.cell.id,s=this.views[o];if(!!s)s.flag=t,s.options=n,(e.hasAction(t,["translate","resize","rotate"])||!1===n.async)&&(r=tR.PRIOR,i=!1),this.queue.queueJob({id:o,priority:r,cb:()=>{this.renderViewInArea(e,t,n);let r=n.queue;if(r){let t=r.indexOf(e.cell.id);t>=0&&r.splice(t,1),0===r.length&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(e).forEach(e=>{this.requestViewUpdate(e.view,e.flag,n,r,!1)}),i&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(null==e)return!1;let t=this.views[e.cell.id];return!!t&&t.state===pn.ViewState.MOUNTED}renderViews(e,t={}){e.sort((e,t)=>e.isNode()&&t.isEdge()?-1:0),e.forEach(e=>{let n=e.id,r=this.views,i=0,o=r[n];if(o)i=pn.FLAG_INSERT;else{let r=this.createCellView(e);r&&(r.graph=this.graph,i=pn.FLAG_INSERT|r.getBootstrapFlag(),o={view:r,flag:i,options:t,state:pn.ViewState.CREATED},this.views[n]=o)}o&&this.requestViewUpdate(o.view,i,t,this.getRenderPriority(o.view),!1)}),this.flush()}renderViewInArea(e,t,n={}){let r=e.cell,i=r.id,o=this.views[i];if(!o)return;let s=0;this.isUpdatable(e)?(s=this.updateView(e,t,n),o.flag=s):o.state===pn.ViewState.MOUNTED?(s=this.updateView(e,t,n),o.flag=s):o.state=pn.ViewState.WAITING,s&&r.isEdge()&&(s&e.getFlag(["source","target"]))==0&&this.queue.queueJob({id:i,priority:tR.RenderEdge,cb:()=>{this.updateView(e,t,n)}})}removeViews(e){e.forEach(e=>{let t=e.id,n=this.views[t];n&&(this.willRemoveViews[t]=n,delete this.views[t],this.queue.queueJob({id:t,priority:this.getRenderPriority(n.view),cb:()=>{this.removeView(n.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(e=>{if(e&&e.state===pn.ViewState.WAITING){let{view:t,flag:n,options:r}=e;this.requestViewUpdate(t,n,r,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,n={}){if(null==e)return 0;if(ds.isCellView(e)){if(t&pn.FLAG_REMOVE)return this.removeView(e.cell),0;t&pn.FLAG_INSERT&&(this.insertView(e),t^=pn.FLAG_INSERT)}return t?e.confirmUpdate(t,n):0}insertView(e){let t=this.views[e.cell.id];if(t){let n=e.cell.getZIndex(),r=this.addZPivot(n);this.container.insertBefore(e.container,r),!e.cell.isVisible()&&this.toggleVisible(e.cell,!1),t.state=pn.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){let t=e.cell,n=this.willRemoveViews[t.id];n&&e&&(n.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){let n=this.model.getConnectedEdges(e);for(let e=0,r=n.length;e<r;e+=1){let r=n[e];if(t){let e=r.getSourceCell(),t=r.getTargetCell();if(e&&!e.isVisible()||t&&!t.isVisible())continue;this.toggleVisible(r,!0)}else this.toggleVisible(r,!1)}let r=this.views[e.id];r&&aq(r.view.container,{display:t?"unset":"none"})}addZPivot(e=0){null==this.zPivots&&(this.zPivots={});let t=this.zPivots,n=t[e];if(n)return n;n=t[e]=document.createComment(`z-index:${e+1}`);let r=-1/0;for(let n in t){let t=+n;if(t<e&&t>r&&(r=t)===e-1)continue}let i=this.container;if(r!==-1/0){let e=t[r];i.insertBefore(n,e.nextSibling)}else i.insertBefore(n,i.firstChild);return n}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){let t={graph:this.graph},n=this.graph.options.createCellView;if(n){let r=n0(n,this.graph,e);if(r)return new r(e,t);if(null===r)return null}let r=e.view;if(null!=r&&"string"==typeof r){let n=ds.registry.get(r);return n?new n(e,t):ds.registry.onNotFound(r)}return e.isNode()?new fQ(e,t):e.isEdge()?new fK(e,t):null}getEffectedEdges(e){let t=[],n=e.cell,r=this.model.getConnectedEdges(n);for(let e=0,i=r.length;e<i;e+=1){let i=r[e],o=this.views[i.id];if(!o)continue;let s=o.view;if(!this.isViewMounted(s))continue;let l=["update"];i.getTargetCell()===n&&l.push("target"),i.getSourceCell()===n&&l.push("source"),t.push({id:i.id,view:s,flag:s.getFlag(l)})}return t}isUpdatable(e){if(e.isNodeView())return!this.renderArea||this.renderArea.isIntersectWithRect(e.cell.getBBox());if(e.isEdgeView()){let t=e.cell,n=t.getSourceCell(),r=t.getTargetCell();if(this.renderArea&&n&&r)return this.renderArea.isIntersectWithRect(n.getBBox())||this.renderArea.isIntersectWithRect(r.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?tR.RenderNode:tR.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([nC.dispose()],pn.prototype,"dispose",null),(eG=pn||(pn={})).FLAG_INSERT=0x40000000,eG.FLAG_REMOVE=0x20000000,eG.FLAG_RENDER=0x3ffffff;(eq=(eH=pn||(pn={})).ViewState||(eH.ViewState={}))[eq.CREATED=0]="CREATED",eq[eq.MOUNTED=1]="MOUNTED",eq[eq.WAITING=2]="WAITING";class pr extends f1{constructor(){super(...arguments),this.schedule=new pn(this.graph)}requestViewUpdate(e,t,n={}){this.schedule.requestViewUpdate(e,t,n)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(null==e)return null;let t=this.options.container,n="string"==typeof e?t.querySelector(e):e instanceof Element?e:e[0];if(n){let e=this.graph.view.findAttr("data-cell-id",n);if(e){let t=this.schedule.views;if(t[e])return t[e].view}}return null}findViewByCell(e){if(null==e)return null;let t=fL.isCell(e)?e.id:e,n=this.schedule.views;return n[t]?n[t].view:null}findViewsFromPoint(e){let t={x:e.x,y:e.y};return this.model.getCells().map(e=>this.findViewByCell(e)).filter(e=>null!=e&&ty.getBBox(e.container,{target:this.view.stage}).containsPoint(t))}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(e=>this.findViewByCell(e)).filter(n=>{if(null!=n){let r=n.getClosestPoint(e);if(r)return r.distance(e)<=t}return!1})}findViewsInArea(e,t={}){let n=uM.create(e);return this.model.getCells().map(e=>this.findViewByCell(e)).filter(e=>{if(e){if(t.nodeOnly&&!e.isNodeView())return!1;let r=ty.getBBox(e.container,{target:this.view.stage});return 0===r.width?r.inflate(1,0):0===r.height&&r.inflate(0,1),t.strict?n.containsRect(r):n.isIntersectWithRect(r)}return!1})}dispose(){this.schedule.dispose()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([f1.dispose()],pr.prototype,"dispose",null);var pi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class po extends f1{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return null!=this.svg.getElementById(e)}filter(e){let t=e.id,n=e.name;if(!t&&(t=`filter-${n}-${this.cid}-${lG(JSON.stringify(e))}`),!this.isDefined(t)){let r=tp.registry.get(n);if(null==r)return tp.registry.onNotFound(n);let i=r(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});aK.create(tE.sanitize(i),o).appendTo(this.defs)}return t}gradient(e){let t=e.id,n=e.type;if(!t&&(t=`gradient-${n}-${this.cid}-${lG(JSON.stringify(e))}`),!this.isDefined(t)){let r=e.stops.map(e=>{let t=null!=e.opacity&&Number.isFinite(e.opacity)?e.opacity:1;return`<stop offset="${e.offset}" stop-color="${e.color}" stop-opacity="${t}"/>`}),i=`<${n}>${r.join("")}</${n}>`,o=Object.assign({id:t},e.attrs);aK.create(i,o).appendTo(this.defs)}return t}marker(e){let{id:t,refX:n,refY:r,markerUnits:i,markerOrient:o,tagName:s,children:l}=e,a=pi(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]),u=t;if(!u&&(u=`marker-${this.cid}-${lG(JSON.stringify(e))}`),!this.isDefined(u)){"path"!==s&&delete a.d;let e=aK.create("marker",{refX:n,refY:r,id:u,overflow:"visible",orient:null!=o?o:"auto",markerUnits:i||"userSpaceOnUse"},l?l.map(e=>{var{tagName:t}=e,n=pi(e,["tagName"]);return aK.create(`${t}`||"path",aL(Object.assign(Object.assign({},a),n)))}):[aK.create(s||"path",aL(a))]);this.defs.appendChild(e.node)}return u}remove(e){let t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class ps extends f1{getClientMatrix(){return ui(this.view.stage.getScreenCTM())}getClientOffset(){let e=this.view.svg.getBoundingClientRect();return new uA(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return("number"==typeof e?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){let n=uA.create(e,t);return ty.transformPoint(n,this.graph.matrix())}localToClientPoint(e,t){let n=uA.create(e,t);return ty.transformPoint(n,this.getClientMatrix())}localToPagePoint(e,t){return("number"==typeof e?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,n,r){let i=uM.create(e,t,n,r);return ty.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,n,r){let i=uM.create(e,t,n,r);return ty.transformRectangle(i,this.getClientMatrix())}localToPageRect(e,t,n,r){return("number"==typeof e?this.localToGraphRect(e,t,n,r):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){let n=uA.create(e,t);return ty.transformPoint(n,this.graph.matrix().inverse())}clientToLocalPoint(e,t){let n=uA.create(e,t);return ty.transformPoint(n,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){let n=uA.create(e,t);return ty.transformPoint(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){let n=uA.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(n)}graphToLocalRect(e,t,n,r){let i=uM.create(e,t,n,r);return ty.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,n,r){let i=uM.create(e,t,n,r);return ty.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,n,r){let i=uM.create(e,t,n,r);return ty.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,n,r){let i=uM.create(e,t,n,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}class pl extends f1{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:e,magnet:t,options:n={}}){let r=this.resolveHighlighter(n);if(!r)return;let i=this.getHighlighterId(t,r);if(!this.highlights[i]){let n=r.highlighter;n.highlight(e,t,Object.assign({},r.args)),this.highlights[i]={cellView:e,magnet:t,highlighter:n,args:r.args}}}onCellUnhighlight({magnet:e,options:t={}}){let n=this.resolveHighlighter(t);if(!n)return;let r=this.getHighlighterId(e,n);this.unhighlight(r)}resolveHighlighter(e){let t=this.options,n=e.highlighter;if(null==n){let r=e.type;n=r&&t.highlighting[r]||t.highlighting.default}if(null==n)return null;let r="string"==typeof n?{name:n}:n,i=r.name,o=tv.registry.get(i);return null==o?tv.registry.onNotFound(i):(tv.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(e,t){return ah(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){let t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([pl.dispose()],pl.prototype,"dispose",null);class pa extends f1{getScroller(){let e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){let e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){let e=this.options.autoResize;if(e)return"boolean"==typeof e?this.getContainer():e}init(){if(this.options.autoResize){let e=this.getSensorTarget();e&&ts.bind(e,()=>{let t=e.offsetWidth,n=e.offsetHeight;this.resize(t,n)})}}resize(e,t){let n=this.getScroller();n?n.resize(e,t):this.graph.transform.resize(e,t)}dispose(){ts.clear(this.graph.container)}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([f1.dispose()],pa.prototype,"dispose",null);class pu extends sp{get container(){return this.options.container}get[Symbol.toStringTag](){return pu.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=tL.get(e),this.css=new f2(this),this.view=new fZ(this),this.defs=new po(this),this.coord=new ps(this),this.transform=new f4(this),this.highlight=new pl(this),this.grid=new f6(this),this.background=new f8(this),this.options.model?this.model=this.options.model:(this.model=new fV,this.model.graph=this),this.renderer=new pr(this),this.panning=new f9(this),this.mousewheel=new f7(this),this.virtualRender=new pe(this),this.size=new pa(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(e=>fB.isNode(e)?e:this.createNode(e)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(e=>fz.isEdge(e)?e:this.createEdge(e)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,n={}){return this.model.isNeighbor(e,t,n)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,n={}){return this.model.isSuccessor(e,t,n)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,n={}){return this.model.isPredecessor(e,t,n)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,n,r,i){return this.model.getNodesInArea(e,t,n,r,i)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,n={}){return this.model.search(e,t,n),this}getShortestPath(e,t,n={}){return this.model.getShortestPath(e,t,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,n){let r="string"==typeof e?e:"update",i="string"==typeof e?t:e,o="function"==typeof t?n:t;this.startBatch(r,o);let s=i();return this.stopBatch(r,o),s}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return fL.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return uM.isRectangleLike(e)?this.findViewsInArea(e):uA.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){return this.renderer.findViewsFromPoint("number"==typeof e?{x:e,y:t}:e)}findViewsInArea(e,t,n,r,i){let o="number"==typeof e?{x:e,y:t,width:n,height:r}:e,s="number"==typeof e?i:t;return this.renderer.findViewsInArea(o,s)}matrix(e){return void 0===e?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){let n=this.getPlugin("scroller");return n?n.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,n=0,r=0){return void 0===e?this.transform.getScale():(this.transform.scale(e,t,n,r),this)}zoom(e,t){let n=this.getPlugin("scroller");if(n){if(void 0===e)return n.zoom();n.zoom(e,t)}else{if(void 0===e)return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){let n=this.getPlugin("scroller");return n?n.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){let n=this.getPlugin("scroller");return n?n.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){let t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,n){return void 0===e?this.transform.getRotation():(this.transform.rotate(e,t,n),this)}translate(e,t){return void 0===e?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){let n=this.translate(),r=n.tx+e,i=n.ty+t;return this.translate(r,i)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,n,r){return this.transform.fitToContent(e,t,n,r)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,n){let r=this.getPlugin("scroller");return r?r.centerPoint(e,t,n):this.transform.centerPoint(e,t),this}centerContent(e){let t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){let n=this.getPlugin("scroller");return n?n.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,n,r={}){let i=this.getPlugin("scroller");return i?i.positionPoint(e,t,n,r):this.transform.positionPoint(e,t,n),this}positionRect(e,t,n){let r=this.getPlugin("scroller");return r?r.positionRect(e,t,n):this.transform.positionRect(e,t),this}positionCell(e,t,n){let r=this.getPlugin("scroller");return r?r.positionCell(e,t,n):this.transform.positionCell(e,t),this}positionContent(e,t){let n=this.getPlugin("scroller");return n?n.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,n,r){return uM.isRectangleLike(e)?this.coord.pageToLocalRect(e):"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r?this.coord.pageToLocalRect(e,t,n,r):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,n,r){return uM.isRectangleLike(e)?this.coord.localToPageRect(e):"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r?this.coord.localToPageRect(e,t,n,r):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,n,r){return uM.isRectangleLike(e)?this.coord.clientToLocalRect(e):"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r?this.coord.clientToLocalRect(e,t,n,r):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,n,r){return uM.isRectangleLike(e)?this.coord.localToClientRect(e):"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r?this.coord.localToClientRect(e,t,n,r):this.coord.localToClientPoint(e,t)}localToGraph(e,t,n,r){return uM.isRectangleLike(e)?this.coord.localToGraphRect(e):"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r?this.coord.localToGraphRect(e,t,n,r):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,n,r){return uM.isRectangleLike(e)?this.coord.graphToLocalRect(e):"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r?this.coord.graphToLocalRect(e,t,n,r):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,n,r){return uM.isRectangleLike(e)?this.coord.clientToGraphRect(e):"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r?this.coord.clientToGraphRect(e,t,n,r):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){let n=this.getPlugin("scroller");return null==n||null!=this.options.background&&t?this.background.draw(e):n.drawBackground(e,t),this}clearBackground(e){let t=this.getPlugin("scroller");return null==t||null!=this.options.background&&e?this.background.clear():t.clearBackground(e),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(e){return null==e?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){let e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){let e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){let e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return null==e?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return!this.installedPlugins.has(e)&&(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;!Array.isArray(t)&&(t=[t]);let n=this.getPlugins(t);return null==n||n.forEach(e=>{var t;null===(t=null==e?void 0:e.enable)||void 0===t||t.call(e)}),this}disablePlugins(e){let t=e;!Array.isArray(t)&&(t=[t]);let n=this.getPlugins(t);return null==n||n.forEach(e=>{var t;null===(t=null==e?void 0:e.disable)||void 0===t||t.call(e)}),this}isPluginEnabled(e){var t;let n=this.getPlugin(e);return null===(t=null==n?void 0:n.isEnabled)||void 0===t?void 0:t.call(n)}disposePlugins(e){let t=e;!Array.isArray(t)&&(t=[t]);let n=this.getPlugins(t);return null==n||n.forEach(e=>{e.dispose(),this.installedPlugins.delete(e)}),this}dispose(e=!0){e&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([sp.dispose()],pu.prototype,"dispose",null),(eW=pu||(pu={})).View=fZ,eW.Renderer=pr,eW.MouseWheel=f7,eW.DefsManager=po,eW.GridManager=f6,eW.CoordManager=ps,eW.TransformManager=f4,eW.HighlightManager=pl,eW.BackgroundManager=f8,eW.PanningManager=f9,(eX=pu||(pu={})).toStringTag=`X6.${eX.name}`,eX.isGraph=function(e){if(null==e)return!1;if(e instanceof eX)return!0;let t=e[Symbol.toStringTag];return null==t||t===eX.toStringTag||!1},(eY=pu||(pu={})).render=function(e,t){let n=e instanceof HTMLElement?new eY({container:e}):new eY(e);return null!=t&&n.fromJSON(t),n},(eJ=pu||(pu={})).registerNode=fB.registry.register,eJ.registerEdge=fz.registry.register,eJ.registerView=ds.registry.register,eJ.registerAttr=tm.registry.register,eJ.registerGrid=u0.registry.register,eJ.registerFilter=tp.registry.register,eJ.registerNodeTool=tP.registry.register,eJ.registerEdgeTool=tO.registry.register,eJ.registerBackground=tf.registry.register,eJ.registerHighlighter=tv.registry.register,eJ.registerPortLayout=tx.registry.register,eJ.registerPortLabelLayout=tw.registry.register,eJ.registerMarker=tg.registry.register,eJ.registerRouter=tN.registry.register,eJ.registerConnector=tj.registry.register,eJ.registerAnchor=tk.registry.register,eJ.registerEdgeAnchor=tA.registry.register,eJ.registerConnectionPoint=tM.registry.register,(eQ=pu||(pu={})).unregisterNode=fB.registry.unregister,eQ.unregisterEdge=fz.registry.unregister,eQ.unregisterView=ds.registry.unregister,eQ.unregisterAttr=tm.registry.unregister,eQ.unregisterGrid=u0.registry.unregister,eQ.unregisterFilter=tp.registry.unregister,eQ.unregisterNodeTool=tP.registry.unregister,eQ.unregisterEdgeTool=tO.registry.unregister,eQ.unregisterBackground=tf.registry.unregister,eQ.unregisterHighlighter=tv.registry.unregister,eQ.unregisterPortLayout=tx.registry.unregister,eQ.unregisterPortLabelLayout=tw.registry.unregister,eQ.unregisterMarker=tg.registry.unregister,eQ.unregisterRouter=tN.registry.unregister,eQ.unregisterConnector=tj.registry.unregister,eQ.unregisterAnchor=tk.registry.unregister,eQ.unregisterEdgeAnchor=tA.registry.unregister,eQ.unregisterConnectionPoint=tM.registry.unregister;var pc=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ph=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class pd extends fB{}!function(e){var t;class n extends fQ{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:t}){let n=e.shapeMaps[this.cell.shape];if(n){let{effect:e}=n;(!e||e.includes(t))&&this.renderHTMLComponent()}}confirmUpdate(e){let t=super.confirmUpdate(e);return this.handleAction(t,n.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){let t=this.selectors&&this.selectors.foContent;if(t){aC(t);let n=e.shapeMaps[this.cell.shape];if(!n)return;let{html:r}=n;"function"==typeof r&&(r=r(this.cell)),r&&("string"==typeof r?t.innerHTML=r:aE(t,r))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}pc([n.dispose()],n.prototype,"dispose",null),e.View=n,(t=n=e.View||(e.View={})).action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),fQ.registry.register("html-view",t,!0)}(pd||(pd={})),(eK=pd||(pd={})).config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},tE.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),fB.registry.register("html",eK,!0),(eZ=pd||(pd={})).shapeMaps={},eZ.register=function(e){let{shape:t,html:n,effect:r,inherit:i}=e,o=ph(e,["shape","html","effect","inherit"]);if(!t)throw Error("should specify shape in config");eZ.shapeMaps[t]={html:n,effect:r},pu.registerNode(t,Object.assign({inherit:i||"html"},o),!0)};let pf=`.x6-widget-minimap {
254
+ `;class ft extends yn{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var U5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class yf extends ft{init(){Fo("core",H5)}dispose(){Vo("core")}}U5([yf.dispose()],yf.prototype,"dispose",null);var W5=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Qo;(function(n){function e(t){const{grid:r,panning:i,mousewheel:s,embedding:o}=t,a=W5(t,["grid","panning","mousewheel","embedding"]),l=t.container;if(l!=null)a.width==null&&(a.width=l.clientWidth),a.height==null&&(a.height=l.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const c=Ie({},n.defaults,a),u={size:10,visible:!1};return typeof r=="number"?c.grid={size:r,visible:!1}:typeof r=="boolean"?c.grid=Object.assign(Object.assign({},u),{visible:r}):c.grid=Object.assign(Object.assign({},u),r),["panning","mousewheel","embedding"].forEach(f=>{const d=t[f];typeof d=="boolean"?c[f].enabled=d:c[f]=Object.assign(Object.assign({},c[f]),d)}),c}n.get=e})(Qo||(Qo={})),function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:on.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:on.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:e,sourceView:t,targetView:r}){return(e==="target"?r:t)!=null},createEdge(){return new z5}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}}(Qo||(Qo={}));var X5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Y5=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class vf extends ft{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const r=this.graph.matrix(),i=this.getInstance(),s=Array.isArray(e)?e:[e];this.patterns.forEach((l,c)=>{const u=`pattern_${c}`,h=r.a||1,f=r.d||1,{update:d,markup:g}=l,p=Y5(l,["update","markup"]),b=Object.assign(Object.assign(Object.assign({},p),s[c]),{sx:h,sy:f,ox:r.e||0,oy:r.f||0,width:t*h,height:t*f});i.has(u)||i.add(u,Z.create("pattern",{id:u,patternUnits:"userSpaceOnUse"},Z.createVectors(g)).node);const m=i.get(u);typeof d=="function"&&d(m.childNodes[0],b);let v=b.ox%b.width;v<0&&(v+=b.width);let y=b.oy%b.height;y<0&&(y+=b.height),fe(m,{x:v,y,width:b.width,height:b.height})});const o=new XMLSerializer().serializeToString(i.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new Nr),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Nr.presets.dot),e.args)];const r=Nr.registry.get(t);if(r){let i=e.args||[];return Array.isArray(i)||(i=[i]),Array.isArray(r)?r.map((s,o)=>Object.assign(Object.assign({},s),i[o])):[Object.assign(Object.assign({},r),i[0])]}return Nr.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}X5([ft.dispose()],vf.prototype,"dispose",null);class Vw extends ft{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),ut(this.viewportMatrix)}setMatrix(e){const t=ut(e),r=ps(t);this.viewport.setAttribute("transform",r),this.viewportMatrix=t,this.viewportTransformString=r}resize(e,t){let r=e===void 0?this.options.width:e,i=t===void 0?this.options.height:t;this.options.width=r,this.options.height=i,typeof r=="number"&&(r=Math.round(r)),typeof i=="number"&&(i=Math.round(i)),this.container.style.width=r==null?"":`${r}px`,this.container.style.height=i==null?"":`${i}px`;const s=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},s)),this}getComputedSize(){let e=this.options.width,t=this.options.height;return $b(e)||(e=this.container.clientWidth),$b(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return iq(this.getMatrix())}scale(e,t=e,r=0,i=0){if(e=this.clampScale(e),t=this.clampScale(t),r||i){const o=this.getTranslation(),a=o.tx-r*(e-1),l=o.ty-i*(t-1);(a!==o.tx||l!==o.ty)&&this.translate(a,l)}const s=this.getMatrix();return s.a=e,s.d=t,this.setMatrix(s),this.graph.trigger("scale",{sx:e,sy:t,ox:r,oy:i}),this}clampScale(e){const t=this.graph.options.scaling;return en(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let r=e,i=e;const s=this.getScale(),o=this.getComputedSize();let a=o.width/2,l=o.height/2;if(t.absolute||(r+=s.sx,i+=s.sy),t.scaleGrid&&(r=Math.round(r/t.scaleGrid)*t.scaleGrid,i=Math.round(i/t.scaleGrid)*t.scaleGrid),t.maxScale&&(r=Math.min(t.maxScale,r),i=Math.min(t.maxScale,i)),t.minScale&&(r=Math.max(t.minScale,r),i=Math.max(t.minScale,i)),t.center&&(a=t.center.x,l=t.center.y),r=this.clampScale(r),i=this.clampScale(i),a||l){const c=this.getTranslation(),u=a-(a-c.tx)*(r/s.sx),h=l-(l-c.ty)*(i/s.sy);(u!==c.tx||h!==c.ty)&&this.translate(u,h)}return this.scale(r,i),this}getRotation(){return sq(this.getMatrix())}rotate(e,t,r){if(t==null||r==null){const s=de.getBBox(this.stage);t=s.width/2,r=s.height/2}const i=this.getMatrix().translate(t,r).rotate(e).translate(-t,-r);return this.setMatrix(i),this}getTranslation(){return oq(this.getMatrix())}translate(e,t){const r=this.getMatrix();r.e=e||0,r.f=t||0,this.setMatrix(r);const i=this.getTranslation();return this.options.x=i.tx,this.options.y=i.ty,this.graph.trigger("translate",Object.assign({},i)),this}setOrigin(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,r,i){if(typeof e=="object"){const y=e;e=y.gridWidth||1,t=y.gridHeight||1,r=y.padding||0,i=y}else e=e||1,t=t||1,r=r||0,i==null&&(i={});const s=Bn(r),o=i.border||0,a=i.contentArea?D.create(i.contentArea):this.getContentArea(i);o>0&&a.inflate(o);const l=this.getScale(),c=this.getTranslation(),u=l.sx,h=l.sy;a.x*=u,a.y*=h,a.width*=u,a.height*=h;let f=Math.max(Math.ceil((a.width+a.x)/e),1)*e,d=Math.max(Math.ceil((a.height+a.y)/t),1)*t,g=0,p=0;(i.allowNewOrigin==="negative"&&a.x<0||i.allowNewOrigin==="positive"&&a.x>=0||i.allowNewOrigin==="any")&&(g=Math.ceil(-a.x/e)*e,g+=s.left,f+=g),(i.allowNewOrigin==="negative"&&a.y<0||i.allowNewOrigin==="positive"&&a.y>=0||i.allowNewOrigin==="any")&&(p=Math.ceil(-a.y/t)*t,p+=s.top,d+=p),f+=s.right,d+=s.bottom,f=Math.max(f,i.minWidth||0),d=Math.max(d,i.minHeight||0),f=Math.min(f,i.maxWidth||Number.MAX_SAFE_INTEGER),d=Math.min(d,i.maxHeight||Number.MAX_SAFE_INTEGER);const b=this.getComputedSize(),m=f!==b.width||d!==b.height;return(g!==c.tx||p!==c.ty)&&this.translate(g,p),m&&this.resize(f,d),new D(-g/u,-p/h,f/u,d/h)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let r,i;if(e.contentArea){const m=e.contentArea;r=this.graph.localToGraph(m),i=P.create(m)}else r=this.getContentBBox(e),i=this.graph.graphToLocal(r);if(!r.width||!r.height)return;const s=Bn(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,l=e.minScaleX||o,c=e.maxScaleX||a,u=e.minScaleY||o,h=e.maxScaleY||a;let f;if(e.viewportArea)f=e.viewportArea;else{const m=this.getComputedSize(),v=this.getTranslation();f={x:v.tx,y:v.ty,width:m.width,height:m.height}}f=D.create(f).moveAndExpand({x:s.left,y:s.top,width:-s.left-s.right,height:-s.top-s.bottom});const d=this.getScale();let g=f.width/r.width*d.sx,p=f.height/r.height*d.sy;e.preserveAspectRatio!==!1&&(g=p=Math.min(g,p));const b=e.scaleGrid;if(b&&(g=b*Math.floor(g/b),p=b*Math.floor(p/b)),g=en(g,l,c),p=en(p,u,h),this.scale(g,p),t){const m=this.options,v=f.x-i.x*g-m.x,y=f.y-i.y*p-m.y;this.translate(v,y)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new D:de.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=D.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const r=D.create(e),i=this.graph;t.contentArea=r,t.viewportArea==null&&(t.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const s=r.getCenter();return this.centerPoint(s.x,s.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const r=this.getComputedSize(),i=this.getScale(),s=this.getTranslation(),o=r.width/2,a=r.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*i.sx,t=a-t*i.sy,(s.tx!==e||s.ty!==t)&&this.translate(e,t)}centerContent(e){const r=this.graph.getContentArea(e).getCenter();this.centerPoint(r.x,r.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,r){const i=this.getComputedSize();t=Vt(t,Math.max(0,i.width)),t<0&&(t=i.width+t),r=Vt(r,Math.max(0,i.height)),r<0&&(r=i.height+r);const s=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,l=r-e.y*o.sy;(s.tx!==a||s.ty!==l)&&this.translate(a,l)}positionRect(e,t){const r=D.create(e);switch(t){case"center":return this.positionPoint(r.getCenter(),"50%","50%");case"top":return this.positionPoint(r.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(r.getTopRight(),"100%",0);case"right":return this.positionPoint(r.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(r.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(r.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(r.getBottomLeft(),0,"100%");case"left":return this.positionPoint(r.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(r.getTopLeft(),0,0);default:return this}}positionCell(e,t){const r=e.getBBox();return this.positionRect(r,t)}positionContent(e,t){const r=this.graph.getContentArea(t);return this.positionRect(r,e)}}var K5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class uc extends ft{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(e={}){let t=e.size||"auto auto",r=e.position||"center";const i=this.graph.transform.getScale(),s=this.graph.translate();if(typeof r=="object"){const o=s.tx+i.sx*(r.x||0),a=s.ty+i.sy*(r.y||0);r=`${o}px ${a}px`}typeof t=="object"&&(t=D.fromSize(t).scale(i.sx,i.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=r}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const r=this.optionsCache;if(r&&r.image!==t.image)return;let i;const s=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const l=qo.registry.get(a);if(typeof l=="function"){const u=t.quality||1;e.width*=u,e.height*=u;const h=l(e,t);if(!(h instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=h.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=h.width/e.width,o.height*=h.height/e.height):o===void 0&&(t.size={width:h.width/u,height:h.height/u})}else i=e.src,o===void 0&&(t.size={width:e.width,height:e.height});r!=null&&typeof t.size=="object"&&t.image===r.image&&t.repeat===r.repeat&&t.quality===r.quality&&(r.size=Mh(t.size));const c=this.elem.style;c.backgroundImage=`url(${i})`,c.backgroundRepeat=a,c.opacity=s==null||s>=1?"":`${s}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=Mh(t);const r=document.createElement("img");r.onload=()=>this.drawBackgroundImage(r,e),r.setAttribute("crossorigin","anonymous"),r.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}K5([ft.dispose()],uc.prototype,"dispose",null);var J5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class bf extends ft{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),Se.on(this.graph.container,"mousedown",this.onRightMouseDown),this.mousewheelHandle=new L1(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),Se.off(this.graph.container,"mousedown",this.onRightMouseDown),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return this.pannable&&ir.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),Se.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),Se.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),r=t.clientX-this.clientX,i=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(r,i)}stopPanning(e){this.panning=!1,this.updateClassName(),Se.off(document.body,".panning"),Se.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),r=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(K(e,t),mt(e,r)):(mt(e,t),K(e,r)):(mt(e,t),mt(e,r))}onMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.getPlugin("selection"),r=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!r)&&this.startPanning(e)}onRightMouseDown(e){const t=this.widgetOptions.eventTypes;t!=null&&t.includes("rightMouseDown")&&e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}onMouseWheel(e,t,r){this.graph.translateBy(-t,-r)}allowBlankMouseDown(e){const t=this.widgetOptions.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}allowMouseWheel(e){var t;return this.pannable&&!e.ctrlKey&&((t=this.widgetOptions.eventTypes)===null||t===void 0?void 0:t.includes("mouseWheel"))}autoPanning(e,t){const i=this.graph.getGraphArea();let s=0,o=0;e<=i.left+10&&(s=-10),t<=i.top+10&&(o=-10),e>=i.right-10&&(s=10),t>=i.bottom-10&&(o=10),(s!==0||o!==0)&&this.graph.translateBy(-s,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}J5([ft.dispose()],bf.prototype,"dispose",null);var Q5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class wf extends ft{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new L1(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&ir.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&ir.isMatch(e,this.widgetOptions.modifiers)){const r=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*r*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/r)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const s=this.currentScale;let o=this.graph.transform.clampScale(s*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=en(o,a,l),o!==s)if(this.widgetOptions.zoomAtMousePosition){const u=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:u.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}Q5([yn.dispose()],wf.prototype,"dispose",null);var Z5=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class qw extends ft{init(){this.resetRenderArea=lV(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}Z5([ft.dispose()],qw.prototype,"dispose",null);class eG{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&lr.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,r=this.queue.length,i=r-1;const s=e.priority;for(;t<=i;){const o=(i-t>>1)+t;s<=this.queue[o].priority?t=o+1:(r=o,i=o-1)}return r}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var lr;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(lr||(lr={}));var tG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class it extends yn{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new eG,this.graph=e,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const t=this.model.getCells();this.renderViews(t,Object.assign(Object.assign({},e),{queue:t.map(r=>r.id)}))}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const r=this.views[e.id];r&&this.requestViewUpdate(r.view,it.FLAG_INSERT,t,lr.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,r={},i=lr.Update,s=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=r,(e.hasAction(t,["translate","resize","rotate"])||r.async===!1)&&(i=lr.PRIOR,s=!1),this.queue.queueJob({id:o,priority:i,cb:()=>{this.renderViewInArea(e,t,r);const u=r.queue;if(u){const h=u.indexOf(e.cell.id);h>=0&&u.splice(h,1),u.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(e).forEach(u=>{this.requestViewUpdate(u.view,u.flag,r,i,!1)}),s&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===it.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((r,i)=>r.isNode()&&i.isEdge()?-1:0),e.forEach(r=>{const i=r.id,s=this.views;let o=0,a=s[i];if(a)o=it.FLAG_INSERT;else{const l=this.createCellView(r);l&&(l.graph=this.graph,o=it.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:t,state:it.ViewState.CREATED},this.views[i]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,r={}){const i=e.cell,s=i.id,o=this.views[s];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,r),o.flag=a):o.state===it.ViewState.MOUNTED?(a=this.updateView(e,t,r),o.flag=a):o.state=it.ViewState.WAITING,a&&i.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:s,priority:lr.RenderEdge,cb:()=>{this.updateView(e,t,r)}})}removeViews(e){e.forEach(t=>{const r=t.id,i=this.views[r];i&&(this.willRemoveViews[r]=i,delete this.views[r],this.queue.queueJob({id:r,priority:this.getRenderPriority(i.view),cb:()=>{this.removeView(i.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(e=>{if(e&&e.state===it.ViewState.WAITING){const{view:t,flag:r,options:i}=e;this.requestViewUpdate(t,r,i,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,r={}){if(e==null)return 0;if(We.isCellView(e)){if(t&it.FLAG_REMOVE)return this.removeView(e.cell),0;t&it.FLAG_INSERT&&(this.insertView(e),t^=it.FLAG_INSERT)}return t?e.confirmUpdate(t,r):0}insertView(e){const t=this.views[e.cell.id];if(t){const r=e.cell.getZIndex(),i=this.addZPivot(r);this.container.insertBefore(e.container,i),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=it.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,r=this.willRemoveViews[t.id];r&&e&&(r.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const r=this.model.getConnectedEdges(e);for(let s=0,o=r.length;s<o;s+=1){const a=r[s];if(t){const l=a.getSourceCell(),c=a.getTargetCell();if(l&&!l.isVisible()||c&&!c.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const i=this.views[e.id];i&&me(i.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let r=t[e];if(r)return r;r=t[e]=document.createComment(`z-index:${e+1}`);let i=-1/0;for(const o in t){const a=+o;a<e&&a>i&&(i=a,e-1)}const s=this.container;if(i!==-1/0){const o=t[i];s.insertBefore(r,o.nextSibling)}else s.insertBefore(r,s.firstChild);return r}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},r=this.graph.options.createCellView;if(r){const s=Y(r,this.graph,e);if(s)return new s(e,t);if(s===null)return null}const i=e.view;if(i!=null&&typeof i=="string"){const s=We.registry.get(i);return s?new s(e,t):We.registry.onNotFound(i)}return e.isNode()?new kt(e,t):e.isEdge()?new ar(e,t):null}getEffectedEdges(e){const t=[],r=e.cell,i=this.model.getConnectedEdges(r);for(let s=0,o=i.length;s<o;s+=1){const a=i[s],l=this.views[a.id];if(!l)continue;const c=l.view;if(!this.isViewMounted(c))continue;const u=["update"];a.getTargetCell()===r&&u.push("target"),a.getSourceCell()===r&&u.push("source"),t.push({id:a.id,view:c,flag:c.getFlag(u)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,r=t.getSourceCell(),i=t.getTargetCell();if(this.renderArea&&r&&i)return this.renderArea.isIntersectWithRect(r.getBBox())||this.renderArea.isIntersectWithRect(i.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?lr.RenderNode:lr.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}tG([yn.dispose()],it.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(it||(it={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(it||(it={}));var nG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class xf extends ft{constructor(){super(...arguments),this.schedule=new it(this.graph)}requestViewUpdate(e,t,r={}){this.schedule.requestViewUpdate(e,t,r)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,r=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[0];if(r){const i=this.graph.view.findAttr("data-cell-id",r);if(i){const s=this.schedule.views;if(s[i])return s[i].view}}return null}findViewByCell(e){if(e==null)return null;const t=le.isCell(e)?e.id:e,r=this.schedule.views;return r[t]?r[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>r!=null?de.getBBox(r.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(r=>this.findViewByCell(r)).filter(r=>{if(r!=null){const i=r.getClosestPoint(e);if(i)return i.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const r=D.create(e);return this.model.getCells().map(i=>this.findViewByCell(i)).filter(i=>{if(i){if(t.nodeOnly&&!i.isNodeView())return!1;const s=de.getBBox(i.container,{target:this.view.stage});return s.width===0?s.inflate(1,0):s.height===0&&s.inflate(0,1),t.strict?r.containsRect(s):r.isIntersectWithRect(s)}return!1})}dispose(){this.schedule.dispose()}}nG([ft.dispose()],xf.prototype,"dispose",null);var Gw=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Hw extends ft{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const r=e.name;if(t||(t=`filter-${r}-${this.cid}-${Fh(JSON.stringify(e))}`),!this.isDefined(t)){const i=bs.registry.get(r);if(i==null)return bs.registry.onNotFound(r);const s=i(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});Z.create(Pe.sanitize(s),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const r=e.type;if(t||(t=`gradient-${r}-${this.cid}-${Fh(JSON.stringify(e))}`),!this.isDefined(t)){const s=e.stops.map(l=>{const c=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${c}"/>`}),o=`<${r}>${s.join("")}</${r}>`,a=Object.assign({id:t},e.attrs);Z.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:r,refY:i,markerUnits:s,markerOrient:o,tagName:a,children:l}=e,c=Gw(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let u=t;if(u||(u=`marker-${this.cid}-${Fh(JSON.stringify(e))}`),!this.isDefined(u)){a!=="path"&&delete c.d;const h=Z.create("marker",{refX:r,refY:i,id:u,overflow:"visible",orient:o!=null?o:"auto",markerUnits:s||"userSpaceOnUse"},l?l.map(f=>{var{tagName:d}=f,g=Gw(f,["tagName"]);return Z.create(`${d}`||"path",No(Object.assign(Object.assign({},c),g)))}):[Z.create(a||"path",No(c))]);this.defs.appendChild(h.node)}return u}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Uw extends ft{getClientMatrix(){return ut(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new P(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.graph.matrix())}localToClientPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.graph.matrix())}localToClientRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.getClientMatrix())}localToPageRect(e,t,r,i){return(typeof e=="number"?this.localToGraphRect(e,t,r,i):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const i=P.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.graph.matrix().inverse())}clientToLocalRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.getClientMatrix().inverse())}clientToGraphRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.getPageOffset();return s.x-=o.x,s.y-=o.y,this.graphToLocalRect(s)}}var rG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class hc extends ft{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:e,magnet:t,options:r={}}){const i=this.resolveHighlighter(r);if(!i)return;const s=this.getHighlighterId(t,i);if(!this.highlights[s]){const o=i.highlighter;o.highlight(e,t,Object.assign({},i.args)),this.highlights[s]={cellView:e,magnet:t,highlighter:o,args:i.args}}}onCellUnhighlight({magnet:e,options:t={}}){const r=this.resolveHighlighter(t);if(!r)return;const i=this.getHighlighterId(e,r);this.unhighlight(i)}resolveHighlighter(e){const t=this.options;let r=e.highlighter;if(r==null){const a=e.type;r=a&&t.highlighting[a]||t.highlighting.default}if(r==null)return null;const i=typeof r=="string"?{name:r}:r,s=i.name,o=sr.registry.get(s);return o==null?sr.registry.onNotFound(s):(sr.check(s,o),{name:s,highlighter:o,args:i.args||{}})}getHighlighterId(e,t){return Hh(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}rG([hc.dispose()],hc.prototype,"dispose",null);var iG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Ww extends ft{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&ql.bind(t,()=>{const r=t.offsetWidth,i=t.offsetHeight;this.resize(r,i)})}}resize(e,t){const r=this.getScroller();r?r.resize(e,t):this.graph.transform.resize(e,t)}dispose(){ql.clear(this.graph.container)}}iG([ft.dispose()],Ww.prototype,"dispose",null);var sG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let V=class FM extends pt{get container(){return this.options.container}get[Symbol.toStringTag](){return FM.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=Qo.get(e),this.css=new yf(this),this.view=new Sn(this),this.defs=new Hw(this),this.coord=new Uw(this),this.transform=new Vw(this),this.highlight=new hc(this),this.grid=new vf(this),this.background=new uc(this),this.options.model?this.model=this.options.model:(this.model=new Cn,this.model.graph=this),this.renderer=new xf(this),this.panning=new bf(this),this.mousewheel=new wf(this),this.virtualRender=new qw(this),this.size=new Ww(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(r=>Xe.isNode(r)?r:this.createNode(r)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(r=>Ve.isEdge(r)?r:this.createEdge(r)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,r={}){return this.model.isNeighbor(e,t,r)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,r={}){return this.model.isSuccessor(e,t,r)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,r={}){return this.model.isPredecessor(e,t,r)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,r,i,s){return this.model.getNodesInArea(e,t,r,i,s)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,r={}){return this.model.search(e,t,r),this}getShortestPath(e,t,r={}){return this.model.getShortestPath(e,t,r)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,r){const i=typeof e=="string"?e:"update",s=typeof e=="string"?t:e,o=typeof t=="function"?r:t;this.startBatch(i,o);const a=s();return this.stopBatch(i,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return le.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return D.isRectangleLike(e)?this.findViewsInArea(e):P.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(r)}findViewsInArea(e,t,r,i,s){const o=typeof e=="number"?{x:e,y:t,width:r,height:i}:e,a=typeof e=="number"?s:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e=="undefined"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const r=this.getPlugin("scroller");return r?r.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,r=0,i=0){return typeof e=="undefined"?this.transform.getScale():(this.transform.scale(e,t,r,i),this)}zoom(e,t){const r=this.getPlugin("scroller");if(r){if(typeof e=="undefined")return r.zoom();r.zoom(e,t)}else{if(typeof e=="undefined")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const r=this.getPlugin("scroller");return r?r.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const r=this.getPlugin("scroller");return r?r.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,r){return typeof e=="undefined"?this.transform.getRotation():(this.transform.rotate(e,t,r),this)}translate(e,t){return typeof e=="undefined"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const r=this.translate(),i=r.tx+e,s=r.ty+t;return this.translate(i,s)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,r,i){return this.transform.fitToContent(e,t,r,i)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,r){const i=this.getPlugin("scroller");return i?i.centerPoint(e,t,r):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const r=this.getPlugin("scroller");return r?r.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,r,i={}){const s=this.getPlugin("scroller");return s?s.positionPoint(e,t,r,i):this.transform.positionPoint(e,t,r),this}positionRect(e,t,r){const i=this.getPlugin("scroller");return i?i.positionRect(e,t,r):this.transform.positionRect(e,t),this}positionCell(e,t,r){const i=this.getPlugin("scroller");return i?i.positionCell(e,t,r):this.transform.positionCell(e,t),this}positionContent(e,t){const r=this.getPlugin("scroller");return r?r.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.pageToLocalRect(e,t,r,i):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToPageRect(e,t,r,i):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToLocalRect(e,t,r,i):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToClientRect(e,t,r,i):this.coord.localToClientPoint(e,t)}localToGraph(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToGraphRect(e,t,r,i):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.graphToLocalRect(e,t,r,i):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,r,i){return D.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToGraphRect(e,t,r,i):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const r=this.getPlugin("scroller");return r!=null&&(this.options.background==null||!t)?r.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{var s;(s=i==null?void 0:i.enable)===null||s===void 0||s.call(i)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{var s;(s=i==null?void 0:i.disable)===null||s===void 0||s.call(i)}),this}isPluginEnabled(e){var t;const r=this.getPlugin(e);return(t=r==null?void 0:r.isEnabled)===null||t===void 0?void 0:t.call(r)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{i.dispose(),this.installedPlugins.delete(i)}),this}dispose(e=!0){e&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(t=>{t.dispose()})}};sG([pt.dispose()],V.prototype,"dispose",null),function(n){n.View=Sn,n.Renderer=xf,n.MouseWheel=wf,n.DefsManager=Hw,n.GridManager=vf,n.CoordManager=Uw,n.TransformManager=Vw,n.HighlightManager=hc,n.BackgroundManager=uc,n.PanningManager=bf}(V||(V={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag];return r==null||r===n.toStringTag}n.isGraph=e}(V||(V={})),function(n){function e(t,r){const i=t instanceof HTMLElement?new n({container:t}):new n(t);return r!=null&&i.fromJSON(r),i}n.render=e}(V||(V={})),function(n){n.registerNode=Xe.registry.register,n.registerEdge=Ve.registry.register,n.registerView=We.registry.register,n.registerAttr=Vn.registry.register,n.registerGrid=Nr.registry.register,n.registerFilter=bs.registry.register,n.registerNodeTool=Ss.registry.register,n.registerEdgeTool=Ps.registry.register,n.registerBackground=qo.registry.register,n.registerHighlighter=sr.registry.register,n.registerPortLayout=Ai.registry.register,n.registerPortLabelLayout=xs.registry.register,n.registerMarker=$r.registry.register,n.registerRouter=Br.registry.register,n.registerConnector=Oi.registry.register,n.registerAnchor=Es.registry.register,n.registerEdgeAnchor=As.registry.register,n.registerConnectionPoint=Os.registry.register}(V||(V={})),function(n){n.unregisterNode=Xe.registry.unregister,n.unregisterEdge=Ve.registry.unregister,n.unregisterView=We.registry.unregister,n.unregisterAttr=Vn.registry.unregister,n.unregisterGrid=Nr.registry.unregister,n.unregisterFilter=bs.registry.unregister,n.unregisterNodeTool=Ss.registry.unregister,n.unregisterEdgeTool=Ps.registry.unregister,n.unregisterBackground=qo.registry.unregister,n.unregisterHighlighter=sr.registry.unregister,n.unregisterPortLayout=Ai.registry.unregister,n.unregisterPortLabelLayout=xs.registry.unregister,n.unregisterMarker=$r.registry.unregister,n.unregisterRouter=Br.registry.unregister,n.unregisterConnector=Oi.registry.unregister,n.unregisterAnchor=Es.registry.unregister,n.unregisterEdgeAnchor=As.registry.unregister,n.unregisterConnectionPoint=Os.registry.unregister}(V||(V={}));var oG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},aG=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class ks extends Xe{}(function(n){class e extends kt{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:r}){const i=n.shapeMaps[this.cell.shape];if(i){const{effect:s}=i;(!s||s.includes(r))&&this.renderHTMLComponent()}}confirmUpdate(r){const i=super.confirmUpdate(r);return this.handleAction(i,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const r=this.selectors&&this.selectors.foContent;if(r){To(r);const i=n.shapeMaps[this.cell.shape];if(!i)return;let{html:s}=i;typeof s=="function"&&(s=s(this.cell)),s&&(typeof s=="string"?r.innerHTML=s:zn(r,s))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}oG([e.dispose()],e.prototype,"dispose",null),n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),kt.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(ks||(ks={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Pe.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Xe.registry.register("html",n,!0)}(ks||(ks={})),function(n){n.shapeMaps={};function e(t){const{shape:r,html:i,effect:s,inherit:o}=t,a=aG(t,["shape","html","effect","inherit"]);if(!r)throw new Error("should specify shape in config");n.shapeMaps[r]={html:i,effect:s},V.registerNode(r,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(ks||(ks={}));const lG=`.x6-widget-minimap {
252
255
  position: relative;
253
256
  display: table-cell;
254
257
  box-sizing: border-box;
@@ -291,7 +294,7 @@
291
294
  border-radius: 50%;
292
295
  cursor: nwse-resize;
293
296
  }
294
- `;class pp extends de{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(e){super(),this.name="minimap",this.options=Object.assign(Object.assign({},tB.defaultOptions),e),uP(this.name,pf)}init(e){this.graph=e,this.updateViewport=nQ(this.updateViewport.bind(this),0),this.container=document.createElement("div"),aa(this.container,this.prefixClassName(t_.root));let t=document.createElement("div");this.container.appendChild(t),this.viewport=document.createElement("div"),aa(this.viewport,this.prefixClassName(t_.viewport)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),aa(this.zoomHandle,this.prefixClassName(t_.zoom)),aO(this.zoomHandle,this.viewport)),aE(this.container,this.viewport),aq(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;let n=Object.assign(Object.assign({},this.options.graphOptions),{container:t,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new pu(n),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?ti.on(this.graphContainer,`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?ti.off(this.graphContainer,this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.stopListening(),this.targetGraph.dispose(!1)}onTransform(e){(e.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(e,t){let n,r;"object"==typeof e?(n=e.width,r=e.height):(n=e,r=t);let i=this.sourceGraph.options,o=this.sourceGraph.transform.getScale(),s=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;n/=o.sx,r/=o.sy,this.ratio=Math.min(s/n,l/r);let a=this.ratio,u=i.x*a/o.sx,c=i.y*a/o.sy;return n*=a,r*=a,this.targetGraph.resize(n,r),this.targetGraph.translate(u,c),this.scroller?this.targetGraph.scale(a,a):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){let e=this.sourceGraph.transform.getScale(),t=this.targetGraph.transform.getScale(),n=null;n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0);let r=function(e){let t;let n="fixed"===aG(e,"position");if(n){let n=e.getBoundingClientRect();t={left:n.left,top:n.top}}else t=ub(e);if(!n){var r;let n=e.ownerDocument,i=e.offsetParent||n.documentElement;for(;(i===n.body||i===n.documentElement)&&"static"===aG(i,"position");)i=i.parentNode;if(i!==e&&(r=i)&&1===r.nodeType){let e=ub(i);t.top-=e.top+aH(i,"borderTopWidth"),t.left-=e.left+aH(i,"borderLeftWidth")}}return{top:t.top-aH(e,"marginTop"),left:t.left-aH(e,"marginLeft")}}(this.targetGraph.container),i=this.targetGraph.translate();i.ty=i.ty||0,this.geometry={top:r.top+n.y*t.sy+i.ty,left:r.left+n.x*t.sx+i.tx,width:this.graphContainer.clientWidth*t.sx/e.sx,height:this.graphContainer.clientHeight*t.sy/e.sy},aq(this.viewport,this.geometry)}startAction(e){let t=this.normalizeEvent(e),n=t.target===this.zoomHandle?"zooming":"panning",{tx:r,ty:i}=this.sourceGraph.translate(),o={action:n,clientX:t.clientX,clientY:t.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:r,translateY:i};this.targetGraphTransforming=!0,this.delegateDocumentEvents(tB.documentEvents,o)}doAction(e){let t=this.normalizeEvent(e),n=t.clientX,r=t.clientY,i=t.data;switch(i.action){case"panning":{let e=this.sourceGraph.transform.getScale(),t=(n-i.clientX)*e.sx,o=(r-i.clientY)*e.sy;this.scroller?(this.graphContainer.scrollLeft=i.scrollLeft+t/this.ratio,this.graphContainer.scrollTop=i.scrollTop+o/this.ratio):this.sourceGraph.translate(i.translateX-t/this.ratio,i.translateY-o/this.ratio);break}case"zooming":{let e=i.scale,t=i.geometry,r=1+(i.clientX-n)/t.width/e.sx;i.frameId&&cancelAnimationFrame(i.frameId),i.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(r*i.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})})}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(e){let t,n;let r=this.normalizeEvent(e),i=this.targetGraph.translate();if(i.ty=i.ty||0,null==r.offsetX){let e=ub(this.targetGraph.container);t=r.pageX-e.left,n=r.pageY-e.top}else t=r.offsetX,n=r.offsetY;let o=(t-i.tx)/this.ratio,s=(n-i.ty)/this.ratio;this.sourceGraph.centerPoint(o,s)}dispose(){this.remove(),uO(this.name)}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([de.dispose()],pp.prototype,"dispose",null),(e0=t_||(t_={})).root="widget-minimap",e0.viewport=`${e0.root}-viewport`,e0.zoom=`${e0.viewport}-zoom`,(e1=tB||(tB={})).defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:e=>new pu(e)},e1.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"};var pg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class pm extends de{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(e){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=pm.getOptions(e),this.onUpdate=nQ(this.onUpdate,200);let t=this.graph.transform.getScale();this.sx=t.sx,this.sy=t.sy;let n=this.options.width||this.graph.options.width,r=this.options.height||this.graph.options.height;this.container=document.createElement("div"),aa(this.container,this.prefixClassName(pm.containerClass)),aq(this.container,{width:n,height:r}),this.options.pageVisible&&aa(this.container,this.prefixClassName(pm.pagedClass)),this.options.className&&aa(this.container,this.options.className);let i=this.graph.container;i.parentNode&&aP(i,this.container),this.content=document.createElement("div"),aa(this.content,this.prefixClassName(pm.contentClass)),aq(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),aa(this.background,this.prefixClassName(pm.backgroundClass)),aE(this.content,this.background),!this.options.pageVisible&&aE(this.content,this.graph.view.grid),aE(this.content,i),aO(this.content,this.container),this.startListening(),!this.options.pageVisible&&this.graph.grid.update(),this.backgroundManager=new pm.Background(this),!this.options.autoResize&&this.update()}startListening(){let e=this.graph,t=this.model;e.on("scale",this.onScale,this),e.on("resize",this.onResize,this),e.on("before:print",this.storeScrollPosition,this),e.on("before:export",this.storeScrollPosition,this),e.on("after:print",this.restoreScrollPosition,this),e.on("after:export",this.restoreScrollPosition,this),t.on("reseted",this.onUpdate,this),t.on("cell:added",this.onUpdate,this),t.on("cell:removed",this.onUpdate,this),t.on("cell:changed",this.onUpdate,this),this.delegateBackgroundEvents()}stopListening(){let e=this.graph,t=this.model;e.off("scale",this.onScale,this),e.off("resize",this.onResize,this),e.off("beforeprint",this.storeScrollPosition,this),e.off("beforeexport",this.storeScrollPosition,this),e.off("afterprint",this.restoreScrollPosition,this),e.off("afterexport",this.restoreScrollPosition,this),t.off("reseted",this.onUpdate,this),t.off("cell:added",this.onUpdate,this),t.off("cell:removed",this.onUpdate,this),t.off("cell:changed",this.onUpdate,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(e){let t=e||fZ.events;this.delegatedHandlers=Object.keys(t).reduce((e,n)=>{let r=t[n];if(-1===n.indexOf(" ")){if("function"==typeof r)e[n]=r;else{let t=this.graph.view[r];"function"==typeof t&&(t=t.bind(this.graph.view),e[n]=t)}}return e},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(e=>{this.delegateEvent(e,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(e=>{this.undelegateEvent(e,this.onBackgroundEvent)})}onBackgroundEvent(e){let t=!1,n=e.target;if(this.options.pageVisible)t=this.options.background?this.background===n:this.content===n;else{let e=this.graph.view;t=e.background===n||e.grid===n}if(t){let t=this.delegatedHandlers[e.type];"function"==typeof t&&t.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:e,sy:t,ox:n,oy:r}){this.updateScale(e,t),(n||r)&&(this.centerPoint(n,r),this.updatePageBreak()),"function"==typeof this.options.autoResizeOptions&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(e4.IS_IE||e4.IS_EDGE)&&aq(this.container,{visibility:"hidden"})}afterManipulation(){(e4.IS_IE||e4.IS_EDGE)&&aq(this.container,{visibility:"visible"})}updatePageSize(e,t){null!=e&&(this.options.pageWidth=e),null!=t&&(this.options.pageHeight=t),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){let e=this.graph.options.width,t=this.graph.options.height,n=this.options.pageWidth*this.sx,r=this.options.pageHeight*this.sy;if(0!==n&&0!==r){if(e>n||t>r){let i=!1,o=document.createElement("div");for(let t=1,r=Math.floor(e/n);t<r;t+=1){let e=document.createElement("div");aa(e,this.prefixClassName("graph-pagebreak-vertical")),aq(e,{left:t*n}),aO(e,o),i=!0}for(let e=1,n=Math.floor(t/r);e<n;e+=1){let t=document.createElement("div");aa(t,this.prefixClassName("graph-pagebreak-horizontal")),aq(t,{top:e*r}),aO(t,o),i=!0}i&&(aa(o,this.prefixClassName("graph-pagebreak")),!function(e,t){let n=e.parentNode;n&&(Array.isArray(t)?t:[t]).forEach(t=>{null!=t&&n.insertBefore(t,e.nextSibling)})}(this.graph.view.grid,o),this.pageBreak=o)}}}}update(){let e=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(e.width/2,e.height/2);let t=this.options.autoResizeOptions;"function"==typeof t&&(t=n0(t,this,this));let n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},t);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(e){let t=this.sx,n=this.sy;return e.gridWidth&&(e.gridWidth*=t),e.gridHeight&&(e.gridHeight*=n),e.minWidth&&(e.minWidth*=t),e.minHeight&&(e.minHeight*=n),"object"==typeof e.padding?e.padding={left:(e.padding.left||0)*t,right:(e.padding.right||0)*t,top:(e.padding.top||0)*n,bottom:(e.padding.bottom||0)*n}:"number"==typeof e.padding&&(e.padding*=t),!this.options.autoResize&&(e.contentArea=uM.create()),e}updateScale(e,t){let n=this.graph.options,r=e/this.sx,i=t/this.sy;this.sx=e,this.sy=t,this.graph.translate(n.x*r,n.y*i),this.graph.transform.resize(n.width*r,n.height*i)}scrollbarPosition(e,t){if(null==e&&null==t)return{left:this.container.scrollLeft,top:this.container.scrollTop};let n={};return"number"==typeof e&&(n.scrollLeft=e),"number"==typeof t&&(n.scrollTop=t),aQ(this.container,n),this}scrollToPoint(e,t){let n=this.getClientSize(),r=this.graph.matrix(),i={};return"number"==typeof e&&(i.scrollLeft=e-n.width/2+r.e+(this.padding.left||0)),"number"==typeof t&&(i.scrollTop=t-n.height/2+r.f+(this.padding.top||0)),aQ(this.container,i),this}scrollToContent(){let e=this.sx,t=this.sy,n=this.graph.getContentArea().getCenter();return this.scrollToPoint(n.x*e,n.y*t)}scrollToCell(e){let t=this.sx,n=this.sy,r=e.getBBox().getCenter();return this.scrollToPoint(r.x*t,r.y*n)}center(e){return this.centerPoint(e)}centerPoint(e,t,n){let r;let i=this.graph.matrix(),o=i.a,s=i.d,l=-i.e,a=-i.f,u=l+this.graph.options.width,c=a+this.graph.options.height;if(this.storeClientSize(),"number"==typeof e||"number"==typeof t){r=n;let i=this.getVisibleArea().getCenter();"number"==typeof e?e*=o:e=i.x,"number"==typeof t?t*=s:t=i.y}else r=e,e=(l+u)/2,t=(a+c)/2;if(r&&r.padding)return this.positionPoint({x:e,y:t},"50%","50%",r);let h=this.getPadding(),d=this.getClientSize(),f=d.width/2,p=d.height/2,g=f-h.left-e+l,m=f-h.right+e-u,y=p-h.top-t+a,b=p-h.bottom+t-c;this.addPadding(Math.max(g,0),Math.max(m,0),Math.max(y,0),Math.max(b,0));let v=this.scrollToPoint(e,t);return this.restoreClientSize(),v}centerContent(e){return this.positionContent("center",e)}centerCell(e,t){return this.positionCell(e,"center",t)}positionContent(e,t){let n=this.graph.getContentArea(t);return this.positionRect(n,e,t)}positionCell(e,t,n){let r=e.getBBox();return this.positionRect(r,t,n)}positionRect(e,t,n){let r=uM.create(e);switch(t){case"center":return this.positionPoint(r.getCenter(),"50%","50%",n);case"top":return this.positionPoint(r.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(r.getTopRight(),"100%",0,n);case"right":return this.positionPoint(r.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(r.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(r.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(r.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(r.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(r.getTopLeft(),0,0,n);default:return this}}positionPoint(e,t,n,r={}){let{padding:i}=r,o=pg(r,["padding"]),s=lJ(i),l=uM.fromSize(this.getClientSize()),a=l.clone().moveAndExpand({x:s.left,y:s.top,width:-s.right-s.left,height:-s.top-s.bottom});(t=lY(t,Math.max(0,a.width)))<0&&(t=a.width+t),(n=lY(n,Math.max(0,a.height)))<0&&(n=a.height+n);let u=a.getTopLeft().translate(t,n),c=l.getCenter().diff(u),h=this.zoom(),d=c.scale(1/h,1/h),f=uA.create(e).translate(d);return this.centerPoint(f.x,f.y,o)}zoom(e,t){let n,r;if(null==e)return this.sx;t=t||{};let i=this.getClientSize(),o=this.clientToLocalPoint(i.width/2,i.height/2),s=e,l=e;if(!t.absolute&&(s+=this.sx,l+=this.sy),t.scaleGrid&&(s=Math.round(s/t.scaleGrid)*t.scaleGrid,l=Math.round(l/t.scaleGrid)*t.scaleGrid),t.maxScale&&(s=Math.min(t.maxScale,s),l=Math.min(t.maxScale,l)),t.minScale&&(s=Math.max(t.minScale,s),l=Math.max(t.minScale,l)),s=this.graph.transform.clampScale(s),l=this.graph.transform.clampScale(l),t.center){let e=s/this.sx,i=l/this.sy;n=t.center.x-(t.center.x-o.x)/e,r=t.center.y-(t.center.y-o.y)/i}else n=o.x,r=o.y;return this.beforeManipulation(),this.graph.transform.scale(s,l),this.centerPoint(n,r),this.afterManipulation(),this}zoomToRect(e,t={}){let n=uM.create(e),r=this.graph;if(t.contentArea=n,null==t.viewportArea){let e=this.container.getBoundingClientRect();t.viewportArea={x:r.options.x,y:r.options.y,width:e.width,height:e.height}}this.beforeManipulation(),r.transform.scaleContentToFitImpl(t,!1);let i=n.getCenter();return this.centerPoint(i.x,i.y),this.afterManipulation(),this}zoomToFit(e={}){return this.zoomToRect(this.graph.getContentArea(e),e)}transitionToPoint(e,t,n){let r,i;"object"==typeof e&&(n=t,t=e.y,e=e.x),null==n&&(n={});let o=this.sx,s=Math.max(n.scale||o,1e-6),l=this.getClientSize(),a=new uA(e,t),u=this.clientToLocalPoint(l.width/2,l.height/2);if(o===s){let e=u.diff(a).scale(o,o).round();r=`translate(${e.x}px,${e.y}px)`}else{let e=s/(o-s)*a.distance(u),t=u.clone().move(a,e),n=this.localToBackgroundPoint(t).round();r=`scale(${s/o})`,i=`${n.x}px ${n.y}px`}let c=n.onTransitionEnd;return aa(this.container,pm.transitionClassName),ti.off(this.content,pm.transitionEventName),ti.on(this.content,pm.transitionEventName,n=>{this.syncTransition(s,{x:e,y:t}),"function"==typeof c&&n0(c,this,n.originalEvent)}),aq(this.content,{transform:r,transformOrigin:i,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(e,t){return this.beforeManipulation(),this.graph.scale(e),this.removeTransition(),this.centerPoint(t.x,t.y),this.afterManipulation(),this}removeTransition(){return au(this.container,pm.transitionClassName),ti.off(this.content,pm.transitionEventName),aq(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(e,t={}){let n=uM.create(e),r=t.maxScale||1/0,i=t.minScale||Number.MIN_VALUE,o=t.scaleGrid||null,s=t.visibility||1,l=t.center?uA.create(t.center):n.getCenter(),a=this.getClientSize(),u=a.width*s,c=a.height*s,h=new uM(l.x-u/2,l.y-c/2,u,c).getMaxUniformScaleToFit(n,l);return h=Math.min(h,r),o&&(h=Math.floor(h/o)*o),h=Math.max(i,h),this.transitionToPoint(l,Object.assign({scale:h},t))}startPanning(e){let t=this.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("pan:start",{e:t}),ti.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),ti.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){let t=this.normalizeEvent(e),n=t.clientX-this.clientX,r=t.clientY-this.clientY;this.container.scrollTop-=r,this.container.scrollLeft-=n,this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("panning",{e:t})}stopPanning(e){ti.off(document.body,".panning"),ti.off(window,".panning"),this.trigger("pan:stop",{e})}clientToLocalPoint(e,t){let n="object"==typeof e?e.x:e,r="object"==typeof e?e.y:t,i=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-i.e,r+=this.container.scrollTop-this.padding.top-i.f,new uA(n/i.a,r/i.d)}localToBackgroundPoint(e,t){let n="object"==typeof e?uA.create(e):new uA(e,t),r=this.graph.matrix(),i=this.padding;return ty.transformPoint(n,r).translate(i.left,i.top)}resize(e,t){let n=null!=e?e:this.container.offsetWidth,r=null!=t?t:this.container.offsetHeight;"number"==typeof n&&(n=Math.round(n)),"number"==typeof r&&(r=Math.round(r)),this.options.width=n,this.options.height=r,aq(this.container,{width:n,height:r}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(e,t){let n=this.container,r=n.getBoundingClientRect(),i=0,o=0;return e<=r.left+10&&(i=-10),t<=r.top+10&&(o=-10),e>=r.right-10&&(i=10),t>=r.bottom-10&&(o=10),0!==i&&(n.scrollLeft+=i),0!==o&&(n.scrollTop+=o),{scrollerX:i,scrollerY:o}}addPadding(e,t,n,r){let i=this.getPadding();this.padding={left:Math.round(i.left+(e||0)),top:Math.round(i.top+(n||0)),bottom:Math.round(i.bottom+(r||0)),right:Math.round(i.right+(t||0))},i=this.padding,aq(this.content,{width:i.left+this.graph.options.width+i.right,height:i.top+this.graph.options.height+i.bottom});let o=this.graph.container;return o.style.left=`${this.padding.left}px`,o.style.top=`${this.padding.top}px`,this}getPadding(){let e=this.options.padding;return"function"==typeof e?lJ(n0(e,this,this)):lJ(e)}getVisibleArea(){let e=this.graph.matrix(),t=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:t.width,height:t.height},r=ty.transformRectangle(n,e.inverse());return r.x-=(this.padding.left||0)/this.sx,r.y-=(this.padding.top||0)/this.sy,r}isCellVisible(e,t={}){let n=e.getBBox(),r=this.getVisibleArea();return t.strict?r.containsRect(n):r.isIntersectWithRect(n)}isPointVisible(e){return this.getVisibleArea().containsPoint(e)}lock(){return aq(this.container,{overflow:"hidden"}),this}unlock(){return aq(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){aP(this.container,this.graph.container),this.remove()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([de.dispose()],pm.prototype,"dispose",null),(pm||(pm={})).Background=class e extends f8{get elem(){return this.scroller.background}constructor(e){super(e.graph),this.scroller=e,e.options.background&&this.draw(e.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(e){this.scroller.options.background=e}},(e2=pm||(pm={})).containerClass="graph-scroller",e2.panningClass=`${e2.containerClass}-panning`,e2.pannableClass=`${e2.containerClass}-pannable`,e2.pagedClass=`${e2.containerClass}-paged`,e2.contentClass=`${e2.containerClass}-content`,e2.backgroundClass=`${e2.containerClass}-background`,e2.transitionClassName="transition-in-progress",e2.transitionEventName="transitionend.graph-scroller-transition",e2.defaultOptions={padding(){let e=this.getClientSize(),t=Math.max(this.options.minVisibleWidth||0,1)||1,n=Math.max(this.options.minVisibleHeight||0,1)||1,r=Math.max(e.width-t,0),i=Math.max(e.height-n,0);return{left:r,top:i,right:r,bottom:i}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0},e2.getOptions=function(e){let t=iM({},e2.defaultOptions,e);null==t.pageWidth&&(t.pageWidth=e.graph.options.width),null==t.pageHeight&&(t.pageHeight=e.graph.options.height);let n=e.graph.options;return n.background&&t.enabled&&null==t.background&&(t.background=n.background,e.graph.background.clear()),t};let py=`.x6-graph-scroller {
297
+ `;var cG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Xw extends ge{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(e){super(),this.name="minimap",this.options=Object.assign(Object.assign({},fc.defaultOptions),e),Fo(this.name,lG)}init(e){this.graph=e,this.updateViewport=$h(this.updateViewport.bind(this),0),this.container=document.createElement("div"),K(this.container,this.prefixClassName(Zo.root));const t=document.createElement("div");this.container.appendChild(t),this.viewport=document.createElement("div"),K(this.viewport,this.prefixClassName(Zo.viewport)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),K(this.zoomHandle,this.prefixClassName(Zo.zoom)),Tr(this.zoomHandle,this.viewport)),zn(this.container,this.viewport),me(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const r=Object.assign(Object.assign({},this.options.graphOptions),{container:t,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(r):new V(r),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?Se.on(this.graphContainer,`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?Se.off(this.graphContainer,this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.stopListening(),this.targetGraph.dispose(!1)}onTransform(e){(e.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(e,t){let r,i;typeof e=="object"?(r=e.width,i=e.height):(r=e,i=t);const s=this.sourceGraph.options,o=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;r/=o.sx,i/=o.sy,this.ratio=Math.min(a/r,l/i);const c=this.ratio,u=s.x*c/o.sx,h=s.y*c/o.sy;return r*=c,i*=c,this.targetGraph.resize(r,i),this.targetGraph.translate(u,h),this.scroller?this.targetGraph.scale(c,c):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const e=this.sourceGraph.transform.getScale(),t=this.targetGraph.transform.getScale();let r=null;this.scroller?r=this.scroller.clientToLocalPoint(0,0):r=this.graph.graphToLocal(0,0);const i=fq(this.targetGraph.container),s=this.targetGraph.translate();s.ty=s.ty||0,this.geometry={top:i.top+r.y*t.sy+s.ty,left:i.left+r.x*t.sx+s.tx,width:this.graphContainer.clientWidth*t.sx/e.sx,height:this.graphContainer.clientHeight*t.sy/e.sy},me(this.viewport,this.geometry)}startAction(e){const t=this.normalizeEvent(e),r=t.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:s}=this.sourceGraph.translate(),o={action:r,clientX:t.clientX,clientY:t.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:s};this.targetGraphTransforming=!0,this.delegateDocumentEvents(fc.documentEvents,o)}doAction(e){const t=this.normalizeEvent(e),r=t.clientX,i=t.clientY,s=t.data;switch(s.action){case"panning":{const o=this.sourceGraph.transform.getScale(),a=(r-s.clientX)*o.sx,l=(i-s.clientY)*o.sy;this.scroller?(this.graphContainer.scrollLeft=s.scrollLeft+a/this.ratio,this.graphContainer.scrollTop=s.scrollTop+l/this.ratio):this.sourceGraph.translate(s.translateX-a/this.ratio,s.translateY-l/this.ratio);break}case"zooming":{const o=s.scale,a=s.geometry,l=1+(s.clientX-r)/a.width/o.sx;s.frameId&&cancelAnimationFrame(s.frameId),s.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(l*s.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(e){const t=this.normalizeEvent(e);let r,i;const s=this.targetGraph.translate();if(s.ty=s.ty||0,t.offsetX==null){const l=Do(this.targetGraph.container);r=t.pageX-l.left,i=t.pageY-l.top}else r=t.offsetX,i=t.offsetY;const o=(r-s.tx)/this.ratio,a=(i-s.ty)/this.ratio;this.sourceGraph.centerPoint(o,a)}dispose(){this.remove(),Vo(this.name)}}cG([ge.dispose()],Xw.prototype,"dispose",null);var Zo;(function(n){n.root="widget-minimap",n.viewport=`${n.root}-viewport`,n.zoom=`${n.viewport}-zoom`})(Zo||(Zo={}));var fc;(function(n){n.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:e=>new V(e)},n.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}})(fc||(fc={}));var uG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},hG=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class st extends ge{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(e){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=st.getOptions(e),this.onUpdate=$h(this.onUpdate,200);const t=this.graph.transform.getScale();this.sx=t.sx,this.sy=t.sy;const r=this.options.width||this.graph.options.width,i=this.options.height||this.graph.options.height;this.container=document.createElement("div"),K(this.container,this.prefixClassName(st.containerClass)),me(this.container,{width:r,height:i}),this.options.pageVisible&&K(this.container,this.prefixClassName(st.pagedClass)),this.options.className&&K(this.container,this.options.className);const s=this.graph.container;s.parentNode&&_o(s,this.container),this.content=document.createElement("div"),K(this.content,this.prefixClassName(st.contentClass)),me(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),K(this.background,this.prefixClassName(st.backgroundClass)),zn(this.content,this.background),this.options.pageVisible||zn(this.content,this.graph.view.grid),zn(this.content,s),Tr(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new st.Background(this),this.options.autoResize||this.update()}startListening(){const e=this.graph,t=this.model;e.on("scale",this.onScale,this),e.on("resize",this.onResize,this),e.on("before:print",this.storeScrollPosition,this),e.on("before:export",this.storeScrollPosition,this),e.on("after:print",this.restoreScrollPosition,this),e.on("after:export",this.restoreScrollPosition,this),t.on("reseted",this.onUpdate,this),t.on("cell:added",this.onUpdate,this),t.on("cell:removed",this.onUpdate,this),t.on("cell:changed",this.onUpdate,this),this.delegateBackgroundEvents()}stopListening(){const e=this.graph,t=this.model;e.off("scale",this.onScale,this),e.off("resize",this.onResize,this),e.off("beforeprint",this.storeScrollPosition,this),e.off("beforeexport",this.storeScrollPosition,this),e.off("afterprint",this.restoreScrollPosition,this),e.off("afterexport",this.restoreScrollPosition,this),t.off("reseted",this.onUpdate,this),t.off("cell:added",this.onUpdate,this),t.off("cell:removed",this.onUpdate,this),t.off("cell:changed",this.onUpdate,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(e){const t=e||Sn.events;this.delegatedHandlers=Object.keys(t).reduce((r,i)=>{const s=t[i];if(i.indexOf(" ")===-1)if(typeof s=="function")r[i]=s;else{let o=this.graph.view[s];typeof o=="function"&&(o=o.bind(this.graph.view),r[i]=o)}return r},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(r=>{this.delegateEvent(r,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(e=>{this.undelegateEvent(e,this.onBackgroundEvent)})}onBackgroundEvent(e){let t=!1;const r=e.target;if(this.options.pageVisible)this.options.background?t=this.background===r:t=this.content===r;else{const i=this.graph.view;t=i.background===r||i.grid===r}if(t){const i=this.delegatedHandlers[e.type];typeof i=="function"&&i.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:e,sy:t,ox:r,oy:i}){this.updateScale(e,t),(r||i)&&(this.centerPoint(r,i),this.updatePageBreak()),typeof this.options.autoResizeOptions=="function"&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(nn.IS_IE||nn.IS_EDGE)&&me(this.container,{visibility:"hidden"})}afterManipulation(){(nn.IS_IE||nn.IS_EDGE)&&me(this.container,{visibility:"visible"})}updatePageSize(e,t){e!=null&&(this.options.pageWidth=e),t!=null&&(this.options.pageHeight=t),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const e=this.graph.options.width,t=this.graph.options.height,r=this.options.pageWidth*this.sx,i=this.options.pageHeight*this.sy;if(r===0||i===0)return;if(e>r||t>i){let s=!1;const o=document.createElement("div");for(let a=1,l=Math.floor(e/r);a<l;a+=1){const c=document.createElement("div");K(c,this.prefixClassName("graph-pagebreak-vertical")),me(c,{left:a*r}),Tr(c,o),s=!0}for(let a=1,l=Math.floor(t/i);a<l;a+=1){const c=document.createElement("div");K(c,this.prefixClassName("graph-pagebreak-horizontal")),me(c,{top:a*i}),Tr(c,o),s=!0}s&&(K(o,this.prefixClassName("graph-pagebreak")),OV(this.graph.view.grid,o),this.pageBreak=o)}}}update(){const e=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(e.width/2,e.height/2);let t=this.options.autoResizeOptions;typeof t=="function"&&(t=Y(t,this,this));const r=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},t);this.graph.fitToContent(this.getFitToContentOptions(r))}getFitToContentOptions(e){const t=this.sx,r=this.sy;return e.gridWidth&&(e.gridWidth*=t),e.gridHeight&&(e.gridHeight*=r),e.minWidth&&(e.minWidth*=t),e.minHeight&&(e.minHeight*=r),typeof e.padding=="object"?e.padding={left:(e.padding.left||0)*t,right:(e.padding.right||0)*t,top:(e.padding.top||0)*r,bottom:(e.padding.bottom||0)*r}:typeof e.padding=="number"&&(e.padding*=t),this.options.autoResize||(e.contentArea=D.create()),e}updateScale(e,t){const r=this.graph.options,i=e/this.sx,s=t/this.sy;this.sx=e,this.sy=t,this.graph.translate(r.x*i,r.y*s),this.graph.transform.resize(r.width*i,r.height*s)}scrollbarPosition(e,t){if(e==null&&t==null)return{left:this.container.scrollLeft,top:this.container.scrollTop};const r={};return typeof e=="number"&&(r.scrollLeft=e),typeof t=="number"&&(r.scrollTop=t),Qh(this.container,r),this}scrollToPoint(e,t){const r=this.getClientSize(),i=this.graph.matrix(),s={};return typeof e=="number"&&(s.scrollLeft=e-r.width/2+i.e+(this.padding.left||0)),typeof t=="number"&&(s.scrollTop=t-r.height/2+i.f+(this.padding.top||0)),Qh(this.container,s),this}scrollToContent(){const e=this.sx,t=this.sy,r=this.graph.getContentArea().getCenter();return this.scrollToPoint(r.x*e,r.y*t)}scrollToCell(e){const t=this.sx,r=this.sy,i=e.getBBox().getCenter();return this.scrollToPoint(i.x*t,i.y*r)}center(e){return this.centerPoint(e)}centerPoint(e,t,r){const i=this.graph.matrix(),s=i.a,o=i.d,a=-i.e,l=-i.f,c=a+this.graph.options.width,u=l+this.graph.options.height;let h;if(this.storeClientSize(),typeof e=="number"||typeof t=="number"){h=r;const x=this.getVisibleArea().getCenter();typeof e=="number"?e*=s:e=x.x,typeof t=="number"?t*=o:t=x.y}else h=e,e=(a+c)/2,t=(l+u)/2;if(h&&h.padding)return this.positionPoint({x:e,y:t},"50%","50%",h);const f=this.getPadding(),d=this.getClientSize(),g=d.width/2,p=d.height/2,b=g-f.left-e+a,m=g-f.right+e-c,v=p-f.top-t+l,y=p-f.bottom+t-u;this.addPadding(Math.max(b,0),Math.max(m,0),Math.max(v,0),Math.max(y,0));const w=this.scrollToPoint(e,t);return this.restoreClientSize(),w}centerContent(e){return this.positionContent("center",e)}centerCell(e,t){return this.positionCell(e,"center",t)}positionContent(e,t){const r=this.graph.getContentArea(t);return this.positionRect(r,e,t)}positionCell(e,t,r){const i=e.getBBox();return this.positionRect(i,t,r)}positionRect(e,t,r){const i=D.create(e);switch(t){case"center":return this.positionPoint(i.getCenter(),"50%","50%",r);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,r);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,r);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",r);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",r);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",r);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",r);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",r);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,r);default:return this}}positionPoint(e,t,r,i={}){const{padding:s}=i,o=hG(i,["padding"]),a=Bn(s),l=D.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});t=Vt(t,Math.max(0,c.width)),t<0&&(t=c.width+t),r=Vt(r,Math.max(0,c.height)),r<0&&(r=c.height+r);const u=c.getTopLeft().translate(t,r),h=l.getCenter().diff(u),f=this.zoom(),d=h.scale(1/f,1/f),g=P.create(e).translate(d);return this.centerPoint(g.x,g.y,o)}zoom(e,t){if(e==null)return this.sx;t=t||{};let r,i;const s=this.getClientSize(),o=this.clientToLocalPoint(s.width/2,s.height/2);let a=e,l=e;if(t.absolute||(a+=this.sx,l+=this.sy),t.scaleGrid&&(a=Math.round(a/t.scaleGrid)*t.scaleGrid,l=Math.round(l/t.scaleGrid)*t.scaleGrid),t.maxScale&&(a=Math.min(t.maxScale,a),l=Math.min(t.maxScale,l)),t.minScale&&(a=Math.max(t.minScale,a),l=Math.max(t.minScale,l)),a=this.graph.transform.clampScale(a),l=this.graph.transform.clampScale(l),t.center){const c=a/this.sx,u=l/this.sy;r=t.center.x-(t.center.x-o.x)/c,i=t.center.y-(t.center.y-o.y)/u}else r=o.x,i=o.y;return this.beforeManipulation(),this.graph.transform.scale(a,l),this.centerPoint(r,i),this.afterManipulation(),this}zoomToRect(e,t={}){const r=D.create(e),i=this.graph;if(t.contentArea=r,t.viewportArea==null){const o=this.container.getBoundingClientRect();t.viewportArea={x:i.options.x,y:i.options.y,width:o.width,height:o.height}}this.beforeManipulation(),i.transform.scaleContentToFitImpl(t,!1);const s=r.getCenter();return this.centerPoint(s.x,s.y),this.afterManipulation(),this}zoomToFit(e={}){return this.zoomToRect(this.graph.getContentArea(e),e)}transitionToPoint(e,t,r){typeof e=="object"?(r=t,t=e.y,e=e.x):t=t,r==null&&(r={});let i,s;const o=this.sx,a=Math.max(r.scale||o,1e-6),l=this.getClientSize(),c=new P(e,t),u=this.clientToLocalPoint(l.width/2,l.height/2);if(o===a){const f=u.diff(c).scale(o,o).round();i=`translate(${f.x}px,${f.y}px)`}else{const f=a/(o-a)*c.distance(u),d=u.clone().move(c,f),g=this.localToBackgroundPoint(d).round();i=`scale(${a/o})`,s=`${g.x}px ${g.y}px`}const h=r.onTransitionEnd;return K(this.container,st.transitionClassName),Se.off(this.content,st.transitionEventName),Se.on(this.content,st.transitionEventName,f=>{this.syncTransition(a,{x:e,y:t}),typeof h=="function"&&Y(h,this,f.originalEvent)}),me(this.content,{transform:i,transformOrigin:s,transition:"transform",transitionDuration:r.duration||"1s",transitionDelay:r.delay,transitionTimingFunction:r.timing}),this}syncTransition(e,t){return this.beforeManipulation(),this.graph.scale(e),this.removeTransition(),this.centerPoint(t.x,t.y),this.afterManipulation(),this}removeTransition(){return mt(this.container,st.transitionClassName),Se.off(this.content,st.transitionEventName),me(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(e,t={}){const r=D.create(e),i=t.maxScale||1/0,s=t.minScale||Number.MIN_VALUE,o=t.scaleGrid||null,a=t.visibility||1,l=t.center?P.create(t.center):r.getCenter(),c=this.getClientSize(),u=c.width*a,h=c.height*a;let f=new D(l.x-u/2,l.y-h/2,u,h).getMaxUniformScaleToFit(r,l);return f=Math.min(f,i),o&&(f=Math.floor(f/o)*o),f=Math.max(s,f),this.transitionToPoint(l,Object.assign({scale:f},t))}startPanning(e){const t=this.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("pan:start",{e:t}),Se.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),Se.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.normalizeEvent(e),r=t.clientX-this.clientX,i=t.clientY-this.clientY;this.container.scrollTop-=i,this.container.scrollLeft-=r,this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("panning",{e:t})}stopPanning(e){Se.off(document.body,".panning"),Se.off(window,".panning"),this.trigger("pan:stop",{e})}clientToLocalPoint(e,t){let r=typeof e=="object"?e.x:e,i=typeof e=="object"?e.y:t;const s=this.graph.matrix();return r+=this.container.scrollLeft-this.padding.left-s.e,i+=this.container.scrollTop-this.padding.top-s.f,new P(r/s.a,i/s.d)}localToBackgroundPoint(e,t){const r=typeof e=="object"?P.create(e):new P(e,t),i=this.graph.matrix(),s=this.padding;return de.transformPoint(r,i).translate(s.left,s.top)}resize(e,t){let r=e!=null?e:this.container.offsetWidth,i=t!=null?t:this.container.offsetHeight;typeof r=="number"&&(r=Math.round(r)),typeof i=="number"&&(i=Math.round(i)),this.options.width=r,this.options.height=i,me(this.container,{width:r,height:i}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(e,t){const i=this.container,s=i.getBoundingClientRect();let o=0,a=0;return e<=s.left+10&&(o=-10),t<=s.top+10&&(a=-10),e>=s.right-10&&(o=10),t>=s.bottom-10&&(a=10),o!==0&&(i.scrollLeft+=o),a!==0&&(i.scrollTop+=a),{scrollerX:o,scrollerY:a}}addPadding(e,t,r,i){let s=this.getPadding();this.padding={left:Math.round(s.left+(e||0)),top:Math.round(s.top+(r||0)),bottom:Math.round(s.bottom+(i||0)),right:Math.round(s.right+(t||0))},s=this.padding,me(this.content,{width:s.left+this.graph.options.width+s.right,height:s.top+this.graph.options.height+s.bottom});const o=this.graph.container;return o.style.left=`${this.padding.left}px`,o.style.top=`${this.padding.top}px`,this}getPadding(){const e=this.options.padding;return Bn(typeof e=="function"?Y(e,this,this):e)}getVisibleArea(){const e=this.graph.matrix(),t=this.getClientSize(),r={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:t.width,height:t.height},i=de.transformRectangle(r,e.inverse());return i.x-=(this.padding.left||0)/this.sx,i.y-=(this.padding.top||0)/this.sy,i}isCellVisible(e,t={}){const r=e.getBBox(),i=this.getVisibleArea();return t.strict?i.containsRect(r):i.isIntersectWithRect(r)}isPointVisible(e){return this.getVisibleArea().containsPoint(e)}lock(){return me(this.container,{overflow:"hidden"}),this}unlock(){return me(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){_o(this.container,this.graph.container),this.remove()}}uG([ge.dispose()],st.prototype,"dispose",null),function(n){class e extends uc{get elem(){return this.scroller.background}constructor(r){super(r.graph),this.scroller=r,r.options.background&&this.draw(r.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(r){this.scroller.options.background=r}}n.Background=e}(st||(st={})),function(n){n.containerClass="graph-scroller",n.panningClass=`${n.containerClass}-panning`,n.pannableClass=`${n.containerClass}-pannable`,n.pagedClass=`${n.containerClass}-paged`,n.contentClass=`${n.containerClass}-content`,n.backgroundClass=`${n.containerClass}-background`,n.transitionClassName="transition-in-progress",n.transitionEventName="transitionend.graph-scroller-transition",n.defaultOptions={padding(){const t=this.getClientSize(),r=Math.max(this.options.minVisibleWidth||0,1)||1,i=Math.max(this.options.minVisibleHeight||0,1)||1,s=Math.max(t.width-r,0),o=Math.max(t.height-i,0);return{left:s,top:o,right:s,bottom:o}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0};function e(t){const r=Ie({},n.defaultOptions,t);r.pageWidth==null&&(r.pageWidth=t.graph.options.width),r.pageHeight==null&&(r.pageHeight=t.graph.options.height);const i=t.graph.options;return i.background&&r.enabled&&r.background==null&&(r.background=i.background,t.graph.background.clear()),r}n.getOptions=e}(st||(st={}));const fG=`.x6-graph-scroller {
295
298
  position: relative;
296
299
  box-sizing: border-box;
297
300
  overflow: scroll;
@@ -349,7 +352,7 @@
349
352
  height: 1px;
350
353
  border-top: 1px dashed #bdbdbd;
351
354
  }
352
- `;pu.prototype.lockScroller=function(){let e=this.getPlugin("scroller");return e&&e.lockScroller(),this},pu.prototype.unlockScroller=function(){let e=this.getPlugin("scroller");return e&&e.unlockScroller(),this},pu.prototype.updateScroller=function(){let e=this.getPlugin("scroller");return e&&e.updateScroller(),this},pu.prototype.getScrollbarPosition=function(){let e=this.getPlugin("scroller");return e?e.getScrollbarPosition():{left:0,top:0}},pu.prototype.setScrollbarPosition=function(e,t){let n=this.getPlugin("scroller");return n&&n.setScrollbarPosition(e,t),this};class pb extends sp{get pannable(){if(this.options)return"object"==typeof this.options.pannable?this.options.pannable.enabled:!!this.options.pannable;return!1}get container(){return this.scrollerImpl.container}constructor(e={}){super(),this.name="scroller",this.options=e,uP(this.name,py)}init(e){this.graph=e;let t=pm.getOptions(Object.assign(Object.assign({enabled:!0},this.options),{graph:e}));this.options=t,this.scrollerImpl=new pm(t),this.setup(),this.startListening(),this.updateClassName(),this.scrollerImpl.center()}resize(e,t){this.scrollerImpl.resize(e,t)}resizePage(e,t){this.scrollerImpl.updatePageSize(e,t)}zoom(e,t){return void 0===e?this.scrollerImpl.zoom():(this.scrollerImpl.zoom(e,t),this)}zoomTo(e,t={}){return this.scrollerImpl.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){return this.scrollerImpl.zoomToRect(e,t),this}zoomToFit(e={}){return this.scrollerImpl.zoomToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,n){return this.scrollerImpl.centerPoint(e,t,n),this}centerContent(e){return this.scrollerImpl.centerContent(e),this}centerCell(e,t){return this.scrollerImpl.centerCell(e,t),this}positionPoint(e,t,n,r={}){return this.scrollerImpl.positionPoint(e,t,n,r),this}positionRect(e,t,n){return this.scrollerImpl.positionRect(e,t,n),this}positionCell(e,t,n){return this.scrollerImpl.positionCell(e,t,n),this}positionContent(e,t){return this.scrollerImpl.positionContent(e,t),this}drawBackground(e,t){return(null==this.graph.options.background||!t)&&this.scrollerImpl.backgroundManager.draw(e),this}clearBackground(e){return(null==this.graph.options.background||!e)&&this.scrollerImpl.backgroundManager.clear(),this}isPannable(){return this.pannable}enablePanning(){!this.pannable&&(this.options.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.options.pannable=!1,this.updateClassName())}togglePanning(e){return null==e?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}lockScroller(){return this.scrollerImpl.lock(),this}unlockScroller(){return this.scrollerImpl.unlock(),this}updateScroller(){return this.scrollerImpl.update(),this}getScrollbarPosition(){return this.scrollerImpl.scrollbarPosition()}setScrollbarPosition(e,t){return this.scrollerImpl.scrollbarPosition(e,t),this}scrollToPoint(e,t){return this.scrollerImpl.scrollToPoint(e,t),this}scrollToContent(){return this.scrollerImpl.scrollToContent(),this}scrollToCell(e){return this.scrollerImpl.scrollToCell(e),this}transitionToPoint(e,t,n){return this.scrollerImpl.transitionToPoint(e,t,n),this}transitionToRect(e,t={}){return this.scrollerImpl.transitionToRect(e,t),this}enableAutoResize(){this.scrollerImpl.enableAutoResize()}disableAutoResize(){this.scrollerImpl.disableAutoResize()}autoScroll(e,t){return this.scrollerImpl.autoScroll(e,t)}clientToLocalPoint(e,t){return this.scrollerImpl.clientToLocalPoint(e,t)}setup(){this.scrollerImpl.on("*",(e,t)=>{this.trigger(e,t)})}startListening(){let e=[],t=this.options.pannable;(e="object"==typeof t?t.eventTypes||[]:["leftMouseDown"]).includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),ti.on(this.scrollerImpl.container,"mousedown",this.onRightMouseDown))}stopListening(){let e=[],t=this.options.pannable;(e="object"==typeof t?t.eventTypes||[]:["leftMouseDown"]).includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&ti.off(this.scrollerImpl.container,"mousedown",this.onRightMouseDown)}onRightMouseDown(e){2===e.button&&this.allowPanning(e,!0)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e}){let t=this.allowPanning(e,!0),n=this.graph.getPlugin("selection"),r=n&&n.allowRubberband(e,!0);(t||this.allowPanning(e)&&!r)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(e,t){return this.pannable&&ta.isMatch(e,this.options.modifiers,t)}updateClassName(e){let t=this.scrollerImpl.container,n=hk.prefix("graph-scroller-pannable");this.pannable?(aa(t,n),t.dataset.panning=(!!e).toString()):au(t,n)}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),uO(this.name)}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([sp.dispose()],pb.prototype,"dispose",null);class pv extends de{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(tD.classNames.box)}get $boxes(){return function(e,t){let n=[],r=e.firstChild;for(;r;r=r.nextSibling)1===r.nodeType&&(!t||al(r,t))&&n.push(r);return n}(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new fF([],{comparator:tD.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){let e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){let e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){let{showNodeSelectionBox:n,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:s,snapped:l}=t,a=(!0!==n||"none"===r)&&!this.translating&&!o,u=i&&s&&e.id===s;if(a&&(u||l)){this.translating=!0;let n=e.position(),r=e.previous("position"),i=n.x-r.x,o=n.y-r.y;(0!==i||0!==o)&&this.translateSelectedNodes(i,o,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;let n=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(n,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){let n=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(n,Object.assign(Object.assign({},t),{ui:!0})),this}let n=this.cells,r=this.filter(Array.isArray(e)?e:[e]),i={},o={};n.forEach(e=>i[e.id]=e),r.forEach(e=>o[e.id]=e);let s=[],l=[];return r.forEach(e=>{!i[e.id]&&s.push(e)}),n.forEach(e=>{!o[e.id]&&l.push(e)}),l.length&&this.unselect(l,Object.assign(Object.assign({},t),{ui:!0})),s.length&&this.select(s,Object.assign(Object.assign({},t),{ui:!0})),0===l.length&&0===s.length&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(!1===e.batch?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){let t,n;e=this.normalizeEvent(e),this.clean();let r=this.graph.container;if(null!=e.offsetX&&null!=e.offsetY&&r.contains(e.target))t=e.offsetX,n=e.offsetY;else{let i=ub(r),o=r.scrollLeft,s=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,n=e.clientY-i.top+window.pageYOffset+s}aq(this.container,{top:n,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:n,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(tD.documentEvents,e.data)}filter(e){let t=this.options.filter;return e.filter(e=>Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||n0(t,this.graph,e))}stopSelecting(e){let t=this.graph,n=this.getEventData(e);switch(n.action){case"selecting":{let e=this.container.getBoundingClientRect().width,n=this.container.getBoundingClientRect().height,r=ub(this.container),i=t.pageToLocal(r.left,r.top),o=t.transform.getScale();e/=o.sx,n/=o.sy;let s=new uM(i.x,i.y,e,n),l=this.getCellViewsInArea(s).map(e=>e.cell);this.reset(l,{batch:!0}),this.hideRubberband();break}case"translating":{let r=t.snapToGrid(e.clientX,e.clientY);!this.options.following&&this.updateSelectedNodesPosition({dx:n.clientX-n.originX,dy:n.clientY-n.originY}),this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,r.x,r.y);break}default:this.clean()}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){!this.options.following&&e.stopPropagation();let t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);let n=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:n});let r=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,r.x,r.y),this.delegateDocumentEvents(tD.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");let t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){let e=this.graph.options.translating.restrict,t="function"==typeof e?n0(e,this.graph,null):e;return"number"==typeof t?this.graph.transform.getGraphArea().inflate(t):!0===t?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let n=e.x-t.clientX,r=e.y-t.clientY,i=this.getRestrictArea();if(i){let o=this.collection.toArray(),s=fL.getCellsBBox(o,{deep:!0})||uM.create(),l=i.x-s.x,a=i.y-s.y,u=i.x+i.width-(s.x+s.width),c=i.y+i.height-(s.y+s.height);if(n<l&&(n=l),r<a&&(r=a),u<n&&(n=u),c<r&&(r=c),!this.options.following){let i=e.x-t.originX,o=e.y-t.originY;n=i<=l||i>=u?0:n,r=o<=a||o>=c?0:r}}return{dx:n,dy:r}}updateElementPosition(e,t,n){let r=aq(e,"left"),i=aq(e,"top"),o=r?parseFloat(r):0,s=i?parseFloat(i):0;aq(e,"left",o+t),aq(e,"top",s+n)}updateSelectedNodesPosition(e){let{dx:t,dy:n}=e;if(t||n){if(this.translateSelectedNodes(t,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{let e=this.graph.transform.getScale();for(let r=0,i=this.$boxes,o=i.length;r<o;r+=1)this.updateElementPosition(i[r],t*e.sx,n*e.sy);this.updateElementPosition(this.selectionContainer,t*e.sx,n*e.sy)}}}autoScrollGraph(e,t){let n=this.graph.getPlugin("scroller");return n?n.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){let t=this.normalizeEvent(e),n=this.getEventData(t);switch(n.action){case"selecting":{!0!==n.moving&&(aO(this.container,this.graph.container),this.showRubberband(),n.moving=!0);let{scrollerX:e,scrollerY:r}=this.autoScrollGraph(t.clientX,t.clientY);n.scrollerX+=e,n.scrollerY+=r;let i=t.clientX-n.clientX+n.scrollerX,o=t.clientY-n.clientY+n.scrollerY,s=parseInt(aq(this.container,"left")||"0",10),l=parseInt(aq(this.container,"top")||"0",10);aq(this.container,{left:i<0?n.offsetX+i:s,top:o<0?n.offsetY+o:l,width:Math.abs(i),height:Math.abs(o)});break}case"translating":{let r=this.graph.snapToGrid(t.clientX,t.clientY),i=this.getSelectionOffset(r,n);this.options.following?this.updateSelectedNodesPosition(i):this.updateContainerPosition(i),i.dx&&(n.clientX=r.x),i.dy&&(n.clientY=r.y),this.notifyBoxEvent("box:mousemove",e,r.x,r.y)}}this.boxesUpdated=!1}translateSelectedNodes(e,t,n,r){let i={},o=[];if(n&&(i[n.id]=!0),this.collection.toArray().forEach(e=>{e.getDescendants({deep:!0}).forEach(e=>{i[e.id]=!0})}),r&&r.translateBy){let e=this.graph.getCellById(r.translateBy);e&&(i[e.id]=!0,e.getDescendants({deep:!0}).forEach(e=>{i[e.id]=!0}),o.push(e))}this.collection.toArray().forEach(n=>{if(!i[n.id]){let s=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});n.translate(e,t,s),this.graph.model.getConnectedEdges(n).forEach(n=>{!i[n.id]&&(n.translate(e,t,s),i[n.id]=!0)})}})}getCellViewsInArea(e){let t=this.graph,n={strict:this.options.strict},r=[];return this.options.rubberNode&&(r=r.concat(t.model.getNodesInArea(e,n).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),this.options.rubberEdge&&(r=r.concat(t.model.getEdgesInArea(e,n).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),r}notifyBoxEvent(e,t,n,r){let i=this.getEventData(t).activeView;this.trigger(e,{e:t,view:i,x:n,y:r,cell:i.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){let t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){let t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(aw(this.container.querySelector(`[data-cell-id="${e.id}"]`)),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(e=>this.removeCellUnSelectedClassName(e)),this.hide(),aw(this.$boxes),this.boxCount=0}hide(){au(this.container,this.prefixClassName(tD.classNames.rubberband)),au(this.container,this.prefixClassName(tD.classNames.selected))}showRubberband(){aa(this.container,this.prefixClassName(tD.classNames.rubberband))}hideRubberband(){au(this.container,this.prefixClassName(tD.classNames.rubberband))}showSelected(){aM(this.container,"style"),aa(this.container,this.prefixClassName(tD.classNames.selected))}createContainer(){this.container=document.createElement("div"),aa(this.container,this.prefixClassName(tD.classNames.root)),this.options.className&&aa(this.container,this.options.className),this.selectionContainer=document.createElement("div"),aa(this.selectionContainer,this.prefixClassName(tD.classNames.inner)),this.selectionContent=document.createElement("div"),aa(this.selectionContent,this.prefixClassName(tD.classNames.content)),aE(this.selectionContainer,this.selectionContent),aj(this.selectionContainer,"data-selection-length",this.collection.length),aS(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){let e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(e=>this.canShowSelectionBox(e)).forEach(n=>{let r=this.graph.renderer.findViewByCell(n);if(r){let n=r.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),t.x=Math.max(t.x,n.x+n.width),t.y=Math.max(t.y,n.y+n.height)}}),aq(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),aj(this.selectionContainer,"data-selection-length",this.collection.length);let n=this.options.content;if(n){if("function"==typeof n){let e=n0(n,this.graph,this,this.selectionContent);e&&(this.selectionContent.innerHTML=e)}else this.selectionContent.innerHTML=n}this.collection.length>0&&!this.container.parentNode?aO(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&!0===this.options.showNodeSelectionBox||e.isEdge()&&!0===this.options.showEdgeSelectionBox}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){let t=this.graph.renderer.findViewByCell(e);if(t){let n=t.getBBox({useCellGeometry:!0}),r=this.boxClassName,i=document.createElement("div");aa(i,r),aa(i,`${r}-${e.isNode()?"node":"edge"}`),aj(i,"data-cell-id",e.id),aq(i,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:this.options.pointerEvents||"auto"}),aO(i,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,n=t.length;e<n;e+=1){let n=t[e],r=aj(n,"data-cell-id");aw(n),this.boxCount-=1;let i=this.collection.get(r);i&&this.createSelectionBox(i)}this.updateContainer()}return 0}getCellViewFromElem(e){let t=e.getAttribute("data-cell-id");if(t){let e=this.collection.get(t);if(e)return this.graph.renderer.findViewByCell(e)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(e=>{this.listenCellRemoveEvent(e),this.createSelectionBox(e)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:n}){e.forEach(e=>{this.trigger("cell:selected",{cell:e,options:n}),e.isNode()?this.trigger("node:selected",{cell:e,options:n,node:e}):e.isEdge()&&this.trigger("edge:selected",{cell:e,options:n,edge:e})}),t.forEach(e=>{this.trigger("cell:unselected",{cell:e,options:n}),e.isNode()?this.trigger("node:unselected",{cell:e,options:n,node:e}):e.isEdge()&&this.trigger("edge:unselected",{cell:e,options:n,edge:e})});let r={added:e,removed:t,options:n,selected:this.cells.filter(e=>!!this.graph.getCellById(e.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([de.dispose()],pv.prototype,"dispose",null),!function(e){let t="widget-selection";e.classNames={root:t,inner:`${t}-inner`,box:`${t}-box`,content:`${t}-content`,rubberband:`${t}-rubberband`,selected:`${t}-selected`},e.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};e.depthComparator=function(e){return e.getAncestors().length}}(tD||(tD={}));let px=`.x6-widget-selection {
355
+ `;V.prototype.lockScroller=function(){const n=this.getPlugin("scroller");return n&&n.lockScroller(),this},V.prototype.unlockScroller=function(){const n=this.getPlugin("scroller");return n&&n.unlockScroller(),this},V.prototype.updateScroller=function(){const n=this.getPlugin("scroller");return n&&n.updateScroller(),this},V.prototype.getScrollbarPosition=function(){const n=this.getPlugin("scroller");return n?n.getScrollbarPosition():{left:0,top:0}},V.prototype.setScrollbarPosition=function(n,e){const t=this.getPlugin("scroller");return t&&t.setScrollbarPosition(n,e),this};var dG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Yw extends pt{get pannable(){return this.options?typeof this.options.pannable=="object"?this.options.pannable.enabled:!!this.options.pannable:!1}get container(){return this.scrollerImpl.container}constructor(e={}){super(),this.name="scroller",this.options=e,Fo(this.name,fG)}init(e){this.graph=e;const t=st.getOptions(Object.assign(Object.assign({enabled:!0},this.options),{graph:e}));this.options=t,this.scrollerImpl=new st(t),this.setup(),this.startListening(),this.updateClassName(),this.scrollerImpl.center()}resize(e,t){this.scrollerImpl.resize(e,t)}resizePage(e,t){this.scrollerImpl.updatePageSize(e,t)}zoom(e,t){return typeof e=="undefined"?this.scrollerImpl.zoom():(this.scrollerImpl.zoom(e,t),this)}zoomTo(e,t={}){return this.scrollerImpl.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){return this.scrollerImpl.zoomToRect(e,t),this}zoomToFit(e={}){return this.scrollerImpl.zoomToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,r){return this.scrollerImpl.centerPoint(e,t,r),this}centerContent(e){return this.scrollerImpl.centerContent(e),this}centerCell(e,t){return this.scrollerImpl.centerCell(e,t),this}positionPoint(e,t,r,i={}){return this.scrollerImpl.positionPoint(e,t,r,i),this}positionRect(e,t,r){return this.scrollerImpl.positionRect(e,t,r),this}positionCell(e,t,r){return this.scrollerImpl.positionCell(e,t,r),this}positionContent(e,t){return this.scrollerImpl.positionContent(e,t),this}drawBackground(e,t){return(this.graph.options.background==null||!t)&&this.scrollerImpl.backgroundManager.draw(e),this}clearBackground(e){return(this.graph.options.background==null||!e)&&this.scrollerImpl.backgroundManager.clear(),this}isPannable(){return this.pannable}enablePanning(){this.pannable||(this.options.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.options.pannable=!1,this.updateClassName())}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}lockScroller(){return this.scrollerImpl.lock(),this}unlockScroller(){return this.scrollerImpl.unlock(),this}updateScroller(){return this.scrollerImpl.update(),this}getScrollbarPosition(){return this.scrollerImpl.scrollbarPosition()}setScrollbarPosition(e,t){return this.scrollerImpl.scrollbarPosition(e,t),this}scrollToPoint(e,t){return this.scrollerImpl.scrollToPoint(e,t),this}scrollToContent(){return this.scrollerImpl.scrollToContent(),this}scrollToCell(e){return this.scrollerImpl.scrollToCell(e),this}transitionToPoint(e,t,r){return this.scrollerImpl.transitionToPoint(e,t,r),this}transitionToRect(e,t={}){return this.scrollerImpl.transitionToRect(e,t),this}enableAutoResize(){this.scrollerImpl.enableAutoResize()}disableAutoResize(){this.scrollerImpl.disableAutoResize()}autoScroll(e,t){return this.scrollerImpl.autoScroll(e,t)}clientToLocalPoint(e,t){return this.scrollerImpl.clientToLocalPoint(e,t)}setup(){this.scrollerImpl.on("*",(e,t)=>{this.trigger(e,t)})}startListening(){let e=[];const t=this.options.pannable;typeof t=="object"?e=t.eventTypes||[]:e=["leftMouseDown"],e.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),Se.on(this.scrollerImpl.container,"mousedown",this.onRightMouseDown))}stopListening(){let e=[];const t=this.options.pannable;typeof t=="object"?e=t.eventTypes||[]:e=["leftMouseDown"],e.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&Se.off(this.scrollerImpl.container,"mousedown",this.onRightMouseDown)}onRightMouseDown(e){e.button===2&&this.allowPanning(e,!0)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e}){const t=this.allowPanning(e,!0),r=this.graph.getPlugin("selection"),i=r&&r.allowRubberband(e,!0);(t||this.allowPanning(e)&&!i)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(e,t){return this.pannable&&ir.isMatch(e,this.options.modifiers,t)}updateClassName(e){const t=this.scrollerImpl.container,r=on.prefix("graph-scroller-pannable");this.pannable?(K(t,r),t.dataset.panning=(!!e).toString()):mt(t,r)}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),Vo(this.name)}}dG([pt.dispose()],Yw.prototype,"dispose",null);var gG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Kw extends ge{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(It.classNames.box)}get $boxes(){return TV(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new cc([],{comparator:It.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:r,pointerEvents:i}=this.options,{ui:s,selection:o,translateBy:a,snapped:l}=t,c=(r!==!0||i==="none")&&!this.translating&&!o,u=s&&a&&e.id===a;if(c&&(u||l)){this.translating=!0;const h=e.position(),f=e.previous("position"),d=h.x-f.x,g=h.y-f.y;(d!==0||g!==0)&&this.translateSelectedNodes(d,g,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const r=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(r,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const c=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(c,Object.assign(Object.assign({},t),{ui:!0})),this}const r=this.cells,i=this.filter(Array.isArray(e)?e:[e]),s={},o={};r.forEach(c=>s[c.id]=c),i.forEach(c=>o[c.id]=c);const a=[],l=[];return i.forEach(c=>{s[c.id]||a.push(c)}),r.forEach(c=>{o[c.id]||l.push(c)}),l.length&&this.unselect(l,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),l.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(e.batch===!1?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){e=this.normalizeEvent(e),this.clean();let t,r;const i=this.graph.container;if(e.offsetX!=null&&e.offsetY!=null&&i.contains(e.target))t=e.offsetX,r=e.offsetY;else{const s=Do(i),o=i.scrollLeft,a=i.scrollTop;t=e.clientX-s.left+window.pageXOffset+o,r=e.clientY-s.top+window.pageYOffset+a}me(this.container,{top:r,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:r,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(It.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(r=>Array.isArray(t)?t.some(i=>typeof i=="string"?r.shape===i:r.id===i.id):typeof t=="function"?Y(t,this.graph,r):!0)}stopSelecting(e){const t=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":{let s=uq(this.container),o=hq(this.container);const a=Do(this.container),l=t.pageToLocal(a.left,a.top),c=t.transform.getScale();s/=c.sx,o/=c.sy;const u=new D(l.x,l.y,s,o),h=this.getCellViewsInArea(u).map(f=>f.cell);this.reset(h,{batch:!0}),this.hideRubberband();break}case"translating":{const s=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const o=r;this.updateSelectedNodesPosition({dx:o.clientX-o.originX,dy:o.clientY-o.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,s.x,s.y);break}default:{this.clean();break}}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const r=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:r});const i=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,i.x,i.y),this.delegateDocumentEvents(It.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t=typeof e=="function"?Y(e,this.graph,null):e;return typeof t=="number"?this.graph.transform.getGraphArea().inflate(t):t===!0?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let r=e.x-t.clientX,i=e.y-t.clientY;const s=this.getRestrictArea();if(s){const o=this.collection.toArray(),a=le.getCellsBBox(o,{deep:!0})||D.create(),l=s.x-a.x,c=s.y-a.y,u=s.x+s.width-(a.x+a.width),h=s.y+s.height-(a.y+a.height);if(r<l&&(r=l),i<c&&(i=c),u<r&&(r=u),h<i&&(i=h),!this.options.following){const f=e.x-t.originX,d=e.y-t.originY;r=f<=l||f>=u?0:r,i=d<=c||d>=h?0:i}}return{dx:r,dy:i}}updateElementPosition(e,t,r){const i=me(e,"left"),s=me(e,"top"),o=i?parseFloat(i):0,a=s?parseFloat(s):0;me(e,"left",o+t),me(e,"top",a+r)}updateSelectedNodesPosition(e){const{dx:t,dy:r}=e;if(t||r)if(this.translateSelectedNodes(t,r),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const i=this.graph.transform.getScale();for(let s=0,o=this.$boxes,a=o.length;s<a;s+=1)this.updateElementPosition(o[s],t*i.sx,r*i.sy);this.updateElementPosition(this.selectionContainer,t*i.sx,r*i.sy)}}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");return r?r.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),r=this.getEventData(t);switch(r.action){case"selecting":{const s=r;s.moving!==!0&&(Tr(this.container,this.graph.container),this.showRubberband(),s.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(t.clientX,t.clientY);s.scrollerX+=o,s.scrollerY+=a;const l=t.clientX-s.clientX+s.scrollerX,c=t.clientY-s.clientY+s.scrollerY,u=parseInt(me(this.container,"left")||"0",10),h=parseInt(me(this.container,"top")||"0",10);me(this.container,{left:l<0?s.offsetX+l:u,top:c<0?s.offsetY+c:h,width:Math.abs(l),height:Math.abs(c)});break}case"translating":{const s=this.graph.snapToGrid(t.clientX,t.clientY),o=r,a=this.getSelectionOffset(s,o);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(o.clientX=s.x),a.dy&&(o.clientY=s.y),this.notifyBoxEvent("box:mousemove",e,s.x,s.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,r,i){const s={},o=[];if(r&&(s[r.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(l=>{s[l.id]=!0})}),i&&i.translateBy){const a=this.graph.getCellById(i.translateBy);a&&(s[a.id]=!0,a.getDescendants({deep:!0}).forEach(l=>{s[l.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!s[a.id]){const l=Object.assign(Object.assign({},i),{selection:this.cid,exclude:o});a.translate(e,t,l),this.graph.model.getConnectedEdges(a).forEach(c=>{s[c.id]||(c.translate(e,t,l),s[c.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,r={strict:this.options.strict};let i=[];return this.options.rubberNode&&(i=i.concat(t.model.getNodesInArea(e,r).map(s=>t.renderer.findViewByCell(s)).filter(s=>s!=null))),this.options.rubberEdge&&(i=i.concat(t.model.getEdgesInArea(e,r).map(s=>t.renderer.findViewByCell(s)).filter(s=>s!=null))),i}notifyBoxEvent(e,t,r,i){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:r,y:i,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(nr(this.container.querySelector(`[data-cell-id="${e.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),nr(this.$boxes),this.boxCount=0}hide(){mt(this.container,this.prefixClassName(It.classNames.rubberband)),mt(this.container,this.prefixClassName(It.classNames.selected))}showRubberband(){K(this.container,this.prefixClassName(It.classNames.rubberband))}hideRubberband(){mt(this.container,this.prefixClassName(It.classNames.rubberband))}showSelected(){Xh(this.container,"style"),K(this.container,this.prefixClassName(It.classNames.selected))}createContainer(){this.container=document.createElement("div"),K(this.container,this.prefixClassName(It.classNames.root)),this.options.className&&K(this.container,this.options.className),this.selectionContainer=document.createElement("div"),K(this.selectionContainer,this.prefixClassName(It.classNames.inner)),this.selectionContent=document.createElement("div"),K(this.selectionContent,this.prefixClassName(It.classNames.content)),zn(this.selectionContainer,this.selectionContent),fe(this.selectionContainer,"data-selection-length",this.collection.length),g1(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(s=>this.canShowSelectionBox(s)).forEach(s=>{const o=this.graph.renderer.findViewByCell(s);if(o){const a=o.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,a.x),e.y=Math.min(e.y,a.y),t.x=Math.max(t.x,a.x+a.width),t.y=Math.max(t.y,a.y+a.height)}}),me(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),fe(this.selectionContainer,"data-selection-length",this.collection.length);const i=this.options.content;if(i)if(typeof i=="function"){const s=Y(i,this.graph,this,this.selectionContent);s&&(this.selectionContent.innerHTML=s)}else this.selectionContent.innerHTML=i;this.collection.length>0&&!this.container.parentNode?Tr(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&this.options.showNodeSelectionBox===!0||e.isEdge()&&this.options.showEdgeSelectionBox===!0}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const r=t.getBBox({useCellGeometry:!0}),i=this.boxClassName,s=document.createElement("div");K(s,i),K(s,`${i}-${e.isNode()?"node":"edge"}`),fe(s,"data-cell-id",e.id),me(s,{position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,pointerEvents:this.options.pointerEvents||"auto"}),Tr(s,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,r=t.length;e<r;e+=1){const i=t[e],s=fe(i,"data-cell-id");nr(i),this.boxCount-=1;const o=this.collection.get(s);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const r=this.collection.get(t);if(r)return this.graph.renderer.findViewByCell(r)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(r=>{this.listenCellRemoveEvent(r),this.createSelectionBox(r)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:r}){e.forEach(s=>{this.trigger("cell:selected",{cell:s,options:r}),s.isNode()?this.trigger("node:selected",{cell:s,options:r,node:s}):s.isEdge()&&this.trigger("edge:selected",{cell:s,options:r,edge:s})}),t.forEach(s=>{this.trigger("cell:unselected",{cell:s,options:r}),s.isNode()?this.trigger("node:unselected",{cell:s,options:r,node:s}):s.isEdge()&&this.trigger("edge:unselected",{cell:s,options:r,edge:s})});const i={added:e,removed:t,options:r,selected:this.cells.filter(s=>!!this.graph.getCellById(s.id))};this.trigger("selection:changed",i)}dispose(){this.clean(),this.remove(),this.off()}}gG([ge.dispose()],Kw.prototype,"dispose",null);var It;(function(n){const e="widget-selection";n.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function t(r){return r.getAncestors().length}n.depthComparator=t})(It||(It={}));const pG=`.x6-widget-selection {
353
356
  position: absolute;
354
357
  top: 0;
355
358
  left: 0;
@@ -414,7 +417,7 @@
414
417
  font-size: 10px;
415
418
  background-color: #6a6b8a;
416
419
  }
417
- `;pu.prototype.isSelectionEnabled=function(){let e=this.getPlugin("selection");return!!e&&e.isEnabled()},pu.prototype.enableSelection=function(){let e=this.getPlugin("selection");return e&&e.enable(),this},pu.prototype.disableSelection=function(){let e=this.getPlugin("selection");return e&&e.disable(),this},pu.prototype.toggleSelection=function(e){let t=this.getPlugin("selection");return t&&t.toggleEnabled(e),this},pu.prototype.isMultipleSelection=function(){let e=this.getPlugin("selection");return!!e&&e.isMultipleSelection()},pu.prototype.enableMultipleSelection=function(){let e=this.getPlugin("selection");return e&&e.enableMultipleSelection(),this},pu.prototype.disableMultipleSelection=function(){let e=this.getPlugin("selection");return e&&e.disableMultipleSelection(),this},pu.prototype.toggleMultipleSelection=function(e){let t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(e),this},pu.prototype.isSelectionMovable=function(){let e=this.getPlugin("selection");return!!e&&e.isSelectionMovable()},pu.prototype.enableSelectionMovable=function(){let e=this.getPlugin("selection");return e&&e.enableSelectionMovable(),this},pu.prototype.disableSelectionMovable=function(){let e=this.getPlugin("selection");return e&&e.disableSelectionMovable(),this},pu.prototype.toggleSelectionMovable=function(e){let t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(e),this},pu.prototype.isRubberbandEnabled=function(){let e=this.getPlugin("selection");return!!e&&e.isRubberbandEnabled()},pu.prototype.enableRubberband=function(){let e=this.getPlugin("selection");return e&&e.enableRubberband(),this},pu.prototype.disableRubberband=function(){let e=this.getPlugin("selection");return e&&e.disableRubberband(),this},pu.prototype.toggleRubberband=function(e){let t=this.getPlugin("selection");return t&&t.toggleRubberband(e),this},pu.prototype.isStrictRubberband=function(){let e=this.getPlugin("selection");return!!e&&e.isStrictRubberband()},pu.prototype.enableStrictRubberband=function(){let e=this.getPlugin("selection");return e&&e.enableStrictRubberband(),this},pu.prototype.disableStrictRubberband=function(){let e=this.getPlugin("selection");return e&&e.disableStrictRubberband(),this},pu.prototype.toggleStrictRubberband=function(e){let t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(e),this},pu.prototype.setRubberbandModifiers=function(e){let t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(e),this},pu.prototype.setSelectionFilter=function(e){let t=this.getPlugin("selection");return t&&t.setSelectionFilter(e),this},pu.prototype.setSelectionDisplayContent=function(e){let t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(e),this},pu.prototype.isSelectionEmpty=function(){let e=this.getPlugin("selection");return!e||e.isEmpty()},pu.prototype.cleanSelection=function(e){let t=this.getPlugin("selection");return t&&t.clean(e),this},pu.prototype.resetSelection=function(e,t){let n=this.getPlugin("selection");return n&&n.reset(e,t),this},pu.prototype.getSelectedCells=function(){let e=this.getPlugin("selection");return e?e.getSelectedCells():[]},pu.prototype.getSelectedCellCount=function(){let e=this.getPlugin("selection");return e?e.getSelectedCellCount():0},pu.prototype.isSelected=function(e){let t=this.getPlugin("selection");return!!t&&t.isSelected(e)},pu.prototype.select=function(e,t){let n=this.getPlugin("selection");return n&&n.select(e,t),this},pu.prototype.unselect=function(e,t){let n=this.getPlugin("selection");return n?n.unselect(e,t):this};class pw extends sp{get rubberbandDisabled(){return!0!==this.options.enabled||!0!==this.options.rubberband}get disabled(){return!0!==this.options.enabled}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=iM({enabled:!0},pw.defaultOptions,e),uP(this.name,px)}init(e){this.graph=e,this.selectionImpl=new pv(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){!this.disabled&&(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return null!=e?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.options.movable}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return null!=e?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return!this.rubberbandDisabled&&(this.options.rubberband=!1),this}toggleRubberband(e){return null!=e?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selectionImpl.options.strict}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return null!=e?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){let n=this.getCells(e);return n.length&&(this.isMultiple()?this.selectionImpl.select(n,t):this.reset(n.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e}){let t=this.graph.panning.allowPanning(e,!0),n=this.graph.getPlugin("scroller"),r=n&&n.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!r&&!t)&&this.startRubberband(e)}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&ta.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&ta.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){let n=this.options,r=this.disabled;!r&&this.movedMap.has(t)&&(!(r=!1===n.selectCellOnMoved)&&(r=!1===n.selectNodeOnMoved&&t.isNode()),!r&&(r=!1===n.selectEdgeOnMoved&&t.isEdge())),!r&&(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){!this.disabled&&this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(e=>"string"==typeof e?this.graph.getCellById(e):e).filter(e=>null!=e)}startRubberband(e){return!this.rubberbandDisabled&&this.selectionImpl.startSelecting(e),this}isMultiple(){return!1!==this.options.multiple}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),uO(this.name)}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([sp.dispose()],pw.prototype,"dispose",null),(pw||(pw={})).defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null};var pC=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class pE extends de{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();let{graph:t}=e,n=pC(e,["graph"]);this.graph=t,this.options=Object.assign({},n),this.offset={x:0,y:0},this.render(),!this.disabled&&this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){!this.disabled&&(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){let e=this.containerWrapper=new aK("svg"),t=this.horizontal=new aK("line"),n=this.vertical=new aK("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),n.setAttribute("display","none"),e.append([t,n]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){"resize"===e&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:n}){let r=e.getDelegatedView();if(r&&this.isNodeMovable(r)){let r=e.cell.getPosition();this.offset={x:t-r.x,y:n-r.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){let t=this.graph.options.translating.restrict,n="function"==typeof t?n0(t,this.graph,e):t;return"number"==typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){let n=this.graph.renderer.findViewByCell(e);if(n&&n.cell.isNode()){let r,i,o,s,l,a;let u=e.getBBox(),c=u.bbox(e.getAngle()),h=c.getTopLeft(),d=c.getBottomRight(),f=th.normalize(e.getAngle()),p=this.options.tolerance||0,g={vertical:0,horizontal:0},m=t.direction,y=t.trueDirection,b=t.relativeDirection;-1!==y.indexOf("right")?g.vertical=d.x:g.vertical=h.x,-1!==y.indexOf("bottom")?g.horizontal=d.y:g.horizontal=h.y,this.model.getNodes().some(t=>{if(this.isIgnored(e,t))return!1;let n=t.getBBox().bbox(t.getAngle()),u=n.getTopLeft(),h=n.getBottomRight(),f={vertical:[u.x,h.x],horizontal:[u.y,h.y]},m={};return Object.keys(f).forEach(e=>{let t=f[e].map(t=>({position:t,distance:Math.abs(t-g[e])})).filter(e=>e.distance<=p);m[e]=sH(t,e=>e.distance)}),null==r&&m.vertical.length>0&&(r=m.vertical[0].position,i=Math.min(c.y,n.y),o=Math.max(d.y,h.y)-i),null==s&&m.horizontal.length>0&&(s=m.horizontal[0].position,l=Math.min(c.x,n.x),a=Math.max(d.x,h.x)-l),null!=r&&null!=s}),this.hide();let v=0,x=0;(null!=s||null!=r)&&(null!=r&&(v=-1!==y.indexOf("right")?r-d.x:h.x-r),null!=s&&(x=-1!==y.indexOf("bottom")?s-d.y:h.y-s));let w=0,C=0;if(f%90==0)90===f||270===f?(w=x,C=v):(w=v,C=x);else{let e=f>=0&&f<90?1:f>=90&&f<180?4:f>=180&&f<270?3:2;null!=s&&null!=r&&(v<x?(x=0,s=void 0):(v=0,r=void 0));let t=th.toRad(f%90);v&&(w=3===e?v/Math.cos(t):v/Math.sin(t)),x&&(C=3===e?x/Math.cos(t):x/Math.sin(t));let n=1===e||3===e;switch(b){case"top":case"bottom":C=x?x/(n?Math.cos(t):Math.sin(t)):v/(n?Math.sin(t):Math.cos(t));break;case"left":case"right":w=v?v/(n?Math.cos(t):Math.sin(t)):x/(n?Math.sin(t):Math.cos(t))}}switch(b){case"top":case"bottom":w=0;break;case"left":case"right":C=0}let E=this.graph.getGridSize(),S=Math.max(u.width+w,E),P=Math.max(u.height+C,E);t.minWidth&&t.minWidth>E&&(S=Math.max(S,t.minWidth)),t.minHeight&&t.minHeight>E&&(P=Math.max(P,t.minHeight)),t.maxWidth&&(S=Math.min(S,t.maxWidth)),t.maxHeight&&(P=Math.min(P,t.maxHeight)),t.preserveAspectRatio&&(C<w?P=S*(u.height/u.width):S=P*(u.width/u.height)),(S!==u.width||P!==u.height)&&(e.resize(S,P,{direction:m,relativeDirection:b,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),o&&(o+=P-u.height),a&&(a+=S-u.width));let O=e.getBBox().bbox(f);r&&Math.abs(O.x-r)>1&&Math.abs(O.width+O.x-r)>1&&(r=void 0),s&&Math.abs(O.y-s)>1&&Math.abs(O.height+O.y-s)>1&&(s=void 0),this.update({verticalLeft:r,verticalTop:i,verticalHeight:o,horizontalTop:s,horizontalLeft:l,horizontalWidth:a})}}}snapOnMoving({view:e,e:t,x:n,y:r}){let i,o,s,l,a,u;let c=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(c))return;let h=c.cell,d=h.getSize(),f=h.getPosition(),p=new uM(n-this.offset.x,r-this.offset.y,d.width,d.height),g=h.getAngle(),m=p.getCenter(),y=p.bbox(g),b=y.getTopLeft(),v=y.getBottomRight(),x=this.options.tolerance||0,w=0,C=0;if(this.model.getNodes().some(e=>{if(this.isIgnored(h,e))return!1;let t=e.getBBox().bbox(e.getAngle()),n=t.getCenter(),r=t.getTopLeft(),c=t.getBottomRight();return null==i&&(Math.abs(n.x-m.x)<x?(i=n.x,w=.5):Math.abs(r.x-b.x)<x?(i=r.x,w=0):Math.abs(r.x-v.x)<x?(i=r.x,w=1):Math.abs(c.x-v.x)<x?(i=c.x,w=1):Math.abs(c.x-b.x)<x&&(i=c.x),null!=i&&(o=Math.min(y.y,t.y),s=Math.max(v.y,c.y)-o)),null==l&&(Math.abs(n.y-m.y)<x?(l=n.y,C=.5):Math.abs(r.y-b.y)<x?l=r.y:Math.abs(r.y-v.y)<x?(l=r.y,C=1):Math.abs(c.y-v.y)<x?(l=c.y,C=1):Math.abs(c.y-b.y)<x&&(l=c.y),null!=l&&(a=Math.min(y.x,t.x),u=Math.max(v.x,c.x)-a)),null!=i&&null!=l}),this.hide(),null!=l||null!=i){null!=l&&(y.y=l-C*y.height),null!=i&&(y.x=i-w*y.width);let e=y.getCenter(),t=e.x-p.width/2,n=e.y-p.height/2,r=t-f.x,d=n-f.y;(0!==r||0!==d)&&(h.translate(r,d,{snapped:!0,restrict:this.getRestrictArea(c)}),u&&(u+=r),s&&(s+=d)),this.update({verticalLeft:i,verticalTop:o,verticalHeight:s,horizontalTop:l,horizontalLeft:a,horizontalWidth:u})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){let t=this.options.filter;return Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||n0(t,this.graph,e)}update(e){if(e.horizontalTop){let t=this.graph.localToGraph(new uA(e.horizontalLeft,e.horizontalTop)),n=this.graph.localToGraph(new uA(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){let t=this.graph.localToGraph(new uA(e.verticalLeft,e.verticalTop)),n=this.graph.localToGraph(new uA(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");let e=this.options.clean,t="number"==typeof e?e:!1!==e?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{null!==this.container.parentNode&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([de.dispose()],pE.prototype,"dispose",null);let pS=`.x6-widget-snapline {
420
+ `;V.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},V.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},V.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},V.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},V.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},V.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},V.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},V.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},V.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},V.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},V.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},V.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},V.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},V.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},V.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},V.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},V.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},V.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},V.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},V.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},V.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},V.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},V.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},V.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},V.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},V.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},V.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},V.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},V.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},V.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},V.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t?t.unselect(n,e):this};var mG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Is extends pt{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Ie({enabled:!0},Is.defaultOptions,e),Fo(this.name,pG)}init(e){this.graph=e,this.selectionImpl=new Kw(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return e!=null?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return e!=null?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return e!=null?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return e!=null?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const r=this.getCells(e);return r.length&&(this.isMultiple()?this.selectionImpl.select(r,t):this.reset(r.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e}){const t=this.graph.panning.allowPanning(e,!0),r=this.graph.getPlugin("scroller"),i=r&&r.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!i&&!t)&&this.startRubberband(e)}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&ir.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&ir.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){const r=this.options;let i=this.disabled;!i&&this.movedMap.has(t)&&(i=r.selectCellOnMoved===!1,i||(i=r.selectNodeOnMoved===!1&&t.isNode()),i||(i=r.selectEdgeOnMoved===!1&&t.isEdge())),i||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?this.graph.getCellById(t):t).filter(t=>t!=null)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Vo(this.name)}}mG([pt.dispose()],Is.prototype,"dispose",null),function(n){n.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null}}(Is||(Is={}));var yG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},vG=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Jw extends ge{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,r=vG(e,["graph"]);this.graph=t,this.options=Object.assign({},r),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new Z("svg"),t=this.horizontal=new Z("line"),r=this.vertical=new Z("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),r.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),r.setAttribute("display","none"),e.append([t,r]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){e==="resize"&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:r}){const i=e.getDelegatedView();if(i&&this.isNodeMovable(i)){const s=e.cell.getPosition();this.offset={x:t-s.x,y:r-s.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,r=typeof t=="function"?Y(t,this.graph,e):t;return typeof r=="number"?this.graph.transform.getGraphArea().inflate(r):r===!0?this.graph.transform.getGraphArea():r||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const r=this.graph.renderer.findViewByCell(e);if(r&&r.cell.isNode()){const i=e.getBBox(),s=i.bbox(e.getAngle()),o=s.getTopLeft(),a=s.getBottomRight(),l=ve.normalize(e.getAngle()),c=this.options.tolerance||0;let u,h,f,d,g,p;const b={vertical:0,horizontal:0},m=t.direction,v=t.trueDirection,y=t.relativeDirection;v.indexOf("right")!==-1?b.vertical=a.x:b.vertical=o.x,v.indexOf("bottom")!==-1?b.horizontal=a.y:b.horizontal=o.y,this.model.getNodes().some(I=>{if(this.isIgnored(e,I))return!1;const q=I.getBBox().bbox(I.getAngle()),U=q.getTopLeft(),T=q.getBottomRight(),k={vertical:[U.x,T.x],horizontal:[U.y,T.y]},Q={};return Object.keys(k).forEach(j=>{const z=j,H=k[z].map(te=>({position:te,distance:Math.abs(te-b[z])})).filter(te=>te.distance<=c);Q[z]=Lb(H,te=>te.distance)}),u==null&&Q.vertical.length>0&&(u=Q.vertical[0].position,h=Math.min(s.y,q.y),f=Math.max(a.y,T.y)-h),d==null&&Q.horizontal.length>0&&(d=Q.horizontal[0].position,g=Math.min(s.x,q.x),p=Math.max(a.x,T.x)-g),u!=null&&d!=null}),this.hide();let w=0,x=0;(d!=null||u!=null)&&(u!=null&&(w=v.indexOf("right")!==-1?u-a.x:o.x-u),d!=null&&(x=v.indexOf("bottom")!==-1?d-a.y:o.y-d));let C=0,S=0;if(l%90===0)l===90||l===270?(C=x,S=w):(C=w,S=x);else{const I=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;d!=null&&u!=null&&(w<x?(x=0,d=void 0):(w=0,u=void 0));const q=ve.toRad(l%90);w&&(C=I===3?w/Math.cos(q):w/Math.sin(q)),x&&(S=I===3?x/Math.cos(q):x/Math.sin(q));const U=I===1||I===3;switch(y){case"top":case"bottom":S=x?x/(U?Math.cos(q):Math.sin(q)):w/(U?Math.sin(q):Math.cos(q));break;case"left":case"right":C=w?w/(U?Math.cos(q):Math.sin(q)):x/(U?Math.sin(q):Math.cos(q));break}}switch(y){case"top":case"bottom":C=0;break;case"left":case"right":S=0;break}const E=this.graph.getGridSize();let A=Math.max(i.width+C,E),M=Math.max(i.height+S,E);t.minWidth&&t.minWidth>E&&(A=Math.max(A,t.minWidth)),t.minHeight&&t.minHeight>E&&(M=Math.max(M,t.minHeight)),t.maxWidth&&(A=Math.min(A,t.maxWidth)),t.maxHeight&&(M=Math.min(M,t.maxHeight)),t.preserveAspectRatio&&(S<C?M=A*(i.height/i.width):A=M*(i.width/i.height)),(A!==i.width||M!==i.height)&&(e.resize(A,M,{direction:m,relativeDirection:y,trueDirection:v,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(r)}),f&&(f+=M-i.height),p&&(p+=A-i.width));const O=e.getBBox().bbox(l);u&&Math.abs(O.x-u)>1&&Math.abs(O.width+O.x-u)>1&&(u=void 0),d&&Math.abs(O.y-d)>1&&Math.abs(O.height+O.y-d)>1&&(d=void 0),this.update({verticalLeft:u,verticalTop:h,verticalHeight:f,horizontalTop:d,horizontalLeft:g,horizontalWidth:p})}}}snapOnMoving({view:e,e:t,x:r,y:i}){const s=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(s))return;const o=s.cell,a=o.getSize(),l=o.getPosition(),c=new D(r-this.offset.x,i-this.offset.y,a.width,a.height),u=o.getAngle(),h=c.getCenter(),f=c.bbox(u),d=f.getTopLeft(),g=f.getBottomRight(),p=this.options.tolerance||0;let b,m,v,y,w,x,C=0,S=0;if(this.model.getNodes().some(E=>{if(this.isIgnored(o,E))return!1;const A=E.getBBox().bbox(E.getAngle()),M=A.getCenter(),O=A.getTopLeft(),I=A.getBottomRight();return b==null&&(Math.abs(M.x-h.x)<p?(b=M.x,C=.5):Math.abs(O.x-d.x)<p?(b=O.x,C=0):Math.abs(O.x-g.x)<p?(b=O.x,C=1):Math.abs(I.x-g.x)<p?(b=I.x,C=1):Math.abs(I.x-d.x)<p&&(b=I.x),b!=null&&(m=Math.min(f.y,A.y),v=Math.max(g.y,I.y)-m)),y==null&&(Math.abs(M.y-h.y)<p?(y=M.y,S=.5):Math.abs(O.y-d.y)<p?y=O.y:Math.abs(O.y-g.y)<p?(y=O.y,S=1):Math.abs(I.y-g.y)<p?(y=I.y,S=1):Math.abs(I.y-d.y)<p&&(y=I.y),y!=null&&(w=Math.min(f.x,A.x),x=Math.max(g.x,I.x)-w)),b!=null&&y!=null}),this.hide(),y!=null||b!=null){y!=null&&(f.y=y-S*f.height),b!=null&&(f.x=b-C*f.width);const E=f.getCenter(),A=E.x-c.width/2,M=E.y-c.height/2,O=A-l.x,I=M-l.y;(O!==0||I!==0)&&(o.translate(O,I,{snapped:!0,restrict:this.getRestrictArea(s)}),x&&(x+=O),v&&(v+=I)),this.update({verticalLeft:b,verticalTop:m,verticalHeight:v,horizontalTop:y,horizontalLeft:w,horizontalWidth:x})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(r=>typeof r=="string"?e.shape===r:e.id===r.id):typeof t=="function"?Y(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new P(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new P(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${r.x}`:"100%",y2:`${r.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new P(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new P(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${r.x}`,y2:this.options.sharp?`${r.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t=typeof e=="number"?e:e!==!1?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}yG([ge.dispose()],Jw.prototype,"dispose",null);const bG=`.x6-widget-snapline {
418
421
  position: absolute;
419
422
  top: 0;
420
423
  right: 0;
@@ -427,4 +430,313 @@
427
430
  stroke: #2ecc71;
428
431
  stroke-width: 1px;
429
432
  }
430
- `;pu.prototype.isSnaplineEnabled=function(){let e=this.getPlugin("snapline");return!!e&&e.isEnabled()},pu.prototype.enableSnapline=function(){let e=this.getPlugin("snapline");return e&&e.enable(),this},pu.prototype.disableSnapline=function(){let e=this.getPlugin("snapline");return e&&e.disable(),this},pu.prototype.toggleSnapline=function(){let e=this.getPlugin("snapline");return e&&e.toggleEnabled(),this},pu.prototype.hideSnapline=function(){let e=this.getPlugin("snapline");return e&&e.hide(),this},pu.prototype.setSnaplineFilter=function(e){let t=this.getPlugin("snapline");return t&&t.setFilter(e),this},pu.prototype.isSnaplineOnResizingEnabled=function(){let e=this.getPlugin("snapline");return!!e&&e.isOnResizingEnabled()},pu.prototype.enableSnaplineOnResizing=function(){let e=this.getPlugin("snapline");return e&&e.enableOnResizing(),this},pu.prototype.disableSnaplineOnResizing=function(){let e=this.getPlugin("snapline");return e&&e.disableOnResizing(),this},pu.prototype.toggleSnaplineOnResizing=function(e){let t=this.getPlugin("snapline");return t&&t.toggleOnResizing(e),this},pu.prototype.isSharpSnapline=function(){let e=this.getPlugin("snapline");return!!e&&e.isSharp()},pu.prototype.enableSharpSnapline=function(){let e=this.getPlugin("snapline");return e&&e.enableSharp(),this},pu.prototype.disableSharpSnapline=function(){let e=this.getPlugin("snapline");return e&&e.disableSharp(),this},pu.prototype.toggleSharpSnapline=function(e){let t=this.getPlugin("snapline");return t&&t.toggleSharp(e),this},pu.prototype.getSnaplineTolerance=function(){let e=this.getPlugin("snapline");if(e)return e.getTolerance()},pu.prototype.setSnaplineTolerance=function(e){let t=this.getPlugin("snapline");return t&&t.setTolerance(e),this};class pP extends nC{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),uP(this.name,pS)}init(e){this.snaplineImpl=new pE(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(null==e)return this.isEnabled()?this.disable():this.enable(),this;e!==this.isEnabled()&&(e?this.enable():this.disable())}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return!0===this.snaplineImpl.options.resizing}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return null!=e?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return!0===this.snaplineImpl.options.sharp}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return null!=e?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),uO(this.name)}}!function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([nC.dispose()],pP.prototype,"dispose",null);class pO extends fB{}!function(e){function t(e){let t=[],n=tE.getForeignObjectMarkup();return e?t.push({tagName:e,selector:"body"},n):t.push(n),t}e.config({view:"react-shape-view",markup:t(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(e){if(null==e.markup){let n=e.primer;if(n){e.markup=t(n);let r={};switch(n){case"circle":r={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":r={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}e.attrs=iM({},{body:Object.assign({refWidth:null,refHeight:null},r)},e.attrs||{})}}return e}}),fB.registry.register("react-shape",e,!0)}(pO||(pO={}));var pk=g("5350"),pA=g("9195");!function(e){let t,n=!1,r=(e,t)=>{let n=t.payload;switch(t.type){case"add":{let t=e.findIndex(e=>e.id===n.id);if(t>=0)return e[t]=n,[...e];return[...e,n]}case"remove":{let t=e.findIndex(e=>e.id===n.id);if(t>=0){let n=[...e];return n.splice(t,1),n}}}return e};e.connect=function(e,r){n&&t({type:"add",payload:{id:e,portal:r}})};e.disconnect=function(e){n&&t({type:"remove",payload:{id:e}})};e.isActive=function(){return n};e.getProvider=function(){return()=>{n=!0;let[e,i]=(0,t4.useReducer)(r,[]);return t=i,t8().createElement(t8().Fragment,{children:e.map(e=>e.portal)})}}}(tz||(tz={}));var pM=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let pT={};class pN extends t8().PureComponent{constructor(e){super(e),this.state={tick:0}}componentDidMount(){let{node:e}=this.props;e.on("change:*",({key:t})=>{let n=pT[e.shape];if(n){let{effect:e}=n;(!e||e.includes(t))&&this.setState({tick:this.state.tick+1})}})}clone(e){let{node:t,graph:n}=this.props;return"string"==typeof e.type?t8().cloneElement(e):t8().cloneElement(e,{node:t,graph:n})}render(){let{node:e}=this.props,t=pT[e.shape];if(!t)return null;let{component:n}=t;return t8().isValidElement(n)?this.clone(n):this.clone(t8().createElement(n,null))}}class pj extends fQ{targetId(){return`${this.graph.view.cid}:${this.cell.id}`}getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(e){let t=super.confirmUpdate(e);return this.handleAction(t,pj.action,()=>{this.renderReactComponent()})}renderReactComponent(){this.unmountReactComponent();let e=this.getComponentContainer(),t=this.cell;if(e){let n=t8().createElement(pN,{node:t,graph:this.graph});if(tz.isActive()){let t=(0,pk.createPortal)(n,e);tz.connect(this.targetId(),t)}else this.root=(0,pA.createRoot)(e),this.root.render(n)}}unmountReactComponent(){this.getComponentContainer()&&this.root&&(this.root.unmount(),this.root=void 0)}onMouseDown(e,t,n){let r=e.target;if("input"===r.tagName.toLowerCase()){let e=r.getAttribute("type");if(null==e||["text","password","number","email","search","tel","url"].includes(e))return}super.onMouseDown(e,t,n)}unmount(){return tz.isActive()&&tz.disconnect(this.targetId()),this.unmountReactComponent(),super.unmount(),this}}(e3=pj||(pj={})).action="react",e3.config({bootstrap:[e3.action],actions:{component:e3.action}}),fQ.registry.register("react-shape-view",e3,!0);var pI=g("4964"),pL=g("1011"),pR=g.n(pL),p_=g("467"),pB=g.n(p_),pD=g("6128");function pz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,i=t,o=n[t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}function pV(e){return function(e){if(Array.isArray(e))return pz(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return pz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pz(e,t)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var p$=pB().groupBy,pU=pB().reduce,pG=pB().uniq,pH=pB().uniqBy,pq="er-rect",pW=function(){return(0,ni.useTranslation)("graph-collection-manager")},pX=function(e,t){var n=[],r=function(t){var i=null==e?void 0:e.find(function(e){return e.name===t});if(i){var o=i.inherits;if(o)for(var s=0;s<o.length;s++){var l=o[s];n.push(l),r(l)}}return pG(n)};return r(t)},pY=function(e,t){var n=[],r=function(t){return e.filter(function(e){var n;return null===(n=e.inherits)||void 0===n?void 0:n.includes(t)}).forEach(function(e){var t=e.name;return n.push(e),r(t)}),n};return r(t)},pJ=function(e){var t=[],n=[],r=e.map(function(r){var i=[],o=pV(r.fields),s=pU(pX(e,r.name),function(t,n){var i,o=null===(i=e.find(function(e){return e.name===n}))||void 0===i?void 0:i.fields.map(function(e){var t,n;return t=pF({},e),n=(n={sourceCollectionName:r.name},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t});return o?t.concat(o):t},[]);pH(o.concat(s),"name").forEach(function(e){e.uiSchema&&i.push(pF({id:e.name,group:"list"},e)),["obo","oho","o2o","o2m","m2o","m2m","linkTo","mbm"].includes(e.interface)&&t.push(e)}),n.push(r.name);var l=pQ(i);return{id:r.name,shape:pq,name:r.name,title:r.title,width:250,ports:pV(l.initPorts||[]).concat(pV(l.morePorts||[])),item:r}}),i=pZ(t,n,r);return{nodesData:r,edgesData:i,inheritEdges:pK(e)}},pQ=function(e){return p$(e,function(e){return e.isForeignKey||e.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id","mbm"].includes(e.interface)?"initPorts":"morePorts"})},pK=function(e){var t={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null}},router:{name:"smooth",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:"inherits",fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",fill:"var(--nb-box-bg)"}},position:{distance:.5,args:{keepGradient:!0,ensureLegibility:!0}}}]},n=[];return e.forEach(function(e){var r=e.inherits||[];r.length&&r.forEach(function(r){n.push(pF({id:e.name+r,source:{cell:e.name,connectionPoint:"rect"},target:{cell:r,connectionPoint:"rect"},connector:{name:"normal",zIndex:1e3},connectionType:"inherited"},t))})}),n},pZ=function(e,t,n){for(var r=function(r){if(t.includes(e[r].target)){var o=n.find(function(t){return t.name===e[r].target}),s=n.find(function(t){return t.name===(e[r].sourceCollectionName||e[r].collectionName)}),l={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null,targetMarker:null}},router:s.id===o.id?{name:"oneSide",args:{side:"left"}}:{name:"er",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:p0(e[r].interface)[0],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",strokeWidth:1,rx:10,ry:10}},position:{distance:.3,args:{keepGradient:!0,ensureLegibility:!0}}},{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:p0(e[r].interface)[1],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",rx:10,ry:10,strokeWidth:1}},position:{distance:.7,args:{keepGradient:!0,ensureLegibility:!0}}}],connector:{name:"normal",zIndex:1e3}},a=function(t){var n=i.find(function(e){return e.id===t});return!n||(n.associated.push(e[r].name),!1)};if(["m2m","linkTo"].includes(e[r].interface)){var u=n.find(function(t){return t.name===e[r].through});if(u){var c,h,d,f,p=s.id,g=u.id,m=null===(c=s.ports.find(function(t){return t.name===e[r].sourceKey}))||void 0===c?void 0:c.id,y=null===(h=u.ports.find(function(t){return t.name===e[r].foreignKey}))||void 0===h?void 0:h.id,b=o.id,v=u.id,x=null===(d=o.ports.find(function(t){return t.name===e[r].targetKey}))||void 0===d?void 0:d.id,w=null===(f=u.ports.find(function(t){return t.name===e[r].otherKey}))||void 0===f?void 0:f.id,C=p+m+g+y,E=b+x+v+w;i.push(pF({id:C,source:{cell:p,port:m,anchor:{name:"right"}},target:{cell:g,port:y,anchor:{name:"left"}},associated:[e[r].name],m2m:[C,E]},l)),i.push(pF({id:E,source:{cell:b,port:x,anchor:{name:"right"}},target:{cell:v,port:w,anchor:{name:"left"}},associated:[e[r].name],m2m:[C,E]},l))}}else{var S,P,O,k=n.find(function(t){return t.name==(e[r].sourceCollectionName||e[r].collectionName)}).ports.find(function(t){return t.name===e[r].foreignKey}),A=s.id,M=o.id,T=null==k?void 0:k.id,N=null===(S=o.ports.find(function(t){return t.name===e[r].targetKey}))||void 0===S?void 0:S.id,j=s.id,I=o.id,L=null===(P=s.ports.find(function(t){return t.name===e[r].sourceKey}))||void 0===P?void 0:P.id,R=null===(O=o.ports.find(function(t){return t.name===e[r].foreignKey}))||void 0===O?void 0:O.id;a(M+N+A+T)&&k&&N&&i.push(pF({id:A+T+M+N,source:{cell:A,port:T,anchor:{name:"right"}},target:{cell:M,port:N,anchor:{name:"left"}},associated:[e[r].name]},l)),a(I+R+j+L)&&L&&R&&i.push(pF({id:j+L+I+R,source:{cell:j,port:L,anchor:{name:"right"}},target:{cell:I,port:R,anchor:{name:"left"}},associated:[e[r].name]},l))}}},i=[],o=0;o<e.length;o++)r(o);return pH(i,"id")},p0=function(e){switch(e){case"m2m":case"linkTo":case"o2m":return["1","N"];case"m2o":return["N","1"];case"obo":case"oho":return["1","1"];case"mbm":return["N","N"];default:return[]}},p1=function(e,t){for(var n=function(n){if(t.find(function(t){return t.id===e[n].id})){var r=t.find(function(t){return t.id===e[n].id}),o=null==r?void 0:r.ports.items,s=e[n].ports;if(r){for(var l=function(t){!o.find(function(e){return e.id===s[t].id})&&i.push({status:"insertPort",node:e[n],port:{index:t,port:s[t]}})},a=function(t){!s.find(function(e){return e.id===o[t].id})&&i.push({status:"deletePort",node:e[n],port:o[t]})},u=0;u<s.length;u++)l(u);for(var c=0;c<o.length;c++)a(c);r.title!==e[n].title&&i.push({status:"updateNode",node:e[n]})}}else i.push({status:"add",node:e[n]})},r=function(n){!e.find(function(e){return e.id===t[n].id})&&i.push({status:"delete",node:t[n]})},i=[],o=e.length,s=t.length,l=0;l<o;l++)n(l);for(var a=0;a<s;a++)r(a);return i},p2=function(e,t){for(var n=function(n){!t.find(function(t){return t.id===e[n].id})&&s.push({status:"add",edge:e[n]})},r=function(n){!e.find(function(e){return e.id===t[n].id})&&s.push({status:"delete",edge:t[n]})},i=e.length,o=null==t?void 0:t.length,s=[],l=0;l<i;l++)n(l);for(var a=0;a<o;a++)r(a);return s},p3=function(){return tF?tF:tF=document.getElementById("graph_container")},p5=function(){tF=null},p6={name:"collections",filterTargetKey:"name",targetKey:"name",sortable:!0,fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{ t("Collection display name") }}',type:"number","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:'{{ t("Collection name") }}',type:"string","x-component":"Input",description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'}},{type:"string",name:"template",interface:"input",uiSchema:{title:'{{ t("Collection Template") }}',type:"string","x-component":"Input"}},{type:"hasMany",name:"fields",target:"fields",collectionName:"collections",sourceKey:"name",targetKey:"name",uiSchema:{}},{type:"hasMany",name:"inherits",interface:"select",uiSchema:{title:'{{ t("Inherits") }}',type:"string","x-component":"Select","x-component-props":{mode:"multiple"}}},{type:"string",name:"description",interface:"input",uiSchema:{title:'{{ t("Description") }}',type:"string","x-component":"Input"}}]},p4=function(e){var t=e.item;return t8().createElement(t3.AddCollection,{trigger:["click"],align:{overflow:{adjustY:!1}},item:t,scope:{useCancelAction:nd},getContainer:p3},t8().createElement(nt.Button,{type:"primary"},t8().createElement(t5.PlusOutlined,null)))};function p8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p9(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function p7(){var e=p9(["\n .ant-menu-item {\n height: 32px;\n line-height: 32px;\n }\n "]);return p7=function(){return e},e}function ge(){var e=p9(["\n .ant-popover-inner-content {\n padding: 0;\n }\n "]);return ge=function(){return e},e}var gt=function(e){var t,n=e.onClick,r=pW().t,i=[{key:mv.Both,label:"All relationships"},{key:mv.Entity,label:"Entity relationship only"},{key:mv.Inherit,label:"Inheritance relationship only"}];var o=t8().createElement("div",null,t8().createElement(nt.Menu,{defaultSelectedKeys:[mv.Both],selectable:!0,className:(0,pI.css)(p7()),style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"}].concat(function(e){if(Array.isArray(e))return p8(e)}(t=i.map(function(e){return{key:e.key,label:r(e.label),onClick:function(t){null==n||n(e.key)}}}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return p8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p8(e,t)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}));return t8().createElement(nt.Popover,{content:o,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:p3,overlayClassName:(0,pI.css)(ge())},t8().createElement(nt.Button,null,t8().createElement(t5.ShareAltOutlined,null)))};function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gr(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gi(){var e=gr(["\n .ant-menu-item {\n height: 32px;\n line-height: 32px;\n }\n "]);return gi=function(){return e},e}function go(){var e=gr(["\n .ant-popover-inner-content {\n padding: 0;\n }\n "]);return go=function(){return e},e}var gs=function(e){var t,n=e.onClick,r=pW().t,i=[{key:mb.Both,label:"All directions"},{key:mb.Target,label:"Target index"},{key:mb.Source,label:"Source index"}];var o=t8().createElement("div",null,t8().createElement(nt.Menu,{defaultSelectedKeys:[mb.Target],selectable:!0,className:(0,pI.css)(gi()),style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"}].concat(function(e){if(Array.isArray(e))return gn(e)}(t=i.map(function(e){return{key:e.key,label:r(e.label),onClick:function(){null==n||n(e.key)}}}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return gn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gn(e,t)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}));return t8().createElement(nt.Popover,{content:o,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:p3,overlayClassName:(0,pI.css)(go())},t8().createElement(nt.Button,null,t8().createElement(t5.LineHeightOutlined,null)))};function gl(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ga(){var e=gl(["\n .x6-widget-minimap {\n background-color: ",";\n }\n "]);return ga=function(){return e},e}function gu(){var e=gl(["\n flex-shrink: 0;\n padding: 2em 0;\n "]);return gu=function(){return e},e}function gc(){var e=gl(["\n .btn-del {\n border-color: transparent;\n background-color: ",";\n color: ",";\n height: 20px;\n width: 20px;\n &:hover {\n background-color: ",";\n }\n }\n .btn-add {\n background: ",";\n border-color: transparent;\n color: ",";\n width: 20px;\n &:hover {\n background-color: ",";\n }\n }\n .btn-edit {\n color: ",";\n display: flex;\n &:hover {\n background: ",";\n }\n }\n .btn-edit-in-head {\n border-color: transparent;\n color: ",";\n height: 20px;\n width: 22px;\n margin: 0px 5px 4px;\n line-height: 25px;\n &:hover {\n background: ",";\n }\n }\n .btn-inheriedParent {\n background: ",";\n border-color: transparent;\n color: ",";\n width: 20px;\n height: 20px;\n line-height: 25px;\n &:hover {\n background-color: ",";\n }\n }\n .btn-inheriedChild {\n background: ",";\n border-color: transparent;\n color: ",";\n width: 20px;\n height: 20px;\n margin: 0px 5px 4px;\n &:hover {\n background-color: ",";\n }\n }\n width: 250px;\n height: 100%;\n border-radius: ","px;\n background-color: ",";\n border: 0;\n overflow: hidden;\n &:hover {\n box-shadow: ",";\n }\n .body {\n width: 100%;\n height: 100%;\n background-color: ",";\n cursor: pointer;\n .morePorts {\n max-height: 300px;\n overflow: auto;\n }\n .body-item {\n display: inline-table;\n width: 100%;\n max-width: 250px;\n height: 40px;\n font-size: 14px;\n color: ",";\n border-top: 1px solid ",";\n text-overflow: ellipsis;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n .field-operator {\n display: none;\n }\n &:hover {\n .field-operator {\n display: flex;\n flex-direction: row-reverse;\n height: 32px;\n line-height: 32px;\n z-index: 999;\n cursor: pointer;\n text-align: right;\n background: ",";\n padding-right: 3px;\n span {\n margin: 3px;\n margin-left: 4px;\n padding: 3px;\n height: 20px;\n width: 20px;\n }\n .btn-override {\n border-color: transparent;\n width: 20px;\n color: ",";\n &:hover {\n background-color: ",";\n }\n }\n .btn-view {\n border-color: transparent;\n color: ",";\n width: 20px;\n }\n .btn-view:hover {\n background: ",";\n }\n .btn-assocition {\n border-color: transparent;\n color: ",";\n width: 20px;\n }\n .btn-assocition:hover {\n background: ",";\n }\n }\n .field_type {\n display: none;\n }\n }\n\n .name {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n margin-left: 8px;\n min-width: 50%;\n .ant-badge {\n padding-right: 5px;\n }\n }\n\n .type {\n color: ",";\n margin-right: 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n }\n }\n "]);return gc=function(){return e},e}function gh(){var e=gl(["\n height: 50px;\n font-size: 14px;\n font-weight: 500;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background: ",";\n color: ",";\n padding: 0 8px;\n "]);return gh=function(){return e},e}function gd(){var e=gl(["\n max-width: 80%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: 500;\n "]);return gd=function(){return e},e}function gf(){var e=gl(["\n display: flex;\n span {\n cursor: pointer;\n }\n "]);return gf=function(){return e},e}function gp(){var e=gl(["\n div.field-content {\n font-size: 14px;\n color: ",";\n opacity: 0.8;\n display: block;\n .field-type {\n color: ",";\n float: right;\n }\n }\n "]);return gp=function(){return e},e}function gg(){var e=gl(["\n .nb-action-bar {\n float: right;\n position: fixed;\n margin-top: 24px;\n right: 24px;\n z-index: 1000;\n .trigger {\n float: right;\n margin: 2px 4px;\n font-size: 16px;\n }\n .ant-input {\n margin: 4px;\n }\n .ant-menu-inline {\n border-top: 1px solid ",";\n }\n .ant-layout-sider {\n margin-top: 24px;\n }\n .ant-menu-item {\n height: 32px;\n }\n .ant-btn {\n border: 0;\n }\n }\n "]);return gg=function(){return e},e}function gm(){var e=gl(["\n overflow: hidden;\n #container {\n height: 100% !important;\n }\n .x6-graph-scroller {\n height: calc(100vh) !important;\n width: calc(100vw) !important;\n }\n "]);return gm=function(){return e},e}var gy=(0,t3.createStyles)(function(e){var t=e.token,n=e.css;return{graphMinimap:n(ga(),t.colorBgContainer),addButtonClass:n(gu()),entityContainer:n(gc(),t.colorErrorBg,t.colorErrorText,t.colorErrorBgHover,t.colorSuccessBg,t.colorSuccessText,t.colorSuccessBgHover,t.colorText,t.colorBgTextHover,t.colorText,t.colorBgTextHover,t.colorInfoBg,t.colorInfo,t.colorInfoBgHover,t.colorInfoBg,t.colorInfo,t.colorInfoBgHover,t.borderRadiusLG,t.colorBgContainer,t.boxShadowTertiary,t.colorBgContainer,t.colorText,t.colorBorderSecondary,t.colorBgContainer,t.colorText,t.colorBgTextHover,t.colorText,t.colorBgTextHover,t.colorPrimary,t.colorBgTextHover,t.colorTextTertiary),headClass:n(gh(),t.colorFillAlter,t.colorTextHeading),tableNameClass:n(gd()),tableBtnClass:n(gf()),collectionPopoverClass:n(gp(),t.colorTextSecondary,t.colorText),collectionListClass:n(gg(),t.colorBorderSecondary),graphCollectionContainerClass:n(gm())}});function gb(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,i)}var gv=function(e){var t=np(e.collectionName,e.key).run;return{run:function(){var e;return(e=function(){return function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(e){switch(e.label){case 0:return[4,t()];case 1:return e.sent(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){gb(o,r,i,s,l,"next",e)}function l(e){gb(o,r,i,s,l,"throw",e)}s(void 0)})})()}}},gx=function(e){var t=e.item,n=e.database;return t8().createElement(t3.AddFieldAction,{trigger:["click"],align:{overflow:{adjustY:!1}},item:t,database:n,scope:{useCancelAction:nd,useCreateCollectionField:function(){return gv(t)}},getContainer:p3},t8().createElement(t5.PlusOutlined,{className:"btn-add",id:"graph_btn_add_field"}))},gw=function(e){var t=e.targetGraph,n=e.item;return t8().createElement(t5.BranchesOutlined,{className:"btn-assocition",onClick:function(){t.onConnectionAssociation(n)}})},gC=function(e){var t=e.targetGraph,n=e.item,r=pW().t,i=(0,(0,t3.useCollectionManager_deprecated)().getChildrenCollections)(n.name);return(null==i?void 0:i.some(function(e){var n=e.name;return!t.hasCell(n)}))?t8().createElement(nt.Tooltip,{title:r("Show child"),getPopupContainer:p3},t8().createElement(t5.FallOutlined,{className:"btn-inheriedChild",onClick:function(){t.onConnectionChilds(i.map(function(e){return e.name}))}})):""},gE=function(e){var t=e.targetGraph,n=e.item,r=pW().t,i=(0,(0,t3.useCollectionManager_deprecated)().getInheritCollections)(n.name);return(null==i?void 0:i.some(function(e){return!t.hasCell(e)}))?t8().createElement(nt.Tooltip,{title:r("Show parent"),getPopupContainer:p3},t8().createElement(t5.RiseOutlined,{className:"btn-inheriedParent",onClick:function(){t.onConnectionParents(i)}})):""},gS=function(e){var t=e.item,n=e.className,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++){if(n=o[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}}return i}(e,["item","className"]);return t8().createElement(t3.DeleteCollection,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,i=t,o=n[t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}({item:t,scope:{useCancelAction:nd,useUpdateCollectionActionAndRefreshCM:nm,createOnly:!1},getContainer:p3},r),t8().createElement(t5.DeleteOutlined,{className:n}))},gP=function(e){var t=e.item,n=e.className;return t8().createElement(t3.EditCollection,{item:t,scope:{useCancelAction:nd,useUpdateCollectionActionAndRefreshCM:nm,createOnly:!1},getContainer:p3},t8().createElement(t5.EditOutlined,{className:n}))};function gO(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,i)}var gk=function(e){var t=ng({collectionName:e.collectionName,name:e.name,key:e.id}).run;return{run:function(){var e;return(e=function(){return function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(e){switch(e.label){case 0:return[4,t()];case 1:return e.sent(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){gO(o,r,i,s,l,"next",e)}function l(e){gO(o,r,i,s,l,"throw",e)}s(void 0)})})()}}},gA=function(e){var t=e.item,n=e.parentItem;return t8().createElement(t3.EditFieldAction,{item:t,parentItem:n,scope:{useCancelAction:nd,useUpdateCollectionField:function(){return gk(t)}},getContainer:p3},t8().createElement(t5.EditOutlined,{className:"btn-edit"}))};function gM(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gT(){var e=gM(["\n background: #f6f6f6;\n margin-bottom: 24px;\n padding: 16px;\n "]);return gT=function(){return e},e}function gN(){var e=gM([""]);return gN=function(){return e},e}function gj(){var e=gM(["\n margin-top: 8px;\n color: rgba(0, 0, 0, 0.45);\n "]);return gj=function(){return e},e}var gI=(0,t9.observer)(function(e){var t=e.schemaKey,n=(0,t3.useCollectionManager_deprecated)().getInterface,r=(0,t3.useCompile)(),i=(0,ni.useTranslation)().t,o=n(t);return o?t8().createElement("div",{className:(0,t3.css)(gT())},t8().createElement("div",{className:(0,t3.css)(gN())},i("Field interface"),": ",t8().createElement(nt.Tag,null,r(o.title))),o.description?t8().createElement("div",{className:(0,t3.css)(gj())},r(o.description)):null):null},{displayName:"FieldSummary"});function gL(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,i)}var gR=function(e){var t=np(e.targetCollection).run;return{run:function(){var e;return(e=function(){return function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(e){switch(e.label){case 0:return[4,t()];case 1:return e.sent(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){gL(o,r,i,s,l,"next",e)}function l(e){gL(o,r,i,s,l,"throw",e)}s(void 0)})})()}}},g_=function(e){var t=e.item,n=e.parentItem;return t8().createElement(t3.OverridingFieldAction,{item:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,i=t,o=n[t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}({},t),parentItem:n,scope:{useCancelAction:nd,useOverridingCollectionField:function(){return gR(t)}},getContainer:p3},t8().createElement(t5.CopyOutlined,{className:"btn-override"}))},gB=function(e){var t=e.item,n=e.parentItem;return t8().createElement(t3.ViewFieldAction,{item:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,i=t,o=n[t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}({},t),parentItem:n,getContainer:p3},t8().createElement(t5.EyeOutlined,{className:"btn-view"}))};function gD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gz(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,i)}function gF(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){gz(o,r,i,s,l,"next",e)}function l(e){gz(o,r,i,s,l,"throw",e)}s(void 0)})}}function gV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){gV(e,t,n[t])})}return e}function gU(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function gG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],s=!0,l=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{!s&&null!=i.return&&i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gD(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gH(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}function gq(){var e,t,n=(e=["\n display: block;\n color: #958f8f;\n padding: 10px 5px;\n &:hover {\n color: rgb(99 90 88);\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return gq=function(){return n},n}var gW=t8().memo(function(e){var t=e.property,n=e.loadCollections,r=e.collectionData,i=e.setTargetNode,o=e.node,s=e.handelOpenPorts,l=e.title,a=e.name,u=e.targetGraph,c=!(t.collectionName!==a),h=(0,t4.useContext)(t9.SchemaOptionsContext),d=["hasOne","hasMany","belongsTo","belongsToMany"].includes(t.type)&&!(t.through?u.hasCell(t.through):u.hasCell(t.target)),f=(0,t3.useCurrentAppInfo)().data.database;return t8().createElement("div",{className:"field-operator"},t8().createElement(t3.SchemaComponentProvider,{components:g$({Select:function(e){return t8().createElement(t3.Select,gU(g$({popupMatchSelectWidth:!1},e),{getPopupContainer:p3}))},FieldSummary:gI,AddFieldAction:gx,OverrideFieldAction:g_,ViewFieldAction:gB,EditFieldAction:gA,ConnectAssociationAction:gw},h.components),scope:g$({useAsyncDataSource:nw,loadCollections:n,useCancelAction:nd,useNewId:function(e){return"".concat(e||"").concat((0,t6.uid)())},useCurrentFields:function(){var e=(0,t3.useRecord)();return(0,(0,t3.useCollectionManager_deprecated)().getCollectionFields)(e.collectionName||e.name)},useValuesFromRecord:nh,useUpdateCollectionActionAndRefreshCM:nm,isInheritField:c,isShowAssocition:d},h.scope)},t8().createElement(ns,{record:r.current,setTargetNode:i,node:o,handelOpenPorts:function(){return s(!0)}},t8().createElement(t3.SchemaComponent,{scope:nd,schema:{type:"object",properties:{create:{type:"void","x-action":"create","x-component":"AddFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:gU(g$({},t),{title:l}),database:f}},update:{type:"void","x-action":"update","x-component":"EditFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:gU(g$({},t),{title:l}),parentItem:r.current}},delete:{type:"void","x-action":"destroy","x-component":"Action.Link","x-visible":"{{isInheritField}}","x-component-props":{component:t5.DeleteOutlined,icon:"DeleteOutlined",className:"btn-del",confirm:{getContainer:p3,title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:function(){return nx({collectionName:t.collectionName,name:t.name})}}},override:{type:"void","x-action":"create","x-visible":"{{!isInheritField}}","x-component":"OverrideFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:gU(g$({},t),{title:l,targetCollection:a}),parentItem:r.current}},view:{type:"void","x-action":"view","x-visible":"{{!isInheritField}}","x-component":"ViewFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:gU(g$({},t),{title:l}),parentItem:r.current}},connectAssociation:{type:"void","x-action":"view","x-visible":"{{isShowAssocition}}","x-component":"ConnectAssociationAction","x-component-props":{item:gU(g$({},t),{title:l,__parent:r.current}),targetGraph:u}}}}}))))});gW.displayName="OperationButton";var gX=t8().forwardRef(function(e,t){var n,r,i,o,s,l=e.property,a=e.node,u=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++){if(n=o[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}}return i}(e,["property","node"]),c=a.store.data,h=c.title,d=c.name,f=c.sourcePort,p=c.associated,g=c.targetPort,m=(0,t3.useCompile)(),y=gy().styles,b=(0,t3.useCollectionManager_deprecated)().getInterface,v=gG((0,t4.useState)(!1),2),x=v[0],w=v[1],C=t8().useCallback(function(e){var t=e.type,n=e.name,r=e.primaryKey,i=e.allowNull,o=e.autoIncrement;return t8().createElement("div",{className:y.collectionPopoverClass},t8().createElement("div",{className:"field-content"},t8().createElement("div",null,t8().createElement("span",null,"name"),": ",t8().createElement("span",{className:"field-type"},n)),t8().createElement("div",null,t8().createElement("span",null,"type"),": ",t8().createElement("span",{className:"field-type"},t))),t8().createElement("p",null,r&&t8().createElement(nt.Tag,{color:"green"},"PRIMARY"),i&&t8().createElement(nt.Tag,{color:"geekblue"},"ALLOWNULL"),o&&t8().createElement(nt.Tag,{color:"purple"},"AUTOINCREMENT")))},[]),E=g$({title:h,name:d,node:a},u);return t8().createElement("div",null,t8().createElement("div",{className:"body-item",key:l.id,id:l.id,style:{background:g===l.id||f===l.id||(null==p?void 0:p.includes(l.name))?"#e6f7ff":null},onMouseEnter:function(){w(!0)},onMouseLeave:function(){return w(!1)}},t8().createElement(t3.StablePopover,{content:C(l),getPopupContainer:p3,mouseLeaveDelay:0,title:t8().createElement("div",null,m(null===(r=l.uiSchema)||void 0===r?void 0:r.title),t8().createElement("span",{style:{color:"#ffa940",float:"right"}},m(null===(i=b(l.interface))||void 0===i?void 0:i.title))),key:l.id,placement:"right"},t8().createElement("div",{className:"name"},t8().createElement(nt.Badge,{color:(n=l).isForeignKey||n.primaryKey||"id"===n.interface?"red":["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(n.interface)?"orange":void 0}),m(null===(o=l.uiSchema)||void 0===o?void 0:o.title))),t8().createElement("div",{className:"type field_type"},m(null===(s=b(l.interface))||void 0===s?void 0:s.title)),x&&t8().createElement(gW,g$({property:l},E))))});gX.displayName="PopoverContent";var gY=t8().memo(function(e){var t,n,r=e.targetGraph,i=e.collectionData,o=e.setTargetNode,s=e.node,l=e.loadCollections,a=s.store.data,u=a.item,c=a.ports,h=a.data,d=gG((0,t4.useState)(!1),2),f=d[0],p=d[1],g=pW().t,m=pB().groupBy(c.items,function(e){return e.isForeignKey||e.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id","mbm"].includes(e.interface)?"initPorts":"morePorts"}),y=function(e){null===(t=r.getCellById(u.name))||void 0===t||t.toFront(),p(e);var t,n=r.collapseNodes||[];n.push(gV({},u.name,e)),r.collapseNodes=n,r.getCellById(u.name).setData({collapse:!0})},b=f&&(null==h?void 0:h.collapse),v={collectionData:i,setTargetNode:o,loadCollections:l,handelOpenPorts:y,node:s,targetGraph:r};return t8().createElement("div",{className:"body"},null===(t=m.initPorts)||void 0===t?void 0:t.map(function(e){return e.uiSchema&&t8().createElement(gX,gU(g$({},v),{property:e,key:e.id}))}),t8().createElement("div",{className:"morePorts"},b&&(null===(n=m.morePorts)||void 0===n?void 0:n.map(function(e){return e.uiSchema&&t8().createElement(gX,gU(g$({},v),{property:e,key:e.id}))}))),t8().createElement("a",{className:(0,pI.css)(gq()),onClick:function(){return y(!b)}},b?[t8().createElement(t5.UpOutlined,{style:{margin:"0px 8px 0px 5px"},key:"icon"}),t8().createElement("span",{key:"associate"},g("Association Fields"))]:[t8().createElement(t5.DownOutlined,{style:{margin:"0px 8px 0px 5px"},key:"icon"}),t8().createElement("span",{key:"all"},g("All Fields"))]))}),gJ=function(e){var t,n,r=gy().styles,i=(0,t4.useContext)(t9.SchemaOptionsContext),o=e.node,s=e.setTargetNode,l=e.targetGraph,a=o.store.data,u=a.title,c=a.name,h=a.item,d=a.attrs,f=a.select,p=a.actived,g=o.id,m=(0,t3.useCurrentAppInfo)().data.database,y=(0,t4.useRef)(),b=(0,t4.useContext)(t3.CollectionCategoriesContext);y.current=gU(g$({},h),{title:u,inherits:h.inherits&&new Proxy(h.inherits,{})});var v=h.category,x=void 0===v?[]:v,w=(0,t3.useCompile)();var C=(t=gF(function(e){var t;return gH(this,function(e){return[2,null===(t=l.collections)||void 0===t?void 0:t.map(function(e){return{label:w(e.title),value:e.name}})]})}),function(e){return t.apply(this,arguments)});var E=(n=gF(function(){return gH(this,function(e){return[2,null==b?void 0:b.data.map(function(e){return{label:w(e.name),value:e.id}})]})}),function(){return n.apply(this,arguments)});return t8().createElement("div",{className:r.entityContainer,style:{boxShadow:null==d?void 0:d.boxShadow,border:f?"2px dashed #f5a20a":0}},null==x?void 0:x.map(function(e,t){return t8().createElement(nt.Badge.Ribbon,{key:t,color:e.color,style:{width:"103%",height:"3px",marginTop:5*t-4,borderRadius:0},placement:"start"})}),t8().createElement("div",{className:r.headClass,style:{background:(null==d?void 0:d.hightLight)?"#1890ff":null,paddingTop:3*x.length}},t8().createElement("span",{className:r.tableNameClass},w(u)),t8().createElement("div",{className:r.tableBtnClass},t8().createElement(t3.SchemaComponentProvider,null,t8().createElement(ns,{setTargetNode:s,node:o},t8().createElement(t3.CollectionProvider_deprecated,{collection:p6},t8().createElement(t3.SchemaComponent,{scope:{useUpdateCollectionActionAndRefreshCM:nm,useCancelAction:nd,loadCollections:C,loadCategories:E,useAsyncDataSource:nw,enableInherits:(null==m?void 0:m.dialect)==="postgres",actived:!0===p},components:g$({EditOutlined:t5.EditOutlined,EditCollectionAction:gP,DeleteCollectionAction:gS,ConnectChildAction:gC,ConnectParentAction:gE},i.components),schema:{type:"object",name:o.id,properties:{connectParent:{type:"void","x-visible":"{{actived}}","x-component":"ConnectParentAction","x-component-props":{item:y.current,targetGraph:l}},connectChild:{type:"void","x-component":"ConnectChildAction","x-component-props":{item:y.current,targetGraph:l},"x-visible":"{{actived}}"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"EditCollectionAction","x-component-props":{type:"primary",item:y.current,className:"btn-edit-in-head"}},delete:{type:"void","x-action":"destroy","x-component":"DeleteCollectionAction","x-component-props":{className:"btn-del",getContainer:p3,item:y.current,useAction:function(){return nb({name:c,id:g})}}}}}})))))),t8().createElement(gY,{targetGraph:l,collectionData:y,setTargetNode:s,node:o,loadCollections:C}))},gQ=g("2749");function gK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var gZ=(0,t4.forwardRef)(function(){var e,t,n=pW().t;var r=(e=(0,gQ.useFullscreen)(document.getElementById("graph_container")),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],s=!0,l=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{!s&&null!=i.return&&i.return()}finally{if(l)throw r}}return o}}(e,2)||function(e,t){if(e){if("string"==typeof e)return gK(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gK(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=r[0],o=r[1].toggleFullscreen;return t8().createElement(nt.Tooltip,{title:n("Full Screen"),getPopupContainer:p3},t8().createElement(nt.Button,{onClick:function(){o()}},i?t8().createElement(t5.FullscreenExitOutlined,null):t8().createElement(t5.FullscreenOutlined,null)))});function g0(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}gZ.displayName="FullscreenAction";function g1(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function g2(e,t){if(e){if("string"==typeof e)return g0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g0(e,t)}}function g3(){var e=g1(["\n .ant-menu-item {\n height: 32px;\n line-height: 32px;\n }\n "]);return g3=function(){return e},e}function g5(){var e=g1(["\n .ant-popover-inner-content {\n padding: 0;\n }\n "]);return g5=function(){return e},e}var g6=function(e){var t,n,r,i=e.handleFiterCollections,o=(0,t4.useContext)(mE),s=o.handleSearchCollection,l=o.collectionList;var a=(t=(0,t4.useState)([]),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],s=!0,l=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{!s&&null!=i.return&&i.return()}finally{if(l)throw r}}return o}}(t,2)||g2(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=a[0],c=a[1],h=pW().t,d=(0,t3.useCompile)();var f=t8().createElement("div",null,t8().createElement(nt.Input,{style:{margin:"4px 0"},bordered:!1,placeholder:h("Collection Search"),onChange:s}),t8().createElement(nt.Menu,{selectedKeys:u,selectable:!0,className:(0,pI.css)(g3()),style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"}].concat(function(e){if(Array.isArray(e))return g0(e)}(r=l.map(function(e){return{key:e.name,label:d(e.title),onClick:function(e){e.key!==u[0]?(c([e.key]),i(e.key)):(i(!1),c([]))}}}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||g2(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}));return t8().createElement(nt.Popover,{content:f,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:p3,overlayClassName:(0,pI.css)(g5())},t8().createElement(nt.Button,null,t8().createElement(t5.MenuOutlined,null)))};function g4(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var g8=function(e){var t,n,r=(0,t4.useContext)(mE).collectionList,i=(0,t3.useCompile)();var o=(t=(0,pD.useSearchParams)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],s=!0,l=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{!s&&null!=i.return&&i.return()}finally{if(l)throw r}}return o}}(t,2)||function(e,t){if(e){if("string"==typeof e)return g4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g4(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=o[0],l=o[1],a=s.get("collections"),u=null==a?void 0:a.split(","),c=null==u?void 0:u.filter(function(e){return r.find(function(t){return t.name===e})}),h=(0,t4.useMemo)(function(){return r.map(function(e){return{label:i(e.title),value:e.name}})},[r]);return t8().createElement(t3.Select,{value:c,showSearch:!0,getPopupContainer:p3,mode:"multiple",allowClear:!0,options:h,onChange:function(e){l([["collections",e.toString()]])},style:{minWidth:200,position:"fixed",margin:"24px",zIndex:1e3,maxWidth:"60%"}})};function g9(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g7(e,t,n){return(g7="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=me(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}})(e,t,n||e)}function me(e){return(me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mt(e,t){return(mt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mn=function(){return!!e})()}var mr=function(e){var t,n,r;function i(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),e=this,t=i,n=arguments,t=me(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mn()?Reflect.construct(t,n||[],me(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mt(e,t)}(i,e),t=i,n=[{key:"renderMarkup",value:function(){return this.renderJSONMarkup({tagName:"rect",selector:"body"})}},{key:"update",value:function(){var e=this.cell.getAttrs().hightLight?"#1890ff":"gray";g7(me(i.prototype),"update",this).call(this,{body:{refWidth:"50px",refHeight:"100px",fill:e}})}}],g9(t.prototype,n),i}(fQ);function mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mo(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,i)}function ms(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){mo(o,r,i,s,l,"next",e)}function l(e){mo(o,r,i,s,l,"throw",e)}s(void 0)})}}function ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,i=t,o=n[t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}function ma(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function mu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],s=!0,l=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{!s&&null!=i.return&&i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mi(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mc(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}var mh=pB().drop,md=pB().groupBy,mf=pB().last,mp=pB().maxBy,mg=pB().minBy,mm=pB().take,my=pB().uniq;var mb=((e5={}).Both="both",e5.Target="target",e5.Source="source",e5);var mv=((e6={}).Both="both",e6.Inherit="inherited",e6.Entity="entity",e6),mx=function(e,t){for(var n=[];(null==t?void 0:t.length)>0&&e;)n.push(t.splice(0,e));return n};function mw(){return(mw=ms(function(e,t){var n,r,i,o,s;return mc(this,function(l){switch(l.label){case 0:if(n=tV.positions,r=[],i=tV.getNodes(),o=tV.getEdges(),(s=new(pR()).graphlib.Graph).setGraph({rankdir:"TB",nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0}),s.setDefaultEdgeLabel(function(){return{}}),i.forEach(function(e,t){var n=32*e.getPorts().length+30;s.setNode(e.id,{width:250,height:n})}),pR().layout(s),mx(15,s.nodes()).forEach(function(e,t){e.forEach(function(e,i){var o=tV.getCellById(e);if(o){var s=n&&n.find(function(e){return e.collectionName===o.store.data.name})||{},l={x:i%15*325+50,y:400*t+100};o.position(s.x||l.x,s.y||l.y),n&&!n.find(function(e){return e.collectionName===o.store.data.name})&&r.push({collectionName:o.store.data.name,x:l.x,y:l.y})}})}),o.forEach(function(e){mC(e)}),t$?"string"==typeof t$?tV.positionCell(mf(i),"top",{padding:100}):tV.positionCell(t$,"top",{padding:100}):tV.positionCell(i[0],"top-left",{padding:100}),!(r.length>0&&t))return[3,2];return[4,e(r)];case 1:l.sent(),r=[],l.label=2;case 2:return[2]}})})).apply(this,arguments)}function mC(e){var t,n,r=e.store.data.connectionType,i=e.getSource(),o=e.getTarget(),s=null===(t=tV.getCellById(i.cell))||void 0===t?void 0:t.position().x,l=null===(n=tV.getCellById(o.cell))||void 0===n?void 0:n.position().x,a=r?{name:"topLeft",args:{dy:20}}:{name:"left"},u=r?{name:"topRight",args:{dy:20}}:"right",c=r?"normal":"er";if(e.getVertices().forEach(function(){return e.removeVertexAt(0)}),s-100>l)e.setSource({cell:i.cell,port:i.port,anchor:a}),e.setTarget({cell:o.cell,port:o.port,anchor:u}),e.setRouter(c,{direction:"H"});else if(100>Math.abs(s-l)){var h=tV.getCellById(i.cell),d=tV.getCellById(o.cell);e.setSource({cell:i.cell,port:i.port,anchor:a}),e.setTarget({cell:o.cell,port:o.port,anchor:a}),r?(e.setVertices([{x:h.position().x-30,y:h.position().y+20},{x:d.position().x-30,y:d.position().y+20}]),e.setRouter("normal")):e.setRouter("oneSide",{side:"left"})}else e.setSource({cell:i.cell,port:i.port,anchor:u}),e.setTarget({cell:o.cell,port:o.port,anchor:a}),e.setRouter(c,{direction:"H"})}var mE=(0,t4.createContext)({});mE.displayName="CollapsedContext";var mS=function(){var e=[],t=tV.getEdges(),n=tV.getNodes();return t.forEach(function(t){e.push(t.getSourceCellId()),e.push(t.getTargetCellId())}),md(n,function(t){return e.includes(t.id)?"linkNodes":"rawNodes"})},mP=function(e){var t=mS(),n=t.linkNodes,r=void 0===n?[]:n,i=t.rawNodes,o=void 0===i?[]:i,s=tV.positions,l=r.concat(o||[]),a=tV.getEdges(),u=new(pR()).graphlib.Graph,c=[];u.setGraph({rankdir:"TB",nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0});l.forEach(function(e){u.setNode(e.id,{width:250,height:400})}),a.forEach(function(e){var t=e.getSource(),n=e.getTarget();u.setEdge(t.cell,n.cell,{})}),pR().layout(u);var h=u.nodes(),d=mm(h,r.length),f=mh(h,r.length);if(d.forEach(function(e){var t,n=tV.getCellById(e),r=null===(t=s.find(function(e){return e.collectionName===n.id}))||void 0===t?void 0:t.id;if(n){var i=u.node(e);c.push({id:r,collectionName:n.id,x:i.x,y:i.y}),n.position(null==i?void 0:i.x,null==i?void 0:i.y)}}),d.length){b=tV.getCellById(mp(d,function(e){return tV.getCellById(e).position().y})).position().y,y=tV.getCellById(mg(d,function(e){return tV.getCellById(e).position().x})).position().x;var p,g,m,y,b,v,x=tV.getCellById(mp(d,function(e){return tV.getCellById(e).position().x})).position().x,w=d.filter(function(e){return 50>Math.abs(tV.getCellById(e).position().y-b)}),C=null===(v=tV.getCellById(mp(w,function(e){return tV.getCellById(e).position().x})))||void 0===v?void 0:v.position();if(m=Math.round(x/320)||1,p=Math.floor((4500-(x+100-C.x))/280),g=mx(m,o),p>=1){var E=mm(f,p);g=mx(m,mh(f,p)),E.forEach(function(e,t){var n=tV.getCellById(e);if(n){var r,i={x:C.x+320*t+280,y:C.y};n.position(i.x,i.y);var o=null===(r=s.find(function(e){return e.collectionName===n.id}))||void 0===r?void 0:r.id;c.push({id:o,collectionName:n.id,x:i.x,y:i.y})}})}}else m=15,p=0,g=mx(15,o),y=50,b=50;if(g.forEach(function(e,t){e.forEach(function(e,n){var r=tV.getCellById(e),i=n%m;if(r){var o,l={x:325*i+y,y:300*t+b+300};r.position(l.x,l.y);var a=null===(o=s.find(function(e){return e.collectionName===r.id}))||void 0===o?void 0:o.id;c.push({id:a,collectionName:r.id,x:l.x,y:l.y})}})}),a.forEach(function(e){mC(e)}),tV.positionCell(l[0],"top-left",{padding:100}),!e){var S=c.filter(function(e){return e.id}),P=c.filter(function(e){return!e.id});S.length>0&&tV.updatePositionAction(S,!0),P.length>0&&tV.saveGraphPositionAction(P)}},mO=t8().memo(function(){var e,t,n,r,i,o=(0,t3.useGlobalTheme)().theme,s=gy().styles,l=mu((0,pD.useSearchParams)(),2),a=l[0],u=l[1],c=a.get("collections"),h=(0,t4.useContext)(t9.SchemaOptionsContext),d=(0,t3.useAPIClient)(),f=(0,t3.useCompile)(),p=pW().t,g=mu((0,t4.useState)([]),2),m=g[0],y=g[1],b=mu((0,t4.useState)([]),2),v=b[0],x=b[1],w=mu((0,t4.useState)(!1),2),C=w[0],E=w[1],S=(0,t3.useCollectionManager_deprecated)(),P=(S.collections,S.getCollections),O=(0,t4.useContext)(t3.CollectionCategoriesContext),k=(0,t4.useRef)();k.current=O;var A=(0,t3.useDataSourceManager)(),M=(0,t3.useCurrentAppInfo)(),T=(0,t3.useApp)(),N=M.data.database,j=ml({},null==h?void 0:h.scope),I=ml({},null==h?void 0:h.components);var L=(e=ms(function(e){return mc(this,function(t){switch(t.label){case 0:return[4,d.resource("graphPositions").create({values:e})];case 1:return t.sent(),[4,_()];case 2:return t.sent(),[2]}})}),function(t){return e.apply(this,arguments)});var R=(t=ms(function(e){var t,n=arguments;return mc(this,function(r){switch(r.label){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],c)return[3,6];if(!t)return[3,2];return[4,d.resource("graphPositions").update({values:e})];case 1:return r.sent(),[3,4];case 2:return[4,d.resource("graphPositions").update({filter:{collectionName:e.collectionName},values:ml({},e)})];case 3:r.sent(),r.label=4;case 4:return[4,_()];case 5:r.sent(),r.label=6;case 6:return[2]}})}),function(e){return t.apply(this,arguments)});var _=(n=ms(function(){var e;return mc(this,function(t){switch(t.label){case 0:return[4,d.resource("graphPositions").list({paginate:!1})];case 1:return e=t.sent().data,tV.positions=e.data,[2,Promise.resolve()]}})}),function(){return n.apply(this,arguments)}),B=function(e){t$=e,"destory"===e&&_()};var D=(r=ms(function(e){var t,n;return mc(this,function(r){return(t=P(),tV)?(tV.collections=t,tV.updatePositionAction=R,tV.saveGraphPositionAction=L,n=tV.getNodes(),y(t),x(t),!n.length||e?!c&&q(t):W(t),[2]):[2]})}),function(e){return r.apply(this,arguments)}),z=(0,t3.useDataSource)(),F=function(){(tV=new pu({container:document.getElementById("container"),moveThreshold:0,virtual:!1,async:!0,connecting:{anchor:{name:"midSide"}},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},interacting:{magnetConnectable:!1},preventDefaultBlankAction:!0})).connectionType="both",tV.direction="target",tV.cacheCollection={},tV.onConnectionAssociation=V,tV.onConnectionChilds=$,tV.onConnectionParents=U,pu.registerPortLayout("erPortPosition",function(e){return e.map(function(e,t){return{position:{x:0,y:(t+1)*40},angle:0}})},!0),!function(e){let{shape:t,component:n,effect:r,inherit:i}=e,o=pM(e,["shape","component","effect","inherit"]);if(!t)throw Error("should specify shape in config");pT[t]={component:n,effect:r},pu.registerNode(t,Object.assign({inherit:i||"react-shape"},o),!0)}({shape:"er-rect",width:250,height:40,ports:{groups:{list:{markup:[{tagName:"rect",selector:"portBody"}],attrs:{portBody:{width:250,height:40,strokeWidth:1,visibility:"hidden"}},position:"erPortPosition"}}},body:{refWidth:100,refHeight:100},component:function(e){return t8().createElement(t3.CurrentAppInfoContext.Provider,{value:M},t8().createElement(t3.DataSourceApplicationProvider,{dataSourceManager:A,dataSource:null==z?void 0:z.key},t8().createElement(t3.APIClientProvider,{apiClient:d},t8().createElement(t3.SchemaComponentOptions,{inherit:!0,scope:j,components:I},t8().createElement(t3.CollectionCategoriesContext.Provider,{value:k.current},t8().createElement(nt.ConfigProvider,{theme:o},t8().createElement("div",{style:{height:"auto"}},t8().createElement(nt.App,null,t8().createElement(t3.ApplicationContext.Provider,{value:T},t8().createElement(gJ,ma(ml({},e),{setTargetNode:B,targetGraph:tV})))))))))))}}),tV.use(new pb({autoResize:!0,enabled:!0,pannable:!0,pageVisible:!0,pageBreak:!1,padding:{top:10,left:500,right:300,bottom:300}})),tV.use(new pp({container:document.getElementById("graph-minimap"),width:300,height:200,padding:10,graphOptions:{async:!0,createCellView:function(e){return e.isEdge()?null:e.isNode()?mr:void 0}}})),tV.use(new pw({enabled:!1,multiple:!0,rubberband:!0,movable:!0,className:"node-selecting",modifiers:"shift"})),tV.use(new pP({enabled:!0})),tV.on("edge:mouseleave",function(e){var t=e.e,n=e.edge;t.stopPropagation(),G(n)}),tV.on("node:mouseleave",function(e){var t=e.e,n=e.node;t.stopPropagation(),n.setProp({actived:!1})}),tV.on("node:moved",function(e){var t=e.e,n=e.node;t.stopPropagation();var r=tV.getConnectedEdges(n),i=n.position(),o=tV.positions.find(function(e){return e.collectionName===n.store.data.name});o?(o.x!==i.x||o.y!==i.y)&&R(ml({collectionName:n.store.data.name},i)):L(ml({collectionName:n.store.data.name},i)),r.forEach(function(e){mC(e)})}),tV.on("cell:mouseenter",function(e){var t=e.e,n=e.cell,r=e.edge,i=e.node;t.stopPropagation(),n.toFront(),i&&n.setProp({actived:!0}),r&&H(r)}),tV.on("blank:click",function(e){var t;(null==tV?void 0:tV.activeEdge)&&G(null==tV?void 0:tV.activeEdge),null===(t=tV.collapseNodes)||void 0===t||t.map(function(e){var t=tV.getCellById(Object.keys(e)[0]);Object.values(e)[0]&&(null==t||t.setData({collapse:!1}))}),tV.cleanSelection()}),tV.on("node:selected",function(e){e.e,e.node.setProp({select:!0})}),tV.on("node:unselected",function(e){e.e,e.node.setProp({select:!1})})},V=function(e){var t,n=e.target,r=e.through,i=(null===(t=tV.selectedCollections)||void 0===t?void 0:t.split(","))||[];i.push(n),r&&i.push(r);var o=my(i).toString();u([["collections",o]]),tV.selectedCollections=o},$=function(e){var t=tV.selectedCollections.split(",")||[],n=my(t=t.concat(e)).toString();u([["collections",n]]),tV.selectedCollections=n},U=function(e){var t=tV.selectedCollections.split(",")||[],n=my(t=t.concat(e)).toString();u([["collections",n]]),tV.selectedCollections=n},G=function(e){tV.activeEdge=null;var t,n,r=null!==(n=null===(t=e.store)||void 0===t?void 0:t.data)&&void 0!==n?n:{},i=r.m2m,o=r.connectionType,s=null==i?void 0:i.find(function(t){return t!==e.id}),l=tV.getCellById(s),a=function(e){var t=tV.getCellById(e.store.data.target.cell),n=tV.getCellById(e.store.data.source.cell);t.setProp({targetPort:!1,associated:null}),n.setProp({sourcePort:!1,associated:null}),e.setAttrs({line:{stroke:"#ddd",targetMarker:"inherited"===o?{name:"classic",fill:"#ddd"}:null}}),e.setLabels(e.getLabels().map(function(e){return ma(ml({},e),{attrs:{labelText:ma(ml({},e.attrs.labelText),{fill:"rgba(0, 0, 0, 0.3)"}),labelBody:ma(ml({},e.attrs.labelBody),{stroke:"#ddd"})}})}))};a(e),l&&a(l)},H=function(e){tV.activeEdge=e;var t,n,r=null!==(n=null===(t=e.store)||void 0===t?void 0:t.data)&&void 0!==n?n:{},i=r.associated,o=r.m2m,s=r.connectionType,l=null==o?void 0:o.find(function(t){return t!==e.id}),a=tV.getCellById(l),u=function(e){e.toFront(),e.setAttrs({line:{stroke:"#1890ff",strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",sourceMarker:null,targetMarker:"inherited"===s?{name:"classic",fill:"#1890ff"}:null}}),e.setLabels(e.getLabels().map(function(e){return ma(ml({},e),{attrs:{labelText:ma(ml({},e.attrs.labelText),{fill:"#1890ff"}),labelBody:ma(ml({},e.attrs.labelBody),{stroke:"#1890ff"})}})}));var t=tV.getCellById(e.store.data.target.cell),n=tV.getCellById(e.store.data.source.cell);t.toFront(),n.toFront(),t.setProp({targetPort:e.store.data.target.port,associated:i}),n.setProp({sourcePort:e.store.data.source.port,associated:i})};u(e),a&&u(a)},q=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];tV.clearCells();var n=pJ(e),r=n.nodesData,i=n.edgesData,o=n.inheritEdges;tV.data={nodes:r,edges:i},tV.fromJSON({nodes:r}),tV.addEdges(i),tV.addEdges(o),!function(e,t){mw.apply(this,arguments)}(L,t)},W=function(e){var t,n,r,i=tV.positions,o=pJ(e),s=o.nodesData,l=o.edgesData,a=o.inheritEdges,u=tV.getNodes().map(function(e){return e.store.data}),h=md(tV.getEdges().map(function(e){return e.store.data}),function(e){return e.connectionType?"currentInheritEdges":"currentRelateEdges"}),d=p1(s,u),f=p2(l,h.currentRelateEdges||[]),p=p2(a,h.currentInheritEdges||[]),g=null===(t=mp(i,"y"))||void 0===t?void 0:t.y,m=null===(n=mg(i,"x"))||void 0===n?void 0:n.x,y=i.filter(function(e){return 100>Math.abs(e.y-g)}),b=mp(y,"x");d.forEach(function(e){var t=e.status,n=e.node,i=e.port,o=tV.getCellById(n.id);switch(t){case"add":r=(null==b?void 0:b.x)>4500?{x:m,y:(b=mg(y,"x")).y+400}:{x:(null==b?void 0:b.x)+350,y:null==b?void 0:b.y},t$=tV.addNode(ma(ml({},n),{position:r})),!c&&L(ml({collectionName:n.name},r)),tV&&tV.positionCell(t$,"top",{padding:200});break;case"insertPort":o.insertPort(i.index,i.port);break;case"deletePort":o.removePort(i.id);break;case"updateNode":o.setProp({title:n.title});break;case"delete":tV.removeCell(n.id);break;default:return null}});var v=function(e){e.forEach(function(e){var t=e.status,n=e.edge,r=tV.addEdge(ml({},n));switch(t){case"add":mC(r);break;case"delete":tV.removeCell(n.id);break;default:return null}})};setTimeout(function(){v(f.concat(p))},300)},X=function(e,t){"target"===t?pX(tV.collections,e).forEach(function(e){var n;null===(n=tV.getCellById(e))||void 0===n||n.setAttrs({hightLight:!0,direction:t,connectionType:"inherited"})}):pY(tV.collections,e).forEach(function(e){var n;null===(n=tV.getCellById(e.name))||void 0===n||n.setAttrs({hightLight:!0,direction:t,connectionType:"inherited"})})},Y=function(e){var t=tV.getCellById(e);tV.cacheCollection[e]=!0,tV.getConnectedEdges(t).filter(function(t){var n;return!(null===(n=t.store.data)||void 0===n?void 0:n.connectionType)&&t.getTargetCellId()===e}).forEach(function(t){t.store.data.m2m&&t.store.data.m2m.forEach(function(t){var n=tV.getCellById(t);if(n.getTargetCellId()===e){var r,i=n.getSourceCellId(),o=tV.getCellById(i);!(null===(r=o.store.data.attrs)||void 0===r?void 0:r.hightLight)&&(o.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),Y(i))}});var n,r=t.getSourceCellId(),i=tV.getCellById(r);!(null===(n=i.store.data.attrs)||void 0===n?void 0:n.hightLight)&&(i.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),Y(r))})},J=function(e){var t=tV.getCellById(e);tV.getConnectedEdges(t).filter(function(t){var n;return!(null===(n=t.store.data)||void 0===n?void 0:n.connectionType)&&t.getSourceCellId()===e}).forEach(function(t){t.store.data.m2m&&t.store.data.m2m.forEach(function(t){var n=tV.getCellById(t);if(n.getSourceCellId()===e){var r,i=n.getTargetCellId(),o=tV.getCellById(i);!(null===(r=o.store.data.attrs)||void 0===r?void 0:r.hightLight)&&(o.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),J(i))}});var n,r=t.getTargetCellId(),i=tV.getCellById(r);!(null===(n=i.store.data.attrs)||void 0===n?void 0:n.hightLight)&&(i.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),J(r))})},Q=function(e,t){"target"===t?Y(e):J(e)},K=function(e,t,n){for(var r=function(r){var o,s,l=i[r].getAttrs(),a=l.direction,u=l.connectionType,c=i[r].id!==e,h=!e||(null===(o=tV.filterConfig)||void 0===o?void 0:o.key)!==e||a!==t,d=!e||(null===(s=tV.filterConfig)||void 0===s?void 0:s.key)!==e||u!==n;i[r].id!==e&&setTimeout(function(){c&&(h||d)&&i[r].setAttrs({hightLight:!1})},0)},i=tV.getNodes().filter(function(e){var t;return null===(t=e.store.data.attrs)||void 0===t?void 0:t.hightLight}),o=i.length,s=0;s<o;s++)r(s)},Z=function(e){var t=tV.connectionType,n=tV.direction,r=tV.filterConfig,i=e===(null==r?void 0:r.key)&&"both"===n,o=e===(null==r?void 0:r.key)&&("both"===t||t===r.connectionType);e?(i&&o||K(e,n,t),t$=tV.getCellById(e),tV.positionCell(t$,"center",{padding:0}),t$.setAttrs({hightLight:!0,connectionType:t}),setTimeout(function(){["entity","both"].includes(t)&&("both"===n?(Q(e,"target"),Q(e,"source")):("target"===n&&Q(e,n),"source"===n&&Q(e,n))),["inherited","both"].includes(t)&&("both"===n?(X(e,"target"),X(e,"source")):X(e,n)),tV.filterConfig={key:e,direction:n,connectionType:t}},0)):(tV.filterConfig=null,K())},ee=function(e){t$=null,tV.getEdges().forEach(function(t){var n=t.store.data.connectionType;"entity"===e?n?t.setVisible(!1):t.setVisible(!0):"inherited"===e?n?t.setVisible(!0):t.setVisible(!1):t.setVisible(!0)})};(0,t4.useLayoutEffect)(function(){return F(),function(){tV.off("cell:mouseenter"),tV.off("edge:mouseleave"),tV.off("node:moved"),tV.off("blank:click"),tV=null,t$=null}},[]),(0,t4.useEffect)(function(){return z.addReloadCallback(D),function(){z.removeReloadCallback(D)}},[]),(0,t4.useEffect)(function(){return E(!0),_().then(ms(function(){var e;return mc(this,function(t){return c&&v.length?(e=null==c?void 0:c.split(","),q(v.filter(function(t){return e.includes(t.name)}),!1),mP(!0),tV.selectedCollections=c):c||D(!0),E(!1),[2]})})).catch(function(e){throw E(!1),e}),function(){p5()}},[a]);var et=(i=ms(function(){var e;return mc(this,function(t){return[2,null===(e=tV.collections)||void 0===e?void 0:e.map(function(e){return{label:f(e.title),value:e.name}})]})}),function(){return i.apply(this,arguments)});return t8().createElement(nt.Layout,null,t8().createElement("div",{className:s.graphCollectionContainerClass},t8().createElement(nt.Spin,{spinning:C},t8().createElement(t3.DataSourceApplicationProvider,{dataSourceManager:A},t8().createElement(mE.Provider,{value:{collectionList:v,handleSearchCollection:function(e){var t=e.target.value.toLowerCase();t?x(m.filter(function(e){return f(e.title).toLowerCase().includes(t)})):x(m)}}},t8().createElement("div",{className:(0,pI.cx)(s.collectionListClass)},t8().createElement(t3.SchemaComponent,{components:{Select:function(e){return t8().createElement(t3.Select,ma(ml({popupMatchSelectWidth:!1},e),{getPopupContainer:p3}))},AddCollectionAction:p4,LocateCollectionAction:g6,SelectCollectionsAction:g8,DirectionAction:gs,ConnectorAction:gt,FullscreenAction:gZ},schema:{type:"void",properties:{block1:{type:"void","x-collection":"collections","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:p6,request:{resource:"collections",action:"list",params:{pageSize:50,filter:{inherit:!1},sort:["sort"],appends:[]}}},properties:{selectCollections:{type:"array","x-component":"SelectCollectionsAction"},actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{fontSize:16}},properties:{create:{type:"void",title:'{{ t("Create collection") }}',"x-component":"AddCollectionAction","x-component-props":{type:"primary"}},fullScreen:{type:"void","x-component":"FullscreenAction"},locateCollection:{type:"void","x-component":"LocateCollectionAction","x-component-props":{handleFiterCollections:Z,icon:"MenuOutlined",useAction:function(){return{run:function(){}}}}},autoLayout:{type:"void","x-component":"Action","x-component-props":{component:function(){return t8().createElement(nt.Tooltip,{title:p("Auto layout"),getPopupContainer:p3},t8().createElement(nt.Button,{onClick:function(){mP()}},t8().createElement(t5.ApartmentOutlined,null)))},useAction:function(){return{run:function(){}}}}},connectionType:{type:"void","x-component":"ConnectorAction","x-component-props":{onClick:function(e){tV.connectionType=e;var t=tV.filterConfig;t&&Z(t.key),ee(e)},icon:"MenuOutlined",useAction:function(){return{run:function(){}}}}},direction:{type:"void","x-component":"DirectionAction","x-component-props":{onClick:function(e){tV.direction=e;var t=tV.filterConfig;t&&Z(t.key)}}},selectMode:{type:"void","x-component":function(){return t8().createElement(nt.Tooltip,{title:p("Selection")},t8().createElement(nt.Switch,{onChange:function(e){tV.toggleSelection()}}))}}}}}}}},scope:{useAsyncDataSource:nw,loadCollections:et,useCreateActionAndRefreshCM:function(){return nf(B)},enableInherits:(null==N?void 0:N.dialect)==="postgres"}})))),t8().createElement("div",{id:"container",style:{width:"100vw"}}),t8().createElement("div",{id:"graph-minimap",className:s.graphMinimap,style:{width:"300px",height:"250px",right:"10px",bottom:"20px",position:"fixed"}}))))});mO.displayName="GraphDrawPage";function mk(){var e,t,n=(e=["\n height: calc(100vh - 160px);\n overflow: auto;\n margin: calc(var(--nb-spacing) * -1);\n position: relative;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return mk=function(){return n},n}var mA=function(e){var t,n,r=(0,t3.useActionContext)().visible;var i=(0,t3.useRequest)(function(){return Promise.resolve({data:{name:"t_".concat((0,t6.uid)()),createdBy:!0,updatedBy:!0,sortable:!0,logging:!0,fields:[{name:"id",type:"integer",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0},interface:"id"},{interface:"createdAt",type:"date",field:"createdAt",name:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{interface:"createdBy",type:"belongsTo",target:"users",foreignKey:"createdById",name:"createdBy",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},{type:"date",field:"updatedAt",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"string",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"belongsTo",target:"users",foreignKey:"updatedById",name:"updatedBy",interface:"updatedBy",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}}]}})},(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,i=t,o=n[t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}({},e),n=(n={manual:!0},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t));return(0,t4.useEffect)(function(){r&&i.run()},[r]),i},mM=function(){return t8().createElement("div",{className:(0,t3.css)(mk()),id:"graph_container"},t8().createElement(t3.SchemaComponent,{schema:{type:"void","x-component":"div",properties:{editor:{type:"void","x-component":"GraphDrawPage"}}},components:{GraphDrawPage:mO,DeleteOutlined:t5.DeleteOutlined},scope:{useCollectionValues:mA,useCreateActionAndRefreshCM:nf}}))},mT="graph-collection-manager";function mN(e,t,n,r,i,o,s){try{var l=e[o](s),a=l.value}catch(e){n(e);return}l.done?t(a):Promise.resolve(a).then(r,i)}function mj(e,t,n){return(mj=mB()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&mR(i,n.prototype),i}).apply(null,arguments)}function mI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mL(e){return(mL=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mR(e,t){return(mR=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m_(e){var t="function"==typeof Map?new Map:void 0;return(m_=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return mj(e,arguments,mL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),mR(r,e)})(e)}function mB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mB=function(){return!!e})()}var mD=function(e){var t,n,r;function i(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),e=this,t=i,n=arguments,t=mL(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mB()?Reflect.construct(t,n||[],mL(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mR(e,t)}(i,e),t=i,n=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(e){return t.app.pluginSettingsManager.add("data-source-manager/main.graph",{title:'{{t("Graphical interface", { ns: "'.concat(mT,'" })}}'),Component:mM,topLevelName:"data-source-manager/main",pluginKey:mT,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.graph-collection-manager"}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){mN(o,r,i,s,l,"next",e)}function l(e){mN(o,r,i,s,l,"throw",e)}s(void 0)})})()}}],mI(t.prototype,n),i}(m_(t3.Plugin)),mz=mD}(),m}()});
433
+ `;V.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},V.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},V.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},V.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},V.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},V.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},V.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},V.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},V.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},V.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},V.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},V.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},V.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},V.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},V.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},V.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var wG=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Qw extends yn{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Fo(this.name,bG)}init(e){this.snaplineImpl=new Jw(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(e!=null)e!==this.isEnabled()&&(e?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return e!=null?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return e!=null?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),Vo(this.name)}}wG([yn.dispose()],Qw.prototype,"dispose",null);class Zw extends Xe{}(function(n){function e(t){const r=[],i=Pe.getForeignObjectMarkup();return t?r.push({tagName:t,selector:"body"},i):r.push(i),r}n.config({view:"react-shape-view",markup:e(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(t){if(t.markup==null){const r=t.primer;if(r){t.markup=e(r);let i={};switch(r){case"circle":i={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":i={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}t.attrs=Ie({},{body:Object.assign({refWidth:null,refHeight:null},i)},t.attrs||{})}}return t}}),Xe.registry.register("react-shape",n,!0)})(Zw||(Zw={}));var ex={exports:{}},qt={},tx={exports:{}},nx={};/**
434
+ * @license React
435
+ * scheduler.production.min.js
436
+ *
437
+ * Copyright (c) Facebook, Inc. and its affiliates.
438
+ *
439
+ * This source code is licensed under the MIT license found in the
440
+ * LICENSE file in the root directory of this source tree.
441
+ */(function(n){function e(j,z){var H=j.length;j.push(z);e:for(;0<H;){var te=H-1>>>1,_e=j[te];if(0<i(_e,z))j[te]=z,j[H]=_e,H=te;else break e}}function t(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var z=j[0],H=j.pop();if(H!==z){j[0]=H;e:for(var te=0,_e=j.length,In=_e>>>1;te<In;){var rt=2*(te+1)-1,Kt=j[rt],Ke=rt+1,lt=j[Ke];if(0>i(Kt,H))Ke<_e&&0>i(lt,Kt)?(j[te]=lt,j[Ke]=H,te=Ke):(j[te]=Kt,j[rt]=H,te=rt);else if(Ke<_e&&0>i(lt,H))j[te]=lt,j[Ke]=H,te=Ke;else break e}}return z}function i(j,z){var H=j.sortIndex-z.sortIndex;return H!==0?H:j.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,f=3,d=!1,g=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(j){for(var z=t(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=j)r(c),z.sortIndex=z.expirationTime,e(l,z);else break;z=t(c)}}function w(j){if(p=!1,y(j),!g)if(t(l)!==null)g=!0,k(x);else{var z=t(c);z!==null&&Q(w,z.startTime-j)}}function x(j,z){g=!1,p&&(p=!1,m(E),E=-1),d=!0;var H=f;try{for(y(z),h=t(l);h!==null&&(!(h.expirationTime>z)||j&&!O());){var te=h.callback;if(typeof te=="function"){h.callback=null,f=h.priorityLevel;var _e=te(h.expirationTime<=z);z=n.unstable_now(),typeof _e=="function"?h.callback=_e:h===t(l)&&r(l),y(z)}else r(l);h=t(l)}if(h!==null)var In=!0;else{var rt=t(c);rt!==null&&Q(w,rt.startTime-z),In=!1}return In}finally{h=null,f=H,d=!1}}var C=!1,S=null,E=-1,A=5,M=-1;function O(){return!(n.unstable_now()-M<A)}function I(){if(S!==null){var j=n.unstable_now();M=j;var z=!0;try{z=S(!0,j)}finally{z?q():(C=!1,S=null)}}else C=!1}var q;if(typeof v=="function")q=function(){v(I)};else if(typeof MessageChannel!="undefined"){var U=new MessageChannel,T=U.port2;U.port1.onmessage=I,q=function(){T.postMessage(null)}}else q=function(){b(I,0)};function k(j){S=j,C||(C=!0,q())}function Q(j,z){E=b(function(){j(n.unstable_now())},z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_continueExecution=function(){g||d||(g=!0,k(x))},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return f},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(j){switch(f){case 1:case 2:case 3:var z=3;break;default:z=f}var H=f;f=z;try{return j()}finally{f=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var H=f;f=j;try{return z()}finally{f=H}},n.unstable_scheduleCallback=function(j,z,H){var te=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?te+H:te):H=te,j){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=H+_e,j={id:u++,callback:z,priorityLevel:j,startTime:H,expirationTime:_e,sortIndex:-1},H>te?(j.sortIndex=H,e(c,j),t(l)===null&&j===t(c)&&(p?(m(E),E=-1):p=!0,Q(w,H-te))):(j.sortIndex=_e,e(l,j),g||d||(g=!0,k(x))),j},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(j){var z=f;return function(){var H=f;f=z;try{return j.apply(this,arguments)}finally{f=H}}}})(nx),tx.exports=nx;var xG=tx.exports;/**
442
+ * @license React
443
+ * react-dom.production.min.js
444
+ *
445
+ * Copyright (c) Facebook, Inc. and its affiliates.
446
+ *
447
+ * This source code is licensed under the MIT license found in the
448
+ * LICENSE file in the root directory of this source tree.
449
+ */var rx=ee,Gt=xG;function R(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ix=new Set,ea={};function Mi(n,e){$s(n,e),$s(n+"Capture",e)}function $s(n,e){for(ea[n]=e,n=0;n<e.length;n++)ix.add(e[n])}var cr=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Cf=Object.prototype.hasOwnProperty,CG=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,sx={},ox={};function SG(n){return Cf.call(ox,n)?!0:Cf.call(sx,n)?!1:CG.test(n)?ox[n]=!0:(sx[n]=!0,!1)}function PG(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function EG(n,e,t,r){if(e===null||typeof e=="undefined"||PG(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Tt(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var vt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){vt[n]=new Tt(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];vt[e]=new Tt(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){vt[n]=new Tt(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){vt[n]=new Tt(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){vt[n]=new Tt(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){vt[n]=new Tt(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){vt[n]=new Tt(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){vt[n]=new Tt(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){vt[n]=new Tt(n,5,!1,n.toLowerCase(),null,!1,!1)});var Sf=/[\-:]([a-z])/g;function Pf(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(Sf,Pf);vt[e]=new Tt(e,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(Sf,Pf);vt[e]=new Tt(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(Sf,Pf);vt[e]=new Tt(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){vt[n]=new Tt(n,1,!1,n.toLowerCase(),null,!1,!1)}),vt.xlinkHref=new Tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){vt[n]=new Tt(n,1,!1,n.toLowerCase(),null,!0,!0)});function Ef(n,e,t,r){var i=vt.hasOwnProperty(e)?vt[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(EG(e,t,i,r)&&(t=null),r||i===null?SG(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):i.mustUseProperty?n[i.propertyName]=t===null?i.type===3?!1:"":t:(e=i.attributeName,r=i.attributeNamespace,t===null?n.removeAttribute(e):(i=i.type,t=i===3||i===4&&t===!0?"":""+t,r?n.setAttributeNS(r,e,t):n.setAttribute(e,t))))}var ur=rx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,dc=Symbol.for("react.element"),Ls=Symbol.for("react.portal"),Rs=Symbol.for("react.fragment"),Af=Symbol.for("react.strict_mode"),Of=Symbol.for("react.profiler"),ax=Symbol.for("react.provider"),lx=Symbol.for("react.context"),Mf=Symbol.for("react.forward_ref"),Tf=Symbol.for("react.suspense"),_f=Symbol.for("react.suspense_list"),Nf=Symbol.for("react.memo"),Fr=Symbol.for("react.lazy"),cx=Symbol.for("react.offscreen"),ux=Symbol.iterator;function ta(n){return n===null||typeof n!="object"?null:(n=ux&&n[ux]||n["@@iterator"],typeof n=="function"?n:null)}var $e=Object.assign,kf;function na(n){if(kf===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);kf=e&&e[1]||""}return`
450
+ `+kf+n}var If=!1;function $f(n,e){if(!n||If)return"";If=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(n,[],e)}else{try{e.call()}catch(c){r=c}n.call(e.prototype)}else{try{throw Error()}catch(c){r=c}n()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
451
+ `),s=r.stack.split(`
452
+ `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
453
+ `+i[o].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{If=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?na(n):""}function AG(n){switch(n.tag){case 5:return na(n.type);case 16:return na("Lazy");case 13:return na("Suspense");case 19:return na("SuspenseList");case 0:case 2:case 15:return n=$f(n.type,!1),n;case 11:return n=$f(n.type.render,!1),n;case 1:return n=$f(n.type,!0),n;default:return""}}function Lf(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Rs:return"Fragment";case Ls:return"Portal";case Of:return"Profiler";case Af:return"StrictMode";case Tf:return"Suspense";case _f:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case lx:return(n.displayName||"Context")+".Consumer";case ax:return(n._context.displayName||"Context")+".Provider";case Mf:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Nf:return e=n.displayName||null,e!==null?e:Lf(n.type)||"Memo";case Fr:e=n._payload,n=n._init;try{return Lf(n(e))}catch(t){}}return null}function OG(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Lf(e);case 8:return e===Af?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Vr(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function hx(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function MG(n){var e=hx(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function gc(n){n._valueTracker||(n._valueTracker=MG(n))}function fx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=hx(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function pc(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(e){return n.body}}function Rf(n,e){var t=e.checked;return $e({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function dx(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Vr(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function gx(n,e){e=e.checked,e!=null&&Ef(n,"checked",e,!1)}function jf(n,e){gx(n,e);var t=Vr(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?Df(n,e.type,t):e.hasOwnProperty("defaultValue")&&Df(n,e.type,Vr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function px(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function Df(n,e,t){(e!=="number"||pc(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var ra=Array.isArray;function js(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i<t.length;i++)e["$"+t[i]]=!0;for(t=0;t<n.length;t++)i=e.hasOwnProperty("$"+n[t].value),n[t].selected!==i&&(n[t].selected=i),i&&r&&(n[t].defaultSelected=!0)}else{for(t=""+Vr(t),e=null,i=0;i<n.length;i++){if(n[i].value===t){n[i].selected=!0,r&&(n[i].defaultSelected=!0);return}e!==null||n[i].disabled||(e=n[i])}e!==null&&(e.selected=!0)}}function Bf(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(R(91));return $e({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function mx(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(R(92));if(ra(t)){if(1<t.length)throw Error(R(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Vr(t)}}function yx(n,e){var t=Vr(e.value),r=Vr(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),r!=null&&(n.defaultValue=""+r)}function vx(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function bx(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function zf(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?bx(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var mc,wx=function(n){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,r,i){MSApp.execUnsafeLocalFunction(function(){return n(e,t,r,i)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(mc=mc||document.createElement("div"),mc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=mc.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function ia(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var sa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},TG=["Webkit","ms","Moz","O"];Object.keys(sa).forEach(function(n){TG.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),sa[e]=sa[n]})});function xx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||sa.hasOwnProperty(n)&&sa[n]?(""+e).trim():e+"px"}function Cx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=xx(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var _G=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ff(n,e){if(e){if(_G[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(R(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(R(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(R(61))}if(e.style!=null&&typeof e.style!="object")throw Error(R(62))}}function Vf(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qf=null;function Gf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Hf=null,Ds=null,Bs=null;function Sx(n){if(n=Oa(n)){if(typeof Hf!="function")throw Error(R(280));var e=n.stateNode;e&&(e=Bc(e),Hf(n.stateNode,n.type,e))}}function Px(n){Ds?Bs?Bs.push(n):Bs=[n]:Ds=n}function Ex(){if(Ds){var n=Ds,e=Bs;if(Bs=Ds=null,Sx(n),e)for(n=0;n<e.length;n++)Sx(e[n])}}function Ax(n,e){return n(e)}function Ox(){}var Uf=!1;function Mx(n,e,t){if(Uf)return n(e,t);Uf=!0;try{return Ax(n,e,t)}finally{Uf=!1,(Ds!==null||Bs!==null)&&(Ox(),Ex())}}function oa(n,e){var t=n.stateNode;if(t===null)return null;var r=Bc(t);if(r===null)return null;t=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(n=n.type,r=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!r;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(R(231,e,typeof t));return t}var Wf=!1;if(cr)try{var aa={};Object.defineProperty(aa,"passive",{get:function(){Wf=!0}}),window.addEventListener("test",aa,aa),window.removeEventListener("test",aa,aa)}catch(n){Wf=!1}function NG(n,e,t,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var la=!1,yc=null,vc=!1,Xf=null,kG={onError:function(n){la=!0,yc=n}};function IG(n,e,t,r,i,s,o,a,l){la=!1,yc=null,NG.apply(kG,arguments)}function $G(n,e,t,r,i,s,o,a,l){if(IG.apply(this,arguments),la){if(la){var c=yc;la=!1,yc=null}else throw Error(R(198));vc||(vc=!0,Xf=c)}}function Ti(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function Tx(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function _x(n){if(Ti(n)!==n)throw Error(R(188))}function LG(n){var e=n.alternate;if(!e){if(e=Ti(n),e===null)throw Error(R(188));return e!==n?null:n}for(var t=n,r=e;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return _x(i),n;if(s===r)return _x(i),e;s=s.sibling}throw Error(R(188))}if(t.return!==r.return)t=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===t){o=!0,t=i,r=s;break}if(a===r){o=!0,r=i,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,r=i;break}if(a===r){o=!0,r=s,t=i;break}a=a.sibling}if(!o)throw Error(R(189))}}if(t.alternate!==r)throw Error(R(190))}if(t.tag!==3)throw Error(R(188));return t.stateNode.current===t?n:e}function Nx(n){return n=LG(n),n!==null?kx(n):null}function kx(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=kx(n);if(e!==null)return e;n=n.sibling}return null}var Ix=Gt.unstable_scheduleCallback,$x=Gt.unstable_cancelCallback,RG=Gt.unstable_shouldYield,jG=Gt.unstable_requestPaint,Ye=Gt.unstable_now,DG=Gt.unstable_getCurrentPriorityLevel,Yf=Gt.unstable_ImmediatePriority,Lx=Gt.unstable_UserBlockingPriority,bc=Gt.unstable_NormalPriority,BG=Gt.unstable_LowPriority,Rx=Gt.unstable_IdlePriority,wc=null,qn=null;function zG(n){if(qn&&typeof qn.onCommitFiberRoot=="function")try{qn.onCommitFiberRoot(wc,n,void 0,(n.current.flags&128)===128)}catch(e){}}var Pn=Math.clz32?Math.clz32:qG,FG=Math.log,VG=Math.LN2;function qG(n){return n>>>=0,n===0?32:31-(FG(n)/VG|0)|0}var xc=64,Cc=4194304;function ca(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Sc(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=ca(a):(s&=o,s!==0&&(r=ca(s)))}else o=t&~i,o!==0?r=ca(o):s!==0&&(r=ca(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0<e;)t=31-Pn(e),i=1<<t,r|=n[t],e&=~i;return r}function GG(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function HG(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-Pn(s),a=1<<o,l=i[o];l===-1?(!(a&t)||a&r)&&(i[o]=GG(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function Kf(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function jx(){var n=xc;return xc<<=1,!(xc&4194240)&&(xc=64),n}function Jf(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function ua(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Pn(e),n[e]=t}function UG(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0<t;){var i=31-Pn(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function Qf(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-Pn(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var ye=0;function Dx(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var Bx,Zf,zx,Fx,Vx,ed=!1,Pc=[],qr=null,Gr=null,Hr=null,ha=new Map,fa=new Map,Ur=[],WG="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function qx(n,e){switch(n){case"focusin":case"focusout":qr=null;break;case"dragenter":case"dragleave":Gr=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":ha.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":fa.delete(e.pointerId)}}function da(n,e,t,r,i,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Oa(e),e!==null&&Zf(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function XG(n,e,t,r,i){switch(e){case"focusin":return qr=da(qr,n,e,t,r,i),!0;case"dragenter":return Gr=da(Gr,n,e,t,r,i),!0;case"mouseover":return Hr=da(Hr,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return ha.set(s,da(ha.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,fa.set(s,da(fa.get(s)||null,n,e,t,r,i)),!0}return!1}function Gx(n){var e=_i(n.target);if(e!==null){var t=Ti(e);if(t!==null){if(e=t.tag,e===13){if(e=Tx(t),e!==null){n.blockedOn=e,Vx(n.priority,function(){zx(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Ec(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=nd(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);qf=r,t.target.dispatchEvent(r),qf=null}else return e=Oa(t),e!==null&&Zf(e),n.blockedOn=t,!1;e.shift()}return!0}function Hx(n,e,t){Ec(n)&&t.delete(e)}function YG(){ed=!1,qr!==null&&Ec(qr)&&(qr=null),Gr!==null&&Ec(Gr)&&(Gr=null),Hr!==null&&Ec(Hr)&&(Hr=null),ha.forEach(Hx),fa.forEach(Hx)}function ga(n,e){n.blockedOn===e&&(n.blockedOn=null,ed||(ed=!0,Gt.unstable_scheduleCallback(Gt.unstable_NormalPriority,YG)))}function pa(n){function e(i){return ga(i,n)}if(0<Pc.length){ga(Pc[0],n);for(var t=1;t<Pc.length;t++){var r=Pc[t];r.blockedOn===n&&(r.blockedOn=null)}}for(qr!==null&&ga(qr,n),Gr!==null&&ga(Gr,n),Hr!==null&&ga(Hr,n),ha.forEach(e),fa.forEach(e),t=0;t<Ur.length;t++)r=Ur[t],r.blockedOn===n&&(r.blockedOn=null);for(;0<Ur.length&&(t=Ur[0],t.blockedOn===null);)Gx(t),t.blockedOn===null&&Ur.shift()}var zs=ur.ReactCurrentBatchConfig,Ac=!0;function KG(n,e,t,r){var i=ye,s=zs.transition;zs.transition=null;try{ye=1,td(n,e,t,r)}finally{ye=i,zs.transition=s}}function JG(n,e,t,r){var i=ye,s=zs.transition;zs.transition=null;try{ye=4,td(n,e,t,r)}finally{ye=i,zs.transition=s}}function td(n,e,t,r){if(Ac){var i=nd(n,e,t,r);if(i===null)bd(n,e,r,Oc,t),qx(n,r);else if(XG(i,n,e,t,r))r.stopPropagation();else if(qx(n,r),e&4&&-1<WG.indexOf(n)){for(;i!==null;){var s=Oa(i);if(s!==null&&Bx(s),s=nd(n,e,t,r),s===null&&bd(n,e,r,Oc,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else bd(n,e,r,null,t)}}var Oc=null;function nd(n,e,t,r){if(Oc=null,n=Gf(r),n=_i(n),n!==null)if(e=Ti(n),e===null)n=null;else if(t=e.tag,t===13){if(n=Tx(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return Oc=n,null}function Ux(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(DG()){case Yf:return 1;case Lx:return 4;case bc:case BG:return 16;case Rx:return 536870912;default:return 16}default:return 16}}var Wr=null,rd=null,Mc=null;function Wx(){if(Mc)return Mc;var n,e=rd,t=e.length,r,i="value"in Wr?Wr.value:Wr.textContent,s=i.length;for(n=0;n<t&&e[n]===i[n];n++);var o=t-n;for(r=1;r<=o&&e[t-r]===i[s-r];r++);return Mc=i.slice(n,1<r?1-r:void 0)}function Tc(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function _c(){return!0}function Xx(){return!1}function Ht(n){function e(t,r,i,s,o){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?_c:Xx,this.isPropagationStopped=Xx,this}return $e(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=_c)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=_c)},persist:function(){},isPersistent:_c}),e}var Fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},id=Ht(Fs),ma=$e({},Fs,{view:0,detail:0}),QG=Ht(ma),sd,od,ya,Nc=$e({},ma,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ld,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==ya&&(ya&&n.type==="mousemove"?(sd=n.screenX-ya.screenX,od=n.screenY-ya.screenY):od=sd=0,ya=n),sd)},movementY:function(n){return"movementY"in n?n.movementY:od}}),Yx=Ht(Nc),ZG=$e({},Nc,{dataTransfer:0}),eH=Ht(ZG),tH=$e({},ma,{relatedTarget:0}),ad=Ht(tH),nH=$e({},Fs,{animationName:0,elapsedTime:0,pseudoElement:0}),rH=Ht(nH),iH=$e({},Fs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),sH=Ht(iH),oH=$e({},Fs,{data:0}),Kx=Ht(oH),aH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lH={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},cH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uH(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=cH[n])?!!e[n]:!1}function ld(){return uH}var hH=$e({},ma,{key:function(n){if(n.key){var e=aH[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Tc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?lH[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ld,charCode:function(n){return n.type==="keypress"?Tc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),fH=Ht(hH),dH=$e({},Nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jx=Ht(dH),gH=$e({},ma,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ld}),pH=Ht(gH),mH=$e({},Fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),yH=Ht(mH),vH=$e({},Nc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),bH=Ht(vH),wH=[9,13,27,32],cd=cr&&"CompositionEvent"in window,va=null;cr&&"documentMode"in document&&(va=document.documentMode);var xH=cr&&"TextEvent"in window&&!va,Qx=cr&&(!cd||va&&8<va&&11>=va),Zx=" ",eC=!1;function tC(n,e){switch(n){case"keyup":return wH.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Vs=!1;function CH(n,e){switch(n){case"compositionend":return nC(e);case"keypress":return e.which!==32?null:(eC=!0,Zx);case"textInput":return n=e.data,n===Zx&&eC?null:n;default:return null}}function SH(n,e){if(Vs)return n==="compositionend"||!cd&&tC(n,e)?(n=Wx(),Mc=rd=Wr=null,Vs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Qx&&e.locale!=="ko"?null:e.data;default:return null}}var PH={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rC(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!PH[n.type]:e==="textarea"}function iC(n,e,t,r){Px(r),e=Rc(e,"onChange"),0<e.length&&(t=new id("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var ba=null,wa=null;function EH(n){CC(n,0)}function kc(n){var e=Ws(n);if(fx(e))return n}function AH(n,e){if(n==="change")return e}var sC=!1;if(cr){var ud;if(cr){var hd="oninput"in document;if(!hd){var oC=document.createElement("div");oC.setAttribute("oninput","return;"),hd=typeof oC.oninput=="function"}ud=hd}else ud=!1;sC=ud&&(!document.documentMode||9<document.documentMode)}function aC(){ba&&(ba.detachEvent("onpropertychange",lC),wa=ba=null)}function lC(n){if(n.propertyName==="value"&&kc(wa)){var e=[];iC(e,wa,n,Gf(n)),Mx(EH,e)}}function OH(n,e,t){n==="focusin"?(aC(),ba=e,wa=t,ba.attachEvent("onpropertychange",lC)):n==="focusout"&&aC()}function MH(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return kc(wa)}function TH(n,e){if(n==="click")return kc(e)}function _H(n,e){if(n==="input"||n==="change")return kc(e)}function NH(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var En=typeof Object.is=="function"?Object.is:NH;function xa(n,e){if(En(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var i=t[r];if(!Cf.call(e,i)||!En(n[i],e[i]))return!1}return!0}function cC(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function uC(n,e){var t=cC(n);n=0;for(var r;t;){if(t.nodeType===3){if(r=n+t.textContent.length,n<=e&&r>=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=cC(t)}}function hC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?hC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function fC(){for(var n=window,e=pc();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch(r){t=!1}if(t)n=e.contentWindow;else break;e=pc(n.document)}return e}function fd(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function kH(n){var e=fC(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&hC(t.ownerDocument.documentElement,t)){if(r!==null&&fd(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=uC(t,s);var o=uC(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var IH=cr&&"documentMode"in document&&11>=document.documentMode,qs=null,dd=null,Ca=null,gd=!1;function dC(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;gd||qs==null||qs!==pc(r)||(r=qs,"selectionStart"in r&&fd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ca&&xa(Ca,r)||(Ca=r,r=Rc(dd,"onSelect"),0<r.length&&(e=new id("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=qs)))}function Ic(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Gs={animationend:Ic("Animation","AnimationEnd"),animationiteration:Ic("Animation","AnimationIteration"),animationstart:Ic("Animation","AnimationStart"),transitionend:Ic("Transition","TransitionEnd")},pd={},gC={};cr&&(gC=document.createElement("div").style,"AnimationEvent"in window||(delete Gs.animationend.animation,delete Gs.animationiteration.animation,delete Gs.animationstart.animation),"TransitionEvent"in window||delete Gs.transitionend.transition);function $c(n){if(pd[n])return pd[n];if(!Gs[n])return n;var e=Gs[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in gC)return pd[n]=e[t];return n}var pC=$c("animationend"),mC=$c("animationiteration"),yC=$c("animationstart"),vC=$c("transitionend"),bC=new Map,wC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Xr(n,e){bC.set(n,e),Mi(e,[n])}for(var md=0;md<wC.length;md++){var yd=wC[md],$H=yd.toLowerCase(),LH=yd[0].toUpperCase()+yd.slice(1);Xr($H,"on"+LH)}Xr(pC,"onAnimationEnd"),Xr(mC,"onAnimationIteration"),Xr(yC,"onAnimationStart"),Xr("dblclick","onDoubleClick"),Xr("focusin","onFocus"),Xr("focusout","onBlur"),Xr(vC,"onTransitionEnd"),$s("onMouseEnter",["mouseout","mouseover"]),$s("onMouseLeave",["mouseout","mouseover"]),$s("onPointerEnter",["pointerout","pointerover"]),$s("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),RH=new Set("cancel close invalid load scroll toggle".split(" ").concat(Sa));function xC(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,$G(r,e,void 0,n),n.currentTarget=null}function CC(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var r=n[t],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;xC(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;xC(i,a,c),s=l}}}if(vc)throw n=Xf,vc=!1,Xf=null,n}function Me(n,e){var t=e[Ed];t===void 0&&(t=e[Ed]=new Set);var r=n+"__bubble";t.has(r)||(SC(e,n,2,!1),t.add(r))}function vd(n,e,t){var r=0;e&&(r|=4),SC(t,n,r,e)}var Lc="_reactListening"+Math.random().toString(36).slice(2);function Pa(n){if(!n[Lc]){n[Lc]=!0,ix.forEach(function(t){t!=="selectionchange"&&(RH.has(t)||vd(t,!1,n),vd(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[Lc]||(e[Lc]=!0,vd("selectionchange",!1,e))}}function SC(n,e,t,r){switch(Ux(e)){case 1:var i=KG;break;case 4:i=JG;break;default:i=td}t=i.bind(null,e,t,n),i=void 0,!Wf||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?n.addEventListener(e,t,{capture:!0,passive:i}):n.addEventListener(e,t,!0):i!==void 0?n.addEventListener(e,t,{passive:i}):n.addEventListener(e,t,!1)}function bd(n,e,t,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=_i(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Mx(function(){var c=s,u=Gf(t),h=[];e:{var f=bC.get(n);if(f!==void 0){var d=id,g=n;switch(n){case"keypress":if(Tc(t)===0)break e;case"keydown":case"keyup":d=fH;break;case"focusin":g="focus",d=ad;break;case"focusout":g="blur",d=ad;break;case"beforeblur":case"afterblur":d=ad;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=Yx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=eH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=pH;break;case pC:case mC:case yC:d=rH;break;case vC:d=yH;break;case"scroll":d=QG;break;case"wheel":d=bH;break;case"copy":case"cut":case"paste":d=sH;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=Jx}var p=(e&4)!==0,b=!p&&n==="scroll",m=p?f!==null?f+"Capture":null:f;p=[];for(var v=c,y;v!==null;){y=v;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,m!==null&&(w=oa(v,m),w!=null&&p.push(Ea(v,w,y)))),b)break;v=v.return}0<p.length&&(f=new d(f,g,null,t,u),h.push({event:f,listeners:p}))}}if(!(e&7)){e:{if(f=n==="mouseover"||n==="pointerover",d=n==="mouseout"||n==="pointerout",f&&t!==qf&&(g=t.relatedTarget||t.fromElement)&&(_i(g)||g[hr]))break e;if((d||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,d?(g=t.relatedTarget||t.toElement,d=c,g=g?_i(g):null,g!==null&&(b=Ti(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(d=null,g=c),d!==g)){if(p=Yx,w="onMouseLeave",m="onMouseEnter",v="mouse",(n==="pointerout"||n==="pointerover")&&(p=Jx,w="onPointerLeave",m="onPointerEnter",v="pointer"),b=d==null?f:Ws(d),y=g==null?f:Ws(g),f=new p(w,v+"leave",d,t,u),f.target=b,f.relatedTarget=y,w=null,_i(u)===c&&(p=new p(m,v+"enter",g,t,u),p.target=y,p.relatedTarget=b,w=p),b=w,d&&g)t:{for(p=d,m=g,v=0,y=p;y;y=Hs(y))v++;for(y=0,w=m;w;w=Hs(w))y++;for(;0<v-y;)p=Hs(p),v--;for(;0<y-v;)m=Hs(m),y--;for(;v--;){if(p===m||m!==null&&p===m.alternate)break t;p=Hs(p),m=Hs(m)}p=null}else p=null;d!==null&&PC(h,f,d,p,!1),g!==null&&b!==null&&PC(h,b,g,p,!0)}}e:{if(f=c?Ws(c):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var x=AH;else if(rC(f))if(sC)x=_H;else{x=MH;var C=OH}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=TH);if(x&&(x=x(n,c))){iC(h,x,t,u);break e}C&&C(n,f,c),n==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Df(f,"number",f.value)}switch(C=c?Ws(c):window,n){case"focusin":(rC(C)||C.contentEditable==="true")&&(qs=C,dd=c,Ca=null);break;case"focusout":Ca=dd=qs=null;break;case"mousedown":gd=!0;break;case"contextmenu":case"mouseup":case"dragend":gd=!1,dC(h,t,u);break;case"selectionchange":if(IH)break;case"keydown":case"keyup":dC(h,t,u)}var S;if(cd)e:{switch(n){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Vs?tC(n,t)&&(E="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(E="onCompositionStart");E&&(Qx&&t.locale!=="ko"&&(Vs||E!=="onCompositionStart"?E==="onCompositionEnd"&&Vs&&(S=Wx()):(Wr=u,rd="value"in Wr?Wr.value:Wr.textContent,Vs=!0)),C=Rc(c,E),0<C.length&&(E=new Kx(E,n,null,t,u),h.push({event:E,listeners:C}),S?E.data=S:(S=nC(t),S!==null&&(E.data=S)))),(S=xH?CH(n,t):SH(n,t))&&(c=Rc(c,"onBeforeInput"),0<c.length&&(u=new Kx("onBeforeInput","beforeinput",null,t,u),h.push({event:u,listeners:c}),u.data=S))}CC(h,e)})}function Ea(n,e,t){return{instance:n,listener:e,currentTarget:t}}function Rc(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=oa(n,t),s!=null&&r.unshift(Ea(n,s,i)),s=oa(n,e),s!=null&&r.push(Ea(n,s,i))),n=n.return}return r}function Hs(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function PC(n,e,t,r,i){for(var s=e._reactName,o=[];t!==null&&t!==r;){var a=t,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=oa(t,s),l!=null&&o.unshift(Ea(t,l,a))):i||(l=oa(t,s),l!=null&&o.push(Ea(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var jH=/\r\n?/g,DH=/\u0000|\uFFFD/g;function EC(n){return(typeof n=="string"?n:""+n).replace(jH,`
454
+ `).replace(DH,"")}function jc(n,e,t){if(e=EC(e),EC(n)!==e&&t)throw Error(R(425))}function Dc(){}var wd=null,xd=null;function Cd(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Sd=typeof setTimeout=="function"?setTimeout:void 0,BH=typeof clearTimeout=="function"?clearTimeout:void 0,AC=typeof Promise=="function"?Promise:void 0,zH=typeof queueMicrotask=="function"?queueMicrotask:typeof AC!="undefined"?function(n){return AC.resolve(null).then(n).catch(FH)}:Sd;function FH(n){setTimeout(function(){throw n})}function Pd(n,e){var t=e,r=0;do{var i=t.nextSibling;if(n.removeChild(t),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(r===0){n.removeChild(i),pa(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);pa(e)}function Yr(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function OC(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Us=Math.random().toString(36).slice(2),Gn="__reactFiber$"+Us,Aa="__reactProps$"+Us,hr="__reactContainer$"+Us,Ed="__reactEvents$"+Us,VH="__reactListeners$"+Us,qH="__reactHandles$"+Us;function _i(n){var e=n[Gn];if(e)return e;for(var t=n.parentNode;t;){if(e=t[hr]||t[Gn]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=OC(n);n!==null;){if(t=n[Gn])return t;n=OC(n)}return e}n=t,t=n.parentNode}return null}function Oa(n){return n=n[Gn]||n[hr],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Ws(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(R(33))}function Bc(n){return n[Aa]||null}var Ad=[],Xs=-1;function Kr(n){return{current:n}}function Te(n){0>Xs||(n.current=Ad[Xs],Ad[Xs]=null,Xs--)}function Ee(n,e){Xs++,Ad[Xs]=n.current,n.current=e}var Jr={},St=Kr(Jr),$t=Kr(!1),Ni=Jr;function Ys(n,e){var t=n.type.contextTypes;if(!t)return Jr;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Lt(n){return n=n.childContextTypes,n!=null}function zc(){Te($t),Te(St)}function MC(n,e,t){if(St.current!==Jr)throw Error(R(168));Ee(St,e),Ee($t,t)}function TC(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(R(108,OG(n)||"Unknown",i));return $e({},t,r)}function Fc(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Jr,Ni=St.current,Ee(St,n),Ee($t,$t.current),!0}function _C(n,e,t){var r=n.stateNode;if(!r)throw Error(R(169));t?(n=TC(n,e,Ni),r.__reactInternalMemoizedMergedChildContext=n,Te($t),Te(St),Ee(St,n)):Te($t),Ee($t,t)}var fr=null,Vc=!1,Od=!1;function NC(n){fr===null?fr=[n]:fr.push(n)}function GH(n){Vc=!0,NC(n)}function Qr(){if(!Od&&fr!==null){Od=!0;var n=0,e=ye;try{var t=fr;for(ye=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}fr=null,Vc=!1}catch(i){throw fr!==null&&(fr=fr.slice(n+1)),Ix(Yf,Qr),i}finally{ye=e,Od=!1}}return null}var Ks=[],Js=0,qc=null,Gc=0,ln=[],cn=0,ki=null,dr=1,gr="";function Ii(n,e){Ks[Js++]=Gc,Ks[Js++]=qc,qc=n,Gc=e}function kC(n,e,t){ln[cn++]=dr,ln[cn++]=gr,ln[cn++]=ki,ki=n;var r=dr;n=gr;var i=32-Pn(r)-1;r&=~(1<<i),t+=1;var s=32-Pn(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,dr=1<<32-Pn(e)+i|t<<i|r,gr=s+n}else dr=1<<s|t<<i|r,gr=n}function Md(n){n.return!==null&&(Ii(n,1),kC(n,1,0))}function Td(n){for(;n===qc;)qc=Ks[--Js],Ks[Js]=null,Gc=Ks[--Js],Ks[Js]=null;for(;n===ki;)ki=ln[--cn],ln[cn]=null,gr=ln[--cn],ln[cn]=null,dr=ln[--cn],ln[cn]=null}var Ut=null,Wt=null,Ne=!1,An=null;function IC(n,e){var t=dn(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function $C(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,Ut=n,Wt=Yr(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Ut=n,Wt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=ki!==null?{id:dr,overflow:gr}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=dn(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Ut=n,Wt=null,!0):!1;default:return!1}}function _d(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Nd(n){if(Ne){var e=Wt;if(e){var t=e;if(!$C(n,e)){if(_d(n))throw Error(R(418));e=Yr(t.nextSibling);var r=Ut;e&&$C(n,e)?IC(r,t):(n.flags=n.flags&-4097|2,Ne=!1,Ut=n)}}else{if(_d(n))throw Error(R(418));n.flags=n.flags&-4097|2,Ne=!1,Ut=n}}}function LC(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Ut=n}function Hc(n){if(n!==Ut)return!1;if(!Ne)return LC(n),Ne=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!Cd(n.type,n.memoizedProps)),e&&(e=Wt)){if(_d(n))throw RC(),Error(R(418));for(;e;)IC(n,e),e=Yr(e.nextSibling)}if(LC(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(R(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Wt=Yr(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Wt=null}}else Wt=Ut?Yr(n.stateNode.nextSibling):null;return!0}function RC(){for(var n=Wt;n;)n=Yr(n.nextSibling)}function Qs(){Wt=Ut=null,Ne=!1}function kd(n){An===null?An=[n]:An.push(n)}var HH=ur.ReactCurrentBatchConfig;function On(n,e){if(n&&n.defaultProps){e=$e({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var Uc=Kr(null),Wc=null,Zs=null,Id=null;function $d(){Id=Zs=Wc=null}function Ld(n){var e=Uc.current;Te(Uc),n._currentValue=e}function Rd(n,e,t){for(;n!==null;){var r=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),n===t)break;n=n.return}}function eo(n,e){Wc=n,Id=Zs=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Rt=!0),n.firstContext=null)}function un(n){var e=n._currentValue;if(Id!==n)if(n={context:n,memoizedValue:e,next:null},Zs===null){if(Wc===null)throw Error(R(308));Zs=n,Wc.dependencies={lanes:0,firstContext:n}}else Zs=Zs.next=n;return e}var $i=null;function jd(n){$i===null?$i=[n]:$i.push(n)}function jC(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,jd(e)):(t.next=i.next,i.next=t),e.interleaved=t,pr(n,r)}function pr(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Zr=!1;function Dd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DC(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function mr(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function ei(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,he&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,pr(n,t)}return i=r.interleaved,i===null?(e.next=e,jd(r)):(e.next=i.next,i.next=e),r.interleaved=e,pr(n,t)}function Xc(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Qf(n,t)}}function BC(n,e){var t=n.updateQueue,r=n.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Yc(n,e,t,r){var i=n.updateQueue;Zr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,u=c=l=null,a=s;do{var f=a.lane,d=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,p=a;switch(f=e,d=t,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(d,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,f=typeof g=="function"?g.call(d,h,f):g,f==null)break e;h=$e({},h,f);break e;case 2:Zr=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else d={eventTime:d,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=d,l=h):u=u.next=d,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ji|=o,n.lanes=o,n.memoizedState=h}}function zC(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var r=n[e],i=r.callback;if(i!==null){if(r.callback=null,r=t,typeof i!="function")throw Error(R(191,i));i.call(r)}}}var FC=new rx.Component().refs;function Bd(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:$e({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var Kc={isMounted:function(n){return(n=n._reactInternals)?Ti(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=Nt(),i=ii(n),s=mr(r,i);s.payload=e,t!=null&&(s.callback=t),e=ei(n,s,i),e!==null&&(_n(e,n,i,r),Xc(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=Nt(),i=ii(n),s=mr(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=ei(n,s,i),e!==null&&(_n(e,n,i,r),Xc(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Nt(),r=ii(n),i=mr(t,r);i.tag=2,e!=null&&(i.callback=e),e=ei(n,i,r),e!==null&&(_n(e,n,r,t),Xc(e,n,r))}};function VC(n,e,t,r,i,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!xa(t,r)||!xa(i,s):!0}function qC(n,e,t){var r=!1,i=Jr,s=e.contextType;return typeof s=="object"&&s!==null?s=un(s):(i=Lt(e)?Ni:St.current,r=e.contextTypes,s=(r=r!=null)?Ys(n,i):Jr),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Kc,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function GC(n,e,t,r){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,r),e.state!==n&&Kc.enqueueReplaceState(e,e.state,null)}function zd(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs=FC,Dd(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=un(s):(s=Lt(e)?Ni:St.current,i.context=Ys(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Bd(n,e,s,t),i.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Kc.enqueueReplaceState(i,i.state,null),Yc(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function Ma(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(R(309));var r=t.stateNode}if(!r)throw Error(R(147,n));var i=r,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;a===FC&&(a=i.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(R(284));if(!t._owner)throw Error(R(290,n))}return n}function Jc(n,e){throw n=Object.prototype.toString.call(e),Error(R(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function HC(n){var e=n._init;return e(n._payload)}function UC(n){function e(m,v){if(n){var y=m.deletions;y===null?(m.deletions=[v],m.flags|=16):y.push(v)}}function t(m,v){if(!n)return null;for(;v!==null;)e(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function i(m,v){return m=oi(m,v),m.index=0,m.sibling=null,m}function s(m,v,y){return m.index=y,n?(y=m.alternate,y!==null?(y=y.index,y<v?(m.flags|=2,v):y):(m.flags|=2,v)):(m.flags|=1048576,v)}function o(m){return n&&m.alternate===null&&(m.flags|=2),m}function a(m,v,y,w){return v===null||v.tag!==6?(v=Sg(y,m.mode,w),v.return=m,v):(v=i(v,y),v.return=m,v)}function l(m,v,y,w){var x=y.type;return x===Rs?u(m,v,y.props.children,w,y.key):v!==null&&(v.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Fr&&HC(x)===v.type)?(w=i(v,y.props),w.ref=Ma(m,v,y),w.return=m,w):(w=mu(y.type,y.key,y.props,null,m.mode,w),w.ref=Ma(m,v,y),w.return=m,w)}function c(m,v,y,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=Pg(y,m.mode,w),v.return=m,v):(v=i(v,y.children||[]),v.return=m,v)}function u(m,v,y,w,x){return v===null||v.tag!==7?(v=Fi(y,m.mode,w,x),v.return=m,v):(v=i(v,y),v.return=m,v)}function h(m,v,y){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Sg(""+v,m.mode,y),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case dc:return y=mu(v.type,v.key,v.props,null,m.mode,y),y.ref=Ma(m,null,v),y.return=m,y;case Ls:return v=Pg(v,m.mode,y),v.return=m,v;case Fr:var w=v._init;return h(m,w(v._payload),y)}if(ra(v)||ta(v))return v=Fi(v,m.mode,y,null),v.return=m,v;Jc(m,v)}return null}function f(m,v,y,w){var x=v!==null?v.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return x!==null?null:a(m,v,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case dc:return y.key===x?l(m,v,y,w):null;case Ls:return y.key===x?c(m,v,y,w):null;case Fr:return x=y._init,f(m,v,x(y._payload),w)}if(ra(y)||ta(y))return x!==null?null:u(m,v,y,w,null);Jc(m,y)}return null}function d(m,v,y,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(y)||null,a(v,m,""+w,x);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case dc:return m=m.get(w.key===null?y:w.key)||null,l(v,m,w,x);case Ls:return m=m.get(w.key===null?y:w.key)||null,c(v,m,w,x);case Fr:var C=w._init;return d(m,v,y,C(w._payload),x)}if(ra(w)||ta(w))return m=m.get(y)||null,u(v,m,w,x,null);Jc(v,w)}return null}function g(m,v,y,w){for(var x=null,C=null,S=v,E=v=0,A=null;S!==null&&E<y.length;E++){S.index>E?(A=S,S=null):A=S.sibling;var M=f(m,S,y[E],w);if(M===null){S===null&&(S=A);break}n&&S&&M.alternate===null&&e(m,S),v=s(M,v,E),C===null?x=M:C.sibling=M,C=M,S=A}if(E===y.length)return t(m,S),Ne&&Ii(m,E),x;if(S===null){for(;E<y.length;E++)S=h(m,y[E],w),S!==null&&(v=s(S,v,E),C===null?x=S:C.sibling=S,C=S);return Ne&&Ii(m,E),x}for(S=r(m,S);E<y.length;E++)A=d(S,m,E,y[E],w),A!==null&&(n&&A.alternate!==null&&S.delete(A.key===null?E:A.key),v=s(A,v,E),C===null?x=A:C.sibling=A,C=A);return n&&S.forEach(function(O){return e(m,O)}),Ne&&Ii(m,E),x}function p(m,v,y,w){var x=ta(y);if(typeof x!="function")throw Error(R(150));if(y=x.call(y),y==null)throw Error(R(151));for(var C=x=null,S=v,E=v=0,A=null,M=y.next();S!==null&&!M.done;E++,M=y.next()){S.index>E?(A=S,S=null):A=S.sibling;var O=f(m,S,M.value,w);if(O===null){S===null&&(S=A);break}n&&S&&O.alternate===null&&e(m,S),v=s(O,v,E),C===null?x=O:C.sibling=O,C=O,S=A}if(M.done)return t(m,S),Ne&&Ii(m,E),x;if(S===null){for(;!M.done;E++,M=y.next())M=h(m,M.value,w),M!==null&&(v=s(M,v,E),C===null?x=M:C.sibling=M,C=M);return Ne&&Ii(m,E),x}for(S=r(m,S);!M.done;E++,M=y.next())M=d(S,m,E,M.value,w),M!==null&&(n&&M.alternate!==null&&S.delete(M.key===null?E:M.key),v=s(M,v,E),C===null?x=M:C.sibling=M,C=M);return n&&S.forEach(function(I){return e(m,I)}),Ne&&Ii(m,E),x}function b(m,v,y,w){if(typeof y=="object"&&y!==null&&y.type===Rs&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case dc:e:{for(var x=y.key,C=v;C!==null;){if(C.key===x){if(x=y.type,x===Rs){if(C.tag===7){t(m,C.sibling),v=i(C,y.props.children),v.return=m,m=v;break e}}else if(C.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Fr&&HC(x)===C.type){t(m,C.sibling),v=i(C,y.props),v.ref=Ma(m,C,y),v.return=m,m=v;break e}t(m,C);break}else e(m,C);C=C.sibling}y.type===Rs?(v=Fi(y.props.children,m.mode,w,y.key),v.return=m,m=v):(w=mu(y.type,y.key,y.props,null,m.mode,w),w.ref=Ma(m,v,y),w.return=m,m=w)}return o(m);case Ls:e:{for(C=y.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){t(m,v.sibling),v=i(v,y.children||[]),v.return=m,m=v;break e}else{t(m,v);break}else e(m,v);v=v.sibling}v=Pg(y,m.mode,w),v.return=m,m=v}return o(m);case Fr:return C=y._init,b(m,v,C(y._payload),w)}if(ra(y))return g(m,v,y,w);if(ta(y))return p(m,v,y,w);Jc(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,v!==null&&v.tag===6?(t(m,v.sibling),v=i(v,y),v.return=m,m=v):(t(m,v),v=Sg(y,m.mode,w),v.return=m,m=v),o(m)):t(m,v)}return b}var to=UC(!0),WC=UC(!1),Ta={},Hn=Kr(Ta),_a=Kr(Ta),Na=Kr(Ta);function Li(n){if(n===Ta)throw Error(R(174));return n}function Fd(n,e){switch(Ee(Na,e),Ee(_a,n),Ee(Hn,Ta),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:zf(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=zf(e,n)}Te(Hn),Ee(Hn,e)}function no(){Te(Hn),Te(_a),Te(Na)}function XC(n){Li(Na.current);var e=Li(Hn.current),t=zf(e,n.type);e!==t&&(Ee(_a,n),Ee(Hn,t))}function Vd(n){_a.current===n&&(Te(Hn),Te(_a))}var Le=Kr(0);function Qc(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var qd=[];function Gd(){for(var n=0;n<qd.length;n++)qd[n]._workInProgressVersionPrimary=null;qd.length=0}var Zc=ur.ReactCurrentDispatcher,Hd=ur.ReactCurrentBatchConfig,Ri=0,Re=null,ot=null,dt=null,eu=!1,ka=!1,Ia=0,UH=0;function Pt(){throw Error(R(321))}function Ud(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!En(n[t],e[t]))return!1;return!0}function Wd(n,e,t,r,i,s){if(Ri=s,Re=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Zc.current=n===null||n.memoizedState===null?KH:JH,n=t(r,i),ka){s=0;do{if(ka=!1,Ia=0,25<=s)throw Error(R(301));s+=1,dt=ot=null,e.updateQueue=null,Zc.current=QH,n=t(r,i)}while(ka)}if(Zc.current=ru,e=ot!==null&&ot.next!==null,Ri=0,dt=ot=Re=null,eu=!1,e)throw Error(R(300));return n}function Xd(){var n=Ia!==0;return Ia=0,n}function Un(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Re.memoizedState=dt=n:dt=dt.next=n,dt}function hn(){if(ot===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var e=dt===null?Re.memoizedState:dt.next;if(e!==null)dt=e,ot=n;else{if(n===null)throw Error(R(310));ot=n,n={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},dt===null?Re.memoizedState=dt=n:dt=dt.next=n}return dt}function $a(n,e){return typeof e=="function"?e(n):e}function Yd(n){var e=hn(),t=e.queue;if(t===null)throw Error(R(311));t.lastRenderedReducer=n;var r=ot,i=r.baseQueue,s=t.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,t.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var u=c.lane;if((Ri&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:n(r,c.action);else{var h={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=h,o=r):l=l.next=h,Re.lanes|=u,ji|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,En(r,e.memoizedState)||(Rt=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,t.lastRenderedState=r}if(n=t.interleaved,n!==null){i=n;do s=i.lane,Re.lanes|=s,ji|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function Kd(n){var e=hn(),t=e.queue;if(t===null)throw Error(R(311));t.lastRenderedReducer=n;var r=t.dispatch,i=t.pending,s=e.memoizedState;if(i!==null){t.pending=null;var o=i=i.next;do s=n(s,o.action),o=o.next;while(o!==i);En(s,e.memoizedState)||(Rt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function YC(){}function KC(n,e){var t=Re,r=hn(),i=e(),s=!En(r.memoizedState,i);if(s&&(r.memoizedState=i,Rt=!0),r=r.queue,Jd(ZC.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||dt!==null&&dt.memoizedState.tag&1){if(t.flags|=2048,La(9,QC.bind(null,t,r,i,e),void 0,null),gt===null)throw Error(R(349));Ri&30||JC(t,e,i)}return i}function JC(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=Re.updateQueue,e===null?(e={lastEffect:null,stores:null},Re.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function QC(n,e,t,r){e.value=t,e.getSnapshot=r,eS(e)&&tS(n)}function ZC(n,e,t){return t(function(){eS(e)&&tS(n)})}function eS(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!En(n,t)}catch(r){return!0}}function tS(n){var e=pr(n,1);e!==null&&_n(e,n,1,-1)}function nS(n){var e=Un();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:n},e.queue=n,n=n.dispatch=YH.bind(null,Re,n),[e.memoizedState,n]}function La(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=Re.updateQueue,e===null?(e={lastEffect:null,stores:null},Re.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(r=t.next,t.next=n,n.next=r,e.lastEffect=n)),n}function rS(){return hn().memoizedState}function tu(n,e,t,r){var i=Un();Re.flags|=n,i.memoizedState=La(1|e,t,void 0,r===void 0?null:r)}function nu(n,e,t,r){var i=hn();r=r===void 0?null:r;var s=void 0;if(ot!==null){var o=ot.memoizedState;if(s=o.destroy,r!==null&&Ud(r,o.deps)){i.memoizedState=La(e,t,s,r);return}}Re.flags|=n,i.memoizedState=La(1|e,t,s,r)}function iS(n,e){return tu(8390656,8,n,e)}function Jd(n,e){return nu(2048,8,n,e)}function sS(n,e){return nu(4,2,n,e)}function oS(n,e){return nu(4,4,n,e)}function aS(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function lS(n,e,t){return t=t!=null?t.concat([n]):null,nu(4,4,aS.bind(null,e,n),t)}function Qd(){}function cS(n,e){var t=hn();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&Ud(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function uS(n,e){var t=hn();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&Ud(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function hS(n,e,t){return Ri&21?(En(t,e)||(t=jx(),Re.lanes|=t,ji|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Rt=!0),n.memoizedState=t)}function WH(n,e){var t=ye;ye=t!==0&&4>t?t:4,n(!0);var r=Hd.transition;Hd.transition={};try{n(!1),e()}finally{ye=t,Hd.transition=r}}function fS(){return hn().memoizedState}function XH(n,e,t){var r=ii(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},dS(n))gS(e,t);else if(t=jC(n,e,t,r),t!==null){var i=Nt();_n(t,n,r,i),pS(t,e,r)}}function YH(n,e,t){var r=ii(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(dS(n))gS(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,En(a,o)){var l=e.interleaved;l===null?(i.next=i,jd(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch(c){}finally{}t=jC(n,e,i,r),t!==null&&(i=Nt(),_n(t,n,r,i),pS(t,e,r))}}function dS(n){var e=n.alternate;return n===Re||e!==null&&e===Re}function gS(n,e){ka=eu=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function pS(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Qf(n,t)}}var ru={readContext:un,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useInsertionEffect:Pt,useLayoutEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useMutableSource:Pt,useSyncExternalStore:Pt,useId:Pt,unstable_isNewReconciler:!1},KH={readContext:un,useCallback:function(n,e){return Un().memoizedState=[n,e===void 0?null:e],n},useContext:un,useEffect:iS,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,tu(4194308,4,aS.bind(null,e,n),t)},useLayoutEffect:function(n,e){return tu(4194308,4,n,e)},useInsertionEffect:function(n,e){return tu(4,2,n,e)},useMemo:function(n,e){var t=Un();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=Un();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=XH.bind(null,Re,n),[r.memoizedState,n]},useRef:function(n){var e=Un();return n={current:n},e.memoizedState=n},useState:nS,useDebugValue:Qd,useDeferredValue:function(n){return Un().memoizedState=n},useTransition:function(){var n=nS(!1),e=n[0];return n=WH.bind(null,n[1]),Un().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=Re,i=Un();if(Ne){if(t===void 0)throw Error(R(407));t=t()}else{if(t=e(),gt===null)throw Error(R(349));Ri&30||JC(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,iS(ZC.bind(null,r,s,n),[n]),r.flags|=2048,La(9,QC.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=Un(),e=gt.identifierPrefix;if(Ne){var t=gr,r=dr;t=(r&~(1<<32-Pn(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=Ia++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=UH++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},JH={readContext:un,useCallback:cS,useContext:un,useEffect:Jd,useImperativeHandle:lS,useInsertionEffect:sS,useLayoutEffect:oS,useMemo:uS,useReducer:Yd,useRef:rS,useState:function(){return Yd($a)},useDebugValue:Qd,useDeferredValue:function(n){var e=hn();return hS(e,ot.memoizedState,n)},useTransition:function(){var n=Yd($a)[0],e=hn().memoizedState;return[n,e]},useMutableSource:YC,useSyncExternalStore:KC,useId:fS,unstable_isNewReconciler:!1},QH={readContext:un,useCallback:cS,useContext:un,useEffect:Jd,useImperativeHandle:lS,useInsertionEffect:sS,useLayoutEffect:oS,useMemo:uS,useReducer:Kd,useRef:rS,useState:function(){return Kd($a)},useDebugValue:Qd,useDeferredValue:function(n){var e=hn();return ot===null?e.memoizedState=n:hS(e,ot.memoizedState,n)},useTransition:function(){var n=Kd($a)[0],e=hn().memoizedState;return[n,e]},useMutableSource:YC,useSyncExternalStore:KC,useId:fS,unstable_isNewReconciler:!1};function ro(n,e){try{var t="",r=e;do t+=AG(r),r=r.return;while(r);var i=t}catch(s){i=`
455
+ Error generating stack: `+s.message+`
456
+ `+s.stack}return{value:n,source:e,stack:i,digest:null}}function Zd(n,e,t){return{value:n,source:null,stack:t!=null?t:null,digest:e!=null?e:null}}function eg(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var ZH=typeof WeakMap=="function"?WeakMap:Map;function mS(n,e,t){t=mr(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){uu||(uu=!0,pg=r),eg(n,e)},t}function yS(n,e,t){t=mr(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){eg(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){eg(n,e),typeof r!="function"&&(ni===null?ni=new Set([this]):ni.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function vS(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new ZH;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(t)||(i.add(t),n=d8.bind(null,n,e,t),e.then(n,n))}function bS(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function wS(n,e,t,r,i){return n.mode&1?(n.flags|=65536,n.lanes=i,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=mr(-1,1),e.tag=2,ei(t,e,1))),t.lanes|=1),n)}var e8=ur.ReactCurrentOwner,Rt=!1;function _t(n,e,t,r){e.child=n===null?WC(e,null,t,r):to(e,n.child,t,r)}function xS(n,e,t,r,i){t=t.render;var s=e.ref;return eo(e,i),r=Wd(n,e,t,r,s,i),t=Xd(),n!==null&&!Rt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,yr(n,e,i)):(Ne&&t&&Md(e),e.flags|=1,_t(n,e,r,i),e.child)}function CS(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!Cg(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,SS(n,e,s,r,i)):(n=mu(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&i)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:xa,t(o,r)&&n.ref===e.ref)return yr(n,e,i)}return e.flags|=1,n=oi(s,r),n.ref=e.ref,n.return=e,e.child=n}function SS(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(xa(s,r)&&n.ref===e.ref)if(Rt=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(Rt=!0);else return e.lanes=n.lanes,yr(n,e,i)}return tg(n,e,t,r,i)}function PS(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ee(so,Xt),Xt|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Ee(so,Xt),Xt|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Ee(so,Xt),Xt|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Ee(so,Xt),Xt|=r;return _t(n,e,i,t),e.child}function ES(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function tg(n,e,t,r,i){var s=Lt(t)?Ni:St.current;return s=Ys(e,s),eo(e,i),t=Wd(n,e,t,r,s,i),r=Xd(),n!==null&&!Rt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,yr(n,e,i)):(Ne&&r&&Md(e),e.flags|=1,_t(n,e,t,i),e.child)}function AS(n,e,t,r,i){if(Lt(t)){var s=!0;Fc(e)}else s=!1;if(eo(e,i),e.stateNode===null)su(n,e),qC(e,t,r),zd(e,t,r,i),r=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=t.contextType;typeof c=="object"&&c!==null?c=un(c):(c=Lt(t)?Ni:St.current,c=Ys(e,c));var u=t.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&GC(e,o,r,c),Zr=!1;var f=e.memoizedState;o.state=f,Yc(e,r,o,i),l=e.memoizedState,a!==r||f!==l||$t.current||Zr?(typeof u=="function"&&(Bd(e,t,u,r),l=e.memoizedState),(a=Zr||VC(e,t,a,r,f,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,DC(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:On(e.type,a),o.props=c,h=e.pendingProps,f=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=un(l):(l=Lt(t)?Ni:St.current,l=Ys(e,l));var d=t.getDerivedStateFromProps;(u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&GC(e,o,r,l),Zr=!1,f=e.memoizedState,o.state=f,Yc(e,r,o,i);var g=e.memoizedState;a!==h||f!==g||$t.current||Zr?(typeof d=="function"&&(Bd(e,t,d,r),g=e.memoizedState),(c=Zr||VC(e,t,c,r,f,g,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=1024),r=!1)}return ng(n,e,t,r,s,i)}function ng(n,e,t,r,i,s){ES(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&_C(e,t,!1),yr(n,e,s);r=e.stateNode,e8.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=to(e,n.child,null,s),e.child=to(e,null,a,s)):_t(n,e,a,s),e.memoizedState=r.state,i&&_C(e,t,!0),e.child}function OS(n){var e=n.stateNode;e.pendingContext?MC(n,e.pendingContext,e.pendingContext!==e.context):e.context&&MC(n,e.context,!1),Fd(n,e.containerInfo)}function MS(n,e,t,r,i){return Qs(),kd(i),e.flags|=256,_t(n,e,t,r),e.child}var rg={dehydrated:null,treeContext:null,retryLane:0};function ig(n){return{baseLanes:n,cachePool:null,transitions:null}}function TS(n,e,t){var r=e.pendingProps,i=Le.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),Ee(Le,i&1),n===null)return Nd(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,n=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=yu(o,r,0,null),n=Fi(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=ig(t),e.memoizedState=rg,n):sg(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return t8(n,e,o,r,a,i,t);if(s){s=r.fallback,o=e.mode,i=n.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=oi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=oi(a,s):(s=Fi(s,o,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=n.child.memoizedState,o=o===null?ig(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=rg,r}return s=n.child,n=s.sibling,r=oi(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function sg(n,e){return e=yu({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function iu(n,e,t,r){return r!==null&&kd(r),to(e,n.child,null,t),n=sg(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function t8(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=Zd(Error(R(422))),iu(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=yu({mode:"visible",children:r.children},i,0,null),s=Fi(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&to(e,n.child,null,o),e.child.memoizedState=ig(o),e.memoizedState=rg,s);if(!(e.mode&1))return iu(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(R(419)),r=Zd(s,r,void 0),iu(n,e,o,r)}if(a=(o&n.childLanes)!==0,Rt||a){if(r=gt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,pr(n,i),_n(r,n,i,-1))}return xg(),r=Zd(Error(R(421))),iu(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=g8.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Wt=Yr(i.nextSibling),Ut=e,Ne=!0,An=null,n!==null&&(ln[cn++]=dr,ln[cn++]=gr,ln[cn++]=ki,dr=n.id,gr=n.overflow,ki=e),e=sg(e,r.children),e.flags|=4096,e)}function _S(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),Rd(n.return,e,t)}function og(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function NS(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(_t(n,e,r.children,t),r=Le.current,r&2)r=r&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_S(n,t,e);else if(n.tag===19)_S(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(Ee(Le,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&Qc(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),og(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&Qc(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}og(e,!0,t,null,s);break;case"together":og(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function su(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function yr(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),ji|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(R(153));if(e.child!==null){for(n=e.child,t=oi(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=oi(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function n8(n,e,t){switch(e.tag){case 3:OS(e),Qs();break;case 5:XC(e);break;case 1:Lt(e.type)&&Fc(e);break;case 4:Fd(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Ee(Uc,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Ee(Le,Le.current&1),e.flags|=128,null):t&e.child.childLanes?TS(n,e,t):(Ee(Le,Le.current&1),n=yr(n,e,t),n!==null?n.sibling:null);Ee(Le,Le.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return NS(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ee(Le,Le.current),r)break;return null;case 22:case 23:return e.lanes=0,PS(n,e,t)}return yr(n,e,t)}var kS,ag,IS,$S;kS=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}},ag=function(){},IS=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Li(Hn.current);var s=null;switch(t){case"input":i=Rf(n,i),r=Rf(n,r),s=[];break;case"select":i=$e({},i,{value:void 0}),r=$e({},r,{value:void 0}),s=[];break;case"textarea":i=Bf(n,i),r=Bf(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=Dc)}Ff(t,r);var o;t=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ea.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ea.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Me("scroll",n),s||a===l||(s=[])):(s=s||[]).push(c,l))}t&&(s=s||[]).push("style",t);var c=s;(e.updateQueue=c)&&(e.flags|=4)}},$S=function(n,e,t,r){t!==r&&(e.flags|=4)};function Ra(n,e){if(!Ne)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function Et(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function r8(n,e,t){var r=e.pendingProps;switch(Td(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(e),null;case 1:return Lt(e.type)&&zc(),Et(e),null;case 3:return r=e.stateNode,no(),Te($t),Te(St),Gd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(Hc(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,An!==null&&(vg(An),An=null))),ag(n,e),Et(e),null;case 5:Vd(e);var i=Li(Na.current);if(t=e.type,n!==null&&e.stateNode!=null)IS(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(R(166));return Et(e),null}if(n=Li(Hn.current),Hc(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[Gn]=e,r[Aa]=s,n=(e.mode&1)!==0,t){case"dialog":Me("cancel",r),Me("close",r);break;case"iframe":case"object":case"embed":Me("load",r);break;case"video":case"audio":for(i=0;i<Sa.length;i++)Me(Sa[i],r);break;case"source":Me("error",r);break;case"img":case"image":case"link":Me("error",r),Me("load",r);break;case"details":Me("toggle",r);break;case"input":dx(r,s),Me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Me("invalid",r);break;case"textarea":mx(r,s),Me("invalid",r)}Ff(t,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&jc(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&jc(r.textContent,a,n),i=["children",""+a]):ea.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Me("scroll",r)}switch(t){case"input":gc(r),px(r,s,!0);break;case"textarea":gc(r),vx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Dc)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=bx(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[Gn]=e,n[Aa]=r,kS(n,e,!1,!1),e.stateNode=n;e:{switch(o=Vf(t,r),t){case"dialog":Me("cancel",n),Me("close",n),i=r;break;case"iframe":case"object":case"embed":Me("load",n),i=r;break;case"video":case"audio":for(i=0;i<Sa.length;i++)Me(Sa[i],n);i=r;break;case"source":Me("error",n),i=r;break;case"img":case"image":case"link":Me("error",n),Me("load",n),i=r;break;case"details":Me("toggle",n),i=r;break;case"input":dx(n,r),i=Rf(n,r),Me("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=$e({},r,{value:void 0}),Me("invalid",n);break;case"textarea":mx(n,r),i=Bf(n,r),Me("invalid",n);break;default:i=r}Ff(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Cx(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&wx(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&ia(n,l):typeof l=="number"&&ia(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ea.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Me("scroll",n):l!=null&&Ef(n,s,l,o))}switch(t){case"input":gc(n),px(n,r,!1);break;case"textarea":gc(n),vx(n);break;case"option":r.value!=null&&n.setAttribute("value",""+Vr(r.value));break;case"select":n.multiple=!!r.multiple,s=r.value,s!=null?js(n,!!r.multiple,s,!1):r.defaultValue!=null&&js(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=Dc)}switch(t){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Et(e),null;case 6:if(n&&e.stateNode!=null)$S(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(R(166));if(t=Li(Na.current),Li(Hn.current),Hc(e)){if(r=e.stateNode,t=e.memoizedProps,r[Gn]=e,(s=r.nodeValue!==t)&&(n=Ut,n!==null))switch(n.tag){case 3:jc(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&jc(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[Gn]=e,e.stateNode=r}return Et(e),null;case 13:if(Te(Le),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ne&&Wt!==null&&e.mode&1&&!(e.flags&128))RC(),Qs(),e.flags|=98560,s=!1;else if(s=Hc(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(R(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(R(317));s[Gn]=e}else Qs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Et(e),s=!1}else An!==null&&(vg(An),An=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(r=r!==null,r!==(n!==null&&n.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(n===null||Le.current&1?at===0&&(at=3):xg())),e.updateQueue!==null&&(e.flags|=4),Et(e),null);case 4:return no(),ag(n,e),n===null&&Pa(e.stateNode.containerInfo),Et(e),null;case 10:return Ld(e.type._context),Et(e),null;case 17:return Lt(e.type)&&zc(),Et(e),null;case 19:if(Te(Le),s=e.memoizedState,s===null)return Et(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Ra(s,!1);else{if(at!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=Qc(n),o!==null){for(e.flags|=128,Ra(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=t,t=e.child;t!==null;)s=t,n=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Ee(Le,Le.current&1|2),e.child}n=n.sibling}s.tail!==null&&Ye()>oo&&(e.flags|=128,r=!0,Ra(s,!1),e.lanes=4194304)}else{if(!r)if(n=Qc(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ra(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ne)return Et(e),null}else 2*Ye()-s.renderingStartTime>oo&&t!==1073741824&&(e.flags|=128,r=!0,Ra(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ye(),e.sibling=null,t=Le.current,Ee(Le,r?t&1|2:t&1),e):(Et(e),null);case 22:case 23:return wg(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Xt&1073741824&&(Et(e),e.subtreeFlags&6&&(e.flags|=8192)):Et(e),null;case 24:return null;case 25:return null}throw Error(R(156,e.tag))}function i8(n,e){switch(Td(e),e.tag){case 1:return Lt(e.type)&&zc(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return no(),Te($t),Te(St),Gd(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return Vd(e),null;case 13:if(Te(Le),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(R(340));Qs()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Te(Le),null;case 4:return no(),null;case 10:return Ld(e.type._context),null;case 22:case 23:return wg(),null;case 24:return null;default:return null}}var ou=!1,At=!1,s8=typeof WeakSet=="function"?WeakSet:Set,G=null;function io(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){qe(n,e,r)}else t.current=null}function lg(n,e,t){try{t()}catch(r){qe(n,e,r)}}var LS=!1;function o8(n,e){if(wd=Ac,n=fC(),fd(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch(w){t=null;break e}var o=0,a=-1,l=-1,c=0,u=0,h=n,f=null;t:for(;;){for(var d;h!==t||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===n)break t;if(f===t&&++c===i&&(a=o),f===s&&++u===r&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(xd={focusedElem:n,selectionRange:t},Ac=!1,G=e;G!==null;)if(e=G,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,G=n;else for(;G!==null;){e=G;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,b=g.memoizedState,m=e.stateNode,v=m.getSnapshotBeforeUpdate(e.elementType===e.type?p:On(e.type,p),b);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(w){qe(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,G=n;break}G=e.return}return g=LS,LS=!1,g}function ja(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&lg(e,t,s)}i=i.next}while(i!==r)}}function au(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function cg(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function RS(n){var e=n.alternate;e!==null&&(n.alternate=null,RS(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Gn],delete e[Aa],delete e[Ed],delete e[VH],delete e[qH])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function jS(n){return n.tag===5||n.tag===3||n.tag===4}function DS(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||jS(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function ug(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Dc));else if(r!==4&&(n=n.child,n!==null))for(ug(n,e,t),n=n.sibling;n!==null;)ug(n,e,t),n=n.sibling}function hg(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(hg(n,e,t),n=n.sibling;n!==null;)hg(n,e,t),n=n.sibling}var bt=null,Mn=!1;function ti(n,e,t){for(t=t.child;t!==null;)BS(n,e,t),t=t.sibling}function BS(n,e,t){if(qn&&typeof qn.onCommitFiberUnmount=="function")try{qn.onCommitFiberUnmount(wc,t)}catch(a){}switch(t.tag){case 5:At||io(t,e);case 6:var r=bt,i=Mn;bt=null,ti(n,e,t),bt=r,Mn=i,bt!==null&&(Mn?(n=bt,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):bt.removeChild(t.stateNode));break;case 18:bt!==null&&(Mn?(n=bt,t=t.stateNode,n.nodeType===8?Pd(n.parentNode,t):n.nodeType===1&&Pd(n,t),pa(n)):Pd(bt,t.stateNode));break;case 4:r=bt,i=Mn,bt=t.stateNode.containerInfo,Mn=!0,ti(n,e,t),bt=r,Mn=i;break;case 0:case 11:case 14:case 15:if(!At&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&lg(t,e,o),i=i.next}while(i!==r)}ti(n,e,t);break;case 1:if(!At&&(io(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){qe(t,e,a)}ti(n,e,t);break;case 21:ti(n,e,t);break;case 22:t.mode&1?(At=(r=At)||t.memoizedState!==null,ti(n,e,t),At=r):ti(n,e,t);break;default:ti(n,e,t)}}function zS(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new s8),e.forEach(function(r){var i=p8.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Tn(n,e){var t=e.deletions;if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:bt=a.stateNode,Mn=!1;break e;case 3:bt=a.stateNode.containerInfo,Mn=!0;break e;case 4:bt=a.stateNode.containerInfo,Mn=!0;break e}a=a.return}if(bt===null)throw Error(R(160));BS(s,o,i),bt=null,Mn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){qe(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)FS(e,n),e=e.sibling}function FS(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Tn(e,n),Wn(n),r&4){try{ja(3,n,n.return),au(3,n)}catch(p){qe(n,n.return,p)}try{ja(5,n,n.return)}catch(p){qe(n,n.return,p)}}break;case 1:Tn(e,n),Wn(n),r&512&&t!==null&&io(t,t.return);break;case 5:if(Tn(e,n),Wn(n),r&512&&t!==null&&io(t,t.return),n.flags&32){var i=n.stateNode;try{ia(i,"")}catch(p){qe(n,n.return,p)}}if(r&4&&(i=n.stateNode,i!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&gx(i,s),Vf(a,o);var c=Vf(a,s);for(o=0;o<l.length;o+=2){var u=l[o],h=l[o+1];u==="style"?Cx(i,h):u==="dangerouslySetInnerHTML"?wx(i,h):u==="children"?ia(i,h):Ef(i,u,h,c)}switch(a){case"input":jf(i,s);break;case"textarea":yx(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var d=s.value;d!=null?js(i,!!s.multiple,d,!1):f!==!!s.multiple&&(s.defaultValue!=null?js(i,!!s.multiple,s.defaultValue,!0):js(i,!!s.multiple,s.multiple?[]:"",!1))}i[Aa]=s}catch(p){qe(n,n.return,p)}}break;case 6:if(Tn(e,n),Wn(n),r&4){if(n.stateNode===null)throw Error(R(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(p){qe(n,n.return,p)}}break;case 3:if(Tn(e,n),Wn(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{pa(e.containerInfo)}catch(p){qe(n,n.return,p)}break;case 4:Tn(e,n),Wn(n);break;case 13:Tn(e,n),Wn(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(gg=Ye())),r&4&&zS(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(At=(c=At)||u,Tn(e,n),At=c):Tn(e,n),Wn(n),r&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(G=n,u=n.child;u!==null;){for(h=G=u;G!==null;){switch(f=G,d=f.child,f.tag){case 0:case 11:case 14:case 15:ja(4,f,f.return);break;case 1:io(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,t=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(p){qe(r,t,p)}}break;case 5:io(f,f.return);break;case 22:if(f.memoizedState!==null){GS(h);continue}}d!==null?(d.return=f,G=d):GS(h)}u=u.sibling}e:for(u=null,h=n;;){if(h.tag===5){if(u===null){u=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=xx("display",o))}catch(p){qe(n,n.return,p)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(p){qe(n,n.return,p)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===n)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Tn(e,n),Wn(n),r&4&&zS(n);break;case 21:break;default:Tn(e,n),Wn(n)}}function Wn(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(jS(t)){var r=t;break e}t=t.return}throw Error(R(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ia(i,""),r.flags&=-33);var s=DS(n);hg(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=DS(n);ug(n,a,o);break;default:throw Error(R(161))}}catch(l){qe(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function a8(n,e,t){G=n,VS(n)}function VS(n,e,t){for(var r=(n.mode&1)!==0;G!==null;){var i=G,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||ou;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||At;a=ou;var c=At;if(ou=o,(At=l)&&!c)for(G=i;G!==null;)o=G,l=o.child,o.tag===22&&o.memoizedState!==null?HS(i):l!==null?(l.return=o,G=l):HS(i);for(;s!==null;)G=s,VS(s),s=s.sibling;G=i,ou=a,At=c}qS(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,G=s):qS(n)}}function qS(n){for(;G!==null;){var e=G;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:At||au(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!At)if(t===null)r.componentDidMount();else{var i=e.elementType===e.type?t.memoizedProps:On(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&zC(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}zC(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&pa(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}At||e.flags&512&&cg(e)}catch(f){qe(e,e.return,f)}}if(e===n){G=null;break}if(t=e.sibling,t!==null){t.return=e.return,G=t;break}G=e.return}}function GS(n){for(;G!==null;){var e=G;if(e===n){G=null;break}var t=e.sibling;if(t!==null){t.return=e.return,G=t;break}G=e.return}}function HS(n){for(;G!==null;){var e=G;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{au(4,e)}catch(l){qe(e,t,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){qe(e,i,l)}}var s=e.return;try{cg(e)}catch(l){qe(e,s,l)}break;case 5:var o=e.return;try{cg(e)}catch(l){qe(e,o,l)}}}catch(l){qe(e,e.return,l)}if(e===n){G=null;break}var a=e.sibling;if(a!==null){a.return=e.return,G=a;break}G=e.return}}var l8=Math.ceil,lu=ur.ReactCurrentDispatcher,fg=ur.ReactCurrentOwner,fn=ur.ReactCurrentBatchConfig,he=0,gt=null,tt=null,wt=0,Xt=0,so=Kr(0),at=0,Da=null,ji=0,cu=0,dg=0,Ba=null,jt=null,gg=0,oo=1/0,vr=null,uu=!1,pg=null,ni=null,hu=!1,ri=null,fu=0,za=0,mg=null,du=-1,gu=0;function Nt(){return he&6?Ye():du!==-1?du:du=Ye()}function ii(n){return n.mode&1?he&2&&wt!==0?wt&-wt:HH.transition!==null?(gu===0&&(gu=jx()),gu):(n=ye,n!==0||(n=window.event,n=n===void 0?16:Ux(n.type)),n):1}function _n(n,e,t,r){if(50<za)throw za=0,mg=null,Error(R(185));ua(n,t,r),(!(he&2)||n!==gt)&&(n===gt&&(!(he&2)&&(cu|=t),at===4&&si(n,wt)),Dt(n,r),t===1&&he===0&&!(e.mode&1)&&(oo=Ye()+500,Vc&&Qr()))}function Dt(n,e){var t=n.callbackNode;HG(n,e);var r=Sc(n,n===gt?wt:0);if(r===0)t!==null&&$x(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&$x(t),e===1)n.tag===0?GH(WS.bind(null,n)):NC(WS.bind(null,n)),zH(function(){!(he&6)&&Qr()}),t=null;else{switch(Dx(r)){case 1:t=Yf;break;case 4:t=Lx;break;case 16:t=bc;break;case 536870912:t=Rx;break;default:t=bc}t=tP(t,US.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function US(n,e){if(du=-1,gu=0,he&6)throw Error(R(327));var t=n.callbackNode;if(ao()&&n.callbackNode!==t)return null;var r=Sc(n,n===gt?wt:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=pu(n,r);else{e=r;var i=he;he|=2;var s=YS();(gt!==n||wt!==e)&&(vr=null,oo=Ye()+500,Bi(n,e));do try{h8();break}catch(a){XS(n,a)}while(!0);$d(),lu.current=s,he=i,tt!==null?e=0:(gt=null,wt=0,e=at)}if(e!==0){if(e===2&&(i=Kf(n),i!==0&&(r=i,e=yg(n,i))),e===1)throw t=Da,Bi(n,0),si(n,r),Dt(n,Ye()),t;if(e===6)si(n,r);else{if(i=n.current.alternate,!(r&30)&&!c8(i)&&(e=pu(n,r),e===2&&(s=Kf(n),s!==0&&(r=s,e=yg(n,s))),e===1))throw t=Da,Bi(n,0),si(n,r),Dt(n,Ye()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(R(345));case 2:zi(n,jt,vr);break;case 3:if(si(n,r),(r&130023424)===r&&(e=gg+500-Ye(),10<e)){if(Sc(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){Nt(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=Sd(zi.bind(null,n,jt,vr),e);break}zi(n,jt,vr);break;case 4:if(si(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-Pn(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*l8(r/1960))-r,10<r){n.timeoutHandle=Sd(zi.bind(null,n,jt,vr),r);break}zi(n,jt,vr);break;case 5:zi(n,jt,vr);break;default:throw Error(R(329))}}}return Dt(n,Ye()),n.callbackNode===t?US.bind(null,n):null}function yg(n,e){var t=Ba;return n.current.memoizedState.isDehydrated&&(Bi(n,e).flags|=256),n=pu(n,e),n!==2&&(e=jt,jt=t,e!==null&&vg(e)),n}function vg(n){jt===null?jt=n:jt.push.apply(jt,n)}function c8(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var r=0;r<t.length;r++){var i=t[r],s=i.getSnapshot;i=i.value;try{if(!En(s(),i))return!1}catch(o){return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function si(n,e){for(e&=~dg,e&=~cu,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Pn(e),r=1<<t;n[t]=-1,e&=~r}}function WS(n){if(he&6)throw Error(R(327));ao();var e=Sc(n,0);if(!(e&1))return Dt(n,Ye()),null;var t=pu(n,e);if(n.tag!==0&&t===2){var r=Kf(n);r!==0&&(e=r,t=yg(n,r))}if(t===1)throw t=Da,Bi(n,0),si(n,e),Dt(n,Ye()),t;if(t===6)throw Error(R(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,zi(n,jt,vr),Dt(n,Ye()),null}function bg(n,e){var t=he;he|=1;try{return n(e)}finally{he=t,he===0&&(oo=Ye()+500,Vc&&Qr())}}function Di(n){ri!==null&&ri.tag===0&&!(he&6)&&ao();var e=he;he|=1;var t=fn.transition,r=ye;try{if(fn.transition=null,ye=1,n)return n()}finally{ye=r,fn.transition=t,he=e,!(he&6)&&Qr()}}function wg(){Xt=so.current,Te(so)}function Bi(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,BH(t)),tt!==null)for(t=tt.return;t!==null;){var r=t;switch(Td(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&zc();break;case 3:no(),Te($t),Te(St),Gd();break;case 5:Vd(r);break;case 4:no();break;case 13:Te(Le);break;case 19:Te(Le);break;case 10:Ld(r.type._context);break;case 22:case 23:wg()}t=t.return}if(gt=n,tt=n=oi(n.current,null),wt=Xt=e,at=0,Da=null,dg=cu=ji=0,jt=Ba=null,$i!==null){for(e=0;e<$i.length;e++)if(t=$i[e],r=t.interleaved,r!==null){t.interleaved=null;var i=r.next,s=t.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}t.pending=r}$i=null}return n}function XS(n,e){do{var t=tt;try{if($d(),Zc.current=ru,eu){for(var r=Re.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}eu=!1}if(Ri=0,dt=ot=Re=null,ka=!1,Ia=0,fg.current=null,t===null||t.return===null){at=1,Da=e,tt=null;break}e:{var s=n,o=t.return,a=t,l=e;if(e=wt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var d=bS(o);if(d!==null){d.flags&=-257,wS(d,o,a,s,e),d.mode&1&&vS(s,c,e),e=d,l=c;var g=e.updateQueue;if(g===null){var p=new Set;p.add(l),e.updateQueue=p}else g.add(l);break e}else{if(!(e&1)){vS(s,c,e),xg();break e}l=Error(R(426))}}else if(Ne&&a.mode&1){var b=bS(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),wS(b,o,a,s,e),kd(ro(l,a));break e}}s=l=ro(l,a),at!==4&&(at=2),Ba===null?Ba=[s]:Ba.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=mS(s,l,e);BC(s,m);break e;case 1:a=l;var v=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ni===null||!ni.has(y)))){s.flags|=65536,e&=-e,s.lanes|=e;var w=yS(s,a,e);BC(s,w);break e}}s=s.return}while(s!==null)}JS(t)}catch(x){e=x,tt===t&&t!==null&&(tt=t=t.return);continue}break}while(!0)}function YS(){var n=lu.current;return lu.current=ru,n===null?ru:n}function xg(){(at===0||at===3||at===2)&&(at=4),gt===null||!(ji&268435455)&&!(cu&268435455)||si(gt,wt)}function pu(n,e){var t=he;he|=2;var r=YS();(gt!==n||wt!==e)&&(vr=null,Bi(n,e));do try{u8();break}catch(i){XS(n,i)}while(!0);if($d(),he=t,lu.current=r,tt!==null)throw Error(R(261));return gt=null,wt=0,at}function u8(){for(;tt!==null;)KS(tt)}function h8(){for(;tt!==null&&!RG();)KS(tt)}function KS(n){var e=eP(n.alternate,n,Xt);n.memoizedProps=n.pendingProps,e===null?JS(n):tt=e,fg.current=null}function JS(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=i8(t,e),t!==null){t.flags&=32767,tt=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{at=6,tt=null;return}}else if(t=r8(t,e,Xt),t!==null){tt=t;return}if(e=e.sibling,e!==null){tt=e;return}tt=e=n}while(e!==null);at===0&&(at=5)}function zi(n,e,t){var r=ye,i=fn.transition;try{fn.transition=null,ye=1,f8(n,e,t,r)}finally{fn.transition=i,ye=r}return null}function f8(n,e,t,r){do ao();while(ri!==null);if(he&6)throw Error(R(327));t=n.finishedWork;var i=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(R(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(UG(n,s),n===gt&&(tt=gt=null,wt=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||hu||(hu=!0,tP(bc,function(){return ao(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=fn.transition,fn.transition=null;var o=ye;ye=1;var a=he;he|=4,fg.current=null,o8(n,t),FS(t,n),kH(xd),Ac=!!wd,xd=wd=null,n.current=t,a8(t),jG(),he=a,ye=o,fn.transition=s}else n.current=t;if(hu&&(hu=!1,ri=n,fu=i),s=n.pendingLanes,s===0&&(ni=null),zG(t.stateNode),Dt(n,Ye()),e!==null)for(r=n.onRecoverableError,t=0;t<e.length;t++)i=e[t],r(i.value,{componentStack:i.stack,digest:i.digest});if(uu)throw uu=!1,n=pg,pg=null,n;return fu&1&&n.tag!==0&&ao(),s=n.pendingLanes,s&1?n===mg?za++:(za=0,mg=n):za=0,Qr(),null}function ao(){if(ri!==null){var n=Dx(fu),e=fn.transition,t=ye;try{if(fn.transition=null,ye=16>n?16:n,ri===null)var r=!1;else{if(n=ri,ri=null,fu=0,he&6)throw Error(R(331));var i=he;for(he|=4,G=n.current;G!==null;){var s=G,o=s.child;if(G.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(G=c;G!==null;){var u=G;switch(u.tag){case 0:case 11:case 15:ja(8,u,s)}var h=u.child;if(h!==null)h.return=u,G=h;else for(;G!==null;){u=G;var f=u.sibling,d=u.return;if(RS(u),u===c){G=null;break}if(f!==null){f.return=d,G=f;break}G=d}}}var g=s.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var b=p.sibling;p.sibling=null,p=b}while(p!==null)}}G=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,G=o;else e:for(;G!==null;){if(s=G,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ja(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,G=m;break e}G=s.return}}var v=n.current;for(G=v;G!==null;){o=G;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,G=y;else e:for(o=v;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:au(9,a)}}catch(x){qe(a,a.return,x)}if(a===o){G=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,G=w;break e}G=a.return}}if(he=i,Qr(),qn&&typeof qn.onPostCommitFiberRoot=="function")try{qn.onPostCommitFiberRoot(wc,n)}catch(x){}r=!0}return r}finally{ye=t,fn.transition=e}}return!1}function QS(n,e,t){e=ro(t,e),e=mS(n,e,1),n=ei(n,e,1),e=Nt(),n!==null&&(ua(n,1,e),Dt(n,e))}function qe(n,e,t){if(n.tag===3)QS(n,n,t);else for(;e!==null;){if(e.tag===3){QS(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ni===null||!ni.has(r))){n=ro(t,n),n=yS(e,n,1),e=ei(e,n,1),n=Nt(),e!==null&&(ua(e,1,n),Dt(e,n));break}}e=e.return}}function d8(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=Nt(),n.pingedLanes|=n.suspendedLanes&t,gt===n&&(wt&t)===t&&(at===4||at===3&&(wt&130023424)===wt&&500>Ye()-gg?Bi(n,0):dg|=t),Dt(n,e)}function ZS(n,e){e===0&&(n.mode&1?(e=Cc,Cc<<=1,!(Cc&130023424)&&(Cc=4194304)):e=1);var t=Nt();n=pr(n,e),n!==null&&(ua(n,e,t),Dt(n,t))}function g8(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),ZS(n,t)}function p8(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(e),ZS(n,t)}var eP;eP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||$t.current)Rt=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Rt=!1,n8(n,e,t);Rt=!!(n.flags&131072)}else Rt=!1,Ne&&e.flags&1048576&&kC(e,Gc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;su(n,e),n=e.pendingProps;var i=Ys(e,St.current);eo(e,t),i=Wd(null,e,r,n,i,t);var s=Xd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Lt(r)?(s=!0,Fc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dd(e),i.updater=Kc,e.stateNode=i,i._reactInternals=e,zd(e,r,n,t),e=ng(null,e,r,!0,s,t)):(e.tag=0,Ne&&s&&Md(e),_t(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(su(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=y8(r),n=On(r,n),i){case 0:e=tg(null,e,r,n,t);break e;case 1:e=AS(null,e,r,n,t);break e;case 11:e=xS(null,e,r,n,t);break e;case 14:e=CS(null,e,r,On(r.type,n),t);break e}throw Error(R(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:On(r,i),tg(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:On(r,i),AS(n,e,r,i,t);case 3:e:{if(OS(e),n===null)throw Error(R(387));r=e.pendingProps,s=e.memoizedState,i=s.element,DC(n,e),Yc(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=ro(Error(R(423)),e),e=MS(n,e,r,t,i);break e}else if(r!==i){i=ro(Error(R(424)),e),e=MS(n,e,r,t,i);break e}else for(Wt=Yr(e.stateNode.containerInfo.firstChild),Ut=e,Ne=!0,An=null,t=WC(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Qs(),r===i){e=yr(n,e,t);break e}_t(n,e,r,t)}e=e.child}return e;case 5:return XC(e),n===null&&Nd(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,Cd(r,i)?o=null:s!==null&&Cd(r,s)&&(e.flags|=32),ES(n,e),_t(n,e,o,t),e.child;case 6:return n===null&&Nd(e),null;case 13:return TS(n,e,t);case 4:return Fd(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=to(e,null,r,t):_t(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:On(r,i),xS(n,e,r,i,t);case 7:return _t(n,e,e.pendingProps,t),e.child;case 8:return _t(n,e,e.pendingProps.children,t),e.child;case 12:return _t(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Ee(Uc,r._currentValue),r._currentValue=o,s!==null)if(En(s.value,o)){if(s.children===i.children&&!$t.current){e=yr(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=mr(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Rd(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(R(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Rd(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_t(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,eo(e,t),i=un(i),r=r(i),e.flags|=1,_t(n,e,r,t),e.child;case 14:return r=e.type,i=On(r,e.pendingProps),i=On(r.type,i),CS(n,e,r,i,t);case 15:return SS(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:On(r,i),su(n,e),e.tag=1,Lt(r)?(n=!0,Fc(e)):n=!1,eo(e,t),qC(e,r,i),zd(e,r,i,t),ng(null,e,r,!0,n,t);case 19:return NS(n,e,t);case 22:return PS(n,e,t)}throw Error(R(156,e.tag))};function tP(n,e){return Ix(n,e)}function m8(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(n,e,t,r){return new m8(n,e,t,r)}function Cg(n){return n=n.prototype,!(!n||!n.isReactComponent)}function y8(n){if(typeof n=="function")return Cg(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Mf)return 11;if(n===Nf)return 14}return 2}function oi(n,e){var t=n.alternate;return t===null?(t=dn(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function mu(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")Cg(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Rs:return Fi(t.children,i,s,e);case Af:o=8,i|=8;break;case Of:return n=dn(12,t,e,i|2),n.elementType=Of,n.lanes=s,n;case Tf:return n=dn(13,t,e,i),n.elementType=Tf,n.lanes=s,n;case _f:return n=dn(19,t,e,i),n.elementType=_f,n.lanes=s,n;case cx:return yu(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case ax:o=10;break e;case lx:o=9;break e;case Mf:o=11;break e;case Nf:o=14;break e;case Fr:o=16,r=null;break e}throw Error(R(130,n==null?n:typeof n,""))}return e=dn(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function Fi(n,e,t,r){return n=dn(7,n,r,e),n.lanes=t,n}function yu(n,e,t,r){return n=dn(22,n,r,e),n.elementType=cx,n.lanes=t,n.stateNode={isHidden:!1},n}function Sg(n,e,t){return n=dn(6,n,null,e),n.lanes=t,n}function Pg(n,e,t){return e=dn(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function v8(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jf(0),this.expirationTimes=Jf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Eg(n,e,t,r,i,s,o,a,l){return n=new v8(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=dn(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dd(s),n}function b8(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ls,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function nP(n){if(!n)return Jr;n=n._reactInternals;e:{if(Ti(n)!==n||n.tag!==1)throw Error(R(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Lt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(R(171))}if(n.tag===1){var t=n.type;if(Lt(t))return TC(n,t,e)}return e}function rP(n,e,t,r,i,s,o,a,l){return n=Eg(t,r,!0,n,i,s,o,a,l),n.context=nP(null),t=n.current,r=Nt(),i=ii(t),s=mr(r,i),s.callback=e!=null?e:null,ei(t,s,i),n.current.lanes=i,ua(n,i,r),Dt(n,r),n}function vu(n,e,t,r){var i=e.current,s=Nt(),o=ii(i);return t=nP(t),e.context===null?e.context=t:e.pendingContext=t,e=mr(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=ei(i,e,o),n!==null&&(_n(n,i,o,s),Xc(n,i,o)),o}function bu(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function iP(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Ag(n,e){iP(n,e),(n=n.alternate)&&iP(n,e)}function w8(){return null}var sP=typeof reportError=="function"?reportError:function(n){console.error(n)};function Og(n){this._internalRoot=n}wu.prototype.render=Og.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(R(409));vu(n,e,null,null)},wu.prototype.unmount=Og.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;Di(function(){vu(null,n,null,null)}),e[hr]=null}};function wu(n){this._internalRoot=n}wu.prototype.unstable_scheduleHydration=function(n){if(n){var e=Fx();n={blockedOn:null,target:n,priority:e};for(var t=0;t<Ur.length&&e!==0&&e<Ur[t].priority;t++);Ur.splice(t,0,n),t===0&&Gx(n)}};function Mg(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function xu(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function oP(){}function x8(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=bu(o);s.call(c)}}var o=rP(e,r,n,0,null,!1,!1,"",oP);return n._reactRootContainer=o,n[hr]=o.current,Pa(n.nodeType===8?n.parentNode:n),Di(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=bu(l);a.call(c)}}var l=Eg(n,0,!1,null,null,!1,!1,"",oP);return n._reactRootContainer=l,n[hr]=l.current,Pa(n.nodeType===8?n.parentNode:n),Di(function(){vu(e,l,t,r)}),l}function Cu(n,e,t,r,i){var s=t._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=bu(o);a.call(l)}}vu(e,o,n,i)}else o=x8(t,e,n,i,r);return bu(o)}Bx=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=ca(e.pendingLanes);t!==0&&(Qf(e,t|1),Dt(e,Ye()),!(he&6)&&(oo=Ye()+500,Qr()))}break;case 13:Di(function(){var r=pr(n,1);if(r!==null){var i=Nt();_n(r,n,1,i)}}),Ag(n,1)}},Zf=function(n){if(n.tag===13){var e=pr(n,134217728);if(e!==null){var t=Nt();_n(e,n,134217728,t)}Ag(n,134217728)}},zx=function(n){if(n.tag===13){var e=ii(n),t=pr(n,e);if(t!==null){var r=Nt();_n(t,n,e,r)}Ag(n,e)}},Fx=function(){return ye},Vx=function(n,e){var t=ye;try{return ye=n,e()}finally{ye=t}},Hf=function(n,e,t){switch(e){case"input":if(jf(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var r=t[e];if(r!==n&&r.form===n.form){var i=Bc(r);if(!i)throw Error(R(90));fx(r),jf(r,i)}}}break;case"textarea":yx(n,t);break;case"select":e=t.value,e!=null&&js(n,!!t.multiple,e,!1)}},Ax=bg,Ox=Di;var C8={usingClientEntryPoint:!1,Events:[Oa,Ws,Bc,Px,Ex,bg]},Fa={findFiberByHostInstance:_i,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},S8={bundleType:Fa.bundleType,version:Fa.version,rendererPackageName:Fa.rendererPackageName,rendererConfig:Fa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ur.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=Nx(n),n===null?null:n.stateNode},findFiberByHostInstance:Fa.findFiberByHostInstance||w8,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{wc=Su.inject(S8),qn=Su}catch(n){}}qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C8,qt.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mg(e))throw Error(R(200));return b8(n,e,null,t)},qt.createRoot=function(n,e){if(!Mg(n))throw Error(R(299));var t=!1,r="",i=sP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Eg(n,1,!1,null,null,t,!1,r,i),n[hr]=e.current,Pa(n.nodeType===8?n.parentNode:n),new Og(e)},qt.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(R(188)):(n=Object.keys(n).join(","),Error(R(268,n)));return n=Nx(e),n=n===null?null:n.stateNode,n},qt.flushSync=function(n){return Di(n)},qt.hydrate=function(n,e,t){if(!xu(e))throw Error(R(200));return Cu(null,n,e,!0,t)},qt.hydrateRoot=function(n,e,t){if(!Mg(n))throw Error(R(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=sP;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=rP(e,null,n,1,t!=null?t:null,i,!1,s,o),n[hr]=e.current,Pa(n),r)for(n=0;n<r.length;n++)t=r[n],i=t._getVersion,i=i(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,i]:e.mutableSourceEagerHydrationData.push(t,i);return new wu(e)},qt.render=function(n,e,t){if(!xu(e))throw Error(R(200));return Cu(null,n,e,!1,t)},qt.unmountComponentAtNode=function(n){if(!xu(n))throw Error(R(40));return n._reactRootContainer?(Di(function(){Cu(null,null,n,!1,function(){n._reactRootContainer=null,n[hr]=null})}),!0):!1},qt.unstable_batchedUpdates=bg,qt.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!xu(t))throw Error(R(200));if(n==null||n._reactInternals===void 0)throw Error(R(38));return Cu(n,e,t,!1,r)},qt.version="18.2.0-next-9e3b772b8-20220608";function aP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aP)}catch(n){console.error(n)}}aP(),ex.exports=qt;var lP=ex.exports,cP,uP=lP;cP=uP.createRoot,uP.hydrateRoot;var lo;(function(n){let e=!1,t;const r=(l,c)=>{const u=c.payload;switch(c.type){case"add":{const h=l.findIndex(f=>f.id===u.id);return h>=0?(l[h]=u,[...l]):[...l,u]}case"remove":{const h=l.findIndex(f=>f.id===u.id);if(h>=0){const f=[...l];return f.splice(h,1),f}break}}return l};function i(l,c){e&&t({type:"add",payload:{id:l,portal:c}})}n.connect=i;function s(l){e&&t({type:"remove",payload:{id:l}})}n.disconnect=s;function o(){return e}n.isActive=o;function a(){return()=>{e=!0;const[l,c]=ee.useReducer(r,[]);return t=c,ee.createElement(ee.Fragment,{children:l.map(u=>u.portal)})}}n.getProvider=a})(lo||(lo={}));var P8=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const Tg={};function E8(n){const{shape:e,component:t,effect:r,inherit:i}=n,s=P8(n,["shape","component","effect","inherit"]);if(!e)throw new Error("should specify shape in config");Tg[e]={component:t,effect:r},V.registerNode(e,Object.assign({inherit:i||"react-shape"},s),!0)}class A8 extends ee.PureComponent{constructor(e){super(e),this.state={tick:0}}componentDidMount(){const{node:e}=this.props;e.on("change:*",({key:t})=>{const r=Tg[e.shape];if(r){const{effect:i}=r;(!i||i.includes(t))&&this.setState({tick:this.state.tick+1})}})}clone(e){const{node:t,graph:r}=this.props;return typeof e.type=="string"?ee.cloneElement(e):ee.cloneElement(e,{node:t,graph:r})}render(){const{node:e}=this.props,t=Tg[e.shape];if(!t)return null;const{component:r}=t;if(ee.isValidElement(r))return this.clone(r);const i=r;return this.clone(ee.createElement(i,null))}}class Pu extends kt{targetId(){return`${this.graph.view.cid}:${this.cell.id}`}getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(e){const t=super.confirmUpdate(e);return this.handleAction(t,Pu.action,()=>{this.renderReactComponent()})}renderReactComponent(){this.unmountReactComponent();const e=this.getComponentContainer(),t=this.cell;if(e){const r=ee.createElement(A8,{node:t,graph:this.graph});if(lo.isActive()){const i=lP.createPortal(r,e);lo.connect(this.targetId(),i)}else this.root=cP(e),this.root.render(r)}}unmountReactComponent(){this.getComponentContainer()&&this.root&&(this.root.unmount(),this.root=void 0)}onMouseDown(e,t,r){const i=e.target;if(i.tagName.toLowerCase()==="input"){const o=i.getAttribute("type");if(o==null||["text","password","number","email","search","tel","url"].includes(o))return}super.onMouseDown(e,t,r)}unmount(){return lo.isActive()&&lo.disconnect(this.targetId()),this.unmountReactComponent(),super.unmount(),this}}(function(n){n.action="react",n.config({bootstrap:[n.action],actions:{component:n.action}}),kt.registry.register("react-shape-view",n,!0)})(Pu||(Pu={}));function _g(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ng,hP;function O8(){if(hP)return Ng;hP=1;var n=Gv,e=4;function t(r){return n(r,e)}return Ng=t,Ng}var kg,fP;function Ig(){if(fP)return kg;fP=1;function n(e){return function(){return e}}return kg=n,kg}var $g,dP;function M8(){if(dP)return $g;dP=1;function n(e){return function(t,r,i){for(var s=-1,o=Object(t),a=i(t),l=a.length;l--;){var c=a[e?l:++s];if(r(o[c],c,o)===!1)break}return t}}return $g=n,$g}var Lg,gP;function Rg(){if(gP)return Lg;gP=1;var n=M8(),e=n();return Lg=e,Lg}var jg,pP;function Dg(){if(pP)return jg;pP=1;var n=Rg(),e=Er;function t(r,i){return r&&n(r,i,e)}return jg=t,jg}var Bg,mP;function T8(){if(mP)return Bg;mP=1;var n=Yn;function e(t,r){return function(i,s){if(i==null)return i;if(!n(i))return t(i,s);for(var o=i.length,a=r?o:-1,l=Object(i);(r?a--:++a<o)&&s(l[a],a,l)!==!1;);return i}}return Bg=e,Bg}var zg,yP;function Eu(){if(yP)return zg;yP=1;var n=Dg(),e=T8(),t=e(n);return zg=t,zg}var Fg,vP;function Vi(){if(vP)return Fg;vP=1;function n(e){return e}return Fg=n,Fg}var Vg,bP;function wP(){if(bP)return Vg;bP=1;var n=Vi();function e(t){return typeof t=="function"?t:n}return Vg=e,Vg}var qg,xP;function CP(){if(xP)return qg;xP=1;var n=Ku,e=Eu(),t=wP(),r=Qe;function i(s,o){var a=r(s)?n:e;return a(s,t(o))}return qg=i,qg}var Gg,SP;function PP(){return SP||(SP=1,Gg=CP()),Gg}var Hg,EP;function _8(){if(EP)return Hg;EP=1;var n=Eu();function e(t,r){var i=[];return n(t,function(s,o,a){r(s,o,a)&&i.push(s)}),i}return Hg=e,Hg}var Ug,AP;function N8(){if(AP)return Ug;AP=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return Ug=e,Ug}var Wg,OP;function k8(){if(OP)return Wg;OP=1;function n(e){return this.__data__.has(e)}return Wg=n,Wg}var Xg,MP;function TP(){if(MP)return Xg;MP=1;var n=Yu,e=N8(),t=k8();function r(i){var s=-1,o=i==null?0:i.length;for(this.__data__=new n;++s<o;)this.add(i[s])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,Xg=r,Xg}var Yg,_P;function I8(){if(_P)return Yg;_P=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}return Yg=n,Yg}var Kg,NP;function kP(){if(NP)return Kg;NP=1;function n(e,t){return e.has(t)}return Kg=n,Kg}var Jg,IP;function $P(){if(IP)return Jg;IP=1;var n=TP(),e=I8(),t=kP(),r=1,i=2;function s(o,a,l,c,u,h){var f=l&r,d=o.length,g=a.length;if(d!=g&&!(f&&g>d))return!1;var p=h.get(o),b=h.get(a);if(p&&b)return p==a&&b==o;var m=-1,v=!0,y=l&i?new n:void 0;for(h.set(o,a),h.set(a,o);++m<d;){var w=o[m],x=a[m];if(c)var C=f?c(x,w,m,a,o,h):c(w,x,m,o,a,h);if(C!==void 0){if(C)continue;v=!1;break}if(y){if(!e(a,function(S,E){if(!t(y,E)&&(w===S||u(w,S,l,c,h)))return y.push(E)})){v=!1;break}}else if(!(w===x||u(w,x,l,c,h))){v=!1;break}}return h.delete(o),h.delete(a),v}return Jg=s,Jg}var Qg,LP;function $8(){if(LP)return Qg;LP=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}return Qg=n,Qg}var Zg,RP;function ep(){if(RP)return Zg;RP=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return Zg=n,Zg}var tp,jP;function L8(){if(jP)return tp;jP=1;var n=Xi,e=Mv,t=Ui,r=$P(),i=$8(),s=ep(),o=1,a=2,l="[object Boolean]",c="[object Date]",u="[object Error]",h="[object Map]",f="[object Number]",d="[object RegExp]",g="[object Set]",p="[object String]",b="[object Symbol]",m="[object ArrayBuffer]",v="[object DataView]",y=n?n.prototype:void 0,w=y?y.valueOf:void 0;function x(C,S,E,A,M,O,I){switch(E){case v:if(C.byteLength!=S.byteLength||C.byteOffset!=S.byteOffset)return!1;C=C.buffer,S=S.buffer;case m:return!(C.byteLength!=S.byteLength||!O(new e(C),new e(S)));case l:case c:case f:return t(+C,+S);case u:return C.name==S.name&&C.message==S.message;case d:case p:return C==S+"";case h:var q=i;case g:var U=A&o;if(q||(q=s),C.size!=S.size&&!U)return!1;var T=I.get(C);if(T)return T==S;A|=a,I.set(C,S);var k=r(q(C),q(S),A,M,O,I);return I.delete(C),k;case b:if(w)return w.call(C)==w.call(S)}return!1}return tp=x,tp}var np,DP;function R8(){if(DP)return np;DP=1;var n=wv,e=1,t=Object.prototype,r=t.hasOwnProperty;function i(s,o,a,l,c,u){var h=a&e,f=n(s),d=f.length,g=n(o),p=g.length;if(d!=p&&!h)return!1;for(var b=d;b--;){var m=f[b];if(!(h?m in o:r.call(o,m)))return!1}var v=u.get(s),y=u.get(o);if(v&&y)return v==o&&y==s;var w=!0;u.set(s,o),u.set(o,s);for(var x=h;++b<d;){m=f[b];var C=s[m],S=o[m];if(l)var E=h?l(S,C,m,o,s,u):l(C,S,m,s,o,u);if(!(E===void 0?C===S||c(C,S,a,l,u):E)){w=!1;break}x||(x=m=="constructor")}if(w&&!x){var A=s.constructor,M=o.constructor;A!=M&&"constructor"in s&&"constructor"in o&&!(typeof A=="function"&&A instanceof A&&typeof M=="function"&&M instanceof M)&&(w=!1)}return u.delete(s),u.delete(o),w}return np=i,np}var rp,BP;function j8(){if(BP)return rp;BP=1;var n=rl,e=$P(),t=L8(),r=R8(),i=es,s=Qe,o=Qi,a=bo,l=1,c="[object Arguments]",u="[object Array]",h="[object Object]",f=Object.prototype,d=f.hasOwnProperty;function g(p,b,m,v,y,w){var x=s(p),C=s(b),S=x?u:i(p),E=C?u:i(b);S=S==c?h:S,E=E==c?h:E;var A=S==h,M=E==h,O=S==E;if(O&&o(p)){if(!o(b))return!1;x=!0,A=!1}if(O&&!A)return w||(w=new n),x||a(p)?e(p,b,m,v,y,w):t(p,b,S,m,v,y,w);if(!(m&l)){var I=A&&d.call(p,"__wrapped__"),q=M&&d.call(b,"__wrapped__");if(I||q){var U=I?p.value():p,T=q?b.value():b;return w||(w=new n),y(U,T,m,v,w)}}return O?(w||(w=new n),r(p,b,m,v,y,w)):!1}return rp=g,rp}var ip,zP;function FP(){if(zP)return ip;zP=1;var n=j8(),e=Rn;function t(r,i,s,o,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:n(r,i,s,o,t,a)}return ip=t,ip}var sp,VP;function D8(){if(VP)return sp;VP=1;var n=rl,e=FP(),t=1,r=2;function i(s,o,a,l){var c=a.length,u=c,h=!l;if(s==null)return!u;for(s=Object(s);c--;){var f=a[c];if(h&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++c<u;){f=a[c];var d=f[0],g=s[d],p=f[1];if(h&&f[2]){if(g===void 0&&!(d in s))return!1}else{var b=new n;if(l)var m=l(g,p,d,s,o,b);if(!(m===void 0?e(p,g,t|r,l,b):m))return!1}}return!0}return sp=i,sp}var op,qP;function GP(){if(qP)return op;qP=1;var n=Qt;function e(t){return t===t&&!n(t)}return op=e,op}var ap,HP;function B8(){if(HP)return ap;HP=1;var n=GP(),e=Er;function t(r){for(var i=e(r),s=i.length;s--;){var o=i[s],a=r[o];i[s]=[o,a,n(a)]}return i}return ap=t,ap}var lp,UP;function WP(){if(UP)return lp;UP=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return lp=n,lp}var cp,XP;function z8(){if(XP)return cp;XP=1;var n=D8(),e=B8(),t=WP();function r(i){var s=e(i);return s.length==1&&s[0][2]?t(s[0][0],s[0][1]):function(o){return o===i||n(o,i,s)}}return cp=r,cp}var up,YP;function co(){if(YP)return up;YP=1;var n=di,e=Rn,t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return up=r,up}var hp,KP;function fp(){if(KP)return hp;KP=1;var n=Qe,e=co(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,o){if(n(s))return!1;var a=typeof s;return a=="number"||a=="symbol"||a=="boolean"||s==null||e(s)?!0:r.test(s)||!t.test(s)||o!=null&&s in Object(o)}return hp=i,hp}var dp,JP;function F8(){if(JP)return dp;JP=1;var n=Yu,e="Expected a function";function t(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var s=function(){var o=arguments,a=i?i.apply(this,o):o[0],l=s.cache;if(l.has(a))return l.get(a);var c=r.apply(this,o);return s.cache=l.set(a,c)||l,c};return s.cache=new(t.Cache||n),s}return t.Cache=n,dp=t,dp}var gp,QP;function V8(){if(QP)return gp;QP=1;var n=F8(),e=500;function t(r){var i=n(r,function(o){return s.size===e&&s.clear(),o}),s=i.cache;return i}return gp=t,gp}var pp,ZP;function q8(){if(ZP)return pp;ZP=1;var n=V8(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(e,function(o,a,l,c){s.push(l?c.replace(t,"$1"):a||o)}),s});return pp=r,pp}var mp,eE;function Au(){if(eE)return mp;eE=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}return mp=n,mp}var yp,tE;function G8(){if(tE)return yp;tE=1;var n=Xi,e=Au(),t=Qe,r=co(),i=1/0,s=n?n.prototype:void 0,o=s?s.toString:void 0;function a(l){if(typeof l=="string")return l;if(t(l))return e(l,a)+"";if(r(l))return o?o.call(l):"";var c=l+"";return c=="0"&&1/l==-i?"-0":c}return yp=a,yp}var vp,nE;function rE(){if(nE)return vp;nE=1;var n=G8();function e(t){return t==null?"":n(t)}return vp=e,vp}var bp,iE;function Ou(){if(iE)return bp;iE=1;var n=Qe,e=fp(),t=q8(),r=rE();function i(s,o){return n(s)?s:e(s,o)?[s]:t(r(s))}return bp=i,bp}var wp,sE;function Va(){if(sE)return wp;sE=1;var n=co(),e=1/0;function t(r){if(typeof r=="string"||n(r))return r;var i=r+"";return i=="0"&&1/r==-e?"-0":i}return wp=t,wp}var xp,oE;function Mu(){if(oE)return xp;oE=1;var n=Ou(),e=Va();function t(r,i){i=n(i,r);for(var s=0,o=i.length;r!=null&&s<o;)r=r[e(i[s++])];return s&&s==o?r:void 0}return xp=t,xp}var Cp,aE;function H8(){if(aE)return Cp;aE=1;var n=Mu();function e(t,r,i){var s=t==null?void 0:n(t,r);return s===void 0?i:s}return Cp=e,Cp}var Sp,lE;function U8(){if(lE)return Sp;lE=1;function n(e,t){return e!=null&&t in Object(e)}return Sp=n,Sp}var Pp,cE;function uE(){if(cE)return Pp;cE=1;var n=Ou(),e=vo,t=Qe,r=al,i=Ju,s=Va();function o(a,l,c){l=n(l,a);for(var u=-1,h=l.length,f=!1;++u<h;){var d=s(l[u]);if(!(f=a!=null&&c(a,d)))break;a=a[d]}return f||++u!=h?f:(h=a==null?0:a.length,!!h&&i(h)&&r(d,h)&&(t(a)||e(a)))}return Pp=o,Pp}var Ep,hE;function fE(){if(hE)return Ep;hE=1;var n=U8(),e=uE();function t(r,i){return r!=null&&e(r,i,n)}return Ep=t,Ep}var Ap,dE;function W8(){if(dE)return Ap;dE=1;var n=FP(),e=H8(),t=fE(),r=fp(),i=GP(),s=WP(),o=Va(),a=1,l=2;function c(u,h){return r(u)&&i(h)?s(o(u),h):function(f){var d=e(f,u);return d===void 0&&d===h?t(f,u):n(h,d,a|l)}}return Ap=c,Ap}var Op,gE;function pE(){if(gE)return Op;gE=1;function n(e){return function(t){return t==null?void 0:t[e]}}return Op=n,Op}var Mp,mE;function X8(){if(mE)return Mp;mE=1;var n=Mu();function e(t){return function(r){return n(r,t)}}return Mp=e,Mp}var Tp,yE;function Y8(){if(yE)return Tp;yE=1;var n=pE(),e=X8(),t=fp(),r=Va();function i(s){return t(s)?n(r(s)):e(s)}return Tp=i,Tp}var _p,vE;function br(){if(vE)return _p;vE=1;var n=z8(),e=W8(),t=Vi(),r=Qe,i=Y8();function s(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?r(o)?e(o[0],o[1]):n(o):i(o)}return _p=s,_p}var Np,bE;function wE(){if(bE)return Np;bE=1;var n=pv,e=_8(),t=br(),r=Qe;function i(s,o){var a=r(s)?n:e;return a(s,t(o,3))}return Np=i,Np}var kp,xE;function K8(){if(xE)return kp;xE=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,i){return r!=null&&e.call(r,i)}return kp=t,kp}var Ip,CE;function SE(){if(CE)return Ip;CE=1;var n=K8(),e=uE();function t(r,i){return r!=null&&e(r,i,n)}return Ip=t,Ip}var $p,PE;function J8(){if(PE)return $p;PE=1;var n=Zu,e=es,t=vo,r=Qe,i=Yn,s=Qi,o=ul,a=bo,l="[object Map]",c="[object Set]",u=Object.prototype,h=u.hasOwnProperty;function f(d){if(d==null)return!0;if(i(d)&&(r(d)||typeof d=="string"||typeof d.splice=="function"||s(d)||a(d)||t(d)))return!d.length;var g=e(d);if(g==l||g==c)return!d.size;if(o(d))return!n(d).length;for(var p in d)if(h.call(d,p))return!1;return!0}return $p=f,$p}var Lp,EE;function AE(){if(EE)return Lp;EE=1;function n(e){return e===void 0}return Lp=n,Lp}var Rp,OE;function ME(){if(OE)return Rp;OE=1;var n=Eu(),e=Yn;function t(r,i){var s=-1,o=e(r)?Array(r.length):[];return n(r,function(a,l,c){o[++s]=i(a,l,c)}),o}return Rp=t,Rp}var jp,TE;function _E(){if(TE)return jp;TE=1;var n=Au(),e=br(),t=ME(),r=Qe;function i(s,o){var a=r(s)?n:t;return a(s,e(o,3))}return jp=i,jp}var Dp,NE;function Q8(){if(NE)return Dp;NE=1;function n(e,t,r,i){var s=-1,o=e==null?0:e.length;for(i&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}return Dp=n,Dp}var Bp,kE;function Z8(){if(kE)return Bp;kE=1;function n(e,t,r,i,s){return s(e,function(o,a,l){r=i?(i=!1,o):t(r,o,a,l)}),r}return Bp=n,Bp}var zp,IE;function $E(){if(IE)return zp;IE=1;var n=Q8(),e=Eu(),t=br(),r=Z8(),i=Qe;function s(o,a,l){var c=i(o)?n:r,u=arguments.length<3;return c(o,t(a,4),l,u,e)}return zp=s,zp}var Fp,LE;function eU(){if(LE)return Fp;LE=1;var n=di,e=Qe,t=Rn,r="[object String]";function i(s){return typeof s=="string"||!e(s)&&t(s)&&n(s)==r}return Fp=i,Fp}var Vp,RE;function tU(){if(RE)return Vp;RE=1;var n=pE(),e=n("length");return Vp=e,Vp}var qp,jE;function nU(){if(jE)return qp;jE=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="\\u200d",a=RegExp("["+o+n+i+s+"]");function l(c){return a.test(c)}return qp=l,qp}var Gp,DE;function rU(){if(DE)return Gp;DE=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="["+n+"]",a="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+a+"|"+l+")",u="[^"+n+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",d="\\u200d",g=c+"?",p="["+s+"]?",b="(?:"+d+"(?:"+[u,h,f].join("|")+")"+p+g+")*",m=p+g+b,v="(?:"+[u+a+"?",a,h,f,o].join("|")+")",y=RegExp(l+"(?="+l+")|"+v+m,"g");function w(x){for(var C=y.lastIndex=0;y.test(x);)++C;return C}return Gp=w,Gp}var Hp,BE;function iU(){if(BE)return Hp;BE=1;var n=tU(),e=nU(),t=rU();function r(i){return e(i)?t(i):n(i)}return Hp=r,Hp}var Up,zE;function sU(){if(zE)return Up;zE=1;var n=Zu,e=es,t=Yn,r=eU(),i=iU(),s="[object Map]",o="[object Set]";function a(l){if(l==null)return 0;if(t(l))return r(l)?i(l):l.length;var c=e(l);return c==s||c==o?l.size:n(l).length}return Up=a,Up}var Wp,FE;function oU(){if(FE)return Wp;FE=1;var n=Ku,e=Lv,t=Dg(),r=br(),i=fl,s=Qe,o=Qi,a=mo,l=Qt,c=bo;function u(h,f,d){var g=s(h),p=g||o(h)||c(h);if(f=r(f,4),d==null){var b=h&&h.constructor;p?d=g?new b:[]:l(h)?d=a(b)?e(i(h)):{}:d={}}return(p?n:t)(h,function(m,v,y){return f(d,m,v,y)}),d}return Wp=u,Wp}var Xp,VE;function aU(){if(VE)return Xp;VE=1;var n=Xi,e=vo,t=Qe,r=n?n.isConcatSpreadable:void 0;function i(s){return t(s)||e(s)||!!(r&&s&&s[r])}return Xp=i,Xp}var Yp,qE;function Kp(){if(qE)return Yp;qE=1;var n=th,e=aU();function t(r,i,s,o,a){var l=-1,c=r.length;for(s||(s=e),a||(a=[]);++l<c;){var u=r[l];i>0&&s(u)?i>1?t(u,i-1,s,o,a):n(a,u):o||(a[a.length]=u)}return a}return Yp=t,Yp}var Jp,GE;function lU(){if(GE)return Jp;GE=1;function n(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}return Jp=n,Jp}var Qp,HE;function UE(){if(HE)return Qp;HE=1;var n=lU(),e=Math.max;function t(r,i,s){return i=e(i===void 0?r.length-1:i,0),function(){for(var o=arguments,a=-1,l=e(o.length-i,0),c=Array(l);++a<l;)c[a]=o[i+a];a=-1;for(var u=Array(i+1);++a<i;)u[a]=o[a];return u[i]=s(c),n(r,this,u)}}return Qp=t,Qp}var Zp,WE;function cU(){if(WE)return Zp;WE=1;var n=Ig(),e=sv,t=Vi(),r=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:n(s),writable:!0})}:t;return Zp=r,Zp}var em,XE;function uU(){if(XE)return em;XE=1;var n=800,e=16,t=Date.now;function r(i){var s=0,o=0;return function(){var a=t(),l=e-(a-o);if(o=a,l>0){if(++s>=n)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return em=r,em}var tm,YE;function KE(){if(YE)return tm;YE=1;var n=cU(),e=uU(),t=e(n);return tm=t,tm}var nm,JE;function Tu(){if(JE)return nm;JE=1;var n=Vi(),e=UE(),t=KE();function r(i,s){return t(e(i,s,n),i+"")}return nm=r,nm}var rm,QE;function ZE(){if(QE)return rm;QE=1;function n(e,t,r,i){for(var s=e.length,o=r+(i?1:-1);i?o--:++o<s;)if(t(e[o],o,e))return o;return-1}return rm=n,rm}var im,eA;function hU(){if(eA)return im;eA=1;function n(e){return e!==e}return im=n,im}var sm,tA;function fU(){if(tA)return sm;tA=1;function n(e,t,r){for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}return sm=n,sm}var om,nA;function dU(){if(nA)return om;nA=1;var n=ZE(),e=hU(),t=fU();function r(i,s,o){return s===s?t(i,s,o):n(i,e,o)}return om=r,om}var am,rA;function gU(){if(rA)return am;rA=1;var n=dU();function e(t,r){var i=t==null?0:t.length;return!!i&&n(t,r,0)>-1}return am=e,am}var lm,iA;function pU(){if(iA)return lm;iA=1;function n(e,t,r){for(var i=-1,s=e==null?0:e.length;++i<s;)if(r(t,e[i]))return!0;return!1}return lm=n,lm}var cm,sA;function mU(){if(sA)return cm;sA=1;function n(){}return cm=n,cm}var um,oA;function yU(){if(oA)return um;oA=1;var n=xv,e=mU(),t=ep(),r=1/0,i=n&&1/t(new n([,-0]))[1]==r?function(s){return new n(s)}:e;return um=i,um}var hm,aA;function vU(){if(aA)return hm;aA=1;var n=TP(),e=gU(),t=pU(),r=kP(),i=yU(),s=ep(),o=200;function a(l,c,u){var h=-1,f=e,d=l.length,g=!0,p=[],b=p;if(u)g=!1,f=t;else if(d>=o){var m=c?null:i(l);if(m)return s(m);g=!1,f=r,b=new n}else b=c?[]:p;e:for(;++h<d;){var v=l[h],y=c?c(v):v;if(v=u||v!==0?v:0,g&&y===y){for(var w=b.length;w--;)if(b[w]===y)continue e;c&&b.push(y),p.push(v)}else f(b,y,u)||(b!==p&&b.push(y),p.push(v))}return p}return hm=a,hm}var fm,lA;function cA(){if(lA)return fm;lA=1;var n=Yn,e=Rn;function t(r){return e(r)&&n(r)}return fm=t,fm}var dm,uA;function bU(){if(uA)return dm;uA=1;var n=Kp(),e=Tu(),t=vU(),r=cA(),i=e(function(s){return t(n(s,1,r,!0))});return dm=i,dm}var gm,hA;function wU(){if(hA)return gm;hA=1;var n=Au();function e(t,r){return n(r,function(i){return t[i]})}return gm=e,gm}var pm,fA;function dA(){if(fA)return pm;fA=1;var n=wU(),e=Er;function t(r){return r==null?[]:n(r,e(r))}return pm=t,pm}var mm,gA;function gn(){if(gA)return mm;gA=1;var n;if(typeof _g=="function")try{n={clone:O8(),constant:Ig(),each:PP(),filter:wE(),has:SE(),isArray:Qe,isEmpty:J8(),isFunction:mo,isUndefined:AE(),keys:Er,map:_E(),reduce:$E(),size:sU(),transform:oU(),union:bU(),values:dA()}}catch(e){}return n||(n=window._),mm=n,mm}var ym,pA;function vm(){if(pA)return ym;pA=1;var n=gn();ym=i;var e="\0",t="\0",r="";function i(u){this._isDirected=n.has(u,"directed")?u.directed:!0,this._isMultigraph=n.has(u,"multigraph")?u.multigraph:!1,this._isCompound=n.has(u,"compound")?u.compound:!1,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(u){return this._label=u,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(u){return n.isFunction(u)||(u=n.constant(u)),this._defaultNodeLabelFn=u,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return n.keys(this._nodes)},i.prototype.sources=function(){var u=this;return n.filter(this.nodes(),function(h){return n.isEmpty(u._in[h])})},i.prototype.sinks=function(){var u=this;return n.filter(this.nodes(),function(h){return n.isEmpty(u._out[h])})},i.prototype.setNodes=function(u,h){var f=arguments,d=this;return n.each(u,function(g){f.length>1?d.setNode(g,h):d.setNode(g)}),this},i.prototype.setNode=function(u,h){return n.has(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=h),this):(this._nodes[u]=arguments.length>1?h:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=t,this._children[u]={},this._children[t][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)},i.prototype.node=function(u){return this._nodes[u]},i.prototype.hasNode=function(u){return n.has(this._nodes,u)},i.prototype.removeNode=function(u){var h=this;if(n.has(this._nodes,u)){var f=function(d){h.removeEdge(h._edgeObjs[d])};delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],n.each(this.children(u),function(d){h.setParent(d)}),delete this._children[u]),n.each(n.keys(this._in[u]),f),delete this._in[u],delete this._preds[u],n.each(n.keys(this._out[u]),f),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this},i.prototype.setParent=function(u,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(h))h=t;else{h+="";for(var f=h;!n.isUndefined(f);f=this.parent(f))if(f===u)throw new Error("Setting "+h+" as parent of "+u+" would create a cycle");this.setNode(h)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=h,this._children[h][u]=!0,this},i.prototype._removeFromParentsChildList=function(u){delete this._children[this._parent[u]][u]},i.prototype.parent=function(u){if(this._isCompound){var h=this._parent[u];if(h!==t)return h}},i.prototype.children=function(u){if(n.isUndefined(u)&&(u=t),this._isCompound){var h=this._children[u];if(h)return n.keys(h)}else{if(u===t)return this.nodes();if(this.hasNode(u))return[]}},i.prototype.predecessors=function(u){var h=this._preds[u];if(h)return n.keys(h)},i.prototype.successors=function(u){var h=this._sucs[u];if(h)return n.keys(h)},i.prototype.neighbors=function(u){var h=this.predecessors(u);if(h)return n.union(h,this.successors(u))},i.prototype.isLeaf=function(u){var h;return this.isDirected()?h=this.successors(u):h=this.neighbors(u),h.length===0},i.prototype.filterNodes=function(u){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var f=this;n.each(this._nodes,function(p,b){u(b)&&h.setNode(b,p)}),n.each(this._edgeObjs,function(p){h.hasNode(p.v)&&h.hasNode(p.w)&&h.setEdge(p,f.edge(p))});var d={};function g(p){var b=f.parent(p);return b===void 0||h.hasNode(b)?(d[p]=b,b):b in d?d[b]:g(b)}return this._isCompound&&n.each(h.nodes(),function(p){h.setParent(p,g(p))}),h},i.prototype.setDefaultEdgeLabel=function(u){return n.isFunction(u)||(u=n.constant(u)),this._defaultEdgeLabelFn=u,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return n.values(this._edgeObjs)},i.prototype.setPath=function(u,h){var f=this,d=arguments;return n.reduce(u,function(g,p){return d.length>1?f.setEdge(g,p,h):f.setEdge(g,p),p}),this},i.prototype.setEdge=function(){var u,h,f,d,g=!1,p=arguments[0];typeof p=="object"&&p!==null&&"v"in p?(u=p.v,h=p.w,f=p.name,arguments.length===2&&(d=arguments[1],g=!0)):(u=p,h=arguments[1],f=arguments[3],arguments.length>2&&(d=arguments[2],g=!0)),u=""+u,h=""+h,n.isUndefined(f)||(f=""+f);var b=a(this._isDirected,u,h,f);if(n.has(this._edgeLabels,b))return g&&(this._edgeLabels[b]=d),this;if(!n.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(h),this._edgeLabels[b]=g?d:this._defaultEdgeLabelFn(u,h,f);var m=l(this._isDirected,u,h,f);return u=m.v,h=m.w,Object.freeze(m),this._edgeObjs[b]=m,s(this._preds[h],u),s(this._sucs[u],h),this._in[h][b]=m,this._out[u][b]=m,this._edgeCount++,this},i.prototype.edge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f);return this._edgeLabels[d]},i.prototype.hasEdge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f);return n.has(this._edgeLabels,d)},i.prototype.removeEdge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f),g=this._edgeObjs[d];return g&&(u=g.v,h=g.w,delete this._edgeLabels[d],delete this._edgeObjs[d],o(this._preds[h],u),o(this._sucs[u],h),delete this._in[h][d],delete this._out[u][d],this._edgeCount--),this},i.prototype.inEdges=function(u,h){var f=this._in[u];if(f){var d=n.values(f);return h?n.filter(d,function(g){return g.v===h}):d}},i.prototype.outEdges=function(u,h){var f=this._out[u];if(f){var d=n.values(f);return h?n.filter(d,function(g){return g.w===h}):d}},i.prototype.nodeEdges=function(u,h){var f=this.inEdges(u,h);if(f)return f.concat(this.outEdges(u,h))};function s(u,h){u[h]?u[h]++:u[h]=1}function o(u,h){--u[h]||delete u[h]}function a(u,h,f,d){var g=""+h,p=""+f;if(!u&&g>p){var b=g;g=p,p=b}return g+r+p+r+(n.isUndefined(d)?e:d)}function l(u,h,f,d){var g=""+h,p=""+f;if(!u&&g>p){var b=g;g=p,p=b}var m={v:g,w:p};return d&&(m.name=d),m}function c(u,h){return a(u,h.v,h.w,h.name)}return ym}var bm,mA;function xU(){return mA||(mA=1,bm="2.1.8"),bm}var wm,yA;function CU(){return yA||(yA=1,wm={Graph:vm(),version:xU()}),wm}var xm,vA;function SU(){if(vA)return xm;vA=1;var n=gn(),e=vm();xm={write:t,read:s};function t(o){var a={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:r(o),edges:i(o)};return n.isUndefined(o.graph())||(a.value=n.clone(o.graph())),a}function r(o){return n.map(o.nodes(),function(a){var l=o.node(a),c=o.parent(a),u={v:a};return n.isUndefined(l)||(u.value=l),n.isUndefined(c)||(u.parent=c),u})}function i(o){return n.map(o.edges(),function(a){var l=o.edge(a),c={v:a.v,w:a.w};return n.isUndefined(a.name)||(c.name=a.name),n.isUndefined(l)||(c.value=l),c})}function s(o){var a=new e(o.options).setGraph(o.value);return n.each(o.nodes,function(l){a.setNode(l.v,l.value),l.parent&&a.setParent(l.v,l.parent)}),n.each(o.edges,function(l){a.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),a}return xm}var Cm,bA;function PU(){if(bA)return Cm;bA=1;var n=gn();Cm=e;function e(t){var r={},i=[],s;function o(a){n.has(r,a)||(r[a]=!0,s.push(a),n.each(t.successors(a),o),n.each(t.predecessors(a),o))}return n.each(t.nodes(),function(a){s=[],o(a),s.length&&i.push(s)}),i}return Cm}var Sm,wA;function xA(){if(wA)return Sm;wA=1;var n=gn();Sm=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return n.has(this._keyIndices,t)},e.prototype.priority=function(t){var r=this._keyIndices[t];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,r){var i=this._keyIndices;if(t=String(t),!n.has(i,t)){var s=this._arr,o=s.length;return i[t]=o,s.push({key:t,priority:r}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,r){var i=this._keyIndices[t];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)},e.prototype._heapify=function(t){var r=this._arr,i=2*t,s=i+1,o=t;i<r.length&&(o=r[i].priority<r[o].priority?i:o,s<r.length&&(o=r[s].priority<r[o].priority?s:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var r=this._arr,i=r[t].priority,s;t!==0&&(s=t>>1,!(r[s].priority<i));)this._swap(t,s),t=s},e.prototype._swap=function(t,r){var i=this._arr,s=this._keyIndices,o=i[t],a=i[r];i[t]=a,i[r]=o,s[a.key]=t,s[o.key]=r},Sm}var Pm,CA;function SA(){if(CA)return Pm;CA=1;var n=gn(),e=xA();Pm=r;var t=n.constant(1);function r(s,o,a,l){return i(s,String(o),a||t,l||function(c){return s.outEdges(c)})}function i(s,o,a,l){var c={},u=new e,h,f,d=function(g){var p=g.v!==h?g.v:g.w,b=c[p],m=a(g),v=f.distance+m;if(m<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+m);v<b.distance&&(b.distance=v,b.predecessor=h,u.decrease(p,v))};for(s.nodes().forEach(function(g){var p=g===o?0:Number.POSITIVE_INFINITY;c[g]={distance:p},u.add(g,p)});u.size()>0&&(h=u.removeMin(),f=c[h],f.distance!==Number.POSITIVE_INFINITY);)l(h).forEach(d);return c}return Pm}var Em,PA;function EU(){if(PA)return Em;PA=1;var n=SA(),e=gn();Em=t;function t(r,i,s){return e.transform(r.nodes(),function(o,a){o[a]=n(r,a,i,s)},{})}return Em}var Am,EA;function AA(){if(EA)return Am;EA=1;var n=gn();Am=e;function e(t){var r=0,i=[],s={},o=[];function a(l){var c=s[l]={onStack:!0,lowlink:r,index:r++};if(i.push(l),t.successors(l).forEach(function(f){n.has(s,f)?s[f].onStack&&(c.lowlink=Math.min(c.lowlink,s[f].index)):(a(f),c.lowlink=Math.min(c.lowlink,s[f].lowlink))}),c.lowlink===c.index){var u=[],h;do h=i.pop(),s[h].onStack=!1,u.push(h);while(l!==h);o.push(u)}}return t.nodes().forEach(function(l){n.has(s,l)||a(l)}),o}return Am}var Om,OA;function AU(){if(OA)return Om;OA=1;var n=gn(),e=AA();Om=t;function t(r){return n.filter(e(r),function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return Om}var Mm,MA;function OU(){if(MA)return Mm;MA=1;var n=gn();Mm=t;var e=n.constant(1);function t(i,s,o){return r(i,s||e,o||function(a){return i.outEdges(a)})}function r(i,s,o){var a={},l=i.nodes();return l.forEach(function(c){a[c]={},a[c][c]={distance:0},l.forEach(function(u){c!==u&&(a[c][u]={distance:Number.POSITIVE_INFINITY})}),o(c).forEach(function(u){var h=u.v===c?u.w:u.v,f=s(u);a[c][h]={distance:f,predecessor:c}})}),l.forEach(function(c){var u=a[c];l.forEach(function(h){var f=a[h];l.forEach(function(d){var g=f[c],p=u[d],b=f[d],m=g.distance+p.distance;m<b.distance&&(b.distance=m,b.predecessor=p.predecessor)})})}),a}return Mm}var Tm,TA;function _A(){if(TA)return Tm;TA=1;var n=gn();Tm=e,e.CycleException=t;function e(r){var i={},s={},o=[];function a(l){if(n.has(s,l))throw new t;n.has(i,l)||(s[l]=!0,i[l]=!0,n.each(r.predecessors(l),a),delete s[l],o.push(l))}if(n.each(r.sinks(),a),n.size(i)!==r.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,Tm}var _m,NA;function MU(){if(NA)return _m;NA=1;var n=_A();_m=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return _m}var Nm,kA;function IA(){if(kA)return Nm;kA=1;var n=gn();Nm=e;function e(r,i,s){n.isArray(i)||(i=[i]);var o=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],l={};return n.each(i,function(c){if(!r.hasNode(c))throw new Error("Graph does not have node: "+c);t(r,c,s==="post",l,o,a)}),a}function t(r,i,s,o,a,l){n.has(o,i)||(o[i]=!0,s||l.push(i),n.each(a(i),function(c){t(r,c,s,o,a,l)}),s&&l.push(i))}return Nm}var km,$A;function TU(){if($A)return km;$A=1;var n=IA();km=e;function e(t,r){return n(t,r,"post")}return km}var Im,LA;function _U(){if(LA)return Im;LA=1;var n=IA();Im=e;function e(t,r){return n(t,r,"pre")}return Im}var $m,RA;function NU(){if(RA)return $m;RA=1;var n=gn(),e=vm(),t=xA();$m=r;function r(i,s){var o=new e,a={},l=new t,c;function u(f){var d=f.v===c?f.w:f.v,g=l.priority(d);if(g!==void 0){var p=s(f);p<g&&(a[d]=c,l.decrease(d,p))}}if(i.nodeCount()===0)return o;n.each(i.nodes(),function(f){l.add(f,Number.POSITIVE_INFINITY),o.setNode(f)}),l.decrease(i.nodes()[0],0);for(var h=!1;l.size()>0;){if(c=l.removeMin(),n.has(a,c))o.setEdge(c,a[c]);else{if(h)throw new Error("Input graph is not connected: "+i);h=!0}i.nodeEdges(c).forEach(u)}return o}return $m}var Lm,jA;function kU(){return jA||(jA=1,Lm={components:PU(),dijkstra:SA(),dijkstraAll:EU(),findCycles:AU(),floydWarshall:OU(),isAcyclic:MU(),postorder:TU(),preorder:_U(),prim:NU(),tarjan:AA(),topsort:_A()}),Lm}var Rm,DA;function IU(){if(DA)return Rm;DA=1;var n=CU();return Rm={Graph:n.Graph,json:SU(),alg:kU(),version:n.version},Rm}var _u;if(typeof _g=="function")try{_u=IU()}catch(n){}_u||(_u=window.graphlib);var Nn=_u,jm,BA;function Nu(){if(BA)return jm;BA=1;var n=Ui,e=Yn,t=al,r=Qt;function i(s,o,a){if(!r(a))return!1;var l=typeof o;return(l=="number"?e(a)&&t(o,a.length):l=="string"&&o in a)?n(a[o],s):!1}return jm=i,jm}var Dm,zA;function $U(){if(zA)return Dm;zA=1;var n=Tu(),e=Ui,t=Nu(),r=pi,i=Object.prototype,s=i.hasOwnProperty,o=n(function(a,l){a=Object(a);var c=-1,u=l.length,h=u>2?l[2]:void 0;for(h&&t(l[0],l[1],h)&&(u=1);++c<u;)for(var f=l[c],d=r(f),g=-1,p=d.length;++g<p;){var b=d[g],m=a[b];(m===void 0||e(m,i[b])&&!s.call(a,b))&&(a[b]=f[b])}return a});return Dm=o,Dm}var Bm,FA;function LU(){if(FA)return Bm;FA=1;var n=br(),e=Yn,t=Er;function r(i){return function(s,o,a){var l=Object(s);if(!e(s)){var c=n(o,3);s=t(s),o=function(h){return c(l[h],h,l)}}var u=i(s,o,a);return u>-1?l[c?s[u]:u]:void 0}}return Bm=r,Bm}var zm,VA;function RU(){if(VA)return zm;VA=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return zm=e,zm}var Fm,qA;function jU(){if(qA)return Fm;qA=1;var n=RU(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return Fm=t,Fm}var Vm,GA;function DU(){if(GA)return Vm;GA=1;var n=jU(),e=Qt,t=co(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(t(c))return r;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=n(c);var h=s.test(c);return h||o.test(c)?a(c.slice(2),h?2:8):i.test(c)?r:+c}return Vm=l,Vm}var qm,HA;function UA(){if(HA)return qm;HA=1;var n=DU(),e=1/0,t=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=n(i),i===e||i===-e){var s=i<0?-1:1;return s*t}return i===i?i:0}return qm=r,qm}var Gm,WA;function BU(){if(WA)return Gm;WA=1;var n=UA();function e(t){var r=n(t),i=r%1;return r===r?i?r-i:r:0}return Gm=e,Gm}var Hm,XA;function zU(){if(XA)return Hm;XA=1;var n=ZE(),e=br(),t=BU(),r=Math.max;function i(s,o,a){var l=s==null?0:s.length;if(!l)return-1;var c=a==null?0:t(a);return c<0&&(c=r(l+c,0)),n(s,e(o,3),c)}return Hm=i,Hm}var Um,YA;function FU(){if(YA)return Um;YA=1;var n=LU(),e=zU(),t=n(e);return Um=t,Um}var Wm,KA;function JA(){if(KA)return Wm;KA=1;var n=Kp();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return Wm=e,Wm}var Xm,QA;function VU(){if(QA)return Xm;QA=1;var n=Rg(),e=wP(),t=pi;function r(i,s){return i==null?i:n(i,e(s),t)}return Xm=r,Xm}var Ym,ZA;function qU(){if(ZA)return Ym;ZA=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Ym=n,Ym}var Km,eO;function GU(){if(eO)return Km;eO=1;var n=il,e=Dg(),t=br();function r(i,s){var o={};return s=t(s,3),e(i,function(a,l,c){n(o,l,s(a,l,c))}),o}return Km=r,Km}var Jm,tO;function Qm(){if(tO)return Jm;tO=1;var n=co();function e(t,r,i){for(var s=-1,o=t.length;++s<o;){var a=t[s],l=r(a);if(l!=null&&(c===void 0?l===l&&!n(l):i(l,c)))var c=l,u=a}return u}return Jm=e,Jm}var Zm,nO;function HU(){if(nO)return Zm;nO=1;function n(e,t){return e>t}return Zm=n,Zm}var ey,rO;function UU(){if(rO)return ey;rO=1;var n=Qm(),e=HU(),t=Vi();function r(i){return i&&i.length?n(i,t,e):void 0}return ey=r,ey}var ty,iO;function sO(){if(iO)return ty;iO=1;var n=il,e=Ui;function t(r,i,s){(s!==void 0&&!e(r[i],s)||s===void 0&&!(i in r))&&n(r,i,s)}return ty=t,ty}var ny,oO;function WU(){if(oO)return ny;oO=1;var n=di,e=fl,t=Rn,r="[object Object]",i=Function.prototype,s=Object.prototype,o=i.toString,a=s.hasOwnProperty,l=o.call(Object);function c(u){if(!t(u)||n(u)!=r)return!1;var h=e(u);if(h===null)return!0;var f=a.call(h,"constructor")&&h.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return ny=c,ny}var ry,aO;function lO(){if(aO)return ry;aO=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return ry=n,ry}var iy,cO;function XU(){if(cO)return iy;cO=1;var n=yo,e=pi;function t(r){return n(r,e(r))}return iy=t,iy}var sy,uO;function YU(){if(uO)return sy;uO=1;var n=sO(),e=dv,t=Iv,r=gv,i=Rv,s=vo,o=Qe,a=cA(),l=Qi,c=mo,u=Qt,h=WU(),f=bo,d=lO(),g=XU();function p(b,m,v,y,w,x,C){var S=d(b,v),E=d(m,v),A=C.get(E);if(A){n(b,v,A);return}var M=x?x(S,E,v+"",b,m,C):void 0,O=M===void 0;if(O){var I=o(E),q=!I&&l(E),U=!I&&!q&&f(E);M=E,I||q||U?o(S)?M=S:a(S)?M=r(S):q?(O=!1,M=e(E,!0)):U?(O=!1,M=t(E,!0)):M=[]:h(E)||s(E)?(M=S,s(S)?M=g(S):(!u(S)||c(S))&&(M=i(E))):O=!1}O&&(C.set(E,M),w(M,E,y,x,C),C.delete(E)),n(b,v,M)}return sy=p,sy}var oy,hO;function KU(){if(hO)return oy;hO=1;var n=rl,e=sO(),t=Rg(),r=YU(),i=Qt,s=pi,o=lO();function a(l,c,u,h,f){l!==c&&t(c,function(d,g){if(f||(f=new n),i(d))r(l,c,g,u,a,h,f);else{var p=h?h(o(l,g),d,g+"",l,c,f):void 0;p===void 0&&(p=d),e(l,g,p)}},s)}return oy=a,oy}var ay,fO;function JU(){if(fO)return ay;fO=1;var n=Tu(),e=Nu();function t(r){return n(function(i,s){var o=-1,a=s.length,l=a>1?s[a-1]:void 0,c=a>2?s[2]:void 0;for(l=r.length>3&&typeof l=="function"?(a--,l):void 0,c&&e(s[0],s[1],c)&&(l=a<3?void 0:l,a=1),i=Object(i);++o<a;){var u=s[o];u&&r(i,u,o,l)}return i})}return ay=t,ay}var ly,dO;function QU(){if(dO)return ly;dO=1;var n=KU(),e=JU(),t=e(function(r,i,s){n(r,i,s)});return ly=t,ly}var cy,gO;function pO(){if(gO)return cy;gO=1;function n(e,t){return e<t}return cy=n,cy}var uy,mO;function ZU(){if(mO)return uy;mO=1;var n=Qm(),e=pO(),t=Vi();function r(i){return i&&i.length?n(i,t,e):void 0}return uy=r,uy}var hy,yO;function eW(){if(yO)return hy;yO=1;var n=Qm(),e=br(),t=pO();function r(i,s){return i&&i.length?n(i,e(s,2),t):void 0}return hy=r,hy}var fy,vO;function tW(){if(vO)return fy;vO=1;var n=mn,e=function(){return n.Date.now()};return fy=e,fy}var dy,bO;function nW(){if(bO)return dy;bO=1;var n=sl,e=Ou(),t=al,r=Qt,i=Va();function s(o,a,l,c){if(!r(o))return o;a=e(a,o);for(var u=-1,h=a.length,f=h-1,d=o;d!=null&&++u<h;){var g=i(a[u]),p=l;if(g==="__proto__"||g==="constructor"||g==="prototype")return o;if(u!=f){var b=d[g];p=c?c(b,g,d):void 0,p===void 0&&(p=r(b)?b:t(a[u+1])?[]:{})}n(d,g,p),d=d[g]}return o}return dy=s,dy}var gy,wO;function rW(){if(wO)return gy;wO=1;var n=Mu(),e=nW(),t=Ou();function r(i,s,o){for(var a=-1,l=s.length,c={};++a<l;){var u=s[a],h=n(i,u);o(h,u)&&e(c,t(u,i),h)}return c}return gy=r,gy}var py,xO;function iW(){if(xO)return py;xO=1;var n=rW(),e=fE();function t(r,i){return n(r,i,function(s,o){return e(r,o)})}return py=t,py}var my,CO;function sW(){if(CO)return my;CO=1;var n=JA(),e=UE(),t=KE();function r(i){return t(e(i,void 0,n),i+"")}return my=r,my}var yy,SO;function oW(){if(SO)return yy;SO=1;var n=iW(),e=sW(),t=e(function(r,i){return r==null?{}:n(r,i)});return yy=t,yy}var vy,PO;function aW(){if(PO)return vy;PO=1;var n=Math.ceil,e=Math.max;function t(r,i,s,o){for(var a=-1,l=e(n((i-r)/(s||1)),0),c=Array(l);l--;)c[o?l:++a]=r,r+=s;return c}return vy=t,vy}var by,EO;function lW(){if(EO)return by;EO=1;var n=aW(),e=Nu(),t=UA();function r(i){return function(s,o,a){return a&&typeof a!="number"&&e(s,o,a)&&(o=a=void 0),s=t(s),o===void 0?(o=s,s=0):o=t(o),a=a===void 0?s<o?1:-1:t(a),n(s,o,a,i)}}return by=r,by}var wy,AO;function cW(){if(AO)return wy;AO=1;var n=lW(),e=n();return wy=e,wy}var xy,OO;function uW(){if(OO)return xy;OO=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return xy=n,xy}var Cy,MO;function hW(){if(MO)return Cy;MO=1;var n=co();function e(t,r){if(t!==r){var i=t!==void 0,s=t===null,o=t===t,a=n(t),l=r!==void 0,c=r===null,u=r===r,h=n(r);if(!c&&!h&&!a&&t>r||a&&l&&u&&!c&&!h||s&&l&&u||!i&&u||!o)return 1;if(!s&&!a&&!h&&t<r||h&&i&&o&&!s&&!a||c&&i&&o||!l&&o||!u)return-1}return 0}return Cy=e,Cy}var Sy,TO;function fW(){if(TO)return Sy;TO=1;var n=hW();function e(t,r,i){for(var s=-1,o=t.criteria,a=r.criteria,l=o.length,c=i.length;++s<l;){var u=n(o[s],a[s]);if(u){if(s>=c)return u;var h=i[s];return u*(h=="desc"?-1:1)}}return t.index-r.index}return Sy=e,Sy}var Py,_O;function dW(){if(_O)return Py;_O=1;var n=Au(),e=Mu(),t=br(),r=ME(),i=uW(),s=ll,o=fW(),a=Vi(),l=Qe;function c(u,h,f){h.length?h=n(h,function(p){return l(p)?function(b){return e(b,p.length===1?p[0]:p)}:p}):h=[a];var d=-1;h=n(h,s(t));var g=r(u,function(p,b,m){var v=n(h,function(y){return y(p)});return{criteria:v,index:++d,value:p}});return i(g,function(p,b){return o(p,b,f)})}return Py=c,Py}var Ey,NO;function gW(){if(NO)return Ey;NO=1;var n=Kp(),e=dW(),t=Tu(),r=Nu(),i=t(function(s,o){if(s==null)return[];var a=o.length;return a>1&&r(s,o[0],o[1])?o=[]:a>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(s,n(o,1),[])});return Ey=i,Ey}var Ay,kO;function pW(){if(kO)return Ay;kO=1;var n=rE(),e=0;function t(r){var i=++e;return n(r)+i}return Ay=t,Ay}var Oy,IO;function mW(){if(IO)return Oy;IO=1;function n(e,t,r){for(var i=-1,s=e.length,o=t.length,a={};++i<s;){var l=i<o?t[i]:void 0;r(a,e[i],l)}return a}return Oy=n,Oy}var My,$O;function yW(){if($O)return My;$O=1;var n=sl,e=mW();function t(r,i){return e(r||[],i||[],n)}return My=t,My}var ku;if(typeof _g=="function")try{ku={cloneDeep:Hv,constant:Ig(),defaults:$U(),each:PP(),filter:wE(),find:FU(),flatten:JA(),forEach:CP(),forIn:VU(),has:SE(),isUndefined:AE(),last:qU(),map:_E(),mapValues:GU(),max:UU(),merge:QU(),min:ZU(),minBy:eW(),now:tW(),pick:oW(),range:cW(),reduce:$E(),sortBy:gW(),uniqueId:pW(),values:dA(),zipObject:yW()}}catch(n){}ku||(ku=window._);var ke=ku,vW=Iu;function Iu(){var n={};n._next=n._prev=n,this._sentinel=n}Iu.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return LO(e),e},Iu.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&LO(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},Iu.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,bW)),t=t._prev;return"["+n.join(", ")+"]"};function LO(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function bW(n,e){if(n!=="_next"&&n!=="_prev")return e}var wr=ke,wW=Nn.Graph,xW=vW,CW=PW,SW=wr.constant(1);function PW(n,e){if(n.nodeCount()<=1)return[];var t=AW(n,e||SW),r=EW(t.graph,t.buckets,t.zeroIdx);return wr.flatten(wr.map(r,function(i){return n.outEdges(i.v,i.w)}),!0)}function EW(n,e,t){for(var r=[],i=e[e.length-1],s=e[0],o;n.nodeCount();){for(;o=s.dequeue();)Ty(n,e,t,o);for(;o=i.dequeue();)Ty(n,e,t,o);if(n.nodeCount()){for(var a=e.length-2;a>0;--a)if(o=e[a].dequeue(),o){r=r.concat(Ty(n,e,t,o,!0));break}}}return r}function Ty(n,e,t,r,i){var s=i?[]:void 0;return wr.forEach(n.inEdges(r.v),function(o){var a=n.edge(o),l=n.node(o.v);i&&s.push({v:o.v,w:o.w}),l.out-=a,_y(e,t,l)}),wr.forEach(n.outEdges(r.v),function(o){var a=n.edge(o),l=o.w,c=n.node(l);c.in-=a,_y(e,t,c)}),n.removeNode(r.v),s}function AW(n,e){var t=new wW,r=0,i=0;wr.forEach(n.nodes(),function(a){t.setNode(a,{v:a,in:0,out:0})}),wr.forEach(n.edges(),function(a){var l=t.edge(a.v,a.w)||0,c=e(a),u=l+c;t.setEdge(a.v,a.w,u),i=Math.max(i,t.node(a.v).out+=c),r=Math.max(r,t.node(a.w).in+=c)});var s=wr.range(i+r+3).map(function(){return new xW}),o=r+1;return wr.forEach(t.nodes(),function(a){_y(s,o,t.node(a))}),{graph:t,buckets:s,zeroIdx:o}}function _y(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var qi=ke,OW=CW,MW={run:TW,undo:NW};function TW(n){var e=n.graph().acyclicer==="greedy"?OW(n,t(n)):_W(n);qi.forEach(e,function(r){var i=n.edge(r);n.removeEdge(r),i.forwardName=r.name,i.reversed=!0,n.setEdge(r.w,r.v,i,qi.uniqueId("rev"))});function t(r){return function(i){return r.edge(i).weight}}}function _W(n){var e=[],t={},r={};function i(s){qi.has(r,s)||(r[s]=!0,t[s]=!0,qi.forEach(n.outEdges(s),function(o){qi.has(t,o.w)?e.push(o):i(o.w)}),delete t[s])}return qi.forEach(n.nodes(),i),e}function NW(n){qi.forEach(n.edges(),function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})}var pe=ke,RO=Nn.Graph,Bt={addDummyNode:jO,simplify:kW,asNonCompoundGraph:IW,successorWeights:$W,predecessorWeights:LW,intersectRect:RW,buildLayerMatrix:jW,normalizeRanks:DW,removeEmptyRanks:BW,addBorderNode:zW,maxRank:DO,partition:FW,time:VW,notime:qW};function jO(n,e,t,r){var i;do i=pe.uniqueId(r);while(n.hasNode(i));return t.dummy=e,n.setNode(i,t),i}function kW(n){var e=new RO().setGraph(n.graph());return pe.forEach(n.nodes(),function(t){e.setNode(t,n.node(t))}),pe.forEach(n.edges(),function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},i=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function IW(n){var e=new RO({multigraph:n.isMultigraph()}).setGraph(n.graph());return pe.forEach(n.nodes(),function(t){n.children(t).length||e.setNode(t,n.node(t))}),pe.forEach(n.edges(),function(t){e.setEdge(t,n.edge(t))}),e}function $W(n){var e=pe.map(n.nodes(),function(t){var r={};return pe.forEach(n.outEdges(t),function(i){r[i.w]=(r[i.w]||0)+n.edge(i).weight}),r});return pe.zipObject(n.nodes(),e)}function LW(n){var e=pe.map(n.nodes(),function(t){var r={};return pe.forEach(n.inEdges(t),function(i){r[i.v]=(r[i.v]||0)+n.edge(i).weight}),r});return pe.zipObject(n.nodes(),e)}function RW(n,e){var t=n.x,r=n.y,i=e.x-t,s=e.y-r,o=n.width/2,a=n.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var l,c;return Math.abs(s)*o>Math.abs(i)*a?(s<0&&(a=-a),l=a*i/s,c=a):(i<0&&(o=-o),l=o,c=o*s/i),{x:t+l,y:r+c}}function jW(n){var e=pe.map(pe.range(DO(n)+1),function(){return[]});return pe.forEach(n.nodes(),function(t){var r=n.node(t),i=r.rank;pe.isUndefined(i)||(e[i][r.order]=t)}),e}function DW(n){var e=pe.min(pe.map(n.nodes(),function(t){return n.node(t).rank}));pe.forEach(n.nodes(),function(t){var r=n.node(t);pe.has(r,"rank")&&(r.rank-=e)})}function BW(n){var e=pe.min(pe.map(n.nodes(),function(s){return n.node(s).rank})),t=[];pe.forEach(n.nodes(),function(s){var o=n.node(s).rank-e;t[o]||(t[o]=[]),t[o].push(s)});var r=0,i=n.graph().nodeRankFactor;pe.forEach(t,function(s,o){pe.isUndefined(s)&&o%i!==0?--r:r&&pe.forEach(s,function(a){n.node(a).rank+=r})})}function zW(n,e,t,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=r),jO(n,"border",i,e)}function DO(n){return pe.max(pe.map(n.nodes(),function(e){var t=n.node(e).rank;if(!pe.isUndefined(t))return t}))}function FW(n,e){var t={lhs:[],rhs:[]};return pe.forEach(n,function(r){e(r)?t.lhs.push(r):t.rhs.push(r)}),t}function VW(n,e){var t=pe.now();try{return e()}finally{console.log(n+" time: "+(pe.now()-t)+"ms")}}function qW(n,e){return e()}var BO=ke,GW=Bt,HW={run:UW,undo:XW};function UW(n){n.graph().dummyChains=[],BO.forEach(n.edges(),function(e){WW(n,e)})}function WW(n,e){var t=e.v,r=n.node(t).rank,i=e.w,s=n.node(i).rank,o=e.name,a=n.edge(e),l=a.labelRank;if(s!==r+1){n.removeEdge(e);var c,u,h;for(h=0,++r;r<s;++h,++r)a.points=[],u={width:0,height:0,edgeLabel:a,edgeObj:e,rank:r},c=GW.addDummyNode(n,"edge",u,"_d"),r===l&&(u.width=a.width,u.height=a.height,u.dummy="edge-label",u.labelpos=a.labelpos),n.setEdge(t,c,{weight:a.weight},o),h===0&&n.graph().dummyChains.push(c),t=c;n.setEdge(t,i,{weight:a.weight},o)}}function XW(n){BO.forEach(n.graph().dummyChains,function(e){var t=n.node(e),r=t.edgeLabel,i;for(n.setEdge(t.edgeObj,r);t.dummy;)i=n.successors(e)[0],n.removeNode(e),r.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height),e=i,t=n.node(e)})}var $u=ke,Lu={longestPath:YW,slack:KW};function YW(n){var e={};function t(r){var i=n.node(r);if($u.has(e,r))return i.rank;e[r]=!0;var s=$u.min($u.map(n.outEdges(r),function(o){return t(o.w)-n.edge(o).minlen}));return(s===Number.POSITIVE_INFINITY||s===void 0||s===null)&&(s=0),i.rank=s}$u.forEach(n.sources(),t)}function KW(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}var Ru=ke,JW=Nn.Graph,ju=Lu.slack,zO=QW;function QW(n){var e=new JW({directed:!1}),t=n.nodes()[0],r=n.nodeCount();e.setNode(t,{});for(var i,s;ZW(e,n)<r;)i=e9(e,n),s=e.hasNode(i.v)?ju(n,i):-ju(n,i),t9(e,n,s);return e}function ZW(n,e){function t(r){Ru.forEach(e.nodeEdges(r),function(i){var s=i.v,o=r===s?i.w:s;!n.hasNode(o)&&!ju(e,i)&&(n.setNode(o,{}),n.setEdge(r,o,{}),t(o))})}return Ru.forEach(n.nodes(),t),n.nodeCount()}function e9(n,e){return Ru.minBy(e.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return ju(e,t)})}function t9(n,e,t){Ru.forEach(n.nodes(),function(r){e.node(r).rank+=t})}var xr=ke,n9=zO,r9=Lu.slack,i9=Lu.longestPath,s9=Nn.alg.preorder,o9=Nn.alg.postorder,a9=Bt.simplify,l9=Gi;Gi.initLowLimValues=ky,Gi.initCutValues=Ny,Gi.calcCutValue=FO,Gi.leaveEdge=qO,Gi.enterEdge=GO,Gi.exchangeEdges=HO;function Gi(n){n=a9(n),i9(n);var e=n9(n);ky(e),Ny(e,n);for(var t,r;t=qO(e);)r=GO(e,n,t),HO(e,n,t,r)}function Ny(n,e){var t=o9(n,n.nodes());t=t.slice(0,t.length-1),xr.forEach(t,function(r){c9(n,e,r)})}function c9(n,e,t){var r=n.node(t),i=r.parent;n.edge(t,i).cutvalue=FO(n,e,t)}function FO(n,e,t){var r=n.node(t),i=r.parent,s=!0,o=e.edge(t,i),a=0;return o||(s=!1,o=e.edge(i,t)),a=o.weight,xr.forEach(e.nodeEdges(t),function(l){var c=l.v===t,u=c?l.w:l.v;if(u!==i){var h=c===s,f=e.edge(l).weight;if(a+=h?f:-f,h9(n,t,u)){var d=n.edge(t,u).cutvalue;a+=h?-d:d}}}),a}function ky(n,e){arguments.length<2&&(e=n.nodes()[0]),VO(n,{},1,e)}function VO(n,e,t,r,i){var s=t,o=n.node(r);return e[r]=!0,xr.forEach(n.neighbors(r),function(a){xr.has(e,a)||(t=VO(n,e,t,a,r))}),o.low=s,o.lim=t++,i?o.parent=i:delete o.parent,t}function qO(n){return xr.find(n.edges(),function(e){return n.edge(e).cutvalue<0})}function GO(n,e,t){var r=t.v,i=t.w;e.hasEdge(r,i)||(r=t.w,i=t.v);var s=n.node(r),o=n.node(i),a=s,l=!1;s.lim>o.lim&&(a=o,l=!0);var c=xr.filter(e.edges(),function(u){return l===UO(n,n.node(u.v),a)&&l!==UO(n,n.node(u.w),a)});return xr.minBy(c,function(u){return r9(e,u)})}function HO(n,e,t,r){var i=t.v,s=t.w;n.removeEdge(i,s),n.setEdge(r.v,r.w,{}),ky(n),Ny(n,e),u9(n,e)}function u9(n,e){var t=xr.find(n.nodes(),function(i){return!e.node(i).parent}),r=s9(n,t);r=r.slice(1),xr.forEach(r,function(i){var s=n.node(i).parent,o=e.edge(i,s),a=!1;o||(o=e.edge(s,i),a=!0),e.node(i).rank=e.node(s).rank+(a?o.minlen:-o.minlen)})}function h9(n,e,t){return n.hasEdge(e,t)}function UO(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}var f9=Lu,WO=f9.longestPath,d9=zO,g9=l9,p9=m9;function m9(n){switch(n.graph().ranker){case"network-simplex":XO(n);break;case"tight-tree":v9(n);break;case"longest-path":y9(n);break;default:XO(n)}}var y9=WO;function v9(n){WO(n),d9(n)}function XO(n){g9(n)}var Iy=ke,b9=w9;function w9(n){var e=C9(n);Iy.forEach(n.graph().dummyChains,function(t){for(var r=n.node(t),i=r.edgeObj,s=x9(n,e,i.v,i.w),o=s.path,a=s.lca,l=0,c=o[l],u=!0;t!==i.w;){if(r=n.node(t),u){for(;(c=o[l])!==a&&n.node(c).maxRank<r.rank;)l++;c===a&&(u=!1)}if(!u){for(;l<o.length-1&&n.node(c=o[l+1]).minRank<=r.rank;)l++;c=o[l]}n.setParent(t,c),t=n.successors(t)[0]}})}function x9(n,e,t,r){var i=[],s=[],o=Math.min(e[t].low,e[r].low),a=Math.max(e[t].lim,e[r].lim),l,c;l=t;do l=n.parent(l),i.push(l);while(l&&(e[l].low>o||a>e[l].lim));for(c=l,l=r;(l=n.parent(l))!==c;)s.push(l);return{path:i.concat(s.reverse()),lca:c}}function C9(n){var e={},t=0;function r(i){var s=t;Iy.forEach(n.children(i),r),e[i]={low:s,lim:t++}}return Iy.forEach(n.children(),r),e}var Cr=ke,$y=Bt,S9={run:P9,cleanup:O9};function P9(n){var e=$y.addDummyNode(n,"root",{},"_root"),t=E9(n),r=Cr.max(Cr.values(t))-1,i=2*r+1;n.graph().nestingRoot=e,Cr.forEach(n.edges(),function(o){n.edge(o).minlen*=i});var s=A9(n)+1;Cr.forEach(n.children(),function(o){YO(n,e,i,s,r,t,o)}),n.graph().nodeRankFactor=i}function YO(n,e,t,r,i,s,o){var a=n.children(o);if(!a.length){o!==e&&n.setEdge(e,o,{weight:0,minlen:t});return}var l=$y.addBorderNode(n,"_bt"),c=$y.addBorderNode(n,"_bb"),u=n.node(o);n.setParent(l,o),u.borderTop=l,n.setParent(c,o),u.borderBottom=c,Cr.forEach(a,function(h){YO(n,e,t,r,i,s,h);var f=n.node(h),d=f.borderTop?f.borderTop:h,g=f.borderBottom?f.borderBottom:h,p=f.borderTop?r:2*r,b=d!==g?1:i-s[o]+1;n.setEdge(l,d,{weight:p,minlen:b,nestingEdge:!0}),n.setEdge(g,c,{weight:p,minlen:b,nestingEdge:!0})}),n.parent(o)||n.setEdge(e,l,{weight:0,minlen:i+s[o]})}function E9(n){var e={};function t(r,i){var s=n.children(r);s&&s.length&&Cr.forEach(s,function(o){t(o,i+1)}),e[r]=i}return Cr.forEach(n.children(),function(r){t(r,1)}),e}function A9(n){return Cr.reduce(n.edges(),function(e,t){return e+n.edge(t).weight},0)}function O9(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,Cr.forEach(n.edges(),function(t){var r=n.edge(t);r.nestingEdge&&n.removeEdge(t)})}var Ly=ke,M9=Bt,T9=_9;function _9(n){function e(t){var r=n.children(t),i=n.node(t);if(r.length&&Ly.forEach(r,e),Ly.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,o=i.maxRank+1;s<o;++s)KO(n,"borderLeft","_bl",t,i,s),KO(n,"borderRight","_br",t,i,s)}}Ly.forEach(n.children(),e)}function KO(n,e,t,r,i,s){var o={width:0,height:0,rank:s,borderType:e},a=i[e][s-1],l=M9.addDummyNode(n,"border",o,t);i[e][s]=l,n.setParent(l,r),a&&n.setEdge(a,l,{weight:1})}var Xn=ke,N9={adjust:k9,undo:I9};function k9(n){var e=n.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&JO(n)}function I9(n){var e=n.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&$9(n),(e==="lr"||e==="rl")&&(L9(n),JO(n))}function JO(n){Xn.forEach(n.nodes(),function(e){QO(n.node(e))}),Xn.forEach(n.edges(),function(e){QO(n.edge(e))})}function QO(n){var e=n.width;n.width=n.height,n.height=e}function $9(n){Xn.forEach(n.nodes(),function(e){Ry(n.node(e))}),Xn.forEach(n.edges(),function(e){var t=n.edge(e);Xn.forEach(t.points,Ry),Xn.has(t,"y")&&Ry(t)})}function Ry(n){n.y=-n.y}function L9(n){Xn.forEach(n.nodes(),function(e){jy(n.node(e))}),Xn.forEach(n.edges(),function(e){var t=n.edge(e);Xn.forEach(t.points,jy),Xn.has(t,"x")&&jy(t)})}function jy(n){var e=n.x;n.x=n.y,n.y=e}var Sr=ke,R9=j9;function j9(n){var e={},t=Sr.filter(n.nodes(),function(a){return!n.children(a).length}),r=Sr.max(Sr.map(t,function(a){return n.node(a).rank})),i=Sr.map(Sr.range(r+1),function(){return[]});function s(a){if(!Sr.has(e,a)){e[a]=!0;var l=n.node(a);i[l.rank].push(a),Sr.forEach(n.successors(a),s)}}var o=Sr.sortBy(t,function(a){return n.node(a).rank});return Sr.forEach(o,s),i}var ai=ke,D9=B9;function B9(n,e){for(var t=0,r=1;r<e.length;++r)t+=z9(n,e[r-1],e[r]);return t}function z9(n,e,t){for(var r=ai.zipObject(t,ai.map(t,function(c,u){return u})),i=ai.flatten(ai.map(e,function(c){return ai.sortBy(ai.map(n.outEdges(c),function(u){return{pos:r[u.w],weight:n.edge(u).weight}}),"pos")}),!0),s=1;s<t.length;)s<<=1;var o=2*s-1;s-=1;var a=ai.map(new Array(o),function(){return 0}),l=0;return ai.forEach(i.forEach(function(c){var u=c.pos+s;a[u]+=c.weight;for(var h=0;u>0;)u%2&&(h+=a[u+1]),u=u-1>>1,a[u]+=c.weight;l+=c.weight*h})),l}var ZO=ke,F9=V9;function V9(n,e){return ZO.map(e,function(t){var r=n.inEdges(t);if(r.length){var i=ZO.reduce(r,function(s,o){var a=n.edge(o),l=n.node(o.v);return{sum:s.sum+a.weight*l.order,weight:s.weight+a.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:t}})}var Yt=ke,q9=G9;function G9(n,e){var t={};Yt.forEach(n,function(i,s){var o=t[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Yt.isUndefined(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),Yt.forEach(e.edges(),function(i){var s=t[i.v],o=t[i.w];!Yt.isUndefined(s)&&!Yt.isUndefined(o)&&(o.indegree++,s.out.push(t[i.w]))});var r=Yt.filter(t,function(i){return!i.indegree});return H9(r)}function H9(n){var e=[];function t(s){return function(o){o.merged||(Yt.isUndefined(o.barycenter)||Yt.isUndefined(s.barycenter)||o.barycenter>=s.barycenter)&&U9(s,o)}}function r(s){return function(o){o.in.push(s),--o.indegree===0&&n.push(o)}}for(;n.length;){var i=n.pop();e.push(i),Yt.forEach(i.in.reverse(),t(i)),Yt.forEach(i.out,r(i))}return Yt.map(Yt.filter(e,function(s){return!s.merged}),function(s){return Yt.pick(s,["vs","i","barycenter","weight"])})}function U9(n,e){var t=0,r=0;n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=t/r,n.weight=r,n.i=Math.min(e.i,n.i),e.merged=!0}var qa=ke,W9=Bt,X9=Y9;function Y9(n,e){var t=W9.partition(n,function(u){return qa.has(u,"barycenter")}),r=t.lhs,i=qa.sortBy(t.rhs,function(u){return-u.i}),s=[],o=0,a=0,l=0;r.sort(K9(!!e)),l=eM(s,i,l),qa.forEach(r,function(u){l+=u.vs.length,s.push(u.vs),o+=u.barycenter*u.weight,a+=u.weight,l=eM(s,i,l)});var c={vs:qa.flatten(s,!0)};return a&&(c.barycenter=o/a,c.weight=a),c}function eM(n,e,t){for(var r;e.length&&(r=qa.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}function K9(n){return function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i}}var li=ke,J9=F9,Q9=q9,Z9=X9,e7=tM;function tM(n,e,t,r){var i=n.children(e),s=n.node(e),o=s?s.borderLeft:void 0,a=s?s.borderRight:void 0,l={};o&&(i=li.filter(i,function(g){return g!==o&&g!==a}));var c=J9(n,i);li.forEach(c,function(g){if(n.children(g.v).length){var p=tM(n,g.v,t,r);l[g.v]=p,li.has(p,"barycenter")&&n7(g,p)}});var u=Q9(c,t);t7(u,l);var h=Z9(u,r);if(o&&(h.vs=li.flatten([o,h.vs,a],!0),n.predecessors(o).length)){var f=n.node(n.predecessors(o)[0]),d=n.node(n.predecessors(a)[0]);li.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+d.order)/(h.weight+2),h.weight+=2}return h}function t7(n,e){li.forEach(n,function(t){t.vs=li.flatten(t.vs.map(function(r){return e[r]?e[r].vs:r}),!0)})}function n7(n,e){li.isUndefined(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}var Ga=ke,r7=Nn.Graph,i7=s7;function s7(n,e,t){var r=o7(n),i=new r7({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(s){return n.node(s)});return Ga.forEach(n.nodes(),function(s){var o=n.node(s),a=n.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,a||r),Ga.forEach(n[t](s),function(l){var c=l.v===s?l.w:l.v,u=i.edge(c,s),h=Ga.isUndefined(u)?0:u.weight;i.setEdge(c,s,{weight:n.edge(l).weight+h})}),Ga.has(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function o7(n){for(var e;n.hasNode(e=Ga.uniqueId("_root")););return e}var a7=ke,l7=c7;function c7(n,e,t){var r={},i;a7.forEach(t,function(s){for(var o=n.parent(s),a,l;o;){if(a=n.parent(o),a?(l=r[a],r[a]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=a}})}var ci=ke,u7=R9,h7=D9,f7=e7,d7=i7,g7=l7,p7=Nn.Graph,nM=Bt,m7=y7;function y7(n){var e=nM.maxRank(n),t=rM(n,ci.range(1,e+1),"inEdges"),r=rM(n,ci.range(e-1,-1,-1),"outEdges"),i=u7(n);iM(n,i);for(var s=Number.POSITIVE_INFINITY,o,a=0,l=0;l<4;++a,++l){v7(a%2?t:r,a%4>=2),i=nM.buildLayerMatrix(n);var c=h7(n,i);c<s&&(l=0,o=ci.cloneDeep(i),s=c)}iM(n,o)}function rM(n,e,t){return ci.map(e,function(r){return d7(n,r,t)})}function v7(n,e){var t=new p7;ci.forEach(n,function(r){var i=r.graph().root,s=f7(r,i,t,e);ci.forEach(s.vs,function(o,a){r.node(o).order=a}),g7(r,t,s.vs)})}function iM(n,e){ci.forEach(e,function(t){ci.forEach(t,function(r,i){n.node(r).order=i})})}var se=ke,b7=Nn.Graph,w7=Bt,x7={positionX:P7,findType1Conflicts:sM,findType2Conflicts:oM,addConflict:Dy,hasConflict:aM,verticalAlignment:lM,horizontalCompaction:cM,alignCoordinates:hM,findSmallestWidthAlignment:uM,balance:fM};function sM(n,e){var t={};function r(i,s){var o=0,a=0,l=i.length,c=se.last(s);return se.forEach(s,function(u,h){var f=C7(n,u),d=f?n.node(f).order:l;(f||u===c)&&(se.forEach(s.slice(a,h+1),function(g){se.forEach(n.predecessors(g),function(p){var b=n.node(p),m=b.order;(m<o||d<m)&&!(b.dummy&&n.node(g).dummy)&&Dy(t,p,g)})}),a=h+1,o=d)}),s}return se.reduce(e,r),t}function oM(n,e){var t={};function r(s,o,a,l,c){var u;se.forEach(se.range(o,a),function(h){u=s[h],n.node(u).dummy&&se.forEach(n.predecessors(u),function(f){var d=n.node(f);d.dummy&&(d.order<l||d.order>c)&&Dy(t,f,u)})})}function i(s,o){var a=-1,l,c=0;return se.forEach(o,function(u,h){if(n.node(u).dummy==="border"){var f=n.predecessors(u);f.length&&(l=n.node(f[0]).order,r(o,c,h,a,l),c=h,a=l)}r(o,c,o.length,l,s.length)}),o}return se.reduce(e,i),t}function C7(n,e){if(n.node(e).dummy)return se.find(n.predecessors(e),function(t){return n.node(t).dummy})}function Dy(n,e,t){if(e>t){var r=e;e=t,t=r}var i=n[e];i||(n[e]=i={}),i[t]=!0}function aM(n,e,t){if(e>t){var r=e;e=t,t=r}return se.has(n[e],t)}function lM(n,e,t,r){var i={},s={},o={};return se.forEach(e,function(a){se.forEach(a,function(l,c){i[l]=l,s[l]=l,o[l]=c})}),se.forEach(e,function(a){var l=-1;se.forEach(a,function(c){var u=r(c);if(u.length){u=se.sortBy(u,function(p){return o[p]});for(var h=(u.length-1)/2,f=Math.floor(h),d=Math.ceil(h);f<=d;++f){var g=u[f];s[c]===c&&l<o[g]&&!aM(t,c,g)&&(s[g]=c,s[c]=i[c]=i[g],l=o[g])}}})}),{root:i,align:s}}function cM(n,e,t,r,i){var s={},o=S7(n,e,t,i),a=i?"borderLeft":"borderRight";function l(h,f){for(var d=o.nodes(),g=d.pop(),p={};g;)p[g]?h(g):(p[g]=!0,d.push(g),d=d.concat(f(g))),g=d.pop()}function c(h){s[h]=o.inEdges(h).reduce(function(f,d){return Math.max(f,s[d.v]+o.edge(d))},0)}function u(h){var f=o.outEdges(h).reduce(function(g,p){return Math.min(g,s[p.w]-o.edge(p))},Number.POSITIVE_INFINITY),d=n.node(h);f!==Number.POSITIVE_INFINITY&&d.borderType!==a&&(s[h]=Math.max(s[h],f))}return l(c,o.predecessors.bind(o)),l(u,o.successors.bind(o)),se.forEach(r,function(h){s[h]=s[t[h]]}),s}function S7(n,e,t,r){var i=new b7,s=n.graph(),o=E7(s.nodesep,s.edgesep,r);return se.forEach(e,function(a){var l;se.forEach(a,function(c){var u=t[c];if(i.setNode(u),l){var h=t[l],f=i.edge(h,u);i.setEdge(h,u,Math.max(o(n,c,l),f||0))}l=c})}),i}function uM(n,e){return se.minBy(se.values(e),function(t){var r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return se.forIn(t,function(s,o){var a=A7(n,o)/2;r=Math.max(s+a,r),i=Math.min(s-a,i)}),r-i})}function hM(n,e){var t=se.values(e),r=se.min(t),i=se.max(t);se.forEach(["u","d"],function(s){se.forEach(["l","r"],function(o){var a=s+o,l=n[a],c;if(l!==e){var u=se.values(l);c=o==="l"?r-se.min(u):i-se.max(u),c&&(n[a]=se.mapValues(l,function(h){return h+c}))}})})}function fM(n,e){return se.mapValues(n.ul,function(t,r){if(e)return n[e.toLowerCase()][r];var i=se.sortBy(se.map(n,r));return(i[1]+i[2])/2})}function P7(n){var e=w7.buildLayerMatrix(n),t=se.merge(sM(n,e),oM(n,e)),r={},i;se.forEach(["u","d"],function(o){i=o==="u"?e:se.values(e).reverse(),se.forEach(["l","r"],function(a){a==="r"&&(i=se.map(i,function(h){return se.values(h).reverse()}));var l=(o==="u"?n.predecessors:n.successors).bind(n),c=lM(n,i,t,l),u=cM(n,i,c.root,c.align,a==="r");a==="r"&&(u=se.mapValues(u,function(h){return-h})),r[o+a]=u})});var s=uM(n,r);return hM(r,s),fM(r,n.graph().align)}function E7(n,e,t){return function(r,i,s){var o=r.node(i),a=r.node(s),l=0,c;if(l+=o.width/2,se.has(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":c=-o.width/2;break;case"r":c=o.width/2;break}if(c&&(l+=t?c:-c),c=0,l+=(o.dummy?e:n)/2,l+=(a.dummy?e:n)/2,l+=a.width/2,se.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=t?c:-c),c=0,l}}function A7(n,e){return n.node(e).width}var Ha=ke,dM=Bt,O7=x7.positionX,M7=T7;function T7(n){n=dM.asNonCompoundGraph(n),_7(n),Ha.forEach(O7(n),function(e,t){n.node(t).x=e})}function _7(n){var e=dM.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Ha.forEach(e,function(i){var s=Ha.max(Ha.map(i,function(o){return n.node(o).height}));Ha.forEach(i,function(o){n.node(o).y=r+s/2}),r+=s+t})}var ae=ke,gM=MW,pM=HW,N7=p9,k7=Bt.normalizeRanks,I7=b9,$7=Bt.removeEmptyRanks,mM=S9,L7=T9,yM=N9,R7=m7,j7=M7,ui=Bt,D7=Nn.Graph,B7=z7;function z7(n,e){var t=e&&e.debugTiming?ui.time:ui.notime;t("layout",function(){var r=t(" buildLayoutGraph",function(){return J7(n)});t(" runLayout",function(){F7(r,t)}),t(" updateInputGraph",function(){V7(n,r)})})}function F7(n,e){e(" makeSpaceForEdgeLabels",function(){Q7(n)}),e(" removeSelfEdges",function(){aX(n)}),e(" acyclic",function(){gM.run(n)}),e(" nestingGraph.run",function(){mM.run(n)}),e(" rank",function(){N7(ui.asNonCompoundGraph(n))}),e(" injectEdgeLabelProxies",function(){Z7(n)}),e(" removeEmptyRanks",function(){$7(n)}),e(" nestingGraph.cleanup",function(){mM.cleanup(n)}),e(" normalizeRanks",function(){k7(n)}),e(" assignRankMinMax",function(){eX(n)}),e(" removeEdgeLabelProxies",function(){tX(n)}),e(" normalize.run",function(){pM.run(n)}),e(" parentDummyChains",function(){I7(n)}),e(" addBorderSegments",function(){L7(n)}),e(" order",function(){R7(n)}),e(" insertSelfEdges",function(){lX(n)}),e(" adjustCoordinateSystem",function(){yM.adjust(n)}),e(" position",function(){j7(n)}),e(" positionSelfEdges",function(){cX(n)}),e(" removeBorderNodes",function(){oX(n)}),e(" normalize.undo",function(){pM.undo(n)}),e(" fixupEdgeLabelCoords",function(){iX(n)}),e(" undoCoordinateSystem",function(){yM.undo(n)}),e(" translateGraph",function(){nX(n)}),e(" assignNodeIntersects",function(){rX(n)}),e(" reversePoints",function(){sX(n)}),e(" acyclic.undo",function(){gM.undo(n)})}function V7(n,e){ae.forEach(n.nodes(),function(t){var r=n.node(t),i=e.node(t);r&&(r.x=i.x,r.y=i.y,e.children(t).length&&(r.width=i.width,r.height=i.height))}),ae.forEach(n.edges(),function(t){var r=n.edge(t),i=e.edge(t);r.points=i.points,ae.has(i,"x")&&(r.x=i.x,r.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var q7=["nodesep","edgesep","ranksep","marginx","marginy"],G7={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},H7=["acyclicer","ranker","rankdir","align"],U7=["width","height"],W7={width:0,height:0},X7=["minlen","weight","width","height","labeloffset"],Y7={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},K7=["labelpos"];function J7(n){var e=new D7({multigraph:!0,compound:!0}),t=zy(n.graph());return e.setGraph(ae.merge({},G7,By(t,q7),ae.pick(t,H7))),ae.forEach(n.nodes(),function(r){var i=zy(n.node(r));e.setNode(r,ae.defaults(By(i,U7),W7)),e.setParent(r,n.parent(r))}),ae.forEach(n.edges(),function(r){var i=zy(n.edge(r));e.setEdge(r,ae.merge({},Y7,By(i,X7),ae.pick(i,K7)))}),e}function Q7(n){var e=n.graph();e.ranksep/=2,ae.forEach(n.edges(),function(t){var r=n.edge(t);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Z7(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),i=n.node(e.w),s={rank:(i.rank-r.rank)/2+r.rank,e};ui.addDummyNode(n,"edge-proxy",s,"_ep")}})}function eX(n){var e=0;ae.forEach(n.nodes(),function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=ae.max(e,r.maxRank))}),n.graph().maxRank=e}function tX(n){ae.forEach(n.nodes(),function(e){var t=n.node(e);t.dummy==="edge-proxy"&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))})}function nX(n){var e=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,i=0,s=n.graph(),o=s.marginx||0,a=s.marginy||0;function l(c){var u=c.x,h=c.y,f=c.width,d=c.height;e=Math.min(e,u-f/2),t=Math.max(t,u+f/2),r=Math.min(r,h-d/2),i=Math.max(i,h+d/2)}ae.forEach(n.nodes(),function(c){l(n.node(c))}),ae.forEach(n.edges(),function(c){var u=n.edge(c);ae.has(u,"x")&&l(u)}),e-=o,r-=a,ae.forEach(n.nodes(),function(c){var u=n.node(c);u.x-=e,u.y-=r}),ae.forEach(n.edges(),function(c){var u=n.edge(c);ae.forEach(u.points,function(h){h.x-=e,h.y-=r}),ae.has(u,"x")&&(u.x-=e),ae.has(u,"y")&&(u.y-=r)}),s.width=t-e+o,s.height=i-r+a}function rX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e),r=n.node(e.v),i=n.node(e.w),s,o;t.points?(s=t.points[0],o=t.points[t.points.length-1]):(t.points=[],s=i,o=r),t.points.unshift(ui.intersectRect(r,s)),t.points.push(ui.intersectRect(i,o))})}function iX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);if(ae.has(t,"x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function sX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);t.reversed&&t.points.reverse()})}function oX(n){ae.forEach(n.nodes(),function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),i=n.node(t.borderBottom),s=n.node(ae.last(t.borderLeft)),o=n.node(ae.last(t.borderRight));t.width=Math.abs(o.x-s.x),t.height=Math.abs(i.y-r.y),t.x=s.x+t.width/2,t.y=r.y+t.height/2}}),ae.forEach(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function aX(n){ae.forEach(n.edges(),function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:n.edge(e)}),n.removeEdge(e)}})}function lX(n){var e=ui.buildLayerMatrix(n);ae.forEach(e,function(t){var r=0;ae.forEach(t,function(i,s){var o=n.node(i);o.order=s+r,ae.forEach(o.selfEdges,function(a){ui.addDummyNode(n,"selfedge",{width:a.label.width,height:a.label.height,rank:o.rank,order:s+ ++r,e:a.e,label:a.label},"_se")}),delete o.selfEdges})})}function cX(n){ae.forEach(n.nodes(),function(e){var t=n.node(e);if(t.dummy==="selfedge"){var r=n.node(t.e.v),i=r.x+r.width/2,s=r.y,o=t.x-i,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.label.points=[{x:i+2*o/3,y:s-a},{x:i+5*o/6,y:s-a},{x:i+o,y:s},{x:i+5*o/6,y:s+a},{x:i+2*o/3,y:s+a}],t.label.x=t.x,t.label.y=t.y}})}function By(n,e){return ae.mapValues(ae.pick(n,e),Number)}function zy(n){var e={};return ae.forEach(n,function(t,r){e[r.toLowerCase()]=t}),e}var Du=ke,uX=Bt,hX=Nn.Graph,fX={debugOrdering:dX};function dX(n){var e=uX.buildLayerMatrix(n),t=new hX({compound:!0,multigraph:!0}).setGraph({});return Du.forEach(n.nodes(),function(r){t.setNode(r,{label:r}),t.setParent(r,"layer"+n.node(r).rank)}),Du.forEach(n.edges(),function(r){t.setEdge(r.v,r.w,{},r.name)}),Du.forEach(e,function(r,i){var s="layer"+i;t.setNode(s,{rank:"same"}),Du.reduce(r,function(o,a){return t.setEdge(o,a,{style:"invis"}),a})}),t}var gX="0.8.5",pX={graphlib:Nn,layout:B7,debug:fX,util:{time:Bt.time,notime:Bt.notime},version:gX};const Bu=Yy(pX),{groupBy:mX,reduce:yX,uniq:vX,uniqBy:vM}=Uu,bX={ER:"er-rect",EDGE:"edge"},hi=()=>Ja.useTranslation("graph-collection-manager"),bM=(n,e)=>{const t=[],r=i=>{const s=n==null?void 0:n.find(o=>o.name===i);if(s){const{inherits:o}=s;if(o)for(let a=0;a<o.length;a++){const l=o[a];t.push(l),r(l)}}return vX(t)};return r(e)},wX=(n,e)=>{const t=[],r=i=>(n.filter(o=>{var a;return(a=o.inherits)==null?void 0:a.includes(i)}).forEach(o=>{const a=o.name;return t.push(o),r(a)}),t);return r(e)},wM=n=>{const e=[],t=[],r=n.map(o=>{const a=[],l=[...o.fields],c=bM(n,o.name),u=yX(c,(f,d)=>{var b;const g=f,p=(b=n.find(m=>m.name===d))==null?void 0:b.fields.map(m=>De(re({},m),{sourceCollectionName:o.name}));return p?g.concat(p):g},[]);vM(l.concat(u),"name").forEach(f=>{f.uiSchema&&a.push(re({id:f.name,group:"list"},f)),["obo","oho","o2o","o2m","m2o","m2m","linkTo","mbm"].includes(f.interface)&&e.push(f)}),t.push(o.name);const h=xX(a);return{id:o.name,shape:bX.ER,name:o.name,title:o.title,width:250,ports:[...h.initPorts||[],...h.morePorts||[]],item:o}}),i=SX(e,t,r),s=CX(n);return{nodesData:r,edgesData:i,inheritEdges:s}},xX=n=>mX(n,t=>t.isForeignKey||t.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id","mbm"].includes(t.interface)?"initPorts":"morePorts"),CX=n=>{const e={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null}},router:{name:"smooth",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:"inherits",fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",fill:"var(--nb-box-bg)"}},position:{distance:.5,args:{keepGradient:!0,ensureLegibility:!0}}}]},t=[];return n.forEach(r=>{const i=r.inherits||[];i.length&&i.forEach(s=>{t.push(re({id:r.name+s,source:{cell:r.name,connectionPoint:"rect"},target:{cell:s,connectionPoint:"rect"},connector:{name:"normal",zIndex:1e3},connectionType:"inherited"},e))})}),t},SX=(n,e,t)=>{var i,s,o,a,l,c,u;const r=[];for(let h=0;h<n.length;h++)if(e.includes(n[h].target)){const f=t.find(b=>b.name===n[h].target),d=t.find(b=>b.name===(n[h].sourceCollectionName||n[h].collectionName)),g={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null,targetMarker:null}},router:d.id===f.id?{name:"oneSide",args:{side:"left"}}:{name:"er",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:xM(n[h].interface)[0],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",strokeWidth:1,rx:10,ry:10}},position:{distance:.3,args:{keepGradient:!0,ensureLegibility:!0}}},{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:xM(n[h].interface)[1],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",rx:10,ry:10,strokeWidth:1}},position:{distance:.7,args:{keepGradient:!0,ensureLegibility:!0}}}],connector:{name:"normal",zIndex:1e3}},p=b=>{const m=r.find(v=>v.id===b);return m?(m.associated.push(n[h].name),!1):!0};if(["m2m","linkTo"].includes(n[h].interface)){const b=t.find(m=>m.name===n[h].through);if(b){const m=d.id,v=b.id,y=(i=d.ports.find(O=>O.name===n[h].sourceKey))==null?void 0:i.id,w=(s=b.ports.find(O=>O.name===n[h].foreignKey))==null?void 0:s.id,x=f.id,C=b.id,S=(o=f.ports.find(O=>O.name===n[h].targetKey))==null?void 0:o.id,E=(a=b.ports.find(O=>O.name===n[h].otherKey))==null?void 0:a.id,A=m+y+v+w,M=x+S+C+E;r.push(re({id:A,source:{cell:m,port:y,anchor:{name:"right"}},target:{cell:v,port:w,anchor:{name:"left"}},associated:[n[h].name],m2m:[A,M]},g)),r.push(re({id:M,source:{cell:x,port:S,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name],m2m:[A,M]},g))}}else{const b=t.find(O=>O.name==(n[h].sourceCollectionName||n[h].collectionName)).ports.find(O=>O.name===n[h].foreignKey),m=d.id,v=f.id,y=b==null?void 0:b.id,w=(l=f.ports.find(O=>O.name===n[h].targetKey))==null?void 0:l.id,x=d.id,C=f.id,S=(c=d.ports.find(O=>O.name===n[h].sourceKey))==null?void 0:c.id,E=(u=f.ports.find(O=>O.name===n[h].foreignKey))==null?void 0:u.id,A=m+y+v+w,M=x+S+C+E;p(v+w+m+y)&&b&&w&&r.push(re({id:A,source:{cell:m,port:y,anchor:{name:"right"}},target:{cell:v,port:w,anchor:{name:"left"}},associated:[n[h].name]},g)),p(C+E+x+S)&&S&&E&&r.push(re({id:M,source:{cell:x,port:S,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name]},g))}}return vM(r,"id")},xM=n=>{switch(n){case"m2m":case"linkTo":return["1","N"];case"o2m":return["1","N"];case"m2o":return["N","1"];case"obo":case"oho":return["1","1"];case"mbm":return["N","N"];default:return[]}},PX=(n,e)=>{const t=[],r=n.length,i=e.length;for(let s=0;s<r;s++)if(!e.find(o=>o.id===n[s].id))t.push({status:"add",node:n[s]});else{const o=e.find(c=>c.id===n[s].id),a=o==null?void 0:o.ports.items,l=n[s].ports;if(o){for(let c=0;c<l.length;c++)a.find(u=>u.id===l[c].id)||t.push({status:"insertPort",node:n[s],port:{index:c,port:l[c]}});for(let c=0;c<a.length;c++)l.find(u=>u.id===a[c].id)||t.push({status:"deletePort",node:n[s],port:a[c]});o.title!==n[s].title&&t.push({status:"updateNode",node:n[s]})}}for(let s=0;s<i;s++)n.find(o=>o.id===e[s].id)||t.push({status:"delete",node:e[s]});return t},CM=(n,e)=>{const t=n.length,r=e==null?void 0:e.length,i=[];for(let s=0;s<t;s++)e.find(o=>o.id===n[s].id)||i.push({status:"add",edge:n[s]});for(let s=0;s<r;s++)n.find(o=>o.id===e[s].id)||i.push({status:"delete",edge:e[s]});return i};let zu;const nt=()=>zu||(zu=document.getElementById("graph_container")),EX=()=>{zu=null},SM={name:"collections",filterTargetKey:"name",targetKey:"name",sortable:!0,fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{ t("Collection display name") }}',type:"number","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:'{{ t("Collection name") }}',type:"string","x-component":"Input",description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'}},{type:"string",name:"template",interface:"input",uiSchema:{title:'{{ t("Collection Template") }}',type:"string","x-component":"Input"}},{type:"hasMany",name:"fields",target:"fields",collectionName:"collections",sourceKey:"name",targetKey:"name",uiSchema:{}},{type:"hasMany",name:"inherits",interface:"select",uiSchema:{title:'{{ t("Inherits") }}',type:"string","x-component":"Select","x-component-props":{mode:"multiple"}}},{type:"string",name:"description",interface:"input",uiSchema:{title:'{{ t("Description") }}',type:"string","x-component":"Input"}}]},AX=({item:n})=>_.jsx(L.AddCollection,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,scope:{useCancelAction:Kn},getContainer:nt,children:_.jsx(ce.Button,{type:"primary",children:_.jsx(ue.PlusOutlined,{})})}),OX=n=>{const{onClick:e}=n,{t}=hi(),r=[{key:Xa.Both,label:"All relationships"},{key:Xa.Entity,label:"Entity relationship only"},{key:Xa.Inherit,label:"Inheritance relationship only"}],i=_.jsx("div",{children:_.jsx(ce.Menu,{defaultSelectedKeys:[Xa.Both],selectable:!0,className:Pr.css`
457
+ .ant-menu-item {
458
+ height: 32px;
459
+ line-height: 32px;
460
+ }
461
+ `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...r.map(s=>({key:s.key,label:t(s.label),onClick:o=>{e==null||e(s.key)}}))]})});return _.jsx(ce.Popover,{content:i,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:nt,overlayClassName:Pr.css`
462
+ .ant-popover-inner-content {
463
+ padding: 0;
464
+ }
465
+ `,children:_.jsx(ce.Button,{children:_.jsx(ue.ShareAltOutlined,{})})})},MX=n=>{const{onClick:e}=n,{t}=hi(),r=[{key:Wa.Both,label:"All directions"},{key:Wa.Target,label:"Target index"},{key:Wa.Source,label:"Source index"}],i=_.jsx("div",{children:_.jsx(ce.Menu,{defaultSelectedKeys:[Wa.Target],selectable:!0,className:Pr.css`
466
+ .ant-menu-item {
467
+ height: 32px;
468
+ line-height: 32px;
469
+ }
470
+ `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...r.map(s=>({key:s.key,label:t(s.label),onClick:()=>{e==null||e(s.key)}}))]})});return _.jsx(ce.Popover,{content:i,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:nt,overlayClassName:Pr.css`
471
+ .ant-popover-inner-content {
472
+ padding: 0;
473
+ }
474
+ `,children:_.jsx(ce.Button,{children:_.jsx(ue.LineHeightOutlined,{})})})},Fy=L.createStyles(({token:n,css:e})=>({graphMinimap:e`
475
+ .x6-widget-minimap {
476
+ background-color: ${n.colorBgContainer};
477
+ }
478
+ `,addButtonClass:e`
479
+ flex-shrink: 0;
480
+ padding: 2em 0;
481
+ `,entityContainer:e`
482
+ .btn-del {
483
+ border-color: transparent;
484
+ background-color: ${n.colorErrorBg};
485
+ color: ${n.colorErrorText};
486
+ height: 20px;
487
+ width: 20px;
488
+ &:hover {
489
+ background-color: ${n.colorErrorBgHover};
490
+ }
491
+ }
492
+ .btn-add {
493
+ background: ${n.colorSuccessBg};
494
+ border-color: transparent;
495
+ color: ${n.colorSuccessText};
496
+ width: 20px;
497
+ &:hover {
498
+ background-color: ${n.colorSuccessBgHover};
499
+ }
500
+ }
501
+ .btn-edit {
502
+ color: ${n.colorText};
503
+ display: flex;
504
+ &:hover {
505
+ background: ${n.colorBgTextHover};
506
+ }
507
+ }
508
+ .btn-edit-in-head {
509
+ border-color: transparent;
510
+ color: ${n.colorText};
511
+ height: 20px;
512
+ width: 22px;
513
+ margin: 0px 5px 4px;
514
+ line-height: 25px;
515
+ &:hover {
516
+ background: ${n.colorBgTextHover};
517
+ }
518
+ }
519
+ .btn-inheriedParent {
520
+ background: ${n.colorInfoBg};
521
+ border-color: transparent;
522
+ color: ${n.colorInfo};
523
+ width: 20px;
524
+ height: 20px;
525
+ line-height: 25px;
526
+ &:hover {
527
+ background-color: ${n.colorInfoBgHover};
528
+ }
529
+ }
530
+ .btn-inheriedChild {
531
+ background: ${n.colorInfoBg};
532
+ border-color: transparent;
533
+ color: ${n.colorInfo};
534
+ width: 20px;
535
+ height: 20px;
536
+ margin: 0px 5px 4px;
537
+ &:hover {
538
+ background-color: ${n.colorInfoBgHover};
539
+ }
540
+ }
541
+ width: 250px;
542
+ height: 100%;
543
+ border-radius: ${n.borderRadiusLG}px;
544
+ background-color: ${n.colorBgContainer};
545
+ border: 0;
546
+ overflow: hidden;
547
+ &:hover {
548
+ box-shadow: ${n.boxShadowTertiary};
549
+ }
550
+ .body {
551
+ width: 100%;
552
+ height: 100%;
553
+ background-color: ${n.colorBgContainer};
554
+ cursor: pointer;
555
+ .morePorts {
556
+ max-height: 300px;
557
+ overflow: auto;
558
+ }
559
+ .body-item {
560
+ display: inline-table;
561
+ width: 100%;
562
+ max-width: 250px;
563
+ height: 40px;
564
+ font-size: 14px;
565
+ color: ${n.colorText};
566
+ border-top: 1px solid ${n.colorBorderSecondary};
567
+ text-overflow: ellipsis;
568
+ display: flex;
569
+ flex-direction: row;
570
+ align-items: center;
571
+ justify-content: space-between;
572
+
573
+ .field-operator {
574
+ display: none;
575
+ }
576
+ &:hover {
577
+ .field-operator {
578
+ display: flex;
579
+ flex-direction: row-reverse;
580
+ height: 32px;
581
+ line-height: 32px;
582
+ z-index: 999;
583
+ cursor: pointer;
584
+ text-align: right;
585
+ background: ${n.colorBgContainer};
586
+ padding-right: 3px;
587
+ span {
588
+ margin: 3px;
589
+ margin-left: 4px;
590
+ padding: 3px;
591
+ height: 20px;
592
+ width: 20px;
593
+ }
594
+ .btn-override {
595
+ border-color: transparent;
596
+ width: 20px;
597
+ color: ${n.colorText};
598
+ &:hover {
599
+ background-color: ${n.colorBgTextHover};
600
+ }
601
+ }
602
+ .btn-view {
603
+ border-color: transparent;
604
+ color: ${n.colorText};
605
+ width: 20px;
606
+ }
607
+ .btn-view:hover {
608
+ background: ${n.colorBgTextHover};
609
+ }
610
+ .btn-assocition {
611
+ border-color: transparent;
612
+ color: ${n.colorPrimary};
613
+ width: 20px;
614
+ }
615
+ .btn-assocition:hover {
616
+ background: ${n.colorBgTextHover};
617
+ }
618
+ }
619
+ .field_type {
620
+ display: none;
621
+ }
622
+ }
623
+
624
+ .name {
625
+ text-overflow: ellipsis;
626
+ white-space: nowrap;
627
+ overflow: hidden;
628
+ margin-left: 8px;
629
+ min-width: 50%;
630
+ .ant-badge {
631
+ padding-right: 5px;
632
+ }
633
+ }
634
+
635
+ .type {
636
+ color: ${n.colorTextTertiary};
637
+ margin-right: 8px;
638
+ text-overflow: ellipsis;
639
+ white-space: nowrap;
640
+ overflow: hidden;
641
+ }
642
+ }
643
+ }
644
+ `,headClass:e`
645
+ height: 50px;
646
+ font-size: 14px;
647
+ font-weight: 500;
648
+ display: flex;
649
+ flex-direction: row;
650
+ justify-content: space-between;
651
+ align-items: center;
652
+ background: ${n.colorFillAlter};
653
+ color: ${n.colorTextHeading};
654
+ padding: 0 8px;
655
+ `,tableNameClass:e`
656
+ max-width: 80%;
657
+ overflow: hidden;
658
+ text-overflow: ellipsis;
659
+ white-space: nowrap;
660
+ font-weight: 500;
661
+ `,tableBtnClass:e`
662
+ display: flex;
663
+ span {
664
+ cursor: pointer;
665
+ }
666
+ `,collectionPopoverClass:e`
667
+ div.field-content {
668
+ font-size: 14px;
669
+ color: ${n.colorTextSecondary};
670
+ opacity: 0.8;
671
+ display: block;
672
+ .field-type {
673
+ color: ${n.colorText};
674
+ float: right;
675
+ }
676
+ }
677
+ `,collectionListClass:e`
678
+ .nb-action-bar {
679
+ float: right;
680
+ position: fixed;
681
+ margin-top: 24px;
682
+ right: 24px;
683
+ z-index: 1000;
684
+ .trigger {
685
+ float: right;
686
+ margin: 2px 4px;
687
+ font-size: 16px;
688
+ }
689
+ .ant-input {
690
+ margin: 4px;
691
+ }
692
+ .ant-menu-inline {
693
+ border-top: 1px solid ${n.colorBorderSecondary};
694
+ }
695
+ .ant-layout-sider {
696
+ margin-top: 24px;
697
+ }
698
+ .ant-menu-item {
699
+ height: 32px;
700
+ }
701
+ .ant-btn {
702
+ border: 0;
703
+ }
704
+ }
705
+ `,graphCollectionContainerClass:e`
706
+ overflow: hidden;
707
+ #container {
708
+ height: 100% !important;
709
+ }
710
+ .x6-graph-scroller {
711
+ height: calc(100vh) !important;
712
+ width: calc(100vw) !important;
713
+ }
714
+ `})),TX=n=>{const e=n.collectionName,{run:t}=Xv(e,n.key);return{run(){return Be(this,null,function*(){yield t()})}}},_X=({item:n,database:e})=>_.jsx(L.AddFieldAction,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,database:e,scope:{useCancelAction:Kn,useCreateCollectionField:()=>TX(n)},getContainer:nt,children:_.jsx(ue.PlusOutlined,{className:"btn-add",id:"graph_btn_add_field"})}),NX=n=>{const{targetGraph:e,item:t}=n;return _.jsx(ue.BranchesOutlined,{className:"btn-assocition",onClick:()=>{e.onConnectionAssociation(t)}})},kX=n=>{const{targetGraph:e,item:t}=n,{t:r}=hi(),{getChildrenCollections:i}=L.useCollectionManager_deprecated(),s=i(t.name);return(s==null?void 0:s.some(({name:a})=>!e.hasCell(a)))?_.jsx(ce.Tooltip,{title:r("Show child"),getPopupContainer:nt,children:_.jsx(ue.FallOutlined,{className:"btn-inheriedChild",onClick:()=>{e.onConnectionChilds(s.map(a=>a.name))}})}):""},IX=n=>{const{targetGraph:e,item:t}=n,{t:r}=hi(),{getInheritCollections:i}=L.useCollectionManager_deprecated(),s=i(t.name);return(s==null?void 0:s.some(a=>!e.hasCell(a)))?_.jsx(ce.Tooltip,{title:r("Show parent"),getPopupContainer:nt,children:_.jsx(ue.RiseOutlined,{className:"btn-inheriedParent",onClick:()=>{e.onConnectionParents(s)}})}):""},$X=r=>{var i=r,{item:n,className:e}=i,t=Wy(i,["item","className"]);return _.jsx(L.DeleteCollection,De(re({item:n,scope:{useCancelAction:Kn,useUpdateCollectionActionAndRefreshCM:gl,createOnly:!1},getContainer:nt},t),{children:_.jsx(ue.DeleteOutlined,{className:e})}))},LX=({item:n,className:e})=>_.jsx(L.EditCollection,{item:n,scope:{useCancelAction:Kn,useUpdateCollectionActionAndRefreshCM:gl,createOnly:!1},getContainer:nt,children:_.jsx(ue.EditOutlined,{className:e})}),RX=n=>{const e=n.collectionName,{run:t}=nR({collectionName:e,name:n.name,key:n.id});return{run(){return Be(this,null,function*(){yield t()})}}},jX=({item:n,parentItem:e})=>_.jsx(L.EditFieldAction,{item:n,parentItem:e,scope:{useCancelAction:Kn,useUpdateCollectionField:()=>RX(n)},getContainer:nt,children:_.jsx(ue.EditOutlined,{className:"btn-edit"})}),DX=Ft.observer(n=>{const{schemaKey:e}=n,{getInterface:t}=L.useCollectionManager_deprecated(),r=L.useCompile(),{t:i}=Ja.useTranslation(),s=t(e);return s?_.jsxs("div",{className:L.css`
715
+ background: #f6f6f6;
716
+ margin-bottom: 24px;
717
+ padding: 16px;
718
+ `,children:[_.jsxs("div",{className:L.css``,children:[i("Field interface"),": ",_.jsx(ce.Tag,{children:r(s.title)})]}),s.description?_.jsx("div",{className:L.css`
719
+ margin-top: 8px;
720
+ color: rgba(0, 0, 0, 0.45);
721
+ `,children:r(s.description)}):null]}):null},{displayName:"FieldSummary"}),BX=n=>{const e=n.targetCollection,{run:t}=Xv(e);return{run(){return Be(this,null,function*(){yield t()})}}},zX=({item:n,parentItem:e})=>_.jsx(L.OverridingFieldAction,{item:re({},n),parentItem:e,scope:{useCancelAction:Kn,useOverridingCollectionField:()=>BX(n)},getContainer:nt,children:_.jsx(ue.CopyOutlined,{className:"btn-override"})}),FX=({item:n,parentItem:e})=>_.jsx(L.ViewFieldAction,{item:re({},n),parentItem:e,getContainer:nt,children:_.jsx(ue.EyeOutlined,{className:"btn-view"})}),PM=ee.memo(n=>{const{property:e,loadCollections:t,collectionData:r,setTargetNode:i,node:s,handelOpenPorts:o,title:a,name:l,targetGraph:c}=n,u=e.collectionName===l,h=ee.useContext(Ft.SchemaOptionsContext),d=["hasOne","hasMany","belongsTo","belongsToMany"].includes(e.type)&&!(e.through?c.hasCell(e.through):c.hasCell(e.target)),{data:{database:g}}=L.useCurrentAppInfo(),p=m=>`${m||""}${fo.uid()}`,b=()=>{const m=L.useRecord(),{getCollectionFields:v}=L.useCollectionManager_deprecated();return v(m.collectionName||m.name)};return _.jsx("div",{className:"field-operator",children:_.jsx(L.SchemaComponentProvider,{components:re({Select:m=>_.jsx(L.Select,De(re({popupMatchSelectWidth:!1},m),{getPopupContainer:nt})),FieldSummary:DX,AddFieldAction:_X,OverrideFieldAction:zX,ViewFieldAction:FX,EditFieldAction:jX,ConnectAssociationAction:NX},h.components),scope:re({useAsyncDataSource:lh,loadCollections:t,useCancelAction:Kn,useNewId:p,useCurrentFields:b,useValuesFromRecord:tR,useUpdateCollectionActionAndRefreshCM:gl,isInheritField:u,isShowAssocition:d},h.scope),children:_.jsx(Uv,{record:r.current,setTargetNode:i,node:s,handelOpenPorts:()=>o(!0),children:_.jsx(L.SchemaComponent,{scope:Kn,schema:{type:"object",properties:{create:{type:"void","x-action":"create","x-component":"AddFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:De(re({},e),{title:a}),database:g}},update:{type:"void","x-action":"update","x-component":"EditFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:De(re({},e),{title:a}),parentItem:r.current}},delete:{type:"void","x-action":"destroy","x-component":"Action.Link","x-visible":"{{isInheritField}}","x-component-props":{component:ue.DeleteOutlined,icon:"DeleteOutlined",className:"btn-del",confirm:{getContainer:nt,title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:()=>oR({collectionName:e.collectionName,name:e.name})}},override:{type:"void","x-action":"create","x-visible":"{{!isInheritField}}","x-component":"OverrideFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:De(re({},e),{title:a,targetCollection:l}),parentItem:r.current}},view:{type:"void","x-action":"view","x-visible":"{{!isInheritField}}","x-component":"ViewFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:De(re({},e),{title:a}),parentItem:r.current}},connectAssociation:{type:"void","x-action":"view","x-visible":"{{isShowAssocition}}","x-component":"ConnectAssociationAction","x-component-props":{item:De(re({},e),{title:a,__parent:r.current}),targetGraph:c}}}}})})})})});PM.displayName="OperationButton";const Vy=ee.forwardRef((n,e)=>{var y,w,x,C;const v=n,{property:t,node:r}=v,i=Wy(v,["property","node"]),{store:{data:{title:s,name:o,sourcePort:a,associated:l,targetPort:c}}}=r,u=L.useCompile(),{styles:h}=Fy(),{getInterface:f}=L.useCollectionManager_deprecated(),[d,g]=ee.useState(!1),p=ee.useCallback(S=>{const{type:E,name:A,primaryKey:M,allowNull:O,autoIncrement:I}=S;return _.jsxs("div",{className:h.collectionPopoverClass,children:[_.jsxs("div",{className:"field-content",children:[_.jsxs("div",{children:[_.jsx("span",{children:"name"}),": ",_.jsx("span",{className:"field-type",children:A})]}),_.jsxs("div",{children:[_.jsx("span",{children:"type"}),": ",_.jsx("span",{className:"field-type",children:E})]})]}),_.jsxs("p",{children:[M&&_.jsx(ce.Tag,{color:"green",children:"PRIMARY"}),O&&_.jsx(ce.Tag,{color:"geekblue",children:"ALLOWNULL"}),I&&_.jsx(ce.Tag,{color:"purple",children:"AUTOINCREMENT"})]})]})},[]),b=re({title:s,name:o,node:r},i),m=S=>{if(S.isForeignKey||S.primaryKey||S.interface==="id")return"red";if(["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(S.interface))return"orange"};return _.jsx("div",{children:_.jsxs("div",{className:"body-item",id:t.id,style:{background:c===t.id||a===t.id||l!=null&&l.includes(t.name)?"#e6f7ff":null},onMouseEnter:()=>{g(!0)},onMouseLeave:()=>g(!1),children:[_.jsx(L.StablePopover,{content:p(t),getPopupContainer:nt,mouseLeaveDelay:0,title:_.jsxs("div",{children:[u((y=t.uiSchema)==null?void 0:y.title),_.jsx("span",{style:{color:"#ffa940",float:"right"},children:u((w=f(t.interface))==null?void 0:w.title)})]}),placement:"right",children:_.jsxs("div",{className:"name",children:[_.jsx(ce.Badge,{color:m(t)}),u((x=t.uiSchema)==null?void 0:x.title)]})},t.id),_.jsx("div",{className:"type field_type",children:u((C=f(t.interface))==null?void 0:C.title)}),d&&_.jsx(PM,re({property:t},b))]},t.id)})});Vy.displayName="PopoverContent";const VX=ee.memo(({targetGraph:n,collectionData:e,setTargetNode:t,node:r,loadCollections:i})=>{var p,b;const{store:{data:{item:s,ports:o,data:a}}}=r,[l,c]=ee.useState(!1),{t:u}=hi(),h=Uu.groupBy(o.items,m=>m.isForeignKey||m.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id","mbm"].includes(m.interface)?"initPorts":"morePorts"),f=m=>{var y;(y=n.getCellById(s.name))==null||y.toFront(),c(m);const v=n.collapseNodes||[];v.push({[s.name]:m}),n.collapseNodes=v,n.getCellById(s.name).setData({collapse:!0})},d=l&&(a==null?void 0:a.collapse),g={collectionData:e,setTargetNode:t,loadCollections:i,handelOpenPorts:f,node:r,targetGraph:n};return _.jsxs("div",{className:"body",children:[(p=h.initPorts)==null?void 0:p.map(m=>m.uiSchema&&ee.createElement(Vy,De(re({},g),{property:m,key:m.id}))),_.jsx("div",{className:"morePorts",children:d&&((b=h.morePorts)==null?void 0:b.map(m=>m.uiSchema&&ee.createElement(Vy,De(re({},g),{property:m,key:m.id}))))}),_.jsx("a",{className:Pr.css`
722
+ display: block;
723
+ color: #958f8f;
724
+ padding: 10px 5px;
725
+ &:hover {
726
+ color: rgb(99 90 88);
727
+ }
728
+ `,onClick:()=>f(!d),children:d?[_.jsx(ue.UpOutlined,{style:{margin:"0px 8px 0px 5px"}},"icon"),_.jsx("span",{children:u("Association Fields")},"associate")]:[_.jsx(ue.DownOutlined,{style:{margin:"0px 8px 0px 5px"}},"icon"),_.jsx("span",{children:u("All Fields")},"all")]})]})}),qX=n=>{const{styles:e}=Fy(),t=ee.useContext(Ft.SchemaOptionsContext),{node:r,setTargetNode:i,targetGraph:s}=n,{store:{data:{title:o,name:a,item:l,attrs:c,select:u,actived:h}},id:f}=r,{data:{database:d}}=L.useCurrentAppInfo(),g=ee.useRef(),p=ee.useContext(L.CollectionCategoriesContext);g.current=De(re({},l),{title:o,inherits:l.inherits&&new Proxy(l.inherits,{})});const{category:b=[]}=l,m=L.useCompile(),v=x=>Be(this,null,function*(){var C;return(C=s.collections)==null?void 0:C.map(S=>({label:m(S.title),value:S.name}))}),y=()=>Be(this,null,function*(){return p==null?void 0:p.data.map(x=>({label:m(x.name),value:x.id}))}),w={targetGraph:s,collectionData:g,setTargetNode:i,node:r,loadCollections:v};return _.jsxs("div",{className:e.entityContainer,style:{boxShadow:c==null?void 0:c.boxShadow,border:u?"2px dashed #f5a20a":0},children:[b==null?void 0:b.map((x,C)=>_.jsx(ce.Badge.Ribbon,{color:x.color,style:{width:"103%",height:"3px",marginTop:C*5-4,borderRadius:0},placement:"start"},C)),_.jsxs("div",{className:e.headClass,style:{background:c!=null&&c.hightLight?"#1890ff":null,paddingTop:b.length*3},children:[_.jsx("span",{className:e.tableNameClass,children:m(o)}),_.jsx("div",{className:e.tableBtnClass,children:_.jsx(L.SchemaComponentProvider,{children:_.jsx(Uv,{setTargetNode:i,node:r,children:_.jsx(L.CollectionProvider_deprecated,{collection:SM,children:_.jsx(L.SchemaComponent,{scope:{useUpdateCollectionActionAndRefreshCM:gl,useCancelAction:Kn,loadCollections:v,loadCategories:y,useAsyncDataSource:lh,enableInherits:(d==null?void 0:d.dialect)==="postgres",actived:h===!0},components:re({EditOutlined:ue.EditOutlined,EditCollectionAction:LX,DeleteCollectionAction:$X,ConnectChildAction:kX,ConnectParentAction:IX},t.components),schema:{type:"object",name:r.id,properties:{connectParent:{type:"void","x-visible":"{{actived}}","x-component":"ConnectParentAction","x-component-props":{item:g.current,targetGraph:s}},connectChild:{type:"void","x-component":"ConnectChildAction","x-component-props":{item:g.current,targetGraph:s},"x-visible":"{{actived}}"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"EditCollectionAction","x-component-props":{type:"primary",item:g.current,className:"btn-edit-in-head"}},delete:{type:"void","x-action":"destroy","x-component":"DeleteCollectionAction","x-component-props":{className:"btn-del",getContainer:nt,item:g.current,useAction:()=>iR({name:a,id:f})}}}}})})})})})]}),_.jsx(VX,re({},w))]})},EM=ee.forwardRef(()=>{const{t:n}=hi(),[e,{toggleFullscreen:t}]=VM.useFullscreen(document.getElementById("graph_container"));return _.jsx(ce.Tooltip,{title:n("Full Screen"),getPopupContainer:nt,children:_.jsx(ce.Button,{onClick:()=>{t()},children:e?_.jsx(ue.FullscreenExitOutlined,{}):_.jsx(ue.FullscreenOutlined,{})})})});EM.displayName="FullscreenAction";const GX=n=>{const{handleFiterCollections:e}=n,{handleSearchCollection:t,collectionList:r}=ee.useContext(qu),[i,s]=ee.useState([]),{t:o}=hi(),a=L.useCompile(),l=_.jsxs("div",{children:[_.jsx(ce.Input,{style:{margin:"4px 0"},bordered:!1,placeholder:o("Collection Search"),onChange:t}),_.jsx(ce.Menu,{selectedKeys:i,selectable:!0,className:Pr.css`
729
+ .ant-menu-item {
730
+ height: 32px;
731
+ line-height: 32px;
732
+ }
733
+ `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...r.map(c=>({key:c.name,label:a(c.title),onClick:u=>{u.key!==i[0]?(s([u.key]),e(u.key)):(e(!1),s([]))}}))]})]});return _.jsx(ce.Popover,{content:l,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:nt,overlayClassName:Pr.css`
734
+ .ant-popover-inner-content {
735
+ padding: 0;
736
+ }
737
+ `,children:_.jsx(ce.Button,{children:_.jsx(ue.MenuOutlined,{})})})},HX=n=>{const{collectionList:e}=ee.useContext(qu),t=L.useCompile(),[r,i]=Xy.useSearchParams(),s=r.get("collections"),o=s==null?void 0:s.split(","),a=o==null?void 0:o.filter(u=>e.find(h=>h.name===u)),l=ee.useMemo(()=>e.map(u=>({label:t(u.title),value:u.name})),[e]),c=u=>{i([["collections",u.toString()]])};return _.jsx(L.Select,{value:a,showSearch:!0,getPopupContainer:nt,mode:"multiple",allowClear:!0,options:l,onChange:c,style:{minWidth:200,position:"fixed",margin:"24px",zIndex:1e3,maxWidth:"60%"}})};class UX extends kt{renderMarkup(){return this.renderJSONMarkup({tagName:"rect",selector:"body"})}update(){const t=this.cell.getAttrs().hightLight?"#1890ff":"gray";super.update({body:{refWidth:"50px",refHeight:"100px",fill:t}})}}const{drop:AM,groupBy:OM,last:WX,maxBy:Ua,minBy:qy,take:MM,uniq:Gy}=Uu,Hy=40,Uy=250;let N,kn;const XX="TB";var Wa=(n=>(n.Both="both",n.Target="target",n.Source="source",n))(Wa||{}),Xa=(n=>(n.Both="both",n.Inherit="inherited",n.Entity="entity",n))(Xa||{});const Fu=(n,e)=>{const t=[];for(;(e==null?void 0:e.length)>0&&n;)t.push(e.splice(0,n));return t};function YX(n,e){return Be(this,null,function*(){const{positions:t}=N;let r=[];const i=N.getNodes(),s=N.getEdges(),o=new Bu.graphlib.Graph;o.setGraph({rankdir:XX,nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0}),o.setDefaultEdgeLabel(()=>({})),i.forEach((l,c)=>{const u=Uy,h=l.getPorts().length*32+30;o.setNode(l.id,{width:u,height:h})}),Bu.layout(o),Fu(15,o.nodes()).forEach((l,c)=>{l.forEach((u,h)=>{const f=N.getCellById(u),d=h%15;if(f){const g=t&&t.find(b=>b.collectionName===f.store.data.name)||{},p={x:d*325+50,y:c*400+100};f.position(g.x||p.x,g.y||p.y),t&&!t.find(b=>b.collectionName===f.store.data.name)&&r.push({collectionName:f.store.data.name,x:p.x,y:p.y})}})}),s.forEach(l=>{Vu(l)}),kn?typeof kn=="string"?N.positionCell(WX(i),"top",{padding:100}):N.positionCell(kn,"top",{padding:100}):N.positionCell(i[0],"top-left",{padding:100}),r.length>0&&e&&(yield n(r),r=[])})}function Vu(n){var u,h;const{store:{data:{connectionType:e}}}=n,t=n.getSource(),r=n.getTarget(),i=(u=N.getCellById(t.cell))==null?void 0:u.position().x,s=(h=N.getCellById(r.cell))==null?void 0:h.position().x,o=e?{name:"topLeft",args:{dy:20}}:{name:"left"},a=e?{name:"topRight",args:{dy:20}}:"right",l=e?"normal":"er";if(n.getVertices().forEach(()=>n.removeVertexAt(0)),i-100>s)n.setSource({cell:t.cell,port:t.port,anchor:o}),n.setTarget({cell:r.cell,port:r.port,anchor:a}),n.setRouter(l,{direction:"H"});else if(Math.abs(i-s)<100){const f=N.getCellById(t.cell),d=N.getCellById(r.cell);n.setSource({cell:t.cell,port:t.port,anchor:o}),n.setTarget({cell:r.cell,port:r.port,anchor:o}),e?(n.setVertices([{x:f.position().x-30,y:f.position().y+20},{x:d.position().x-30,y:d.position().y+20}]),n.setRouter("normal")):n.setRouter("oneSide",{side:"left"})}else n.setSource({cell:t.cell,port:t.port,anchor:a}),n.setTarget({cell:r.cell,port:r.port,anchor:o}),n.setRouter(l,{direction:"H"})}const qu=ee.createContext({});qu.displayName="CollapsedContext";const KX=()=>{const n=[],e=N.getEdges(),t=N.getNodes();return e.forEach(i=>{n.push(i.getSourceCellId()),n.push(i.getTargetCellId())}),OM(t,i=>n.includes(i.id)?"linkNodes":"rawNodes")},TM=n=>{var v;const{linkNodes:e=[],rawNodes:t=[]}=KX(),{positions:r}=N,i=e.concat(t||[]),s=N.getEdges(),o=new Bu.graphlib.Graph;let a,l,c,u,h;const f=[];o.setGraph({rankdir:"TB",nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0});const d=250,g=400;i.forEach(y=>{o.setNode(y.id,{width:d,height:g})}),s.forEach(y=>{const w=y.getSource(),x=y.getTarget();o.setEdge(w.cell,x.cell,{})}),Bu.layout(o);const p=o.nodes(),b=MM(p,e.length),m=AM(p,e.length);if(b.forEach(y=>{var C;const w=N.getCellById(y),x=(C=r.find(S=>S.collectionName===w.id))==null?void 0:C.id;if(w){const S=o.node(y);f.push({id:x,collectionName:w.id,x:S.x,y:S.y}),w.position(S==null?void 0:S.x,S==null?void 0:S.y)}}),b.length){h=N.getCellById(Ua(b,C=>N.getCellById(C).position().y)).position().y,u=N.getCellById(qy(b,C=>N.getCellById(C).position().x)).position().x;const y=N.getCellById(Ua(b,C=>N.getCellById(C).position().x)).position().x,w=b.filter(C=>Math.abs(N.getCellById(C).position().y-h)<50),x=(v=N.getCellById(Ua(w,C=>N.getCellById(C).position().x)))==null?void 0:v.position();if(c=Math.round(y/320)||1,a=Math.floor((4500-(y+100-x.x))/280),l=Fu(c,t),a>=1){const C=MM(m,a);l=Fu(c,AM(m,a)),C.forEach((S,E)=>{var M;const A=N.getCellById(S);if(A){const O={x:x.x+320*E+280,y:x.y};A.position(O.x,O.y);const I=(M=r.find(q=>q.collectionName===A.id))==null?void 0:M.id;f.push({id:I,collectionName:A.id,x:O.x,y:O.y})}})}}else c=15,a=0,l=Fu(15,t),u=50,h=50;if(l.forEach((y,w)=>{y.forEach((x,C)=>{var A;const S=N.getCellById(x),E=C%c;if(S){const M={x:E*325+u,y:w*300+h+300};S.position(M.x,M.y);const O=(A=r.find(I=>I.collectionName===S.id))==null?void 0:A.id;f.push({id:O,collectionName:S.id,x:M.x,y:M.y})}})}),s.forEach(y=>{Vu(y)}),N.positionCell(i[0],"top-left",{padding:100}),!n){const y=f.filter(x=>x.id),w=f.filter(x=>!x.id);y.length>0&&N.updatePositionAction(y,!0),w.length>0&&N.saveGraphPositionAction(w)}},_M=ee.memo(()=>{const{theme:n}=L.useGlobalTheme(),{styles:e}=Fy(),[t,r]=Xy.useSearchParams(),i=t.get("collections"),s=ee.useContext(Ft.SchemaOptionsContext),o=L.useAPIClient(),a=L.useCompile(),{t:l}=hi(),[c,u]=ee.useState([]),[h,f]=ee.useState([]),[d,g]=ee.useState(!1),{collections:p,getCollections:b}=L.useCollectionManager_deprecated(),m=ee.useContext(L.CollectionCategoriesContext),v=ee.useRef();v.current=m;const y=L.useDataSourceManager(),w=L.useCurrentAppInfo(),x=L.useApp(),{data:{database:C}}=w,S=re({},s==null?void 0:s.scope),E=re({},s==null?void 0:s.components),A=$=>Be(this,null,function*(){yield o.resource("graphPositions").create({values:$}),yield O()}),M=($,B=!1)=>Be(this,null,function*(){i||(B?yield o.resource("graphPositions").update({values:$}):yield o.resource("graphPositions").update({filter:{collectionName:$.collectionName},values:re({},$)}),yield O())}),O=()=>Be(this,null,function*(){const{data:$}=yield o.resource("graphPositions").list({paginate:!1});return N.positions=$.data,Promise.resolve()}),I=$=>{kn=$,$==="destory"&&O()},q=$=>Be(this,null,function*(){const B=b();if(!N)return;N.collections=B,N.updatePositionAction=M,N.saveGraphPositionAction=A;const W=N.getNodes();u(B),f(B),!W.length||$?i||te(B):_e(B)}),U=L.useDataSource(),T=()=>{N=new V({container:document.getElementById("container"),moveThreshold:0,virtual:!1,async:!0,connecting:{anchor:{name:"midSide"}},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},interacting:{magnetConnectable:!1},preventDefaultBlankAction:!0}),N.connectionType="both",N.direction="target",N.cacheCollection={},N.onConnectionAssociation=k,N.onConnectionChilds=Q,N.onConnectionParents=j,V.registerPortLayout("erPortPosition",$=>$.map((B,W)=>({position:{x:0,y:(W+1)*Hy},angle:0})),!0),E8({shape:"er-rect",width:Uy,height:Hy,ports:{groups:{list:{markup:[{tagName:"rect",selector:"portBody"}],attrs:{portBody:{width:Uy,height:Hy,strokeWidth:1,visibility:"hidden"}},position:"erPortPosition"}}},body:{refWidth:100,refHeight:100},component:$=>_.jsx(L.CurrentAppInfoContext.Provider,{value:w,children:_.jsx(L.DataSourceApplicationProvider,{dataSourceManager:y,dataSource:U==null?void 0:U.key,children:_.jsx(L.APIClientProvider,{apiClient:o,children:_.jsx(L.SchemaComponentOptions,{inherit:!0,scope:S,components:E,children:_.jsx(L.CollectionCategoriesContext.Provider,{value:v.current,children:_.jsx(ce.ConfigProvider,{theme:n,children:_.jsx("div",{style:{height:"auto"},children:_.jsx(ce.App,{children:_.jsx(L.ApplicationContext.Provider,{value:x,children:_.jsx(qX,De(re({},$),{setTargetNode:I,targetGraph:N}))})})})})})})})})})}),N.use(new Yw({autoResize:!0,enabled:!0,pannable:!0,pageVisible:!0,pageBreak:!1,padding:{top:10,left:500,right:300,bottom:300}})),N.use(new Xw({container:document.getElementById("graph-minimap"),width:300,height:200,padding:10,graphOptions:{async:!0,createCellView($){if($.isEdge())return null;if($.isNode())return UX}}})),N.use(new Is({enabled:!1,multiple:!0,rubberband:!0,movable:!0,className:"node-selecting",modifiers:"shift"})),N.use(new Qw({enabled:!0})),N.on("edge:mouseleave",({e:$,edge:B})=>{$.stopPropagation(),z(B)}),N.on("node:mouseleave",({e:$,node:B})=>{$.stopPropagation(),B.setProp({actived:!1})}),N.on("node:moved",({e:$,node:B})=>{$.stopPropagation();const W=N.getConnectedEdges(B),ne=B.position(),oe=N.positions.find(be=>be.collectionName===B.store.data.name);oe?(oe.x!==ne.x||oe.y!==ne.y)&&M(re({collectionName:B.store.data.name},ne)):A(re({collectionName:B.store.data.name},ne)),W.forEach(be=>{Vu(be)})}),N.on("cell:mouseenter",({e:$,cell:B,edge:W,node:ne})=>{$.stopPropagation(),B.toFront(),ne&&B.setProp({actived:!0}),W&&H(W)}),N.on("blank:click",$=>{var B;N!=null&&N.activeEdge&&z(N==null?void 0:N.activeEdge),(B=N.collapseNodes)==null||B.map(W=>{const ne=N.getCellById(Object.keys(W)[0]);Object.values(W)[0]&&(ne==null||ne.setData({collapse:!1}))}),N.cleanSelection()}),N.on("node:selected",({e:$,node:B})=>{B.setProp({select:!0})}),N.on("node:unselected",({e:$,node:B})=>{B.setProp({select:!1})})},k=({target:$,through:B})=>{var oe;const W=((oe=N.selectedCollections)==null?void 0:oe.split(","))||[];W.push($),B&&W.push(B);const ne=Gy(W).toString();r([["collections",ne]]),N.selectedCollections=ne},Q=$=>{let B=N.selectedCollections.split(",")||[];B=B.concat($);const W=Gy(B).toString();r([["collections",W]]),N.selectedCollections=W},j=$=>{let B=N.selectedCollections.split(",")||[];B=B.concat($);const W=Gy(B).toString();r([["collections",W]]),N.selectedCollections=W},z=$=>{var Ot,je;N.activeEdge=null;const{m2m:B,connectionType:W}=(je=(Ot=$.store)==null?void 0:Ot.data)!=null?je:{},ne=B==null?void 0:B.find(Je=>Je!==$.id),oe=N.getCellById(ne),be=Je=>{const Ge=N.getCellById(Je.store.data.target.cell),zt=N.getCellById(Je.store.data.source.cell);Ge.setProp({targetPort:!1,associated:null}),zt.setProp({sourcePort:!1,associated:null}),Je.setAttrs({line:{stroke:"#ddd",targetMarker:W==="inherited"?{name:"classic",fill:"#ddd"}:null}}),Je.setLabels(Je.getLabels().map(Mt=>De(re({},Mt),{attrs:{labelText:De(re({},Mt.attrs.labelText),{fill:"rgba(0, 0, 0, 0.3)"}),labelBody:De(re({},Mt.attrs.labelBody),{stroke:"#ddd"})}})))};be($),oe&&be(oe)},H=$=>{var je,Je;N.activeEdge=$;const{associated:B,m2m:W,connectionType:ne}=(Je=(je=$.store)==null?void 0:je.data)!=null?Je:{},oe=W==null?void 0:W.find(Ge=>Ge!==$.id),be=N.getCellById(oe),Ot=Ge=>{Ge.toFront(),Ge.setAttrs({line:{stroke:"#1890ff",strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",sourceMarker:null,targetMarker:ne==="inherited"?{name:"classic",fill:"#1890ff"}:null}}),Ge.setLabels(Ge.getLabels().map(Jt=>De(re({},Jt),{attrs:{labelText:De(re({},Jt.attrs.labelText),{fill:"#1890ff"}),labelBody:De(re({},Jt.attrs.labelBody),{stroke:"#1890ff"})}})));const zt=N.getCellById(Ge.store.data.target.cell),Mt=N.getCellById(Ge.store.data.source.cell);zt.toFront(),Mt.toFront(),zt.setProp({targetPort:Ge.store.data.target.port,associated:B}),Mt.setProp({sourcePort:Ge.store.data.source.port,associated:B})};Ot($),be&&Ot(be)},te=($,B=!0)=>{N.clearCells();const{nodesData:W,edgesData:ne,inheritEdges:oe}=wM($);N.data={nodes:W,edges:ne},N.fromJSON({nodes:W}),N.addEdges(ne),N.addEdges(oe),YX(A,B)},_e=$=>{var $M,LM;const{positions:B}=N,{nodesData:W,edgesData:ne,inheritEdges:oe}=wM($),be=N.getNodes().map(Ln=>Ln.store.data),Ot=N.getEdges().map(Ln=>Ln.store.data),je=OM(Ot,Ln=>Ln.connectionType?"currentInheritEdges":"currentRelateEdges"),Je=PX(W,be),Ge=CM(ne,je.currentRelateEdges||[]),zt=CM(oe,je.currentInheritEdges||[]),Mt=($M=Ua(B,"y"))==null?void 0:$M.y,Jt=(LM=qy(B,"x"))==null?void 0:LM.x,IM=B.filter(Ln=>Math.abs(Ln.y-Mt)<100);let $n=Ua(IM,"x"),Gu;Je.forEach(({status:Ln,node:Hi,port:ho})=>{const Ka=N.getCellById(Hi.id);switch(Ln){case"add":($n==null?void 0:$n.x)>4500?($n=qy(IM,"x"),Gu={x:Jt,y:$n.y+400}):Gu={x:($n==null?void 0:$n.x)+350,y:$n==null?void 0:$n.y},kn=N.addNode(De(re({},Hi),{position:Gu})),i||A(re({collectionName:Hi.name},Gu)),N&&N.positionCell(kn,"top",{padding:200});break;case"insertPort":Ka.insertPort(ho.index,ho.port);break;case"deletePort":Ka.removePort(ho.id);break;case"updateNode":Ka.setProp({title:Hi.title});break;case"delete":N.removeCell(Hi.id);break;default:return null}});const nY=Ln=>{Ln.forEach(({status:Hi,edge:ho})=>{const Ka=N.addEdge(re({},ho));switch(Hi){case"add":Vu(Ka);break;case"delete":N.removeCell(ho.id);break;default:return null}})};setTimeout(()=>{nY(Ge.concat(zt))},300)},In=$=>{const B=$.target.value.toLowerCase();if(B){const W=c.filter(ne=>a(ne.title).toLowerCase().includes(B));f(W)}else f(c)},rt=($,B)=>{B==="target"?bM(N.collections,$).forEach(ne=>{var oe;(oe=N.getCellById(ne))==null||oe.setAttrs({hightLight:!0,direction:B,connectionType:"inherited"})}):wX(N.collections,$).forEach(ne=>{var oe;(oe=N.getCellById(ne.name))==null||oe.setAttrs({hightLight:!0,direction:B,connectionType:"inherited"})})},Kt=$=>{const B=N.getCellById($);N.cacheCollection[$]=!0,N.getConnectedEdges(B).filter(oe=>{var be;return!((be=oe.store.data)!=null&&be.connectionType)&&oe.getTargetCellId()===$}).forEach(oe=>{var je;oe.store.data.m2m&&oe.store.data.m2m.forEach(Je=>{var zt;const Ge=N.getCellById(Je);if(Ge.getTargetCellId()===$){const Mt=Ge.getSourceCellId(),Jt=N.getCellById(Mt);(zt=Jt.store.data.attrs)!=null&&zt.hightLight||(Jt.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),Kt(Mt))}});const be=oe.getSourceCellId(),Ot=N.getCellById(be);(je=Ot.store.data.attrs)!=null&&je.hightLight||(Ot.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),Kt(be))})},Ke=$=>{const B=N.getCellById($);N.getConnectedEdges(B).filter(oe=>{var be;return!((be=oe.store.data)!=null&&be.connectionType)&&oe.getSourceCellId()===$}).forEach(oe=>{var je;oe.store.data.m2m&&oe.store.data.m2m.forEach(Je=>{var zt;const Ge=N.getCellById(Je);if(Ge.getSourceCellId()===$){const Mt=Ge.getTargetCellId(),Jt=N.getCellById(Mt);(zt=Jt.store.data.attrs)!=null&&zt.hightLight||(Jt.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),Ke(Mt))}});const be=oe.getTargetCellId(),Ot=N.getCellById(be);(je=Ot.store.data.attrs)!=null&&je.hightLight||(Ot.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),Ke(be))})},lt=($,B)=>{B==="target"?Kt($):Ke($)},Ya=($,B,W)=>{var be,Ot;const ne=N.getNodes().filter(je=>{var Je;return(Je=je.store.data.attrs)==null?void 0:Je.hightLight}),oe=ne.length;for(let je=0;je<oe;je++){const{direction:Je,connectionType:Ge}=ne[je].getAttrs(),zt=ne[je].id!==$,Mt=$&&((be=N.filterConfig)==null?void 0:be.key)===$?Je!==B:!0,Jt=$&&((Ot=N.filterConfig)==null?void 0:Ot.key)===$?Ge!==W:!0;ne[je].id!==$&&setTimeout(()=>{zt&&(Mt||Jt)&&ne[je].setAttrs({hightLight:!1})},0)}},uo=$=>{const{connectionType:B,direction:W,filterConfig:ne}=N,oe=$===(ne==null?void 0:ne.key)&&W==="both",be=$===(ne==null?void 0:ne.key)&&(B==="both"||B===ne.connectionType);$?((!oe||!be)&&Ya($,W,B),kn=N.getCellById($),N.positionCell(kn,"center",{padding:0}),kn.setAttrs({hightLight:!0,connectionType:B}),setTimeout(()=>{["entity","both"].includes(B)&&(W==="both"?(lt($,"target"),lt($,"source")):(W==="target"&&lt($,W),W==="source"&&lt($,W))),["inherited","both"].includes(B)&&(W==="both"?(rt($,"target"),rt($,"source")):rt($,W)),N.filterConfig={key:$,direction:W,connectionType:B}},0)):(N.filterConfig=null,Ya())},fi=$=>{N.connectionType=$;const{filterConfig:B}=N;B&&uo(B.key),ZX($)},ZX=$=>{kn=null,N.getEdges().forEach(W=>{const{store:{data:{connectionType:ne}}}=W;$==="entity"?ne?W.setVisible(!1):W.setVisible(!0):$==="inherited"?ne?W.setVisible(!0):W.setVisible(!1):W.setVisible(!0)})},eY=$=>{N.direction=$;const{filterConfig:B}=N;B&&uo(B.key)};ee.useLayoutEffect(()=>(T(),()=>{N.off("cell:mouseenter"),N.off("edge:mouseleave"),N.off("node:moved"),N.off("blank:click"),N=null,kn=null}),[]),ee.useEffect(()=>(U.addReloadCallback(q),()=>{U.removeReloadCallback(q)}),[]),ee.useEffect(()=>(g(!0),O().then(()=>Be(this,null,function*(){if(i&&h.length){const $=i==null?void 0:i.split(","),B=h.filter(W=>$.includes(W.name));te(B,!1),TM(!0),N.selectedCollections=i}else!i&&q(!0);g(!1)})).catch($=>{throw g(!1),$}),()=>{EX()}),[t]);const tY=()=>Be(this,null,function*(){var $;return($=N.collections)==null?void 0:$.map(B=>({label:a(B.title),value:B.name}))});return _.jsx(ce.Layout,{children:_.jsx("div",{className:e.graphCollectionContainerClass,children:_.jsxs(ce.Spin,{spinning:d,children:[_.jsx(L.DataSourceApplicationProvider,{dataSourceManager:y,children:_.jsx(qu.Provider,{value:{collectionList:h,handleSearchCollection:In},children:_.jsx("div",{className:Pr.cx(e.collectionListClass),children:_.jsx(L.SchemaComponent,{components:{Select:$=>_.jsx(L.Select,De(re({popupMatchSelectWidth:!1},$),{getPopupContainer:nt})),AddCollectionAction:AX,LocateCollectionAction:GX,SelectCollectionsAction:HX,DirectionAction:MX,ConnectorAction:OX,FullscreenAction:EM},schema:{type:"void",properties:{block1:{type:"void","x-collection":"collections","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:SM,request:{resource:"collections",action:"list",params:{pageSize:50,filter:{inherit:!1},sort:["sort"],appends:[]}}},properties:{selectCollections:{type:"array","x-component":"SelectCollectionsAction"},actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{fontSize:16}},properties:{create:{type:"void",title:'{{ t("Create collection") }}',"x-component":"AddCollectionAction","x-component-props":{type:"primary"}},fullScreen:{type:"void","x-component":"FullscreenAction"},locateCollection:{type:"void","x-component":"LocateCollectionAction","x-component-props":{handleFiterCollections:uo,icon:"MenuOutlined",useAction:()=>({run(){}})}},autoLayout:{type:"void","x-component":"Action","x-component-props":{component:()=>_.jsx(ce.Tooltip,{title:l("Auto layout"),getPopupContainer:nt,children:_.jsx(ce.Button,{onClick:()=>{TM()},children:_.jsx(ue.ApartmentOutlined,{})})}),useAction:()=>({run(){}})}},connectionType:{type:"void","x-component":"ConnectorAction","x-component-props":{onClick:fi,icon:"MenuOutlined",useAction:()=>({run(){}})}},direction:{type:"void","x-component":"DirectionAction","x-component-props":{onClick:eY}},selectMode:{type:"void","x-component":()=>_.jsx(ce.Tooltip,{title:l("Selection"),children:_.jsx(ce.Switch,{onChange:$=>{N.toggleSelection()}})})}}}}}}},scope:{useAsyncDataSource:lh,loadCollections:tY,useCreateActionAndRefreshCM:()=>Wv(I),enableInherits:(C==null?void 0:C.dialect)==="postgres"}})})})}),_.jsx("div",{id:"container",style:{width:"100vw"}}),_.jsx("div",{id:"graph-minimap",className:e.graphMinimap,style:{width:"300px",height:"250px",right:"10px",bottom:"20px",position:"fixed"}})]})})})});_M.displayName="GraphDrawPage";const JX=n=>{const{visible:e}=L.useActionContext(),t=L.useRequest(()=>Promise.resolve({data:{name:`t_${fo.uid()}`,createdBy:!0,updatedBy:!0,sortable:!0,logging:!0,fields:[{name:"id",type:"integer",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0},interface:"id"},{interface:"createdAt",type:"date",field:"createdAt",name:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{interface:"createdBy",type:"belongsTo",target:"users",foreignKey:"createdById",name:"createdBy",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},{type:"date",field:"updatedAt",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"string",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"belongsTo",target:"users",foreignKey:"updatedById",name:"updatedBy",interface:"updatedBy",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}}]}}),De(re({},n),{manual:!0}));return ee.useEffect(()=>{e&&t.run()},[e]),t},QX=()=>_.jsx("div",{className:L.css`
738
+ height: calc(100vh - 160px);
739
+ overflow: auto;
740
+ margin: calc(var(--nb-spacing) * -1);
741
+ position: relative;
742
+ `,id:"graph_container",children:_.jsx(L.SchemaComponent,{schema:{type:"void","x-component":"div",properties:{editor:{type:"void","x-component":"GraphDrawPage"}}},components:{GraphDrawPage:_M,DeleteOutlined:ue.DeleteOutlined},scope:{useCollectionValues:JX,useCreateActionAndRefreshCM:Wv}})}),NM="graph-collection-manager";class kM extends L.Plugin{load(){return Be(this,null,function*(){this.app.pluginSettingsManager.add("data-source-manager/main.graph",{title:`{{t("Graphical interface", { ns: "${NM}" })}}`,Component:QX,topLevelName:"data-source-manager/main",pluginKey:NM,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.graph-collection-manager"})})}}J.PluginGraphCollectionPlugin=kM,J.default=kM,Object.defineProperties(J,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});