@nocobase/plugin-graph-collection-manager 2.0.22 → 2.1.0-alpha.10

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.
@@ -0,0 +1,430 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ (self.webpackChunk_nocobase_plugin_graph_collection_manager=self.webpackChunk_nocobase_plugin_graph_collection_manager||[]).push([["594"],{2387:function(){"object"==typeof window&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(e=>{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)}})})},3577:function(e,t,n){"use strict";n.d(t,{o:function(){return u}});var r,i,o,s,l=n(3549);let a=`.x6-widget-minimap {
11
+ position: relative;
12
+ display: table-cell;
13
+ box-sizing: border-box;
14
+ overflow: hidden;
15
+ text-align: center;
16
+ vertical-align: middle;
17
+ background-color: #fff;
18
+ user-select: none;
19
+ }
20
+ .x6-widget-minimap .x6-graph {
21
+ display: inline-block;
22
+ box-shadow: 0 0 4px 0 #eee;
23
+ cursor: pointer;
24
+ }
25
+ .x6-widget-minimap .x6-graph > svg {
26
+ pointer-events: none;
27
+ shape-rendering: optimizespeed;
28
+ }
29
+ .x6-widget-minimap .x6-graph .x6-node * {
30
+ /* stylelint-disable-next-line */
31
+ vector-effect: initial;
32
+ }
33
+ .x6-widget-minimap-viewport {
34
+ position: absolute;
35
+ box-sizing: content-box !important;
36
+ margin: -2px 0 0 -2px;
37
+ border: 2px solid #31d0c6;
38
+ cursor: move;
39
+ }
40
+ .x6-widget-minimap-viewport-zoom {
41
+ position: absolute;
42
+ right: 0;
43
+ bottom: 0;
44
+ box-sizing: border-box;
45
+ width: 12px;
46
+ height: 12px;
47
+ margin: 0 -6px -6px 0;
48
+ background-color: #fff;
49
+ border: 2px solid #31d0c6;
50
+ border-radius: 50%;
51
+ cursor: nwse-resize;
52
+ }
53
+ `;class u extends l.Ss{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({},s.defaultOptions),e),l.H.ensure(this.name,a)}init(e){this.graph=e,this.updateViewport=l.eY.debounce(this.updateViewport.bind(this),0),this.container=document.createElement("div"),l.Jf.addClass(this.container,this.prefixClassName(o.root));let t=document.createElement("div");this.container.appendChild(t),this.viewport=document.createElement("div"),l.Jf.addClass(this.viewport,this.prefixClassName(o.viewport)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),l.Jf.addClass(this.zoomHandle,this.prefixClassName(o.zoom)),l.Jf.appendTo(this.zoomHandle,this.viewport)),l.Jf.append(this.container,this.viewport),l.Jf.css(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 l.ke(n),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?l.Jf.Event.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?l.Jf.Event.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=l.Jf.position(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},l.Jf.css(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(s.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,r=this.normalizeEvent(e),i=this.targetGraph.translate();if(i.ty=i.ty||0,null==r.offsetX){let e=l.Jf.offset(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(),l.H.clean(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)}([l.Ss.dispose()],u.prototype,"dispose",null),(r=o||(o={})).root="widget-minimap",r.viewport=`${r.root}-viewport`,r.zoom=`${r.viewport}-zoom`,(i=s||(s={})).defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:e=>new l.ke(e)},i.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}},9553:function(e,t,n){"use strict";n.d(t,{H:function(){return c}});var r,i=n(3549),o=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 s extends i.Ss{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=s.getOptions(e),this.onUpdate=i.eY.debounce(this.onUpdate,200);const t=this.graph.transform.getScale();this.sx=t.sx,this.sy=t.sy;const n=this.options.width||this.graph.options.width,r=this.options.height||this.graph.options.height;this.container=document.createElement("div"),i.Jf.addClass(this.container,this.prefixClassName(s.containerClass)),i.Jf.css(this.container,{width:n,height:r}),this.options.pageVisible&&i.Jf.addClass(this.container,this.prefixClassName(s.pagedClass)),this.options.className&&i.Jf.addClass(this.container,this.options.className);const o=this.graph.container;o.parentNode&&i.Jf.before(o,this.container),this.content=document.createElement("div"),i.Jf.addClass(this.content,this.prefixClassName(s.contentClass)),i.Jf.css(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),i.Jf.addClass(this.background,this.prefixClassName(s.backgroundClass)),i.Jf.append(this.content,this.background),this.options.pageVisible||i.Jf.append(this.content,this.graph.view.grid),i.Jf.append(this.content,o),i.Jf.appendTo(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new s.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||i.wq.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(){(i.OD.IS_IE||i.OD.IS_EDGE)&&i.Jf.css(this.container,{visibility:"hidden"})}afterManipulation(){(i.OD.IS_IE||i.OD.IS_EDGE)&&i.Jf.css(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&&(e>n||t>r)){let o=!1,s=document.createElement("div");for(let t=1,r=Math.floor(e/n);t<r;t+=1){let e=document.createElement("div");i.Jf.addClass(e,this.prefixClassName("graph-pagebreak-vertical")),i.Jf.css(e,{left:t*n}),i.Jf.appendTo(e,s),o=!0}for(let e=1,n=Math.floor(t/r);e<n;e+=1){let t=document.createElement("div");i.Jf.addClass(t,this.prefixClassName("graph-pagebreak-horizontal")),i.Jf.css(t,{top:e*r}),i.Jf.appendTo(t,s),o=!0}o&&(i.Jf.addClass(s,this.prefixClassName("graph-pagebreak")),i.Jf.after(this.graph.view.grid,s),this.pageBreak=s)}}}update(){let e=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(e.width/2,e.height/2);let t=this.options.autoResizeOptions;"function"==typeof t&&(t=i.eY.call(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=i.M_.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),i.Jf.prop(this.container,n),this}scrollToPoint(e,t){let n=this.getClientSize(),r=this.graph.matrix(),o={};return"number"==typeof e&&(o.scrollLeft=e-n.width/2+r.e+(this.padding.left||0)),"number"==typeof t&&(o.scrollTop=t-n.height/2+r.f+(this.padding.top||0)),i.Jf.prop(this.container,o),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,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,g=d.height/2,p=f-h.left-e+l,m=f-h.right+e-u,y=g-h.top-t+a,b=g-h.bottom+t-c;this.addPadding(Math.max(p,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=i.M_.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:s}=r,l=o(r,["padding"]),a=i.Dc.normalizeSides(s),u=i.M_.fromSize(this.getClientSize()),c=u.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});(t=i.Dc.normalizePercentage(t,Math.max(0,c.width)))<0&&(t=c.width+t),(n=i.Dc.normalizePercentage(n,Math.max(0,c.height)))<0&&(n=c.height+n);let h=c.getTopLeft().translate(t,n),d=u.getCenter().diff(h),f=this.zoom(),g=d.scale(1/f,1/f),p=i.bR.create(e).translate(g);return this.centerPoint(p.x,p.y,l)}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=i.M_.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 o=n.getCenter();return this.centerPoint(o.x,o.y),this.afterManipulation(),this}zoomToFit(e={}){return this.zoomToRect(this.graph.getContentArea(e),e)}transitionToPoint(e,t,n){let r,o;"object"==typeof e&&(n=t,t=e.y,e=e.x),null==n&&(n={});let l=this.sx,a=Math.max(n.scale||l,1e-6),u=this.getClientSize(),c=new i.bR(e,t),h=this.clientToLocalPoint(u.width/2,u.height/2);if(l===a){let e=h.diff(c).scale(l,l).round();r=`translate(${e.x}px,${e.y}px)`}else{let e=a/(l-a)*c.distance(h),t=h.clone().move(c,e),n=this.localToBackgroundPoint(t).round();r=`scale(${a/l})`,o=`${n.x}px ${n.y}px`}let d=n.onTransitionEnd;return i.Jf.addClass(this.container,s.transitionClassName),i.Jf.Event.off(this.content,s.transitionEventName),i.Jf.Event.on(this.content,s.transitionEventName,n=>{this.syncTransition(a,{x:e,y:t}),"function"==typeof d&&i.eY.call(d,this,n.originalEvent)}),i.Jf.css(this.content,{transform:r,transformOrigin:o,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 i.Jf.removeClass(this.container,s.transitionClassName),i.Jf.Event.off(this.content,s.transitionEventName),i.Jf.css(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(e,t={}){let n=i.M_.create(e),r=t.maxScale||1/0,o=t.minScale||5e-324,s=t.scaleGrid||null,l=t.visibility||1,a=t.center?i.bR.create(t.center):n.getCenter(),u=this.getClientSize(),c=u.width*l,h=u.height*l,d=new i.M_(a.x-c/2,a.y-h/2,c,h).getMaxUniformScaleToFit(n,a);return d=Math.min(d,r),s&&(d=Math.floor(d/s)*s),d=Math.max(o,d),this.transitionToPoint(a,Object.assign({scale:d},t))}startPanning(e){let t=this.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("pan:start",{e:t}),i.Jf.Event.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)}),i.Jf.Event.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){i.Jf.Event.off(document.body,".panning"),i.Jf.Event.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,o=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-o.e,r+=this.container.scrollTop-this.padding.top-o.f,new i.bR(n/o.a,r/o.d)}localToBackgroundPoint(e,t){let n="object"==typeof e?i.bR.create(e):new i.bR(e,t),r=this.graph.matrix(),o=this.padding;return i.J0.transformPoint(n,r).translate(o.left,o.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,i.Jf.css(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 o=this.getPadding();this.padding={left:Math.round(o.left+(e||0)),top:Math.round(o.top+(n||0)),bottom:Math.round(o.bottom+(r||0)),right:Math.round(o.right+(t||0))},o=this.padding,i.Jf.css(this.content,{width:o.left+this.graph.options.width+o.right,height:o.top+this.graph.options.height+o.bottom});let s=this.graph.container;return s.style.left=`${this.padding.left}px`,s.style.top=`${this.padding.top}px`,this}getPadding(){let e=this.options.padding;return"function"==typeof e?i.Dc.normalizeSides(i.eY.call(e,this,this)):i.Dc.normalizeSides(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=i.J0.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 i.Jf.css(this.container,{overflow:"hidden"}),this}unlock(){return i.Jf.css(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){i.Jf.before(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)}([i.Ss.dispose()],s.prototype,"dispose",null);var l=s||(s={});class a extends i.Mj{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}}l.Background=a,(r=s||(s={})).containerClass="graph-scroller",r.panningClass=`${r.containerClass}-panning`,r.pannableClass=`${r.containerClass}-pannable`,r.pagedClass=`${r.containerClass}-paged`,r.contentClass=`${r.containerClass}-content`,r.backgroundClass=`${r.containerClass}-background`,r.transitionClassName="transition-in-progress",r.transitionEventName="transitionend.graph-scroller-transition",r.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},r.getOptions=function(e){let t=i.D5.merge({},r.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 u=`.x6-graph-scroller {
54
+ position: relative;
55
+ box-sizing: border-box;
56
+ overflow: scroll;
57
+ outline: none;
58
+ }
59
+ .x6-graph-scroller-content {
60
+ position: relative;
61
+ }
62
+ .x6-graph-scroller-background {
63
+ position: absolute;
64
+ top: 0;
65
+ right: 0;
66
+ bottom: 0;
67
+ left: 0;
68
+ }
69
+ .x6-graph-scroller .x6-graph {
70
+ position: absolute;
71
+ display: inline-block;
72
+ margin: 0;
73
+ box-shadow: none;
74
+ }
75
+ .x6-graph-scroller .x6-graph > svg {
76
+ display: block;
77
+ }
78
+ .x6-graph-scroller.x6-graph-scroller-paged .x6-graph {
79
+ box-shadow: 0 0 4px 0 #eee;
80
+ }
81
+ .x6-graph-scroller.x6-graph-scroller-pannable[data-panning='false'] {
82
+ cursor: grab;
83
+ }
84
+ .x6-graph-scroller.x6-graph-scroller-pannable[data-panning='true'] {
85
+ cursor: grabbing;
86
+ user-select: none;
87
+ }
88
+ .x6-graph-pagebreak {
89
+ position: absolute;
90
+ top: 0;
91
+ right: 0;
92
+ bottom: 0;
93
+ left: 0;
94
+ }
95
+ .x6-graph-pagebreak-vertical {
96
+ position: absolute;
97
+ top: 0;
98
+ bottom: 0;
99
+ box-sizing: border-box;
100
+ width: 1px;
101
+ border-left: 1px dashed #bdbdbd;
102
+ }
103
+ .x6-graph-pagebreak-horizontal {
104
+ position: absolute;
105
+ right: 0;
106
+ left: 0;
107
+ box-sizing: border-box;
108
+ height: 1px;
109
+ border-top: 1px dashed #bdbdbd;
110
+ }
111
+ `;i.ke.prototype.lockScroller=function(){let e=this.getPlugin("scroller");return e&&e.lockScroller(),this},i.ke.prototype.unlockScroller=function(){let e=this.getPlugin("scroller");return e&&e.unlockScroller(),this},i.ke.prototype.updateScroller=function(){let e=this.getPlugin("scroller");return e&&e.updateScroller(),this},i.ke.prototype.getScrollbarPosition=function(){let e=this.getPlugin("scroller");return e?e.getScrollbarPosition():{left:0,top:0}},i.ke.prototype.setScrollbarPosition=function(e,t){let n=this.getPlugin("scroller");return n&&n.setScrollbarPosition(e,t),this};class c extends i.Nb{get pannable(){return!!this.options&&("object"==typeof this.options.pannable?this.options.pannable.enabled:!!this.options.pannable)}get container(){return this.scrollerImpl.container}constructor(e={}){super(),this.name="scroller",this.options=e,i.H.ensure(this.name,u)}init(e){this.graph=e;let t=s.getOptions(Object.assign(Object.assign({enabled:!0},this.options),{graph:e}));this.options=t,this.scrollerImpl=new s(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),i.Jf.Event.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")&&i.Jf.Event.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&&i.xH.isMatch(e,this.options.modifiers,t)}updateClassName(e){let t=this.scrollerImpl.container,n=i.TS.prefix("graph-scroller-pannable");this.pannable?(i.Jf.addClass(t,n),t.dataset.panning=(!!e).toString()):i.Jf.removeClass(t,n)}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),i.H.clean(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)}([i.Nb.dispose()],c.prototype,"dispose",null)},9026:function(e,t,n){"use strict";let r;n.d(t,{L:function(){return u}});var i,o,s=n(3549);class l extends s.Ss{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(o.classNames.box)}get $boxes(){return s.Jf.children(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 s.pM([],{comparator:o.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=s.Jf.offset(r),o=r.scrollLeft,l=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,n=e.clientY-i.top+window.pageYOffset+l}s.Jf.css(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(o.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||s.eY.call(t,this.graph,e))}stopSelecting(e){let t=this.graph,n=this.getEventData(e);switch(n.action){case"selecting":{let e=s.Jf.width(this.container),n=s.Jf.height(this.container),r=s.Jf.offset(this.container),i=t.pageToLocal(r.left,r.top),o=t.transform.getScale();e/=o.sx,n/=o.sy;let l=new s.M_(i.x,i.y,e,n),a=this.getCellViewsInArea(l).map(e=>e.cell);this.reset(a,{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(o.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?s.eY.call(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(),l=s.fh.getCellsBBox(o,{deep:!0})||s.M_.create(),a=i.x-l.x,u=i.y-l.y,c=i.x+i.width-(l.x+l.width),h=i.y+i.height-(l.y+l.height);if(n<a&&(n=a),r<u&&(r=u),c<n&&(n=c),h<r&&(r=h),!this.options.following){let i=e.x-t.originX,o=e.y-t.originY;n=i<=a||i>=c?0:n,r=o<=u||o>=h?0:r}}return{dx:n,dy:r}}updateElementPosition(e,t,n){let r=s.Jf.css(e,"left"),i=s.Jf.css(e,"top"),o=r?parseFloat(r):0,l=i?parseFloat(i):0;s.Jf.css(e,"left",o+t),s.Jf.css(e,"top",l+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&&(s.Jf.appendTo(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,l=parseInt(s.Jf.css(this.container,"left")||"0",10),a=parseInt(s.Jf.css(this.container,"top")||"0",10);s.Jf.css(this.container,{left:i<0?n.offsetX+i:l,top:o<0?n.offsetY+o:a,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)&&(s.Jf.remove(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(),s.Jf.remove(this.$boxes),this.boxCount=0}hide(){s.Jf.removeClass(this.container,this.prefixClassName(o.classNames.rubberband)),s.Jf.removeClass(this.container,this.prefixClassName(o.classNames.selected))}showRubberband(){s.Jf.addClass(this.container,this.prefixClassName(o.classNames.rubberband))}hideRubberband(){s.Jf.removeClass(this.container,this.prefixClassName(o.classNames.rubberband))}showSelected(){s.Jf.removeAttribute(this.container,"style"),s.Jf.addClass(this.container,this.prefixClassName(o.classNames.selected))}createContainer(){this.container=document.createElement("div"),s.Jf.addClass(this.container,this.prefixClassName(o.classNames.root)),this.options.className&&s.Jf.addClass(this.container,this.options.className),this.selectionContainer=document.createElement("div"),s.Jf.addClass(this.selectionContainer,this.prefixClassName(o.classNames.inner)),this.selectionContent=document.createElement("div"),s.Jf.addClass(this.selectionContent,this.prefixClassName(o.classNames.content)),s.Jf.append(this.selectionContainer,this.selectionContent),s.Jf.attr(this.selectionContainer,"data-selection-length",this.collection.length),s.Jf.prepend(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)}}),s.Jf.css(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),s.Jf.attr(this.selectionContainer,"data-selection-length",this.collection.length);let n=this.options.content;if(n)if("function"==typeof n){let e=s.eY.call(n,this.graph,this,this.selectionContent);e&&(this.selectionContent.innerHTML=e)}else this.selectionContent.innerHTML=n;this.collection.length>0&&!this.container.parentNode?s.Jf.appendTo(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");s.Jf.addClass(i,r),s.Jf.addClass(i,`${r}-${e.isNode()?"node":"edge"}`),s.Jf.attr(i,"data-cell-id",e.id),s.Jf.css(i,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:this.options.pointerEvents||"auto"}),s.Jf.appendTo(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=s.Jf.attr(n,"data-cell-id");s.Jf.remove(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)}([s.Ss.dispose()],l.prototype,"dispose",null),r="widget-selection",(i=o||(o={})).classNames={root:r,inner:`${r}-inner`,box:`${r}-box`,content:`${r}-content`,rubberband:`${r}-rubberband`,selected:`${r}-selected`},i.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},i.depthComparator=function(e){return e.getAncestors().length};let a=`.x6-widget-selection {
112
+ position: absolute;
113
+ top: 0;
114
+ left: 0;
115
+ display: none;
116
+ width: 0;
117
+ height: 0;
118
+ touch-action: none;
119
+ }
120
+ .x6-widget-selection-rubberband {
121
+ display: block;
122
+ overflow: visible;
123
+ opacity: 0.3;
124
+ }
125
+ .x6-widget-selection-selected {
126
+ display: block;
127
+ }
128
+ .x6-widget-selection-box {
129
+ cursor: move;
130
+ }
131
+ .x6-widget-selection-inner[data-selection-length='0'],
132
+ .x6-widget-selection-inner[data-selection-length='1'] {
133
+ display: none;
134
+ }
135
+ .x6-widget-selection-content {
136
+ position: absolute;
137
+ top: 100%;
138
+ right: -20px;
139
+ left: -20px;
140
+ margin-top: 30px;
141
+ padding: 6px;
142
+ line-height: 14px;
143
+ text-align: center;
144
+ border-radius: 6px;
145
+ }
146
+ .x6-widget-selection-content:empty {
147
+ display: none;
148
+ }
149
+ .x6-widget-selection-rubberband {
150
+ background-color: #3498db;
151
+ border: 2px solid #2980b9;
152
+ }
153
+ .x6-widget-selection-box {
154
+ box-sizing: content-box !important;
155
+ margin-top: -4px;
156
+ margin-left: -4px;
157
+ padding-right: 4px;
158
+ padding-bottom: 4px;
159
+ border: 2px dashed #feb663;
160
+ box-shadow: 2px 2px 5px #d3d3d3;
161
+ }
162
+ .x6-widget-selection-inner {
163
+ box-sizing: content-box !important;
164
+ margin-top: -8px;
165
+ margin-left: -8px;
166
+ padding-right: 12px;
167
+ padding-bottom: 12px;
168
+ border: 2px solid #feb663;
169
+ box-shadow: 2px 2px 5px #d3d3d3;
170
+ }
171
+ .x6-widget-selection-content {
172
+ color: #fff;
173
+ font-size: 10px;
174
+ background-color: #6a6b8a;
175
+ }
176
+ `;s.ke.prototype.isSelectionEnabled=function(){let e=this.getPlugin("selection");return!!e&&e.isEnabled()},s.ke.prototype.enableSelection=function(){let e=this.getPlugin("selection");return e&&e.enable(),this},s.ke.prototype.disableSelection=function(){let e=this.getPlugin("selection");return e&&e.disable(),this},s.ke.prototype.toggleSelection=function(e){let t=this.getPlugin("selection");return t&&t.toggleEnabled(e),this},s.ke.prototype.isMultipleSelection=function(){let e=this.getPlugin("selection");return!!e&&e.isMultipleSelection()},s.ke.prototype.enableMultipleSelection=function(){let e=this.getPlugin("selection");return e&&e.enableMultipleSelection(),this},s.ke.prototype.disableMultipleSelection=function(){let e=this.getPlugin("selection");return e&&e.disableMultipleSelection(),this},s.ke.prototype.toggleMultipleSelection=function(e){let t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(e),this},s.ke.prototype.isSelectionMovable=function(){let e=this.getPlugin("selection");return!!e&&e.isSelectionMovable()},s.ke.prototype.enableSelectionMovable=function(){let e=this.getPlugin("selection");return e&&e.enableSelectionMovable(),this},s.ke.prototype.disableSelectionMovable=function(){let e=this.getPlugin("selection");return e&&e.disableSelectionMovable(),this},s.ke.prototype.toggleSelectionMovable=function(e){let t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(e),this},s.ke.prototype.isRubberbandEnabled=function(){let e=this.getPlugin("selection");return!!e&&e.isRubberbandEnabled()},s.ke.prototype.enableRubberband=function(){let e=this.getPlugin("selection");return e&&e.enableRubberband(),this},s.ke.prototype.disableRubberband=function(){let e=this.getPlugin("selection");return e&&e.disableRubberband(),this},s.ke.prototype.toggleRubberband=function(e){let t=this.getPlugin("selection");return t&&t.toggleRubberband(e),this},s.ke.prototype.isStrictRubberband=function(){let e=this.getPlugin("selection");return!!e&&e.isStrictRubberband()},s.ke.prototype.enableStrictRubberband=function(){let e=this.getPlugin("selection");return e&&e.enableStrictRubberband(),this},s.ke.prototype.disableStrictRubberband=function(){let e=this.getPlugin("selection");return e&&e.disableStrictRubberband(),this},s.ke.prototype.toggleStrictRubberband=function(e){let t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(e),this},s.ke.prototype.setRubberbandModifiers=function(e){let t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(e),this},s.ke.prototype.setSelectionFilter=function(e){let t=this.getPlugin("selection");return t&&t.setSelectionFilter(e),this},s.ke.prototype.setSelectionDisplayContent=function(e){let t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(e),this},s.ke.prototype.isSelectionEmpty=function(){let e=this.getPlugin("selection");return!e||e.isEmpty()},s.ke.prototype.cleanSelection=function(e){let t=this.getPlugin("selection");return t&&t.clean(e),this},s.ke.prototype.resetSelection=function(e,t){let n=this.getPlugin("selection");return n&&n.reset(e,t),this},s.ke.prototype.getSelectedCells=function(){let e=this.getPlugin("selection");return e?e.getSelectedCells():[]},s.ke.prototype.getSelectedCellCount=function(){let e=this.getPlugin("selection");return e?e.getSelectedCellCount():0},s.ke.prototype.isSelected=function(e){let t=this.getPlugin("selection");return!!t&&t.isSelected(e)},s.ke.prototype.select=function(e,t){let n=this.getPlugin("selection");return n&&n.select(e,t),this},s.ke.prototype.unselect=function(e,t){let n=this.getPlugin("selection");return n?n.unselect(e,t):this};class u extends s.Nb{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=s.D5.merge({enabled:!0},u.defaultOptions,e),s.H.ensure(this.name,a)}init(e){this.graph=e,this.selectionImpl=new l(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&&s.xH.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&s.xH.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(),s.H.clean(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)}([s.Nb.dispose()],u.prototype,"dispose",null),(u||(u={})).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}},8790:function(e,t,n){"use strict";n.d(t,{R:function(){return l}});var r=n(3549),i=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 o extends r.Ss{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,n=i(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 r.Mi("svg"),t=this.horizontal=new r.Mi("line"),n=this.vertical=new r.Mi("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?r.eY.call(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 i,o,s,l,a,u,c=e.getBBox(),h=c.bbox(e.getAngle()),d=h.getTopLeft(),f=h.getBottomRight(),g=r.uM.normalize(e.getAngle()),p=this.options.tolerance||0,m={vertical:0,horizontal:0},y=t.direction,b=t.trueDirection,v=t.relativeDirection;-1!==b.indexOf("right")?m.vertical=f.x:m.vertical=d.x,-1!==b.indexOf("bottom")?m.horizontal=f.y:m.horizontal=d.y,this.model.getNodes().some(t=>{if(this.isIgnored(e,t))return!1;let n=t.getBBox().bbox(t.getAngle()),c=n.getTopLeft(),d=n.getBottomRight(),g={vertical:[c.x,d.x],horizontal:[c.y,d.y]},y={};return Object.keys(g).forEach(e=>{let t=g[e].map(t=>({position:t,distance:Math.abs(t-m[e])})).filter(e=>e.distance<=p);y[e]=r.Rw.sortBy(t,e=>e.distance)}),null==i&&y.vertical.length>0&&(i=y.vertical[0].position,o=Math.min(h.y,n.y),s=Math.max(f.y,d.y)-o),null==l&&y.horizontal.length>0&&(l=y.horizontal[0].position,a=Math.min(h.x,n.x),u=Math.max(f.x,d.x)-a),null!=i&&null!=l}),this.hide();let x=0,w=0;(null!=l||null!=i)&&(null!=i&&(x=-1!==b.indexOf("right")?i-f.x:d.x-i),null!=l&&(w=-1!==b.indexOf("bottom")?l-f.y:d.y-l));let C=0,E=0;if(g%90==0)90===g||270===g?(C=w,E=x):(C=x,E=w);else{let e=g>=0&&g<90?1:g>=90&&g<180?4:g>=180&&g<270?3:2;null!=l&&null!=i&&(x<w?(w=0,l=void 0):(x=0,i=void 0));let t=r.uM.toRad(g%90);x&&(C=3===e?x/Math.cos(t):x/Math.sin(t)),w&&(E=3===e?w/Math.cos(t):w/Math.sin(t));let n=1===e||3===e;switch(v){case"top":case"bottom":E=w?w/(n?Math.cos(t):Math.sin(t)):x/(n?Math.sin(t):Math.cos(t));break;case"left":case"right":C=x?x/(n?Math.cos(t):Math.sin(t)):w/(n?Math.sin(t):Math.cos(t))}}switch(v){case"top":case"bottom":C=0;break;case"left":case"right":E=0}let S=this.graph.getGridSize(),P=Math.max(c.width+C,S),k=Math.max(c.height+E,S);t.minWidth&&t.minWidth>S&&(P=Math.max(P,t.minWidth)),t.minHeight&&t.minHeight>S&&(k=Math.max(k,t.minHeight)),t.maxWidth&&(P=Math.min(P,t.maxWidth)),t.maxHeight&&(k=Math.min(k,t.maxHeight)),t.preserveAspectRatio&&(E<C?k=P*(c.height/c.width):P=k*(c.width/c.height)),(P!==c.width||k!==c.height)&&(e.resize(P,k,{direction:y,relativeDirection:v,trueDirection:b,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),s&&(s+=k-c.height),u&&(u+=P-c.width));let M=e.getBBox().bbox(g);i&&Math.abs(M.x-i)>1&&Math.abs(M.width+M.x-i)>1&&(i=void 0),l&&Math.abs(M.y-l)>1&&Math.abs(M.height+M.y-l)>1&&(l=void 0),this.update({verticalLeft:i,verticalTop:o,verticalHeight:s,horizontalTop:l,horizontalLeft:a,horizontalWidth:u})}}}snapOnMoving({view:e,e:t,x:n,y:i}){let o,s,l,a,u,c,h=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(h))return;let d=h.cell,f=d.getSize(),g=d.getPosition(),p=new r.M_(n-this.offset.x,i-this.offset.y,f.width,f.height),m=d.getAngle(),y=p.getCenter(),b=p.bbox(m),v=b.getTopLeft(),x=b.getBottomRight(),w=this.options.tolerance||0,C=0,E=0;if(this.model.getNodes().some(e=>{if(this.isIgnored(d,e))return!1;let t=e.getBBox().bbox(e.getAngle()),n=t.getCenter(),r=t.getTopLeft(),i=t.getBottomRight();return null==o&&(Math.abs(n.x-y.x)<w?(o=n.x,C=.5):Math.abs(r.x-v.x)<w?(o=r.x,C=0):Math.abs(r.x-x.x)<w?(o=r.x,C=1):Math.abs(i.x-x.x)<w?(o=i.x,C=1):Math.abs(i.x-v.x)<w&&(o=i.x),null!=o&&(s=Math.min(b.y,t.y),l=Math.max(x.y,i.y)-s)),null==a&&(Math.abs(n.y-y.y)<w?(a=n.y,E=.5):Math.abs(r.y-v.y)<w?a=r.y:Math.abs(r.y-x.y)<w?(a=r.y,E=1):Math.abs(i.y-x.y)<w?(a=i.y,E=1):Math.abs(i.y-v.y)<w&&(a=i.y),null!=a&&(u=Math.min(b.x,t.x),c=Math.max(x.x,i.x)-u)),null!=o&&null!=a}),this.hide(),null!=a||null!=o){null!=a&&(b.y=a-E*b.height),null!=o&&(b.x=o-C*b.width);let e=b.getCenter(),t=e.x-p.width/2,n=e.y-p.height/2,r=t-g.x,i=n-g.y;(0!==r||0!==i)&&(d.translate(r,i,{snapped:!0,restrict:this.getRestrictArea(h)}),c&&(c+=r),l&&(l+=i)),this.update({verticalLeft:o,verticalTop:s,verticalHeight:l,horizontalTop:a,horizontalLeft:u,horizontalWidth:c})}}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||r.eY.call(t,this.graph,e)}update(e){if(e.horizontalTop){let t=this.graph.localToGraph(new r.bR(e.horizontalLeft,e.horizontalTop)),n=this.graph.localToGraph(new r.bR(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 r.bR(e.verticalLeft,e.verticalTop)),n=this.graph.localToGraph(new r.bR(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:3e3*(!1!==e);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)}([r.Ss.dispose()],o.prototype,"dispose",null);let s=`.x6-widget-snapline {
177
+ position: absolute;
178
+ top: 0;
179
+ right: 0;
180
+ bottom: 0;
181
+ left: 0;
182
+ pointer-events: none;
183
+ }
184
+ .x6-widget-snapline-vertical,
185
+ .x6-widget-snapline-horizontal {
186
+ stroke: #2ecc71;
187
+ stroke-width: 1px;
188
+ }
189
+ `;r.ke.prototype.isSnaplineEnabled=function(){let e=this.getPlugin("snapline");return!!e&&e.isEnabled()},r.ke.prototype.enableSnapline=function(){let e=this.getPlugin("snapline");return e&&e.enable(),this},r.ke.prototype.disableSnapline=function(){let e=this.getPlugin("snapline");return e&&e.disable(),this},r.ke.prototype.toggleSnapline=function(){let e=this.getPlugin("snapline");return e&&e.toggleEnabled(),this},r.ke.prototype.hideSnapline=function(){let e=this.getPlugin("snapline");return e&&e.hide(),this},r.ke.prototype.setSnaplineFilter=function(e){let t=this.getPlugin("snapline");return t&&t.setFilter(e),this},r.ke.prototype.isSnaplineOnResizingEnabled=function(){let e=this.getPlugin("snapline");return!!e&&e.isOnResizingEnabled()},r.ke.prototype.enableSnaplineOnResizing=function(){let e=this.getPlugin("snapline");return e&&e.enableOnResizing(),this},r.ke.prototype.disableSnaplineOnResizing=function(){let e=this.getPlugin("snapline");return e&&e.disableOnResizing(),this},r.ke.prototype.toggleSnaplineOnResizing=function(e){let t=this.getPlugin("snapline");return t&&t.toggleOnResizing(e),this},r.ke.prototype.isSharpSnapline=function(){let e=this.getPlugin("snapline");return!!e&&e.isSharp()},r.ke.prototype.enableSharpSnapline=function(){let e=this.getPlugin("snapline");return e&&e.enableSharp(),this},r.ke.prototype.disableSharpSnapline=function(){let e=this.getPlugin("snapline");return e&&e.disableSharp(),this},r.ke.prototype.toggleSharpSnapline=function(e){let t=this.getPlugin("snapline");return t&&t.toggleSharp(e),this},r.ke.prototype.getSnaplineTolerance=function(){let e=this.getPlugin("snapline");if(e)return e.getTolerance()},r.ke.prototype.setSnaplineTolerance=function(e){let t=this.getPlugin("snapline");return t&&t.setTolerance(e),this};class l extends r.jG{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),r.H.ensure(this.name,s)}init(e){this.snaplineImpl=new o(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(),r.H.clean(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)}([r.jG.dispose()],l.prototype,"dispose",null)},8719:function(e,t,n){"use strict";let r,i,o;n.d(t,{kz:function(){return v}});var s,l,a,u=n(3549);class c extends u.bP{}var h=c||(c={});function d(e){let t=[],n=u.VK.getForeignObjectMarkup();return e?t.push({tagName:e,selector:"body"},n):t.push(n),t}h.config({view:"react-shape-view",markup:d(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(e){if(null==e.markup){let t=e.primer;if(t){e.markup=d(t);let n={};switch(t){case"circle":n={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":n={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}e.attrs=u.D5.merge({},{body:Object.assign({refWidth:null,refHeight:null},n)},e.attrs||{})}}return e}}),u.bP.registry.register("react-shape",h,!0);var f=n(9155),g=n.n(f),p=n(1098),m=n(9827);s=a||(a={}),i=!1,o=(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},s.connect=function(e,t){i&&r({type:"add",payload:{id:e,portal:t}})},s.disconnect=function(e){i&&r({type:"remove",payload:{id:e}})},s.isActive=function(){return i},s.getProvider=function(){return()=>{i=!0;let[e,t]=(0,f.useReducer)(o,[]);return r=t,g().createElement(g().Fragment,{children:e.map(e=>e.portal)})}};var y=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 b={};function v(e){let{shape:t,component:n,effect:r,inherit:i}=e,o=y(e,["shape","component","effect","inherit"]);if(!t)throw Error("should specify shape in config");b[t]={component:n,effect:r},u.ke.registerNode(t,Object.assign({inherit:i||"react-shape"},o),!0)}class x extends g().PureComponent{constructor(e){super(e),this.state={tick:0}}componentDidMount(){let{node:e}=this.props;e.on("change:*",({key:t})=>{let n=b[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?g().cloneElement(e):g().cloneElement(e,{node:t,graph:n})}render(){let{node:e}=this.props,t=b[e.shape];if(!t)return null;let{component:n}=t;return g().isValidElement(n)?this.clone(n):this.clone(g().createElement(n,null))}}class w extends u.Yv{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,w.action,()=>{this.renderReactComponent()})}renderReactComponent(){this.unmountReactComponent();let e=this.getComponentContainer(),t=this.cell;if(e){let n=g().createElement(x,{node:t,graph:this.graph});if(a.isActive()){let t=(0,p.createPortal)(n,e);a.connect(this.targetId(),t)}else this.root=(0,m.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 a.isActive()&&a.disconnect(this.targetId()),this.unmountReactComponent(),super.unmount(),this}}(l=w||(w={})).action="react",l.config({bootstrap:[l.action],actions:{component:l.action}}),u.Yv.registry.register("react-shape-view",l,!0)},3549:function(e,t,n){"use strict";let r,i,o,s,l,a,u,c,h,d,f,g,p,m,y,b,v,x,w,C,E,S,P;n.d(t,{pM:function(){return gM},Mi:function(){return uo},TS:function(){return dp},xH:function(){return tS},bR:function(){return cd},VK:function(){return tB},Rw:function(){return tK},uM:function(){return tM},Ss:function(){return dZ},Yv:function(){return gV},Nb:function(){return sl},J0:function(){return tL},Dc:function(){return t0},Mj:function(){return gY},jG:function(){return na},Jf:function(){return t2},eY:function(){return t1},wq:function(){return g$},bP:function(){return gS},H:function(){return t3},fh:function(){return gw},ke:function(){return g9},D5:function(){return tZ},OD:function(){return td},M_:function(){return cf}});var k,M,O,A,T,N,j,L,R,_,z,I,D,B,V,F,$,U,G,H,q,W,J,X,Y,Q,Z,K,ee,et,en,er,ei,eo,es,el,ea,eu,ec,eh,ed,ef,eg,ep,em,ey,eb,ev,ex,ew,eC,eE,eS,eP,ek,eM,eO,eA,eT,eN,ej,eL,eR,e_,ez,eI,eD,eB,eV,eF,e$,eU,eG,eH,eq,eW,eJ,eX,eY,eQ,eZ,eK,e0,e1,e2,e3,e6,e5,e4,e8,e9,e7,te,tt,tn,tr,ti,to,ts,tl,ta,tu,tc,th,td,tf,tg,tp,tm,ty,tb,tv,tx,tw,tC,tE,tS,tP,tk,tM,tO,tA,tT,tN,tj,tL,tR,t_,tz,tI,tD,tB,tV,tF,t$,tU,tG,tH,tq,tW,tJ,tX,tY,tQ,tZ={};n.r(tZ),n.d(tZ,{applyMixins:function(){return o6},clone:function(){return oY},cloneDeep:function(){return oQ},createClass:function(){return o9},defaults:function(){return o0},defaultsDeep:function(){return o3},ensure:function(){return o7},flatten:function(){return function e(t,n="/",r){let i={};for(let o in Object.keys(t).forEach(o=>{let s=t[o],l="object"==typeof s||Array.isArray(s);if(l&&r&&r(s)&&(l=!1),l){let t=e(s,n,r);Object.keys(t).forEach(e=>{i[o+n+e]=t[e]})}else i[o]=s}),t)if(!Object.prototype.hasOwnProperty.call(t,o))continue;return i}},getBoolean:function(){return sn},getByPath:function(){return si},getNumber:function(){return st},getValue:function(){return se},has:function(){return r_},inherit:function(){return o4},isEmpty:function(){return oA},isEqual:function(){return oM},isMaliciousProp:function(){return sr},isObject:function(){return nc},isPlainObject:function(){return iE},merge:function(){return iq},pick:function(){return r1},setByPath:function(){return so},unsetByPath:function(){return ss}});var tK={};n.r(tK),n.d(tK,{difference:function(){return sU},groupBy:function(){return sF},max:function(){return sq},sortBy:function(){return sI},sortedIndex:function(){return sw},sortedIndexBy:function(){return sT},union:function(){return sm},uniq:function(){return sp}});var t0={};n.r(t0),n.d(t0,{clamp:function(){return lV},isNumber:function(){return lB},isPercentage:function(){return lU},mod:function(){return lF},normalizePercentage:function(){return lG},normalizeSides:function(){return lq},parseCssNumeric:function(){return lH},random:function(){return l$}});var t1={};n.r(t1),n.d(t1,{apply:function(){return nB},call:function(){return nV},debounce:function(){return nI},isAsync:function(){return n$},isAsyncLike:function(){return nF},throttle:function(){return nD},toAsyncBoolean:function(){return nU},toDeferredBoolean:function(){return nG}});var t2={};n.r(t2),n.d(t2,{CASE_SENSITIVE_ATTR:function(){return aI},Event:function(){return tx},EventHook:function(){return tp},EventObject:function(){return uY},KAPPA:function(){return uf},MouseWheelHandle:function(){return u0},addClass:function(){return al},after:function(){return aj},append:function(){return aA},appendTo:function(){return aL},attr:function(){return a$},before:function(){return aN},breakText:function(){return ud},children:function(){return az},circleToPathData:function(){return uw},clearSelection:function(){return a6},computeStyle:function(){return a8},computeStyleInt:function(){return a9},contains:function(){return ak},createElement:function(){return am},createElementNS:function(){return ay},createSVGMatrix:function(){return uL},createSVGPoint:function(){return uj},createSVGTransform:function(){return uR},createSlicePathData:function(){return uM},createSvgDocument:function(){return av},createSvgElement:function(){return ab},css:function(){return a7},data:function(){return ur},decomposeMatrix:function(){return uB},ellipseToPathData:function(){return uC},empty:function(){return aO},ensureId:function(){return ad},find:function(){return aE},findOne:function(){return aS},findParentByClass:function(){return aP},getAttribute:function(){return aD},getClass:function(){return ao},getComputedStyle:function(){return a2},getData:function(){return ut},getPointsFromSvgElement:function(){return ux},getTransformToElement:function(){return uW},getTransformToParentElement:function(){return uJ},getVendorPrefixedName:function(){return a0},hasClass:function(){return as},hasScrollbars:function(){return a3},height:function(){return u3},index:function(){return aC},isCSSVariable:function(){return a4},isElement:function(){return aR},isHTMLElement:function(){return a_},isSVGGraphicsElement:function(){return af},kebablizeAttrs:function(){return aG},lineToPathData:function(){return um},matrixToRotation:function(){return uF},matrixToScale:function(){return uV},matrixToTransformString:function(){return uz},matrixToTranslation:function(){return u$},measureText:function(){return uc},mergeAttrs:function(){return aq},ns:function(){return ag},offset:function(){return u1},parseTransformString:function(){return uI},parseXML:function(){return ax},polygonToPathData:function(){return uy},polylineToPathData:function(){return ub},position:function(){return u6},prepend:function(){return aT},prop:function(){return function e(t,n,r){if(n){if("string"==typeof n)return(n=ui[n]||n,arguments.length<3)?t[n]:void(t[n]=r);for(let r in n)e(t,r,n[r])}}},qualifyAttr:function(){return aU},rectToPathData:function(){return uS},rectangleToPathData:function(){return uE},remove:function(){return aM},removeAttribute:function(){return aB},removeClass:function(){return aa},rotate:function(){return uH},sample:function(){return up},scale:function(){return uq},setAttribute:function(){return aV},setAttributes:function(){return aF},setData:function(){return un},setPrefixedStyle:function(){return a1},splitTextByLength:function(){return uh},styleToObject:function(){return aH},svgVersion:function(){return ap},tagName:function(){return aw},text:function(){return uu},toLocalPoint:function(){return uX},toPath:function(){return uP},toPathData:function(){return uk},toggleClass:function(){return au},transform:function(){return uU},transformStringToMatrix:function(){return u_},translate:function(){return uG},uniqueId:function(){return ah},width:function(){return u2}});var t3={};n.r(t3),n.d(t3,{clean:function(){return cc},ensure:function(){return cu}});var t6={};n.r(t6),n.d(t6,{dot:function(){return cD},doubleMesh:function(){return cF},fixedDot:function(){return cB},mesh:function(){return cV}});var t5={};n.r(t5),n.d(t5,{flipX:function(){return cU},flipXY:function(){return cH},flipY:function(){return cG},watermark:function(){return cq}});var t4={};n.r(t4),n.d(t4,{blur:function(){return cQ},brightness:function(){return c6},contrast:function(){return c5},dropShadow:function(){return cZ},grayScale:function(){return cK},highlight:function(){return cY},hueRotate:function(){return c2},invert:function(){return c3},outline:function(){return cX},saturate:function(){return c1},sepia:function(){return c0}});var t8={};n.r(t8),n.d(t8,{async:function(){return h3},block:function(){return hW},circle:function(){return h5},circlePlus:function(){return h4},classic:function(){return hJ},cross:function(){return h1},diamond:function(){return hQ},ellipse:function(){return h9},path:function(){return hK}});var t9={};n.r(t9),n.d(t9,{annotations:function(){return hL},atConnectionLength:function(){return dd},atConnectionLengthIgnoreGradient:function(){return du},atConnectionLengthKeepGradient:function(){return da},atConnectionRatio:function(){return df},atConnectionRatioIgnoreGradient:function(){return dh},atConnectionRatioKeepGradient:function(){return dc},connection:function(){return dl},displayEmpty:function(){return h_},eol:function(){return hR},fill:function(){return hP},filter:function(){return hU},html:function(){return h$},lineHeight:function(){return hT},port:function(){return hG},ref:function(){return c4},refCx:function(){return hl},refCy:function(){return ha},refD:function(){return hg},refDKeepOffset:function(){return hc},refDResetOffset:function(){return hu},refDx:function(){return c7},refDy:function(){return he},refHeight:function(){return hn},refHeight2:function(){return hv},refPoints:function(){return hp},refPointsKeepOffset:function(){return hd},refPointsResetOffset:function(){return hh},refR:function(){return hf},refRCircumscribed:function(){return hs},refRInscribed:function(){return ho},refRx:function(){return hr},refRy:function(){return hi},refWidth:function(){return ht},refWidth2:function(){return hb},refX:function(){return c8},refX2:function(){return hm},refY:function(){return c9},refY2:function(){return hy},resetOffset:function(){return hB},sourceMarker:function(){return dt},stroke:function(){return hk},style:function(){return hF},targetMarker:function(){return dn},text:function(){return hM},textPath:function(){return hj},textVerticalAnchor:function(){return hN},textWrap:function(){return hO},title:function(){return hz},vertexMarker:function(){return dr},xAlign:function(){return hI},yAlign:function(){return hD}});var t7={};n.r(t7),n.d(t7,{className:function(){return dy},opacity:function(){return dv},stroke:function(){return dw}});var ne={};n.r(ne),n.d(ne,{absolute:function(){return dS},bottom:function(){return dL},ellipse:function(){return dP},ellipseSpread:function(){return dk},left:function(){return dT},line:function(){return dA},right:function(){return dN},top:function(){return dj}});var nt={};n.r(nt),n.d(nt,{bottom:function(){return dF},inside:function(){return dG},insideOriented:function(){return dH},left:function(){return dD},manual:function(){return dI},outside:function(){return d$},outsideOriented:function(){return dU},radial:function(){return dX},radialOriented:function(){return dY},right:function(){return dB},top:function(){return dV}});var nn={};n.r(nn),n.d(nn,{noop:function(){return d5},pinAbsolute:function(){return d7},pinRelative:function(){return d9}});var nr={};n.r(nr),n.d(nr,{bottom:function(){return fb},bottomLeft:function(){return fE},bottomRight:function(){return fS},center:function(){return fm},left:function(){return fv},midSide:function(){return fT},nodeCenter:function(){return fA},orth:function(){return fO},right:function(){return fx},top:function(){return fy},topLeft:function(){return fw},topRight:function(){return fC}});var ni={};n.r(ni),n.d(ni,{closest:function(){return fR},length:function(){return fj},orth:function(){return f_},ratio:function(){return fN}});var no={};n.r(no),n.d(no,{anchor:function(){return fF},bbox:function(){return fD},boundary:function(){return fV},rect:function(){return fB}});var ns={};n.r(ns),n.d(ns,{er:function(){return go},loop:function(){return gl},manhattan:function(){return gn},metro:function(){return gi},normal:function(){return f$},oneSide:function(){return fU},orth:function(){return fJ}});var nl={};n.r(nl),n.d(nl,{jumpover:function(){return gy},loop:function(){return gu},normal:function(){return ga},rounded:function(){return gc},smooth:function(){return gh}}),n(2387);class na{get disposed(){return!0===this._disposed}dispose(){this._disposed=!0}}(na||(na={})).dispose=function(){return(e,t,n)=>{let r=n.value,i=e.__proto__;n.value=function(...e){this.disposed||(r.call(this,...e),i.dispose.call(this))}}};class nu{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()}}(k=nu||(nu={})).from=function(e){let t=new k;return e.forEach(e=>{t.add(e)}),t};var nc=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},nh="object"==typeof global&&global&&global.Object===Object&&global,nd="object"==typeof self&&self&&self.Object===Object&&self,nf=nh||nd||Function("return this")(),ng=function(){return nf.Date.now()},np=/\s/,nm=function(e){for(var t=e.length;t--&&np.test(e.charAt(t)););return t},ny=/^\s+/,nb=nf.Symbol,nv=Object.prototype,nx=nv.hasOwnProperty,nw=nv.toString,nC=nb?nb.toStringTag:void 0,nE=function(e){var t=nx.call(e,nC),n=e[nC];try{e[nC]=void 0;var r=!0}catch(e){}var i=nw.call(e);return r&&(t?e[nC]=n:delete e[nC]),i},nS=Object.prototype.toString,nP=nb?nb.toStringTag:void 0,nk=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nP&&nP in Object(e)?nE(e):nS.call(e)},nM=function(e){return null!=e&&"object"==typeof e},nO=function(e){return"symbol"==typeof e||nM(e)&&"[object Symbol]"==nk(e)},nA=0/0,nT=/^[-+]0x[0-9a-f]+$/i,nN=/^0b[01]+$/i,nj=/^0o[0-7]+$/i,nL=parseInt,nR=function(e){if("number"==typeof e)return e;if(nO(e))return nA;if(nc(e)){var t,n="function"==typeof e.valueOf?e.valueOf():e;e=nc(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,nm(t)+1).replace(ny,""):t;var r=nN.test(e);return r||nj.test(e)?nL(e.slice(2),r?2:8):nT.test(e)?nA:+e},n_=Math.max,nz=Math.min,nI=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)}function g(e){var n=e-a,r=e-u;return void 0===a||n>=t||n<0||h&&r>=o}function p(){var e,n,r,i=ng();if(g(i))return m(i);l=setTimeout(p,(e=i-a,n=i-u,r=t-e,h?nz(r,o-n):r))}function m(e){return(l=void 0,d&&r)?f(e):(r=i=void 0,s)}function y(){var e,n=ng(),o=g(n);if(r=arguments,i=this,a=n,o){if(void 0===l)return u=e=a,l=setTimeout(p,t),c?f(e):s;if(h)return clearTimeout(l),l=setTimeout(p,t),f(a)}return void 0===l&&(l=setTimeout(p,t)),s}return t=nR(t)||0,nc(n)&&(c=!!n.leading,o=(h="maxWait"in n)?n_(nR(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),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(ng())},y},nD=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return nc(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),nI(e,t,{leading:r,maxWait:t,trailing:i})};function nB(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 nV(e,t,...n){return nB(e,t,n)}function nF(e){return"object"==typeof e&&e.then&&"function"==typeof e.then}function n$(e){return null!=e&&(e instanceof Promise||nF(e))}function nU(...e){let t=[];return(e.forEach(e=>{Array.isArray(e)?t.push(...e):t.push(e)}),t.some(e=>n$(e)))?Promise.all(t.map(e=>n$(e)?e:Promise.resolve(!1!==e))).then(e=>e.reduce((e,t)=>!1!==t&&e,!0)):t.every(e=>!1!==e)}function nG(...e){let t=nU(e);return"boolean"==typeof t?Promise.resolve(t):t}function nH(e,t){let n=[];for(let r=0;r<e.length;r+=2){let i=nB(e[r],e[r+1],Array.isArray(t)?t:[t]);n.push(i)}return nU(n)}class nq{constructor(){this.listeners={}}on(e,t,n){return null==t||(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,n)),this}once(e,t,n){let r=(...i)=>(this.off(e,r),nH([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))return void delete r[e];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=nH([...r],t))}let r=this.listeners["*"];return null!=r?nU([n,nH([...r],[e,...t])]):n}emit(e,...t){return this.trigger(e,...t)}}var nW=Object.prototype.hasOwnProperty,nJ=function(e,t){return null!=e&&nW.call(e,t)},nX=Array.isArray,nY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nQ=/^\w*$/,nZ=function(e,t){if(nX(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||nO(e))||nQ.test(e)||!nY.test(e)||null!=t&&e in Object(t)},nK=function(e){if(!nc(e))return!1;var t=nk(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},n0=nf["__core-js_shared__"],n1=(M=/[^.]+$/.exec(n0&&n0.keys&&n0.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",n2=Function.prototype.toString,n3=function(e){if(null!=e){try{return n2.call(e)}catch(e){}try{return e+""}catch(e){}}return""},n6=/^\[object .+?Constructor\]$/,n5=Object.prototype,n4=Function.prototype.toString,n8=n5.hasOwnProperty,n9=RegExp("^"+n4.call(n8).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),n7=function(e){return!!nc(e)&&(!n1||!(n1 in e))&&(nK(e)?n9:n6).test(n3(e))},re=function(e,t){var n=null==e?void 0:e[t];return n7(n)?n:void 0},rt=re(Object,"create"),rn=Object.prototype.hasOwnProperty,rr=Object.prototype.hasOwnProperty;function ri(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])}}ri.prototype.clear=function(){this.__data__=rt?rt(null):{},this.size=0},ri.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},ri.prototype.get=function(e){var t=this.__data__;if(rt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return rn.call(t,e)?t[e]:void 0},ri.prototype.has=function(e){var t=this.__data__;return rt?void 0!==t[e]:rr.call(t,e)},ri.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=rt&&void 0===t?"__lodash_hash_undefined__":t,this};var ro=function(e,t){return e===t||e!=e&&t!=t},rs=function(e,t){for(var n=e.length;n--;)if(ro(e[n][0],t))return n;return -1},rl=Array.prototype.splice;function ra(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])}}ra.prototype.clear=function(){this.__data__=[],this.size=0},ra.prototype.delete=function(e){var t=this.__data__,n=rs(t,e);return!(n<0)&&(n==t.length-1?t.pop():rl.call(t,n,1),--this.size,!0)},ra.prototype.get=function(e){var t=this.__data__,n=rs(t,e);return n<0?void 0:t[n][1]},ra.prototype.has=function(e){return rs(this.__data__,e)>-1},ra.prototype.set=function(e,t){var n=this.__data__,r=rs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var ru=re(nf,"Map"),rc=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},rh=function(e,t){var n=e.__data__;return rc(t)?n["string"==typeof t?"string":"hash"]:n.map};function rd(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])}}function rf(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(rf.Cache||rd),n}rd.prototype.clear=function(){this.size=0,this.__data__={hash:new ri,map:new(ru||ra),string:new ri}},rd.prototype.delete=function(e){var t=rh(this,e).delete(e);return this.size-=!!t,t},rd.prototype.get=function(e){return rh(this,e).get(e)},rd.prototype.has=function(e){return rh(this,e).has(e)},rd.prototype.set=function(e,t){var n=rh(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},rf.Cache=rd;var rg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rp=/\\(\\)?/g,rm=(A=(O=rf(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rg,function(e,n,r,i){t.push(r?i.replace(rp,"$1"):n||e)}),t},function(e){return 500===A.size&&A.clear(),e})).cache,O),ry=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},rb=1/0,rv=nb?nb.prototype:void 0,rx=rv?rv.toString:void 0,rw=function e(t){if("string"==typeof t)return t;if(nX(t))return ry(t,e)+"";if(nO(t))return rx?rx.call(t):"";var n=t+"";return"0"==n&&1/t==-rb?"-0":n},rC=function(e){return null==e?"":rw(e)},rE=function(e,t){return nX(e)?e:nZ(e,t)?[e]:rm(rC(e))},rS=function(e){return nM(e)&&"[object Arguments]"==nk(e)},rP=Object.prototype,rk=rP.hasOwnProperty,rM=rP.propertyIsEnumerable,rO=rS(function(){return arguments}())?rS:function(e){return nM(e)&&rk.call(e,"callee")&&!rM.call(e,"callee")},rA=/^(?:0|[1-9]\d*)$/,rT=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&rA.test(e))&&e>-1&&e%1==0&&e<t},rN=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff},rj=1/0,rL=function(e){if("string"==typeof e||nO(e))return e;var t=e+"";return"0"==t&&1/e==-rj?"-0":t},rR=function(e,t,n){t=rE(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=rL(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&rN(i)&&rT(s,i)&&(nX(e)||rO(e))},r_=function(e,t){return null!=e&&rR(e,t,nJ)},rz=function(e,t){t=rE(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[rL(t[n++])];return n&&n==r?e:void 0},rI=function(){try{var e=re(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),rD=function(e,t,n){"__proto__"==t&&rI?rI(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},rB=Object.prototype.hasOwnProperty,rV=function(e,t,n){var r=e[t];rB.call(e,t)&&ro(r,n)&&(void 0!==n||t in e)||rD(e,t,n)},rF=function(e,t,n,r){if(!nc(e))return e;t=rE(t,e);for(var i=-1,o=t.length,s=o-1,l=e;null!=l&&++i<o;){var a=rL(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=nc(c)?c:rT(t[i+1])?[]:{})}rV(l,a,u),l=l[a]}return e},r$=function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],l=rz(e,s);n(l,s)&&rF(o,rE(s,e),l)}return o},rU=function(e,t){return null!=e&&t in Object(e)},rG=function(e,t){return null!=e&&rR(e,t,rU)},rH=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},rq=nb?nb.isConcatSpreadable:void 0,rW=function(e){return nX(e)||rO(e)||!!(rq&&e&&e[rq])},rJ=function e(t,n,r,i,o){var s=-1,l=t.length;for(r||(r=rW),o||(o=[]);++s<l;){var a=t[s];n>0&&r(a)?n>1?e(a,n-1,r,i,o):rH(o,a):i||(o[o.length]=a)}return o},rX=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)},rY=Math.max,rQ=function(e,t,n){return t=rY(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=rY(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),rX(e,this,l)}},rZ=function(e){return e},rK=Date.now,r0=(T=rI?function(e,t){return rI(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:rZ,N=0,j=0,function(){var e=rK(),t=16-(e-j);if(j=e,t>0){if(++N>=800)return arguments[0]}else N=0;return T.apply(void 0,arguments)}),r1=r0(rQ(L=function(e,t){return null==e?{}:r$(e,t,function(t,n){return rG(e,n)})},void 0,function(e){return(null==e?0:e.length)?rJ(e,1):[]}),L+"");function r2(e){var t=this.__data__=new ra(e);this.size=t.size}r2.prototype.clear=function(){this.__data__=new ra,this.size=0},r2.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},r2.prototype.get=function(e){return this.__data__.get(e)},r2.prototype.has=function(e){return this.__data__.has(e)},r2.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ra){var r=n.__data__;if(!ru||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new rd(r)}return n.set(e,t),this.size=n.size,this};var r3=function(e,t,n){(void 0===n||ro(e[t],n))&&(void 0!==n||t in e)||rD(e,t,n)},r6=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},r5="object"==typeof exports&&exports&&!exports.nodeType&&exports,r4=r5&&"object"==typeof module&&module&&!module.nodeType&&module,r8=r4&&r4.exports===r5?nf.Buffer:void 0,r9=r8?r8.allocUnsafe:void 0,r7=function(e,t){if(t)return e.slice();var n=e.length,r=r9?r9(n):new e.constructor(n);return e.copy(r),r},ie=nf.Uint8Array,it=function(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t},ir=function(e,t){var n=t?it(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},ii=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},io=Object.create,is=function(){function e(){}return function(t){if(!nc(t))return{};if(io)return io(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),il=function(e,t){return function(n){return e(t(n))}},ia=il(Object.getPrototypeOf,Object),iu=Object.prototype,ic=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||iu)},ih=function(e){return"function"!=typeof e.constructor||ic(e)?{}:is(ia(e))},id=function(e){return null!=e&&rN(e.length)&&!nK(e)},ig=function(e){return nM(e)&&id(e)},ip="object"==typeof exports&&exports&&!exports.nodeType&&exports,im=ip&&"object"==typeof module&&module&&!module.nodeType&&module,iy=im&&im.exports===ip?nf.Buffer:void 0,ib=(iy?iy.isBuffer:void 0)||function(){return!1},iv=Object.prototype,ix=Function.prototype.toString,iw=iv.hasOwnProperty,iC=ix.call(Object),iE=function(e){if(!nM(e)||"[object Object]"!=nk(e))return!1;var t=ia(e);if(null===t)return!0;var n=iw.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ix.call(n)==iC},iS={};iS["[object Float32Array]"]=iS["[object Float64Array]"]=iS["[object Int8Array]"]=iS["[object Int16Array]"]=iS["[object Int32Array]"]=iS["[object Uint8Array]"]=iS["[object Uint8ClampedArray]"]=iS["[object Uint16Array]"]=iS["[object Uint32Array]"]=!0,iS["[object Arguments]"]=iS["[object Array]"]=iS["[object ArrayBuffer]"]=iS["[object Boolean]"]=iS["[object DataView]"]=iS["[object Date]"]=iS["[object Error]"]=iS["[object Function]"]=iS["[object Map]"]=iS["[object Number]"]=iS["[object Object]"]=iS["[object RegExp]"]=iS["[object Set]"]=iS["[object String]"]=iS["[object WeakMap]"]=!1;var iP=function(e){return function(t){return e(t)}},ik="object"==typeof exports&&exports&&!exports.nodeType&&exports,iM=ik&&"object"==typeof module&&module&&!module.nodeType&&module,iO=iM&&iM.exports===ik&&nh.process,iA=function(){try{var e=iM&&iM.require&&iM.require("util").types;if(e)return e;return iO&&iO.binding&&iO.binding("util")}catch(e){}}(),iT=iA&&iA.isTypedArray,iN=iT?iP(iT):function(e){return nM(e)&&rN(e.length)&&!!iS[nk(e)]},ij=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},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?rD(n,l,a):rV(n,l,a)}return n},iR=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},i_=Object.prototype.hasOwnProperty,iz=function(e,t){var n=nX(e),r=!n&&rO(e),i=!n&&!r&&ib(e),o=!n&&!r&&!i&&iN(e),s=n||r||i||o,l=s?iR(e.length,String):[],a=l.length;for(var u in e)(t||i_.call(e,u))&&!(s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||rT(u,a)))&&l.push(u);return l},iI=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},iD=Object.prototype.hasOwnProperty,iB=function(e){if(!nc(e))return iI(e);var t=ic(e),n=[];for(var r in e)"constructor"==r&&(t||!iD.call(e,r))||n.push(r);return n},iV=function(e){return id(e)?iz(e,!0):iB(e)},iF=function(e,t,n,r,i,o,s){var l=ij(e,n),a=ij(t,n),u=s.get(a);if(u)return void r3(e,n,u);var c=o?o(l,a,n+"",e,t,s):void 0,h=void 0===c;if(h){var d=nX(a),f=!d&&ib(a),g=!d&&!f&&iN(a);(c=a,d||f||g)?nX(l)?c=l:ig(l)?c=ii(l):f?(h=!1,c=r7(a,!0)):g?(h=!1,c=ir(a,!0)):c=[]:iE(a)||rO(a)?(c=l,rO(l))?c=iL(l,iV(l)):(!nc(l)||nK(l))&&(c=ih(a)):h=!1}h&&(s.set(a,c),i(c,a,r,o,s),s.delete(a)),r3(e,n,c)},i$=function e(t,n,r,i,o){t!==n&&r6(n,function(s,l){if(o||(o=new r2),nc(s))iF(t,n,l,r,e,i,o);else{var a=i?i(ij(t,l),s,l+"",t,n,o):void 0;void 0===a&&(a=s),r3(t,l,a)}},iV)},iU=function(e,t){return r0(rQ(e,t,rZ),e+"")},iG=function(e,t,n){if(!nc(n))return!1;var r=typeof t;return("number"==r?!!(id(n)&&rT(t,n.length)):"string"==r&&t in n)&&ro(n[t],e)},iH=function(e){return iU(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&&iG(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})},iq=iH(function(e,t,n){i$(e,t,n)});function iW(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new rd;++t<n;)this.add(e[t])}iW.prototype.add=iW.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},iW.prototype.has=function(e){return this.__data__.has(e)};var iJ=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},iX=function(e,t){return e.has(t)},iY=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 iW:void 0;for(o.set(e,t),o.set(t,e);++h<l;){var g=e[h],p=t[h];if(r)var m=s?r(p,g,h,t,e,o):r(g,p,h,e,t,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!iJ(t,function(e,t){if(!iX(f,t)&&(g===e||i(g,e,n,r,o)))return f.push(t)})){d=!1;break}}else if(!(g===p||i(g,p,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d},iQ=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},iZ=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},iK=nb?nb.prototype:void 0,i0=iK?iK.valueOf:void 0,i1=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 ie(e),new ie(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return ro(+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=iQ;case"[object Set]":var a=1&r;if(l||(l=iZ),e.size!=t.size&&!a)break;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var c=iY(l(e),l(t),r,i,o,s);return s.delete(e),c;case"[object Symbol]":if(i0)return i0.call(e)==i0.call(t)}return!1},i2=function(e,t,n){var r=t(e);return nX(e)?r:rH(r,n(e))},i3=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},i6=function(){return[]},i5=Object.prototype.propertyIsEnumerable,i4=Object.getOwnPropertySymbols,i8=i4?function(e){return null==e?[]:i3(i4(e=Object(e)),function(t){return i5.call(e,t)})}:i6,i9=il(Object.keys,Object),i7=Object.prototype.hasOwnProperty,oe=function(e){if(!ic(e))return i9(e);var t=[];for(var n in Object(e))i7.call(e,n)&&"constructor"!=n&&t.push(n);return t},ot=function(e){return id(e)?iz(e):oe(e)},on=function(e){return i2(e,ot,i8)},or=Object.prototype.hasOwnProperty,oi=function(e,t,n,r,i,o){var s=1&n,l=on(e),a=l.length;if(a!=on(t).length&&!s)return!1;for(var u=a;u--;){var c=l[u];if(!(s?c in t:or.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 g=s;++u<a;){var p=e[c=l[u]],m=t[c];if(r)var y=s?r(m,p,c,t,e,o):r(p,m,c,e,t,o);if(!(void 0===y?p===m||i(p,m,n,r,o):y)){f=!1;break}g||(g="constructor"==c)}if(f&&!g){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},oo=re(nf,"DataView"),os=re(nf,"Promise"),ol=re(nf,"Set"),oa=re(nf,"WeakMap"),ou="[object Map]",oc="[object Promise]",oh="[object Set]",od="[object WeakMap]",of="[object DataView]",og=n3(oo),op=n3(ru),om=n3(os),oy=n3(ol),ob=n3(oa),ov=nk;(oo&&ov(new oo(new ArrayBuffer(1)))!=of||ru&&ov(new ru)!=ou||os&&ov(os.resolve())!=oc||ol&&ov(new ol)!=oh||oa&&ov(new oa)!=od)&&(ov=function(e){var t=nk(e),n="[object Object]"==t?e.constructor:void 0,r=n?n3(n):"";if(r)switch(r){case og:return of;case op:return ou;case om:return oc;case oy:return oh;case ob:return od}return t});var ox=ov,ow="[object Arguments]",oC="[object Array]",oE="[object Object]",oS=Object.prototype.hasOwnProperty,oP=function(e,t,n,r,i,o){var s=nX(e),l=nX(t),a=s?oC:ox(e),u=l?oC:ox(t);a=a==ow?oE:a,u=u==ow?oE:u;var c=a==oE,h=u==oE,d=a==u;if(d&&ib(e)){if(!ib(t))return!1;s=!0,c=!1}if(d&&!c)return o||(o=new r2),s||iN(e)?iY(e,t,n,r,i,o):i1(e,t,a,n,r,i,o);if(!(1&n)){var f=c&&oS.call(e,"__wrapped__"),g=h&&oS.call(t,"__wrapped__");if(f||g){var p=f?e.value():e,m=g?t.value():t;return o||(o=new r2),i(p,m,n,r,o)}}return!!d&&(o||(o=new r2),oi(e,t,n,r,i,o))},ok=function e(t,n,r,i,o){return t===n||(null!=t&&null!=n&&(nM(t)||nM(n))?oP(t,n,r,i,e,o):t!=t&&n!=n)},oM=function(e,t){return ok(e,t)},oO=Object.prototype.hasOwnProperty,oA=function(e){if(null==e)return!0;if(id(e)&&(nX(e)||"string"==typeof e||"function"==typeof e.splice||ib(e)||iN(e)||rO(e)))return!e.length;var t=ox(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ic(e))return!oe(e).length;for(var n in e)if(oO.call(e,n))return!1;return!0},oT=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},oN=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)rH(t,i8(e)),e=ia(e);return t}:i6,oj=function(e){return i2(e,iV,oN)},oL=Object.prototype.hasOwnProperty,oR=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&oL.call(e,"index")&&(n.index=e.index,n.input=e.input),n},o_=function(e,t){var n=t?it(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},oz=/\w*$/,oI=function(e){var t=new e.constructor(e.source,oz.exec(e));return t.lastIndex=e.lastIndex,t},oD=nb?nb.prototype:void 0,oB=oD?oD.valueOf:void 0,oV=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return it(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return o_(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 ir(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return oI(e);case"[object Symbol]":return oB?Object(oB.call(e)):{}}},oF=iA&&iA.isMap,o$=oF?iP(oF):function(e){return nM(e)&&"[object Map]"==ox(e)},oU=iA&&iA.isSet,oG=oU?iP(oU):function(e){return nM(e)&&"[object Set]"==ox(e)},oH="[object Arguments]",oq="[object Function]",oW="[object Object]",oJ={};oJ[oH]=oJ["[object Array]"]=oJ["[object ArrayBuffer]"]=oJ["[object DataView]"]=oJ["[object Boolean]"]=oJ["[object Date]"]=oJ["[object Float32Array]"]=oJ["[object Float64Array]"]=oJ["[object Int8Array]"]=oJ["[object Int16Array]"]=oJ["[object Int32Array]"]=oJ["[object Map]"]=oJ["[object Number]"]=oJ[oW]=oJ["[object RegExp]"]=oJ["[object Set]"]=oJ["[object String]"]=oJ["[object Symbol]"]=oJ["[object Uint8Array]"]=oJ["[object Uint8ClampedArray]"]=oJ["[object Uint16Array]"]=oJ["[object Uint32Array]"]=!0,oJ["[object Error]"]=oJ[oq]=oJ["[object WeakMap]"]=!1;var oX=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(!nc(t))return t;var h=nX(t);if(h){if(l=oR(t),!a)return ii(t,l)}else{var d,f,g,p,m=ox(t),y=m==oq||"[object GeneratorFunction]"==m;if(ib(t))return r7(t,a);if(m==oW||m==oH||y&&!o){if(l=u||y?{}:ih(t),!a)return u?(f=(d=l)&&iL(t,iV(t),d),iL(t,oN(t),f)):(p=(g=l)&&iL(t,ot(t),g),iL(t,i8(t),p))}else{if(!oJ[m])return o?t:{};l=oV(t,m,a)}}s||(s=new r2);var b=s.get(t);if(b)return b;s.set(t,l),oG(t)?t.forEach(function(i){l.add(e(i,n,r,i,t,s))}):o$(t)&&t.forEach(function(i,o){l.set(o,e(i,n,r,o,t,s))});var v=c?u?oj:on:u?iV:ot,x=h?void 0:v(t);return oT(x||t,function(i,o){x&&(i=t[o=i]),rV(l,o,e(i,n,r,o,t,s))}),l},oY=function(e){return oX(e,4)},oQ=function(e){return oX(e,5)},oZ=Object.prototype,oK=oZ.hasOwnProperty,o0=iU(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&iG(t[0],t[1],i)&&(r=1);++n<r;)for(var o=t[n],s=iV(o),l=-1,a=s.length;++l<a;){var u=s[l],c=e[u];(void 0===c||ro(c,oZ[u])&&!oK.call(e,u))&&(e[u]=o[u])}return e}),o1=function e(t,n,r,i,o,s){return nc(t)&&nc(n)&&(s.set(n,t),i$(t,n,void 0,e,s),s.delete(n)),t},o2=iH(function(e,t,n,r){i$(e,t,n,r)}),o3=iU(function(e){return e.push(void 0,o1),rX(o2,void 0,e)});function o6(e,...t){t.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{"constructor"!==n&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}let o5=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])};function o4(e,t){function n(){this.constructor=e}o5(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}let o8=/^\s*class\s+/.test(`${class{}}`)||/^\s*class\s*\{/.test(`${class{}}`);function o9(e,t){let n;return o8?n=class extends t{}:o4(n=function(){return t.apply(this,arguments)},t),Object.defineProperty(n,"name",{value:e}),n}function o7(e,t){return null!=e?e:t}function se(e,t,n){let r=null!=e?e[t]:null;return void 0!==n?o7(r,n):r}function st(e,t,n){let r=null!=e?e[t]:null;return null==r||Number.isNaN(r*=1)||!Number.isFinite(r)?n:r}function sn(e,t,n){let r=null!=e?e[t]:null;return null==r?n:!!r}function sr(e){return"__proto__"===e}function si(e,t,n="/"){let r,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 so(e,t,n,r="/"){let i=Array.isArray(t)?t:t.split(r),o=i.pop();if(o&&!sr(o)){let t=e;i.forEach(e=>{sr(e)||(null==t[e]&&(t[e]={}),t=t[e])}),t[o]=n}return e}function ss(e,t,n="/"){let r=Array.isArray(t)?t.slice():t.split(n),i=r.pop();if(i)if(r.length>0){let t=si(e,r);t&&delete t[i]}else delete e[i];return e}class sl extends nq{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)}([na.dispose()],sl.prototype,"dispose",null),(sl||(sl={})).dispose=na.dispose,o6(sl,na);var sa=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},su=function(e){return e!=e},sc=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1},sh=function(e,t){return!!(null==e?0:e.length)&&(t==t?sc(e,t,0):sa(e,su,0))>-1},sd=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},sf=ol&&1/iZ(new ol([,-0]))[1]==1/0?function(e){return new ol(e)}:function(){},sg=function(e,t,n){var r=-1,i=sh,o=e.length,s=!0,l=[],a=l;if(n)s=!1,i=sd;else if(o>=200){var u=t?null:sf(e);if(u)return iZ(u);s=!1,i=iX,a=new iW}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},sp=function(e){return e&&e.length?sg(e):[]},sm=iU(function(e){return sg(rJ(e,1,ig,!0))}),sy=Math.floor,sb=Math.min,sv=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=nO(t),u=void 0===t;i<o;){var c=sy((i+o)/2),h=n(e[c]),d=void 0!==h,f=null===h,g=h==h,p=nO(h);if(s)var m=r||g;else m=u?g&&(r||d):l?g&&d&&(r||!f):a?g&&d&&!f&&(r||!p):!f&&!p&&(r?h<=t:h<t);m?i=c+1:o=c}return sb(o,0xfffffffe)},sx=function(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=0x7fffffff){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!nO(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return sv(e,t,rZ,n)},sw=function(e,t){return sx(e,t)},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 r2;if(r)var d=r(u,c,a,e,t,h);if(!(void 0===d?ok(c,u,3,r,h):d))return!1}}return!0},sE=function(e){return e==e&&!nc(e)},sS=function(e){for(var t=ot(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))}},sk=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)}},sM=function(e,t,n){var r=null==e?void 0:rz(e,t);return void 0===r?n:r},sO=function(e){var t;return nZ(e)?(t=rL(e),function(e){return null==e?void 0:e[t]}):function(t){return rz(t,e)}},sA=function(e){if("function"==typeof e)return e;if(null==e)return rZ;if("object"==typeof e){var t,n;return nX(e)?(t=e[0],n=e[1],nZ(t)&&sE(n)?sP(rL(t),n):function(e){var r=sM(e,t);return void 0===r&&r===n?rG(e,t):ok(n,r,3)}):sk(e)}return sO(e)},sT=function(e,t,n){return sv(e,t,sA(n,2))},sN=(R=function(e,t){return e&&r6(e,t,ot)},function(e,t){if(null==e)return e;if(!id(e))return R(e,t);for(var n=e.length,r=-1,i=Object(e);++r<n&&!1!==t(i[r],r,i););return e}),sj=function(e,t){var n=-1,r=id(e)?Array(e.length):[];return sN(e,function(e,i,o){r[++n]=t(e,i,o)}),r},sL=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},sR=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=nO(e),s=void 0!==t,l=null===t,a=t==t,u=nO(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},s_=function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,l=n.length;++r<s;){var a=sR(i[r],o[r]);if(a){if(r>=l)return a;return a*("desc"==n[r]?-1:1)}}return e.index-t.index},sz=function(e,t,n){t=t.length?ry(t,function(e){return nX(e)?function(t){return rz(t,1===e.length?e[0]:e)}:e}):[rZ];var r=-1;return t=ry(t,iP(sA)),sL(sj(e,function(e,n,i){return{criteria:ry(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return s_(e,t,n)})},sI=iU(function(e,t){if(null==e)return[];var n=t.length;return n>1&&iG(e,t[0],t[1])?t=[]:n>2&&iG(t[0],t[1],t[2])&&(t=[t[0]]),sz(e,rJ(t,1),[])}),sD=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},sB=function(e,t,n,r){return sN(e,function(e,i,o){t(r,e,n(e),o)}),r},sV=Object.prototype.hasOwnProperty,sF=(_=function(e,t,n){sV.call(e,n)?e[n].push(t):rD(e,n,[t])},function(e,t){return(nX(e)?sD:sB)(e,_,sA(t,2),{})}),s$=function(e,t,n,r){var i=-1,o=sh,s=!0,l=e.length,a=[],u=t.length;if(!l)return a;n&&(t=ry(t,iP(n))),r?(o=sd,s=!1):t.length>=200&&(o=iX,s=!1,t=new iW(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},sU=iU(function(e,t){return ig(e)?s$(e,rJ(t,1,ig,!0)):[]}),sG=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&&!nO(s):n(s,l)))var l=s,a=o}return a},sH=function(e,t){return e>t},sq=function(e){return e&&e.length?sG(e,rZ,sH):void 0},sW=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},sJ=(z={À:"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==z?void 0:z[e]}),sX=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sY=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),sQ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,sZ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,sK="\\ud800-\\udfff",s0="\\u2700-\\u27bf",s1="a-z\\xdf-\\xf6\\xf8-\\xff",s2="A-Z\\xc0-\\xd6\\xd8-\\xde",s3="\\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",s6="['’]",s5="["+s3+"]",s4="["+s1+"]",s8="[^"+sK+s3+"\\d+"+s0+s1+s2+"]",s9="(?:\\ud83c[\\udde6-\\uddff]){2}",s7="[\\ud800-\\udbff][\\udc00-\\udfff]",le="["+s2+"]",lt="(?:"+s4+"|"+s8+")",ln="(?:"+le+"|"+s8+")",lr="(?:"+s6+"(?:d|ll|m|re|s|t|ve))?",li="(?:"+s6+"(?:D|LL|M|RE|S|T|VE))?",lo="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ls="[\\ufe0e\\ufe0f]?",ll="(?:\\u200d(?:"+["[^"+sK+"]",s9,s7].join("|")+")"+ls+lo+")*",la="(?:"+["["+s0+"]",s9,s7].join("|")+")"+(ls+lo+ll),lu=RegExp([le+"?"+s4+"+"+lr+"(?="+[s5,le,"$"].join("|")+")",ln+"+"+li+"(?="+[s5,le+lt,"$"].join("|")+")",le+"?"+lt+"+"+lr,le+"+"+li,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",la].join("|"),"g"),lc=function(e,t,n){if(e=rC(e),void 0===(t=n?void 0:t)){var r;return(r=e,sZ.test(r))?e.match(lu)||[]:e.match(sQ)||[]}return e.match(t)||[]},lh=RegExp("['’]","g"),ld=function(e){return function(t){var n;return sW(lc(((n=rC(n=t))&&n.replace(sX,sJ).replace(sY,"")).replace(lh,"")),e,"")}},lf=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},lg=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:lf(e,t,n)},lp=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),lm=function(e){return lp.test(e)},ly="\\ud800-\\udfff",lb="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",lv="\\ud83c[\\udffb-\\udfff]",lx="[^"+ly+"]",lw="(?:\\ud83c[\\udde6-\\uddff]){2}",lC="[\\ud800-\\udbff][\\udc00-\\udfff]",lE="(?:"+lb+"|"+lv+")?",lS="[\\ufe0e\\ufe0f]?",lP="(?:\\u200d(?:"+[lx,lw,lC].join("|")+")"+lS+lE+")*",lk=RegExp(lv+"(?="+lv+")|"+("(?:"+[lx+lb+"?",lb,lw,lC,"["+ly+"]"].join("|"))+")"+(lS+lE+lP),"g"),lM=function(e){return function(t){var n,r=lm(t=rC(t))?lm(n=t)?n.match(lk)||[]:n.split(""):void 0,i=r?r[0]:t.charAt(0),o=r?lg(r,1).join(""):t.slice(1);return i[e]()+o}},lO=lM("toUpperCase"),lA=ld(function(e,t,n){return e+(n?" ":"")+lO(t)}),lT=ld(function(e,t,n){return t=t.toLowerCase(),e+(n?lO(rC(t).toLowerCase()):t)}),lN=ld(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),lj=ld(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),lL=lM("toLowerCase");let lR=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},l_=lR(e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase()),lz=lR(e=>lA(lT(e)).replace(/ /g,""));function lI(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 lD(){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}lR(e=>lN(e).replace(/ /g,"_")),lR(e=>lj(e).replace(/ /g,".")),lR(e=>lj(e).replace(/ /g,"/")),lR(e=>lO(lj(e))),lR(e=>lA(lT(e)));var lB=function(e){return"number"==typeof e||nM(e)&&"[object Number]"==nk(e)},lV=function(e,t,n){var r,i,o;return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=nR(n))==n?n:0),void 0!==t&&(t=(t=nR(t))==t?t:0),r=nR(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 lF(e,t){return(e%t+t)%t}function l$(e,t){if(null==t)t=null==e?1:e,e=0;else if(t<e){let n=e;e=t,t=n}return Math.floor(Math.random()*(t-e+1)+e)}function lU(e){return"string"==typeof e&&"%"===e.slice(-1)}function lG(e,t){let n;if(null==e)return 0;if("string"==typeof e){if(n=parseFloat(e),lU(e)&&Number.isFinite(n/=100))return n*t}else n=e;return Number.isFinite(n)?n>0&&n<1?n*t:n:0}function lH(e,t){var n;let r,i,o=parseFloat(e);if(Number.isNaN(o))return null;if(null==t)r="[A-Za-z]*";else if(Array.isArray(t)){if(0===t.length)return null;r=t.join("|")}else"string"==typeof t&&(r=t);let s=(n=r,(i=RegExp(`(?:\\d+(?:\\.\\d+)*)(${n})$`).exec(e))?i[1]:null);return null===s?null:{unit:s,value:o}}function lq(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 lW=!1,lJ=!1,lX=!1,lY=!1,lQ=!1,lZ=!1,lK=!1,l0=!1,l1=!1,l2=!1,l3=!1,l6=!1,l5=!1,l4=!1,l8=!1,l9=!1;if("object"==typeof navigator){let e=navigator.userAgent;lW=e.indexOf("Macintosh")>=0,lJ=!!e.match(/(iPad|iPhone|iPod)/g),lX=e.indexOf("Windows")>=0,lY=e.indexOf("MSIE")>=0,lQ=!!e.match(/Trident\/7\./),lZ=!!e.match(/Edge\//),lK=e.indexOf("Mozilla/")>=0&&0>e.indexOf("MSIE")&&0>e.indexOf("Edge/"),l1=e.indexOf("Chrome/")>=0&&0>e.indexOf("Edge/"),l2=e.indexOf("Opera/")>=0||e.indexOf("OPR/")>=0,l3=e.indexOf("Firefox/")>=0,l6=e.indexOf("AppleWebKit/")>=0&&0>e.indexOf("Chrome/")&&0>e.indexOf("Edge/"),"object"==typeof document&&(l9=!document.createElementNS||"[object SVGForeignObjectElement]"!=`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`||e.indexOf("Opera/")>=0)}if("object"==typeof window&&(l0=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,l4=null!=window.PointerEvent&&!lW),"object"==typeof document){l5="ontouchstart"in document.documentElement;try{let e=Object.defineProperty({},"passive",{get(){l8=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},e)}catch(e){}}(I=td||(td={})).IS_MAC=lW,I.IS_IOS=lJ,I.IS_WINDOWS=lX,I.IS_IE=lY,I.IS_IE11=lQ,I.IS_EDGE=lZ,I.IS_NETSCAPE=lK,I.IS_CHROME_APP=l0,I.IS_CHROME=l1,I.IS_OPERA=l2,I.IS_FIREFOX=l3,I.IS_SAFARI=l6,I.SUPPORT_TOUCH=l5,I.SUPPORT_POINTER=l4,I.SUPPORT_PASSIVE=l8,I.NO_FOREIGNOBJECT=l9,I.SUPPORT_FOREIGNOBJECT=!I.NO_FOREIGNOBJECT;var l7=td||(td={});function ae(){let e=window.module;return null!=e&&null!=e.hot&&null!=e.hot.status?e.hot.status():"unkonwn"}l7.getHMRStatus=ae,l7.isApplyingHMR=function(){return"apply"===ae()};let at={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};l7.isEventSupported=function(e){let t=document.createElement(at[e]||"div"),n=`on${e}`,r=n in t;return r||(t.setAttribute(n,"return;"),r="function"==typeof t[n]),r};let an=/[\t\r\n\f]/g,ar=/\S+/g,ai=e=>` ${e} `;function ao(e){return e&&e.getAttribute&&e.getAttribute("class")||""}function as(e,t){if(null==e||null==t)return!1;let n=ai(ao(e)),r=ai(t);return 1===e.nodeType&&n.replace(an," ").includes(r)}function al(e,t){if(null!=e&&null!=t){if("function"==typeof t)return al(e,t(ao(e)));if("string"==typeof t&&1===e.nodeType){let n=t.match(ar)||[],r=ai(ao(e)).replace(an," "),i=n.reduce((e,t)=>0>e.indexOf(ai(t))?`${e}${t} `:e,r);r!==(i=i.trim())&&e.setAttribute("class",i)}}}function aa(e,t){if(null!=e){if("function"==typeof t)return aa(e,t(ao(e)));if((!t||"string"==typeof t)&&1===e.nodeType){let n=(t||"").match(ar)||[],r=ai(ao(e)).replace(an," "),i=n.reduce((e,t)=>{let n=ai(t);return e.indexOf(n)>-1?e.replace(n," "):e},r);r!==(i=t?i.trim():"")&&e.setAttribute("class",i)}}}function au(e,t,n){if(null!=e&&null!=t){if(null!=n&&"string"==typeof t)return void(n?al(e,t):aa(e,t));if("function"==typeof t)return au(e,t(ao(e),n),n);"string"==typeof t&&(t.match(ar)||[]).forEach(t=>{as(e,t)?aa(e,t):al(e,t)})}}let ac=0;function ah(){return ac+=1,`v${ac}`}function ad(e){return(null==e.id||""===e.id)&&(e.id=ah()),e.id}function af(e){return null!=e&&"function"==typeof e.getScreenCTM&&e instanceof SVGElement}let ag={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"},ap="1.1";function am(e,t=document){return t.createElement(e)}function ay(e,t=ag.xhtml,n=document){return n.createElementNS(t,e)}function ab(e,t=document){return ay(e,ag.svg,t)}function av(e){if(e){let{documentElement:t}=ax(`<svg xmlns="${ag.svg}" xmlns:xlink="${ag.xlink}" version="${ap}">${e}</svg>`,{async:!1});return t}let t=document.createElementNS(ag.svg,"svg");return t.setAttributeNS(ag.xmlns,"xmlns:xlink",ag.xlink),t.setAttribute("version",ap),t}function ax(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}function aw(e,t=!0){let n=e.nodeName;return t?n.toLowerCase():n.toUpperCase()}function aC(e){let t=0,n=e.previousSibling;for(;n;)1===n.nodeType&&(t+=1),n=n.previousSibling;return t}function aE(e,t){return e.querySelectorAll(t)}function aS(e,t){return e.querySelector(t)}function aP(e,t,n){let r=e.ownerSVGElement,i=e.parentNode;for(;i&&i!==n&&i!==r;){if(as(i,t))return i;i=i.parentNode}return null}function ak(e,t){let n=t&&t.parentNode;return e===n||!!(n&&1===n.nodeType&&16&e.compareDocumentPosition(n))}function aM(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function aO(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function aA(e,t){(Array.isArray(t)?t:[t]).forEach(t=>{null!=t&&e.appendChild(t)})}function aT(e,t){let n=e.firstChild;return n?aN(n,t):aA(e,t)}function aN(e,t){let n=e.parentNode;n&&(Array.isArray(t)?t:[t]).forEach(t=>{null!=t&&n.insertBefore(t,e)})}function aj(e,t){let n=e.parentNode;n&&(Array.isArray(t)?t:[t]).forEach(t=>{null!=t&&n.insertBefore(t,e.nextSibling)})}function aL(e,t){null!=t&&t.appendChild(e)}function aR(e){return!!e&&1===e.nodeType}function a_(e){try{return e instanceof HTMLElement}catch(t){return"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument}}function az(e,t){let n=[],r=e.firstChild;for(;r;r=r.nextSibling)1===r.nodeType&&(!t||as(r,t))&&n.push(r);return n}let aI=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function aD(e,t){return e.getAttribute(t)}function aB(e,t){let n=aU(t);n.ns?e.hasAttributeNS(n.ns,n.local)&&e.removeAttributeNS(n.ns,n.local):e.hasAttribute(t)&&e.removeAttribute(t)}function aV(e,t,n){if(null==n)return aB(e,t);let r=aU(t);r.ns&&"string"==typeof n?e.setAttributeNS(r.ns,t,n):"id"===t?e.id=`${n}`:e.setAttribute(t,`${n}`)}function aF(e,t){Object.keys(t).forEach(n=>{aV(e,n,t[n])})}function a$(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?aF(e,t):aV(e,t,n)}function aU(e){if(-1!==e.indexOf(":")){let t=e.split(":");return{ns:ag[t[0]],local:t[1]}}return{ns:null,local:e}}function aG(e){let t={};return Object.keys(e).forEach(n=>{t[aI.includes(n)?n:l_(n)]=e[n]}),t}function aH(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 aq(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,o="object"==typeof e[n],s="object"==typeof t[n];o&&s?(r=e[n],i=t[n]):o?(r=e[n],i=aH(t[n])):s?(r=aH(e[n]),i=t[n]):(r=aH(e[n]),i=aH(t[n])),e[n]=aq(r,i)}else e[n]=t[n]}),e}!function(e){function t(e){let t="data:";return e.substr(0,t.length)===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)}}function i(e){let t=parseFloat(e);return Number.isNaN(t)?null:t}e.isDataUrl=t,e.imageToDataUri=function(e,n){if(!e||t(e))return void setTimeout(()=>n(null,e));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)},e.svgToDataUrl=function(e,t={}){let n=null,r=t=>{let r;return(null==n&&(n=(r=e.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i))&&r[2]?r[2].replace(/\s+/," ").split(" "):null),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}`}}(tf||(tf={}));let aW={px:e=>e,mm:e=>r*e,cm:e=>r*e*10,in:e=>r*e*25.4,pt:e=>25.4*e/72*r,pc:e=>25.4*e/6*r};var aJ=tg||(tg={});function aX(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}aJ.measure=aX,aJ.toPx=function(e,t){null==r&&(r=aX("1","1","mm").width);let n=t?aW[t]:null;return n?n(e):e};let aY=/-(.)/g,aQ={},aZ=["webkit","ms","moz","o"],aK=document?document.createElement("div").style:{};function a0(e){let t=e.replace(aY,(e,t)=>t.toUpperCase());if(null==aQ[t]){let e=t.charAt(0).toUpperCase()+t.slice(1);aQ[t]=t in aK?t:function(e){for(let t=0;t<aZ.length;t+=1){let n=aZ[t]+e;if(n in aK)return n}return null}(e)}return aQ[t]}function a1(e,t,n){let r=a0(t);null!=r&&(e[r]=n),e[t]=n}function a2(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 a3(e){let t=a2(e);return null!=t&&("scroll"===t.overflow||"auto"===t.overflow)}let a6=(s=document).selection?function(){s.selection.empty()}:window.getSelection?function(){let e=window.getSelection();e&&(e.empty?e.empty():e.removeAllRanges&&e.removeAllRanges())}:function(){},a5={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 a4(e){return/^--/.test(e)}function a8(e,t,n){let r=window.getComputedStyle(e,null);return n?r.getPropertyValue(t)||void 0:r[t]||e.style[t]}function a9(e,t){return parseInt(a8(e,t),10)||0}function a7(e,t,n){if("string"==typeof t){var r,i;let o=a4(t);if(o||(t=a0(t)),void 0===n)return a8(e,t,o);o||(r=t,i=n,n=a5[r]||"number"!=typeof i?i:`${i}px`);let s=e.style;return void(o?s.setProperty(t,n):s[t]=n)}for(let n in t)a7(e,n,t[n])}let ue=new WeakMap;function ut(e,t){let n=lT(t),r=ue.get(e);if(r)return r[n]}function un(e,t,n){let r=lT(t),i=ue.get(e);i?i[r]=n:ue.set(e,{[r]:n})}function ur(e,t,n){if(!t){let t={};return Object.keys(ue).forEach(n=>{t[n]=ut(e,n)}),t}if("string"==typeof t)return void 0===n?ut(e,t):void un(e,t,n);for(let n in t)ur(e,n,t[n])}let ui={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};class uo{get[Symbol.toStringTag](){return uo.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(uo.isVector(e))r=e.node;else if("string"==typeof e)if("svg"===e.toLowerCase())r=av();else if("<"===e[0]){const t=av(e);r=document.importNode(t.firstChild,!0)}else r=document.createElementNS(ag.svg,e);else r=e;this.node=r,t&&this.setAttributes(t),n&&this.append(n)}transform(e,t){return null==e?uU(this.node):(uU(this.node,e,t),this)}translate(e,t=0,n={}){return null==e?uG(this.node):(uG(this.node,e,t,n),this)}rotate(e,t,n,r={}){return null==e?uH(this.node):(uH(this.node,e,t,n,r),this)}scale(e,t){return null==e?uq(this.node):(uq(this.node,e,t),this)}getTransformToElement(e){let t=uo.toNode(e);return uW(this.node,t)}removeAttribute(e){return aB(this.node,e),this}getAttribute(e){return aD(this.node,e)}setAttribute(e,t){return aV(this.node,e,t),this}setAttributes(e){return aF(this.node,e),this}attr(e,t){return null==e?a$(this.node):"string"==typeof e&&void 0===t?a$(this.node,e):("object"==typeof e?a$(this.node,e):a$(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:uo.create(this.node.ownerSVGElement)}defs(){let e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?uo.create(t):uo.create("defs").appendTo(e)}text(e,t={}){return uu(this.node,e,t),this}tagName(){return aw(this.node)}clone(){return uo.create(this.node.cloneNode(!0))}remove(){return aM(this.node),this}empty(){return aO(this.node),this}append(e){return aA(this.node,uo.toNodes(e)),this}appendTo(e){return aL(this.node,uo.isVector(e)?e.node:e),this}prepend(e){return aT(this.node,uo.toNodes(e)),this}before(e){return aN(this.node,uo.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(uo.toNode(e),this.node),uo.create(e)}first(){return this.node.firstChild?uo.create(this.node.firstChild):null}last(){return this.node.lastChild?uo.create(this.node.lastChild):null}get(e){let t=this.node.childNodes[e];return t?uo.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(uo.toNode(e))}find(e){let t=[],n=aE(this.node,e);if(n)for(let e=0,r=n.length;e<r;e+=1)t.push(uo.create(n[e]));return t}findOne(e){let t=aS(this.node,e);return t?uo.create(t):null}findParentByClass(e,t){let n=aP(this.node,e,t);return n?uo.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 ak(this.node,uo.isVector(e)?e.node:e)}wrap(e){let t=uo.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=uo.create(t.node.parentNode),null==e)return t;do if("string"==typeof e?t.matches(e):t instanceof e)break;while(t=uo.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(uo.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 aC(this.node)}hasClass(e){return as(this.node,e)}addClass(e){return al(this.node,e),this}removeClass(e){return aa(this.node,e),this}toggleClass(e,t){return au(this.node,e,t),this}toLocalPoint(e,t){return uX(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?up(this.node,e):[]}toPath(){return uo.create(uP(this.node))}toPathData(){return uk(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}function n(t,n,r){return new e(t,n,r)}function r(e){return t(e)?e.node:e}e.toStringTag=`X6.${e.name}`,e.isVector=t,e.create=n,e.createVectors=function(e){if("<"===e[0]){let t=av(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)]}}(uo||(uo={}));let us=document.createElement("canvas").getContext("2d"),ul=/em$/;function ua(e,t){let n=parseFloat(e);return ul.test(e)?n*t:n}function uu(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,g="auto"===f,p=g?"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&&aO(e),a$(e,{"xml:space":"preserve",display:t||n.displayEmpty?null:"none"});let b=a$(e,"font-size"),v=parseFloat(b);!v&&(v=16,(u||d)&&!b&&a$(e,"font-size",`${v}`)),l?("string"==typeof l&&(l={d:l}),r=function(e,t){let n=uo.create(t),r=uo.create("textPath"),i=e.d;if(i&&void 0===e["xlink:href"]){let e=uo.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=p;let n="v-line",a=ab("tspan"),u=w[e];if(u)if(d){let n=(t=function(e,t,n){let r,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=uo.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,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=aq(aq({},r.attrs),s.attrs),n.includeAnnotationIndices&&(null==r.annotations&&(r.annotations=[]),r.annotations.push(i)))}(i=l[u-1])?nc(r)&&nc(i)?JSON.stringify(r.attrs)===JSON.stringify(i.attrs)?a.t+=r.t:(s.push(a),a=r):nc(r)||nc(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:g?null:p,includeAnnotationIndices:h})).lineHeight;n&&g&&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=ua(s.maxFontSize,n)||n,a=0,u=ua(r,n);for(let e=1;e<o;e+=1)a+=ua((s=t[e]).lineHeight,n)||u;let c=ua(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,p);else if("top"===a)i="0.8em";else{let e;switch(E>0?(e=(parseFloat(p)||1)*E,!ul.test(p)&&(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 uc(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"),us.font=n.join(" "),us.measureText(e)}function uh(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]||uc(n,r).width,l=e.slice(0,s+1),a=o[l]||uc(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 ud(e,t,n={},r={}){let i=t.width,o=t.height,s=r.eol||"\n",l=n.fontSize||14,a=Math.floor(o/(n.lineHeight?parseFloat(n.lineHeight):Math.ceil(1.4*l)));if(e.indexOf(s)>-1){let i=lD(),o=[];return e.split(s).map(e=>{let s=ud(e,Object.assign(Object.assign({},t),{height:Number.MAX_SAFE_INTEGER}),n,Object.assign(Object.assign({},r),{eol:i}));s&&o.push(...s.split(i))}),o.slice(0,a).join(s)}let{width:u}=uc(e,n);if(u<i)return e;let c=[],h=e,d=u,f=r.ellipsis,g=0;f&&("string"!=typeof f&&(f="…"),g=uc(f,n).width);for(let e=0;e<a;e+=1)if(d>i)if(e===a-1){let[e]=uh(h,i-g,d,n);c.push(f?`${e}${f}`:e)}else{let[e,t]=uh(h,i,d,n);c.push(e),d=uc(h=t,n).width}else{c.push(h);break}return c.join(s)}let uf=.551784;function ug(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 up(e,t=1){let n,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}function um(e){return["M",ug(e,"x1"),ug(e,"y1"),"L",ug(e,"x2"),ug(e,"y2")].join(" ")}function uy(e){let t=ux(e);return 0===t.length?null:`${uv(t)} Z`}function ub(e){let t=ux(e);return 0===t.length?null:uv(t)}function uv(e){let t=e.map(e=>`${e.x} ${e.y}`);return`M ${t.join(" L")}`}function ux(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 uw(e){let t=ug(e,"cx",0),n=ug(e,"cy",0),r=ug(e,"r"),i=r*uf;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(" ")}function uC(e){let t=ug(e,"cx",0),n=ug(e,"cy",0),r=ug(e,"rx"),i=ug(e,"ry")||r,o=r*uf,s=i*uf;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(" ")}function uE(e){return uS({x:ug(e,"x",0),y:ug(e,"y",0),width:ug(e,"width",0),height:ug(e,"height",0),rx:ug(e,"rx",0),ry:ug(e,"ry",0)})}function uS(e){let t=e.x,n=e.y,r=e.width,i=e.height,o=Math.min(e.rx||e["top-rx"]||0,r/2),s=Math.min(e.rx||e["bottom-rx"]||0,r/2),l=Math.min(e.ry||e["top-ry"]||0,i/2),a=Math.min(e.ry||e["bottom-ry"]||0,i/2);return(o||s||l||a?["M",t,n+l,"v",i-l-a,"a",s,a,0,0,0,s,a,"h",r-2*s,"a",s,a,0,0,0,s,-a,"v",-(i-a-l),"a",o,l,0,0,0,-o,-l,"h",-(r-2*o),"a",o,l,0,0,0,-o,l,"Z"]:["M",t,n,"H",t+r,"V",n+i,"H",t,"V",n,"Z"]).join(" ")}function uP(e){let t=ab("path");a$(t,a$(e));let n=uk(e);return n&&t.setAttribute("d",n),t}function uk(e){let t=e.tagName.toLowerCase();switch(t){case"path":return e.getAttribute("d");case"line":return um(e);case"polygon":return uy(e);case"polyline":return ub(e);case"ellipse":return uC(e);case"circle":return uw(e);case"rect":return uE(e)}throw Error(`"${t}" cannot be converted to svg path element.`)}function uM(e,t,n,r){let i=2*Math.PI-1e-6,o=n,s=r;if(s<o){let e=o;o=s,s=e}let l=s-o,a=l<Math.PI?"0":"1",u=Math.cos(o),c=Math.sin(o),h=Math.cos(s),d=Math.sin(s);return l>=i?e?`M0,${t}A${t},${t} 0 1,1 0,${-t}A${t},${t} 0 1,1 0,${t}M0,${e}A${e},${e} 0 1,0 0,${-e}A${e},${e} 0 1,0 0,${e}Z`:`M0,${t}A${t},${t} 0 1,1 0,${-t}A${t},${t} 0 1,1 0,${t}Z`:e?`M${t*u},${t*c}A${t},${t} 0 ${a},1 ${t*h},${t*d}L${e*h},${e*d}A${e},${e} 0 ${a},0 ${e*u},${e*c}Z`:`M${t*u},${t*c}A${t},${t} 0 ${a},1 ${t*h},${t*d}L0,0Z`}let uO=ab("svg"),uA=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,uT=/[ ,]+/,uN=/^(\w+)\((.*)\)/;function uj(e,t){let n=uO.createSVGPoint();return n.x=e,n.y=t,n}function uL(e){let t=uO.createSVGMatrix();if(null!=e)for(let n in e)t[n]=e[n];return t}function uR(e){return null!=e?(e instanceof DOMMatrix||(e=uL(e)),uO.createSVGTransformFromMatrix(e)):uO.createSVGTransform()}function u_(e){let t=uL(),n=null!=e&&e.match(uA);if(!n)return t;for(let e=0,r=n.length;e<r;e+=1){let r=n[e].match(uN);if(r){let e,n,i,o,s,l=uL(),a=r[2].split(uT);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 uz(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 uI(e){let t,n,r;if(e)if(e.trim().indexOf("matrix")>=0){let i=uB(u_(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(uT));let o=e.match(/rotate\((.*?)\)/);o&&(n=o[1].split(uT));let s=e.match(/scale\((.*?)\)/);s&&(r=s[1].split(uT))}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 uD(e,t){return{x:t.x*e.a+t.y*e.c+0,y:t.x*e.b+t.y*e.d+0}}function uB(e){let t=uD(e,{x:0,y:1}),n=uD(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}}function uV(e){let t,n,r,i;return e?(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}}function uF(e){let t={x:0,y:1};e&&(t=uD(e,t));let n=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:n%360+360*(n<0)}}function u$(e){return{tx:e&&e.e||0,ty:e&&e.f||0}}function uU(e,t,n={}){if(null==t)return u_(a$(e,"transform"));if(n.absolute)return void e.setAttribute("transform",uz(t));let r=e.transform,i=uR(t);r.baseVal.appendItem(i)}function uG(e,t,n=0,r={}){let i=a$(e,"transform"),o=uI(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 uH(e,t,n,r,i={}){let o=a$(e,"transform"),s=uI(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 uq(e,t,n){let r=a$(e,"transform"),i=uI(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 uW(e,t){if(af(t)&&af(e)){let n=t.getScreenCTM(),r=e.getScreenCTM();if(n&&r)return n.inverse().multiply(r)}return uL()}function uJ(e,t){let n=uL();if(af(t)&&af(e)){let r=e,i=[];for(;r&&r!==t;){let e=u_(r.getAttribute("transform")||null);i.push(e),r=r.parentNode}i.reverse().forEach(e=>{n=n.multiply(e)})}return n}function uX(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=uW(e,r).inverse();return n.matrixTransform(o)}catch(e){return i}}l={},(D=tp||(tp={})).get=function(e){return l[e]||{}},D.register=function(e,t){l[e]=t},D.unregister=function(e){delete l[e]},B=tm||(tm={}),a=new WeakMap,B.ensure=function(e){return a.has(e)||a.set(e,{events:Object.create(null)}),a.get(e)},B.get=function(e){return a.get(e)},B.remove=function(e){return a.delete(e)},(V=ty||(ty={})).returnTrue=()=>!0,V.returnFalse=()=>!1,V.stopPropagationCallback=function(e){e.stopPropagation()},V.addEventListener=function(e,t,n){null!=e.addEventListener&&e.addEventListener(t,n)},V.removeEventListener=function(e,t,n){null!=e.removeEventListener&&e.removeEventListener(t,n)},u=/[^\x20\t\r\n\f]+/g,c=/^([^.]*)(?:\.(.+)|)/,(F=ty||(ty={})).splitType=function(e){return(e||"").match(u)||[""]},F.normalizeType=function(e){let t=c.exec(e)||[];return{originType:t[1]?t[1].trim():t[1],namespaces:t[2]?t[2].split(".").map(e=>e.trim()).sort():[]}},F.isValidTarget=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},F.isValidSelector=function(e,t){return!t||null!=e.querySelector&&null!=e.querySelector(t)},$=ty||(ty={}),h=0,d=new WeakMap,$.ensureHandlerId=function(e){return d.has(e)||(d.set(e,h),h+=1),d.get(e)},$.getHandlerId=function(e){return d.get(e)},$.removeHandlerId=function(e){return d.delete(e)},$.setHandlerId=function(e,t){return d.set(e,t)},(ty||(ty={})).getHandlerQueue=function(e,t){let n=[],r=tm.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},(ty||(ty={})).isWindow=function(e){return null!=e&&e===e.window},(ty||(ty={})).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 uY{constructor(e,t){this.isDefaultPrevented=ty.returnFalse,this.isPropagationStopped=ty.returnFalse,this.isImmediatePropagationStopped=ty.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{let e=this.originalEvent;this.isDefaultPrevented=ty.returnTrue,e&&!this.isSimulated&&e.preventDefault()},this.stopPropagation=()=>{let e=this.originalEvent;this.isPropagationStopped=ty.returnTrue,e&&!this.isSimulated&&e.stopPropagation()},this.stopImmediatePropagation=()=>{let e=this.originalEvent;this.isImmediatePropagationStopped=ty.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?ty.returnTrue:ty.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())}}(U=uY||(uY={})).create=function(e){return e instanceof U?e:new U(e)},(G=uY||(uY={})).addProperty=function(e,t){Object.defineProperty(G.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})}})},H=uY||(uY={}),Object.keys(f={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}).forEach(e=>H.addProperty(e,f[e])),tb||(tb={}),tp.register("load",{noBubble:!0}),tb||(tb={}),tp.register("beforeunload",{postDispatch(e,t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}),tb||(tb={}),tp.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let n,r=t.relatedTarget,i=t.handleObj;return r&&(r===e||ty.contains(e,r))||(t.type=i.originType,n=i.handler.call(e,t),t.type="mouseover"),n}}),tp.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let n,r=t.relatedTarget,i=t.handleObj;return r&&(r===e||ty.contains(e,r))||(t.type=i.originType,n=i.handler.call(e,t),t.type="mouseout"),n}});var uQ=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},uZ=tv||(tv={});function uK(e,t,...n){let r=uY.create(t);r.delegateTarget=e;let i=tp.get(r.type);if(i.preDispatch&&!1===i.preDispatch(e,r))return;let o=ty.getHandlerQueue(e,r);for(let e=0,t=o.length;e<t&&!r.isPropagationStopped();e+=1){let t=o[e];r.currentTarget=t.elem;for(let e=0,i=t.handlers.length;e<i&&!r.isImmediatePropagationStopped();e+=1){let i=t.handlers[e];if(null==r.rnamespace||i.namespace&&r.rnamespace.test(i.namespace)){r.handleObj=i,r.data=i.data;let e=tp.get(i.originType).handle,o=e?e(t.elem,r,...n):i.handler.call(t.elem,r,...n);void 0!==o&&(r.result=o,!1===o&&(r.preventDefault(),r.stopPropagation()))}}}return i.postDispatch&&i.postDispatch(e,r),r.result}uZ.on=function(e,t,n,r,i){let o;if(!ty.isValidTarget(e))return;if("function"!=typeof n){let{handler:e,selector:t}=n,r=uQ(n,["handler","selector"]);n=e,i=t,o=r}let s=tm.ensure(e),l=s.handler;null==l&&(l=s.handler=function(t,...n){return g!==t.type?uK(e,t,...n):void 0});let a=ty.ensureHandlerId(n);ty.splitType(t).forEach(t=>{let{originType:u,namespaces:c}=ty.normalizeType(t);if(!u)return;let h=u,d=tp.get(h);h=(i?d.delegateType:d.bindType)||h,d=tp.get(h);let f=Object.assign({type:h,originType:u,data:r,selector:i,guid:a,handler:n,namespace:c.join(".")},o),g=s.events,p=g[h];!p&&(p=g[h]={handlers:[],delegateCount:0},d.setup&&!1!==d.setup(e,r,c,l)||ty.addEventListener(e,h,l)),d.add&&(ty.removeHandlerId(f.handler),d.add(e,f),ty.setHandlerId(f.handler,a)),i?(p.handlers.splice(p.delegateCount,0,f),p.delegateCount+=1):p.handlers.push(f)})},uZ.off=function e(t,n,r,i,o){let s=tm.get(t);if(!s)return;let l=s.events;l&&(ty.splitType(n).forEach(n=>{let{originType:a,namespaces:u}=ty.normalizeType(n);if(!a)return void Object.keys(l).forEach(o=>{e(t,o+n,r,i,!0)});let c=a,h=tp.get(c),d=l[c=(i?h.delegateType:h.bindType)||c];if(!d)return;let f=u.length>0?RegExp(`(^|\\.)${u.join("\\.(?:.*\\.|)")}(\\.|$)`):null,g=d.handlers.length;for(let e=d.handlers.length-1;e>=0;e-=1){let n=d.handlers[e];(o||a===n.originType)&&(!r||ty.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))}g&&0===d.handlers.length&&(h.teardown&&!1!==h.teardown(t,u,s.handler)||ty.removeEventListener(t,c,s.handler),delete l[c])}),0===Object.keys(l).length&&tm.remove(t))},uZ.dispatch=uK,uZ.trigger=function(e,t,n,r){let i,o=e,s="string"==typeof e?e:e.type,l="string"==typeof e||null==o.namespace?[]:o.namespace.split(".");if(3===n.nodeType||8===n.nodeType)return;s.indexOf(".")>-1&&(s=(l=s.split(".")).shift(),l.sort());let a=0>s.indexOf(":")&&`on${s}`;(o=e instanceof uY?e:new uY(s,"object"==typeof e?e:null)).namespace=l.join("."),o.rnamespace=o.namespace?RegExp(`(^|\\.)${l.join("\\.(?:.*\\.|)")}(\\.|$)`):null,o.result=void 0,o.target||(o.target=n);let u=[o];Array.isArray(t)?u.push(...t):u.push(t);let c=tp.get(s);if(!r&&c.trigger&&!1===c.trigger(n,o,t))return;let h=[n];if(!r&&!c.noBubble&&!ty.isWindow(n)){i=c.delegateType||s;let e=n,t=n.parentNode;for(;null!=t;)h.push(t),e=t,t=t.parentNode;if(e===(n.ownerDocument||document)){let t=e.defaultView||e.parentWindow||window;h.push(t)}}let d=n;for(let e=0,t=h.length;e<t&&!o.isPropagationStopped();e+=1){let t=h[e];d=t,o.type=e>1?i:c.bindType||s;let n=tm.get(t);n&&n.events[o.type]&&n.handler&&n.handler.call(t,...u);let r=a&&t[a]||null;r&&ty.isValidTarget(t)&&(o.result=r.call(t,...u),!1===o.result&&o.preventDefault())}if(o.type=s,!r&&!o.isDefaultPrevented()){let e=c.preventDefault;if((null==e||!1===e(h.pop(),o,t))&&ty.isValidTarget(n)&&a&&"function"==typeof n[s]&&!ty.isWindow(n)){let e=n[a];e&&(n[a]=null),g=s,o.isPropagationStopped()&&d.addEventListener(s,ty.stopPropagationCallback),n[s](),o.isPropagationStopped()&&d.removeEventListener(s,ty.stopPropagationCallback),g=void 0,e&&(n[a]=e)}}return o.result},(q=tx||(tx={})).on=function(e,t,n,r,i){return tw.on(e,t,n,r,i),e},q.once=function(e,t,n,r,i){return tw.on(e,t,n,r,i,!0),e},q.off=function(e,t,n,r){return tw.off(e,t,n,r),e},q.trigger=function(e,t,n,r){return tv.trigger(t,n,e,r),e},(W=tw||(tw={})).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=ty.returnFalse;else if(!o)return;if(s){let e=o;o=function(n,...r){return W.off(t,n),e.call(this,n,...r)},ty.setHandlerId(o,ty.ensureHandlerId(e))}tv.on(t,n,o,i,r)},W.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}"object"==typeof n?Object.keys(n).forEach(i=>e(t,i,r,n[i])):((!1===r||"function"==typeof r)&&(i=r,r=void 0),!1===i&&(i=ty.returnFalse),tv.off(t,n,i,r))};class u0{constructor(e,t,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=td.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;(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 u1(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView;return{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}}function u2(e){return e.getBoundingClientRect().width}function u3(e){return e.getBoundingClientRect().height}function u6(e){let t,n="fixed"===a8(e,"position");if(n){let n=e.getBoundingClientRect();t={left:n.left,top:n.top}}else t=u1(e);if(!n){let n=e.ownerDocument,r=e.offsetParent||n.documentElement;for(;(r===n.body||r===n.documentElement)&&"static"===a8(r,"position");)r=r.parentNode;if(r!==e&&aR(r)){let e=u1(r);t.top-=e.top+a9(r,"borderTopWidth"),t.left-=e.left+a9(r,"borderLeftWidth")}}return{top:t.top-a9(e,"marginTop"),left:t.left-a9(e,"marginLeft")}}function u5(e,t=60){let n=null;return(...r)=>{n&&clearTimeout(n),n=window.setTimeout(()=>{e.apply(this,r)},t)}}let u4="u">typeof ResizeObserver?function(e){let t=null,n=[],r=u5(()=>{n.forEach(t=>{t(e)})}),i=()=>{t&&(t.disconnect(),n=[],t=null)};return{element:e,bind:i=>{let o;t||((o=new ResizeObserver(r)).observe(e),r(),t=o),-1===n.indexOf(i)&&n.push(i)},destroy:i,unbind:e=>{let r=n.indexOf(e);-1!==r&&n.splice(r,1),0===n.length&&t&&i()}}}:function(e){let t=null,n=[],r=u5(()=>{n.forEach(t=>t(e))}),i=()=>{t&&t.parentNode&&(t.contentDocument&&t.contentDocument.defaultView.removeEventListener("resize",r),t.parentNode.removeChild(t),t=null,n=[])};return{element:e,bind:i=>{let o;t||("static"===getComputedStyle(e).position&&(e.style.position="relative"),(o=document.createElement("object")).onload=()=>{o.contentDocument.defaultView.addEventListener("resize",r),r()},o.style.display="block",o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.height="100%",o.style.width="100%",o.style.overflow="hidden",o.style.pointerEvents="none",o.style.zIndex="-1",o.style.opacity="0",o.setAttribute("tabindex","-1"),o.type="text/html",e.appendChild(o),o.data="about:blank",t=o),-1===n.indexOf(i)&&n.push(i)},destroy:i,unbind:e=>{let r=n.indexOf(e);-1!==r&&n.splice(r,1),0===n.length&&t&&i()}}};var u8=tC||(tC={});let u9=new WeakMap;function u7(e){let t=u9.get(e);return t||(t=u4(e),u9.set(e,t)),t}u8.bind=(e,t)=>{let n=u7(e);return n.bind(t),()=>n.unbind(t)},u8.clear=e=>{var t;(t=u7(e)).destroy(),u9.delete(t.element)};class ce{constructor(e={}){this.comparator=e.comparator||ce.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,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}}}(ce||(ce={})).defaultComparator=(e,t)=>e-t,(tE||(tE={})).run=function(e,t,n=(e,t)=>1){let r={},i={},o={},s=new ce;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 ct{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 ct.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=ct.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(lV(i,0,255)),this.g=Math.round(lV(o,0,255)),this.b=Math.round(lV(s,0,255)),this.a=null==l?1:lV(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 ct.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 ct.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*/);return new e(o((parseFloat(t[0])%360+360)%360/360,parseFloat(t[1])/100,parseFloat(t[2])/100,null==t[3]?1:parseInt(t[3],10)))}return null}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)))}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))}`}function u(e,t){if("string"==typeof e){let n="#"===e[0],r=parseInt(n?e.substr(1):e,16),i=lV((r>>16)+t,0,255),o=lV((r>>8&255)+t,0,255),s=lV((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.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])},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+6*(o<s);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()},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)},e.darken=function(e,t){return u(e,-t)}}(ct||(ct={})),(ct||(ct={})).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 cn{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()}}var cr=tS||(tS={});function ci(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}}cr.parse=ci,cr.equals=function(e,t){if(null!=e&&null!=t){let n=ci(e),r=ci(t),i=n.or.sort(),o=r.or.sort(),s=n.and.sort(),l=r.and.sort(),a=(e,t)=>e.length===t.length&&(0===e.length||e.every((e,n)=>e===t[n]));return a(i,o)&&a(s,l)}return null==e&&null==t},cr.isMatch=function(e,t,n){if(null==t||Array.isArray(t)&&0===t.length)return!n||!0!==e.altKey&&!0!==e.ctrlKey&&!0!==e.metaKey&&!0!==e.shiftKey;let{or:r,and:i}=ci(t),o=t=>!0===e[`${t.toLowerCase()}Key`];return r.some(e=>o(e))&&i.every(e=>o(e))},(J=tP||(tP={})).linear=e=>e,J.quad=e=>e*e,J.cubic=e=>e*e*e,J.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)},J.exponential=e=>Math.pow(2,10*(e-1)),J.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}},(tP||(tP={})).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)};var co=tP||(tP={});function cs(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 cl(e){return 1-cs(1-e)}co.easeInSine=function(e){return -1*Math.cos(Math.PI/2*e)+1},co.easeOutSine=function(e){return Math.sin(Math.PI/2*e)},co.easeInOutSine=function(e){return -.5*(Math.cos(Math.PI*e)-1)},co.easeInQuad=function(e){return e*e},co.easeOutQuad=function(e){return e*(2-e)},co.easeInOutQuad=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},co.easeInCubic=function(e){return e*e*e},co.easeOutCubic=function(e){let t=e-1;return t*t*t+1},co.easeInOutCubic=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},co.easeInQuart=function(e){return e*e*e*e},co.easeOutQuart=function(e){let t=e-1;return 1-t*t*t*t},co.easeInOutQuart=function(e){let t=e-1;return e<.5?8*e*e*e*e:1-8*t*t*t*t},co.easeInQuint=function(e){return e*e*e*e*e},co.easeOutQuint=function(e){let t=e-1;return 1+t*t*t*t*t},co.easeInOutQuint=function(e){let t=e-1;return e<.5?16*e*e*e*e*e:1+16*t*t*t*t*t},co.easeInExpo=function(e){return 0===e?0:Math.pow(2,10*(e-1))},co.easeOutExpo=function(e){return 1===e?1:-Math.pow(2,-10*e)+1},co.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)},co.easeInCirc=function(e){return -1*(Math.sqrt(1-e/1*e)-1)},co.easeOutCirc=function(e){let t=e-1;return Math.sqrt(1-t*t)},co.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)},co.easeInBack=function(e,t=1.70158){return e*e*((t+1)*e-t)},co.easeOutBack=function(e,t=1.70158){let n=e/1-1;return n*n*((t+1)*n+t)+1},co.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)},co.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))},co.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},co.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},co.easeOutBounce=cs,co.easeInBounce=cl,co.easeInOutBounce=function(e){return e<.5?.5*cl(2*e):.5*cs(2*e-1)+.5},(X=tk||(tk={})).number=(e,t)=>{let n=t-e;return t=>e+n*t},X.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}},X.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},X.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 ca=[];function cu(e,t){let n=ca.find(t=>t.name===e);if((!n||(n.loadTimes+=1,!(n.loadTimes>1)))&&!td.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),ca.push({name:e,loadTimes:1,styleElement:n})}}function cc(e){let t=ca.findIndex(t=>t.name===e);if(t>-1){let e=ca[t];if(e.loadTimes-=1,e.loadTimes>0)return;let n=e.styleElement;n&&n.parentNode&&n.parentNode.removeChild(n),n=null,ca.splice(t,1)}}(Y=tM||(tM={})).toDeg=function(e){return 180*e/Math.PI%360},Y.toRad=function(e,t=!1){return(t?e:e%360)*Math.PI/180},Y.normalize=function(e){return e%360+360*(e<0)},(Q=tO||(tO={})).round=function(e,t=0){return Number.isInteger(e)?e:+e.toFixed(t)},Q.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)},Q.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},Q.snapToGrid=function(e,t){return t*Math.round(e/t)},Q.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},Q.squaredLength=function(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r};class ch{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class cd extends ch{constructor(e,t){super(),this.x=null==e?0:e,this.y=null==t?0:t}round(e=0){return this.x=tO.round(this.x,e),this.y=tO.round(this.y,e),this}add(e,t){let n=cd.create(e,t);return this.x+=n.x,this.y+=n.y,this}update(e,t){let n=cd.create(e,t);return this.x=n.x,this.y=n.y,this}translate(e,t){let n=cd.create(e,t);return this.x+=n.x,this.y+=n.y,this}rotate(e,t){let n=cd.rotate(this,e,t);return this.x=n.x,this.y=n.y,this}scale(e,t,n=new cd){let r=cd.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 cd.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?cd.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){let t=cd.create(e),n=this.x-t.x,r=this.y-t.y;return n*n+r*r}manhattanDistance(e){let t=cd.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 cd){let t=cd.create(e),n=Math.atan2(-(t.y-this.y),t.x-this.x);return n<0&&(n=2*Math.PI+n),180*n/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 cd(0,0).angleBetween(this,e)}toPolar(e){return this.update(cd.toPolar(this,e)),this}changeInAngle(e,t,n=new cd){return this.clone().translate(-e,-t).theta(n)-this.theta(n)}adhereToRect(e){return tO.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=cd.create(e),n=tM.toRad(this.y),r=tM.toRad(t.y),i=this.x,o=t.x,s=tM.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=tM.toDeg(Math.atan2(l,a))-22.5;return u<0&&(u+=360),["NE","E","SE","S","SW","W","NW","N"][u=parseInt(u/45,10)]}cross(e,t){if(null!=e&&null!=t){let n=cd.create(e),r=cd.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=cd.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if("number"==typeof e)return new cd(this.x-e,this.y-t);let n=cd.create(e);return new cd(this.x-n.x,this.y-n.y)}lerp(e,t){let n=cd.create(e);return new cd((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=cd.create(e),r=tM.toRad(n.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return cd.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=tO.snapToGrid(this.x,e),this.y=tO.snapToGrid(this.y,null==t?e:t),this}equals(e){let t=cd.create(e);return null!=t&&t.x===this.x&&t.y===this.y}clone(){return cd.clone(this)}toJSON(){return cd.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(Z=cd||(cd={})).isPoint=function(e){return null!=e&&e instanceof Z},(K=cd||(cd={})).isPointLike=function(e){return null!=e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y},K.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)}function n(e,t){return e===t||null!=e&&null!=t&&e.x===t.x&&e.y===t.y}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.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=tM.normalize(tM.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)},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),tM.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(tO.random(t,n),tO.random(r,i))},e.rotate=function(e,t,n){let i=tM.toRad(tM.normalize(-t)),o=Math.sin(i);return r(e,Math.cos(i),o,n)},e.rotateEx=r}(cd||(cd={}));class cf extends ch{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 cd(this.x,this.y)}get topLeft(){return new cd(this.x,this.y)}get topCenter(){return new cd(this.x+this.width/2,this.y)}get topRight(){return new cd(this.x+this.width,this.y)}get center(){return new cd(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new cd(this.x,this.y+this.height)}get bottomCenter(){return new cd(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new cd(this.x+this.width,this.y+this.height)}get corner(){return new cd(this.x+this.width,this.y+this.height)}get rightMiddle(){return new cd(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new cd(this.x,this.y+this.height/2)}get topLine(){return new cm(this.topLeft,this.topRight)}get rightLine(){return new cm(this.topRight,this.bottomRight)}get bottomLine(){return new cm(this.bottomLeft,this.bottomRight)}get leftLine(){return new cm(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=tM.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 cf(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(e=0){return this.x=tO.round(this.x,e),this.y=tO.round(this.y,e),this.width=tO.round(this.width,e),this.height=tO.round(this.height,e),this}add(e,t,n,r){let i=cf.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=cf.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=cd.create(e,t);return this.x+=n.x,this.y+=n.y,this}scale(e,t,n=new cd){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=tM.toRad(e),r=Math.cos(n),i=Math.sin(n),o=this.getOrigin(),s=this.getTopRight(),l=this.getBottomRight(),a=this.getBottomLeft();o=cd.rotateEx(o,r,i,t),s=cd.rotateEx(s,r,i,t),l=cd.rotateEx(l,r,i,t),a=cd.rotateEx(a,r,i,t);let u=new cf(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=cf.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=cf.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 g=n.bottomRight;g.x>r&&(s=(this.x+this.width-r)/(g.x-r)),g.y>i&&(c=(this.y+this.height-i)/(g.y-i));let p=n.topRight;p.x>r&&(l=(this.x+this.width-r)/(p.x-r)),p.y<i&&(h=(this.y-i)/(p.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 tO.containsPoint(this,cd.create(e,t))}containsRect(e,t,n,r){let i=cf.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=cd.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 cm(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=cf.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 cf(u,c,Math.min(s.x,a.x)-u,Math.min(s.y,a.y)-c)}isIntersectWithRect(e,t,n,r){let i=cf.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)}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=cf.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 cf(s,l,a-s,u-l)}getNearestSideToPoint(e){let t=cd.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=cd.clone(e);if(this.containsPoint(t)){let e=this.getNearestSideToPoint(t);if("left"===e)return new cd(this.x,t.y);if("top"===e)return new cd(t.x,this.y);if("right"===e)return new cd(this.x+this.width,t.y);if("bottom"===e)return new cd(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 cf(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}`}}(ee=cf||(cf={})).isRectangle=function(e){return null!=e&&e instanceof ee},(cf||(cf={})).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};var cg=cf||(cf={});function cp(e){return cg.isRectangle(e)?e.clone():Array.isArray(e)?new cg(e[0],e[1],e[2],e[3]):new cg(e.x,e.y,e.width,e.height)}cg.create=function(e,t,n,r){return null==e||"number"==typeof e?new cg(e,t,n,r):cp(e)},cg.clone=cp,cg.fromEllipse=function(e){return new cg(e.x-e.a,e.y-e.b,2*e.a,2*e.b)},cg.fromSize=function(e){return new cg(0,0,e.width,e.height)},cg.fromPositionAndSize=function(e,t){return new cg(e.x,e.y,t.width,t.height)};class cm extends ch{get center(){return new cd((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 cd(e,t),this.end=new cd(n,r)):(this.start=cd.create(e),this.end=cd.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 cd(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){let e=new cd(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 cf(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 cm(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 cm(this.start,t),new cm(t,this.end)]}divideAtLength(e){let t=this.pointAtLength(e);return[new cm(this.start,t),new cm(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 cm(t,e).length()>r||new cm(e,n).length()>r)}intersect(e,t){let n=e.intersectsWithLine(this,t);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(e){let t=new cd(this.end.x-this.start.x,this.end.y-this.start.y),n=new cd(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*n.y-t.y*n.x,i=new cd(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 cd(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=cd.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=cd.create(e,t);return this.closestPoint(n).squaredDistance(n)}pointDistance(e,t){let n=cd.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 cm(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 cm(t,n);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){let n=cd.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)}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 cm(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(et=cm||(cm={})).isLine=function(e){return null!=e&&e instanceof et};class cy extends ch{get center(){return new cd(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 cf.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=cd.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 cd(this.x,this.y)),a=new cd(s.x/(n*n),s.y/(r*r)),u=new cd(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,r=cd.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=Math.sqrt(1/(1/(this.a*this.a)+s*s/(this.b*this.b))),a=s*(l=i<0?-l:l);return(n=new cd(this.x+l,this.y+a),t)?n.rotate(-t,this.getCenter()):n}tangentTheta(e){let t,n,r=cd.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 cd(t,n).theta(r)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){let n=cf.fromEllipse(this);n.rotate(e,t);let r=cy.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=cd.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 cy(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}`}}(en=cy||(cy={})).isEllipse=function(e){return null!=e&&e instanceof en};var cb=cy||(cy={});function cv(e){return cb.isEllipse(e)?e.clone():Array.isArray(e)?new cb(e[0],e[1],e[2],e[3]):new cb(e.x,e.y,e.a,e.b)}cb.create=function(e,t,n,r){return null==e||"number"==typeof e?new cb(e,t,n,r):cv(e)},cb.parse=cv,cb.fromRect=function(e){let t=e.center;return new cb(t.x,t.y,e.width/2,e.height/2)};let cx=RegExp("^[\\s\\dLMCZz,.]*$");function cw(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 cd(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 g=e[((c+1)%(d=e.length)+d)%d];for(;c<e.length-2&&0===Math.round(g.x-t.x)&&0===Math.round(g.y-t.y);)g=e[((c+2)%(f=e.length)+f)%f],c+=1;i=Math.max(1,Math.sqrt((n=g.x-t.x)*n+(r=g.y-t.y)*r));let p=n*Math.min(a,i/2)/i,m=r*Math.min(a,i/2)/i,y=t.x+p,b=t.y+m;o.push("Q",t.x,t.y,y,b),t=new cd(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 cC(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),g=d*c+f*h,p=-1*f*c+d*h,m=g*g,y=p*p,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*p/r,C=-1*u*r*g/n,E=d*w-f*C+l/2,S=f*w+d*C+a/2,P=Math.atan2((p-C)/r,(g-w)/n)-Math.atan2(0,1),k=P>=0?P:2*Math.PI+P,M=(P=Math.atan2((-p-C)/r,(-g-w)/n)-Math.atan2((p-C)/r,(g-w)/n))>=0?P:2*Math.PI+P;0===s&&M>0?M-=2*Math.PI:0!==s&&M<0&&(M+=2*Math.PI);let O=2*M/Math.PI,A=Math.ceil(O<0?-1*O:O),T=M/A,N=8/3*Math.sin(T/4)*Math.sin(T/4)/Math.sin(T/2),j=d*n,L=d*r,R=f*n,_=f*r,z=Math.cos(k),I=Math.sin(k),D=-N*(j*I+_*z),B=-N*(R*I-L*z),V=0,F=0,$=[];for(let n=0;n<A;n+=1){k+=T,V=j*(z=Math.cos(k))-_*(I=Math.sin(k))+E,F=R*z+L*I+S;let r=-N*(j*I+_*z),i=-N*(R*I-L*z),o=6*n;$[o]=Number(D+e),$[o+1]=Number(B+t),$[o+2]=Number(V-r+e),$[o+3]=Number(F-i+t),$[o+4]=Number(V+e),$[o+5]=Number(F+t),D=V+r,B=F+i}return $.map(e=>+e.toFixed(2))}class cE extends ch{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 cE.parse(e);this.points=e.map(e=>cd.create(e))}else this.points=[]}scale(e,t,n=new cd){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=cd.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 cf;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 cf(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 cm(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=cd.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 cm(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 cd(n+t,r),o=new cm(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 cm(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 cm(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 cm(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,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 cm(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;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 cm(s,a).closestPoint(l).distance(l)<=n?t.splice(i,1):r+=1}return this}toHull(){let e,t=this.points,n=t.length;if(0===n)return new cE;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)||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 cE(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 cE(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(er=cE||(cE={})).isPolyline=function(e){return null!=e&&e instanceof er},(ei=cE||(cE={})).parse=function(e){let t=e.trim();if(""===t)return new ei;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 ei(n)};class cS extends ch{constructor(e,t,n,r){super(),this.PRECISION=3,this.start=cd.create(e),this.controlPoint1=cd.create(t),this.controlPoint2=cd.create(n),this.end=cd.create(r)}bbox(){let e,t,n,r,i,o,s,l,a,u,c,h=this.start,d=this.controlPoint1,f=this.controlPoint2,g=this.end,p=h.x,m=h.y,y=d.x,b=d.y,v=f.x,x=f.y,w=g.x,C=g.y,E=[],S=[],P=[[],[]];for(let a=0;a<2;a+=1){if(0===a?(t=6*p-12*y+6*v,e=-3*p+9*y-9*v+3*w,n=3*y-3*p):(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 k=S.length,M=k;for(;k;)k-=1,a=(c=1-(r=S[k]))*c*c*p+3*c*c*r*y+3*c*r*r*v+r*r*r*w,P[0][k]=a,u=c*c*c*m+3*c*c*r*b+3*c*r*r*x+r*r*r*C,P[1][k]=u,E[k]={X:a,Y:u};S[M]=0,S[M+1]=1,E[M]={X:p,Y:m},E[M+1]={X:w,Y:C},P[0][M]=p,P[1][M]=m,P[0][M+1]=w,P[1][M+1]=C,S.length=M+2,P[0].length=M+2,P[1].length=M+2,E.length=M+2;let O=Math.min.apply(null,P[0]),A=Math.min.apply(null,P[1]),T=Math.max.apply(null,P[0]),N=Math.max.apply(null,P[1]);return new cf(O,A,T-O,N-A)}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,g=h||d;if(r||g)return a<=u?s:l;let p=o.divide(.5);f/=2;let m=p[0].start.distance(e),y=p[0].end.distance(e),b=m+y,v=p[1].start.distance(e),x=p[1].end.distance(e);b<=v+x?(o=p[0],l-=f,a=m,u=y):(o=p[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 cS(t,t,t,t),new cS(t,n,r,i)];if(e>=1)return[new cS(t,n,r,i),new cS(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 cS(t,s,l,a),new cS(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 cm(t,n).pointAt(e),s=new cm(n,r).pointAt(e),l=new cm(r,i).pointAt(e),a=new cm(o,s).pointAt(e),u=new cm(s,l).pointAt(e),c=new cm(a,u).pointAt(e);return{startControlPoint1:o,startControlPoint2:a,divider:c,dividerControlPoint1:u,dividerControlPoint2:l}}getSubdivisions(e={}){let t=this.getPrecision(e),n=[new cS(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 cm(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={}){return{precision:this.getPrecision(e),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],g=f.endpointDistance();if(e<=c+g){l=f,n=o*d,r=(o+1)*d,a=i?e-c:g+c-e,u=i?g+c-e:e-c;break}c+=g}if(null==l)return+!!i;let f=this.length({precision:o,subdivisions:s}),g=Math.pow(10,-o);for(;;){let e,t;if((0!==f?a/f:0)<g)return n;if((0!==f?u/f:0)<g)return r;let i=l.divide(.5);d/=2;let o=i[0].endpointDistance(),s=i[1].endpointDistance();a<=o?(l=i[0],r-=d,t=o-(e=a)):(l=i[1],n+=d,t=s-(e=a-o)),a=e,u=t}}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 cE(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 cS(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(" ")}}(eo=cS||(cS={})).isCurve=function(e){return null!=e&&e instanceof eo};var cP=cS||(cS={});function ck(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}cP.throughPoints=function(e){if(null==e||Array.isArray(e)&&e.length<2)throw Error("At least 2 points are required");let t=function(e){let t=e.map(e=>cd.clone(e)),n=[],r=[],i=t.length-1;if(1===i)return n[0]=new cd((2*t[0].x+t[1].x)/3,(2*t[0].y+t[1].y)/3),r[0]=new cd(2*n[0].x-t[0].x,2*n[0].y-t[0].y),[n,r];let o=[];for(let e=1;e<i-1;e+=1)o[e]=4*t[e].x+2*t[e+1].x;o[0]=t[0].x+2*t[1].x,o[i-1]=(8*t[i-1].x+t[i].x)/2;let s=ck(o);for(let e=1;e<i-1;e+=1)o[e]=4*t[e].y+2*t[e+1].y;o[0]=t[0].y+2*t[1].y,o[i-1]=(8*t[i-1].y+t[i].y)/2;let l=ck(o);for(let e=0;e<i;e+=1)n.push(new cd(s[e],l[e])),e<i-1?r.push(new cd(2*t[e+1].x-s[e+1],2*t[e+1].y-l[e+1])):r.push(new cd((t[i].x+s[i-1])/2,(t[i].y+l[i-1])/2));return[n,r]}(e),n=[];for(let r=0,i=t[0].length;r<i;r+=1){let i=new cd(t[0][r].x,t[0][r].y),o=new cd(t[1][r].x,t[1][r].y);n.push(new cP(e[r],i,o,e[r+1]))}return n};class cM extends ch{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 cO extends cM{constructor(e,t){super(),cm.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=cd.create(e,t).round(2)}get type(){return"L"}get line(){return new cm(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 cO(t[0]),new cO(t[1])]}divideAtLength(e){let t=this.line.divideAtLength(e);return[new cO(t[0]),new cO(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 cO(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}`}}(es=cO||(cO={})).create=function(...e){let t=e.length,n=e[0];if(cm.isLine(n))return new es(n);if(cd.isPointLike(n))return 1===t?new es(n):e.map(e=>new es(e));if(2===t)return new es(+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 es(t,i))}return r};class cA extends cM{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 cm(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 cO(t[0]):this.clone(),new cO(t[1])]}divideAtLength(e){let t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new cO(t[0]):this.clone(),new cO(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 cA}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(el=cA||(cA={})).create=function(){return new el};class cT extends cM{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,cm.isLine(e)||cS.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=cd.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 cT(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}`}}(ea=cT||(cT={})).create=function(...e){let t=e.length,n=e[0];if(cm.isLine(n)||cS.isCurve(n))return new ea(n);if(cd.isPointLike(n)){if(1===t)return new ea(n);let r=[];for(let n=0;n<t;n+=1)0===n?r.push(new ea(e[n])):r.push(new cO(e[n]));return r}if(2===t)return new ea(+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 ea(t,i)):r.push(new cO(t,i))}return r};class cN extends cM{constructor(e,t,n,r,i,o){super(),cS.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 cd(e,t).round(2),this.controlPoint2=new cd(n,r).round(2),this.endPoint=new cd(i,o).round(2)):(this.controlPoint1=cd.create(e).round(2),this.controlPoint2=cd.create(t).round(2),this.endPoint=cd.create(n).round(2))}get type(){return"C"}get curve(){return new cS(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 cN(n[0]),new cN(n[1])]}divideAtLength(e,t={}){let n=this.curve.divideAtLength(e,t);return[new cN(n[0]),new cN(n[1])]}divideAtT(e){let t=this.curve.divideAtT(e);return[new cN(t[0]),new cN(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 cN(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 cj(e,t,n){return{x:e*Math.cos(n)-t*Math.sin(n),y:e*Math.sin(n)+t*Math.cos(n)}}function cL(e,t,n,r,i,o){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]}(eu=cN||(cN={})).create=function(...e){let t=e.length,n=e[0];if(cS.isCurve(n))return new eu(n);if(cd.isPointLike(n)){if(3===t)return new eu(e[0],e[1],e[2]);let n=[];for(let r=0;r<t;r+=3)n.push(new eu(e[r],e[r+1],e[r+2]));return n}if(6===t)return new eu(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 eu(e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]));return r};class cR extends ch{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(cm.isLine(e[0])||cS.isCurve(e[0])){let t=null;e.forEach((e,n)=>{0===n&&this.appendSegment(cR.createSegment("M",e.start)),null==t||t.end.equals(e.start)||this.appendSegment(cR.createSegment("M",e.start)),cm.isLine(e)?this.appendSegment(cR.createSegment("L",e.end)):cS.isCurve(e)&&this.appendSegment(cR.createSegment("C",e.controlPoint1,e.controlPoint2,e.end)),t=e})}else e.forEach(e=>{e.isSegment&&this.appendSegment(e)});else null!=e&&(cm.isLine(e)?(this.appendSegment(cR.createSegment("M",e.start)),this.appendSegment(cR.createSegment("L",e.end))):cS.isCurve(e)?(this.appendSegment(cR.createSegment("M",e.start)),this.appendSegment(cR.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):cE.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((e,t)=>{let n=0===t?cR.createSegment("M",e):cR.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(cT.create.call(null,...e))}lineTo(...e){return this.appendSegment(cO.create.call(null,...e))}curveTo(...e){return this.appendSegment(cN.create.call(null,...e))}arcTo(e,t,n,r,i,o,s){let l=this.end||new cd,a="number"==typeof o?cC(l.x,l.y,e,t,n,r,i,o,s):cC(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 cd,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=cR.parse(o.join(" "));return this.appendSegment(s.segments.slice(1)),this}close(){return this.appendSegment(cA.create())}drawPoints(e,t={}){let n=cw(e,t),r=cR.parse(n);r&&r.segments&&this.appendSegment(r.segments)}bbox(){let e,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 cf(r.end.x,r.end.y,0,0)}appendSegment(e){let t,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,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,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=tO.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=tO.squaredLength(a,e);u<o&&(n={segmentIndex:t,value:i},o=u)}}return 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=tO.squaredLength(i,e);a<o&&(n=s.tangentAtT(t),o=a)}}return 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=tO.clamp(e.value,0,1);return t[r].pointAtT(i)}divideAt(e,t={}){if(0===this.segments.length)return null;let n=tO.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]},g=d.length(f);if(d.isDifferentiable()&&(i=d,o=h,e<=c+g)){r=h,n=d.divideAtLength((l?1:-1)*(e-c),f);break}c+=g}if(!i)return null;n||(r=o,s=+!!l,n=i.divideAtT(s));let h=this.clone(),d=r;h.replaceSegment(d,n);let f=d+1,g=d+2;n[0].isDifferentiable()||(h.removeSegment(d),f-=1,g-=1);let p=h.getSegment(f).start;h.insertSegment(f,cR.createSegment("M",p)),g+=1,n[1].isDifferentiable()||(h.removeSegment(g-1),g-=1);let m=g-d-1;for(let e=g,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=cR.createSegment("L",t.end);h.replaceSegment(e,n)}}return[new cR(h.segments.slice(0,f)),new cR(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=tO.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=tO.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;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=tO.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={}){return{precision:this.getPrecision(e),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 cE(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 cR;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()}}(ec=cR||(cR={})).isPath=function(e){return null!=e&&e instanceof ec};var c_=cR||(cR={});function cz(e,...t){if("M"===e)return cT.create.call(null,...t);if("L"===e)return cO.create.call(null,...t);if("C"===e)return cN.create.call(null,...t);if("z"===e||"Z"===e)return cA.create();throw Error(`Invalid path segment type "${e}"`)}c_.parse=function(e){if(!e)return new c_;let t=new c_,n=c_.normalize(e).match(/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g);if(null!=n)for(let e=0,r=n.length;e<r;e+=1){let r=n[e],i=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,o=r.match(i);if(null!=o){let e=o[0],n=cz.call(null,e,...o.slice(1).map(e=>+e));t.appendSegment(n)}}return t},c_.createSegment=cz,(eh=cR||(cR={})).normalize=function(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,g,p,m=120*Math.PI/180,y=Math.PI/180*(+o||0),b=[];if(c)d=c[0],f=c[1],g=c[2],p=c[3];else{t=(h=cj(t,n,-y)).x,n=h.y,a=(h=cj(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)));g=v*r*o/i+(t+a)/2,p=-(v*i)*e/r+(n+u)/2,d=Math.asin((n-p)/i),f=Math.asin((u-p)/i),d=t<g?Math.PI-d:d,f=a<g?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;b=e(a=g+r*Math.cos(f=d+m*(l&&f>d?1:-1)),u=p+i*Math.sin(f),r,i,o,0,l,n,s,[f,t,g,p])}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],k=[t+E*Math.sin(d),n-S*x],M=[a+E*Math.sin(f),u-S*w],O=[a,u];if(k[0]=2*P[0]-k[0],k[1]=2*P[1]-k[1],c)return[k,M,O].concat(b);{b=[k,M,O].concat(b).join().split(",");let e=[],t=b.length;for(let n=0;n<t;n+=1)e[n]=n%2?cj(+b[n-1],+b[n],y).y:cj(+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(cL(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(cL(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:tO.round(e,2))).join(",").split(",").join(" ")},eh.isValid=function(e){return"string"==typeof e&&cx.test(e)},eh.drawArc=function(e,t,n,r,i=0,o=0,s=0,l,a){let u=[],c=cC(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(" ")},eh.drawPoints=cw,eh.arcToCurves=cC;class cI{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)return void Object.entries(e).forEach(([e,n])=>{this.register(e,n,t)});!this.exist(e)||n||td.isApplyingHMR()||this.onDuplicated(e);let r=this.options.process,i=r?nV(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&&nV(this.options.onConflict,this,e),Error(`${lO(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} ${lL(this.options.type)}`:this.options.type;return`${lO(r)} with name '${e}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(e){return function(e,t,n){let r,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)}}(ed=cI||(cI={})).create=function(e){return new ed(e)};let cD={color:"#aaaaaa",thickness:1,markup:"rect",update(e,t){let n=t.thickness*t.sx,r=t.thickness*t.sy;a$(e,{width:n,height:r,rx:n,ry:r,fill:t.color})}},cB={color:"#aaaaaa",thickness:1,markup:"rect",update(e,t){let n=t.sx<=1?t.thickness*t.sx:t.thickness;a$(e,{width:n,height:n,rx:n,ry:n,fill:t.color})}},cV={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(e,t){let n=t.width,r=t.height,i=t.thickness;a$(e,{d:n-i>=0&&r-i>=0?["M",n,"0 H0 M0 0 V0",r].join(" "):"M 0 0 0 0",stroke:t.color,"stroke-width":t.thickness})}},cF=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(e,t){let n=t.width,r=t.height,i=t.thickness;a$(e,{d:n-i>=0&&r-i>=0?["M",n,"0 H0 M0 0 V0",r].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,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,a$(e,{d:n,stroke:t.color,"stroke-width":t.thickness})}}];class c${constructor(){this.patterns={},this.root=uo.create(av(),{width:"100%",height:"100%"},[ab("defs")]).node}add(e,t){let n=this.root.childNodes[0];n&&n.appendChild(t),this.patterns[e]=t,uo.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]}}(ef=c$||(c$={})).presets=t6,ef.registry=cI.create({type:"grid"}),ef.registry.register(ef.presets,!0);let cU=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},cG=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},cH=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},cq=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=tM.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 cW(e,t){return null!=e?e:t}function cJ(e,t){return null!=e&&Number.isFinite(e)?e:t}function cX(e={}){let t=cW(e.color,"blue"),n=cJ(e.width,1),r=cJ(e.margin,2),i=cJ(e.opacity,1);return`
190
+ <filter>
191
+ <feFlood flood-color="${t}" flood-opacity="${i}" result="colored"/>
192
+ <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${r+n}" />
193
+ <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${r}" />
194
+ <feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>
195
+ <feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>
196
+ <feMerge>
197
+ <feMergeNode in="outline"/>
198
+ <feMergeNode in="SourceGraphic"/>
199
+ </feMerge>
200
+ </filter>
201
+ `.trim()}function cY(e={}){let t=cW(e.color,"red"),n=cJ(e.blur,0),r=cJ(e.width,1),i=cJ(e.opacity,1);return`
202
+ <filter>
203
+ <feFlood flood-color="${t}" flood-opacity="${i}" result="colored"/>
204
+ <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${r}"/>
205
+ <feComposite result="composed" in="colored" in2="morphed" operator="in"/>
206
+ <feGaussianBlur result="blured" in="composed" stdDeviation="${n}"/>
207
+ <feBlend in="SourceGraphic" in2="blured" mode="normal"/>
208
+ </filter>
209
+ `.trim()}function cQ(e={}){let t=cJ(e.x,2),n=null!=e.y&&Number.isFinite(e.y)?[t,e.y]:t;return`
210
+ <filter>
211
+ <feGaussianBlur stdDeviation="${n}"/>
212
+ </filter>
213
+ `.trim()}function cZ(e={}){let t=cJ(e.dx,0),n=cJ(e.dy,0),r=cW(e.color,"black"),i=cJ(e.blur,4),o=cJ(e.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
214
+ <feDropShadow stdDeviation="${i}" dx="${t}" dy="${n}" flood-color="${r}" flood-opacity="${o}" />
215
+ </filter>`.trim():`<filter>
216
+ <feGaussianBlur in="SourceAlpha" stdDeviation="${i}" />
217
+ <feOffset dx="${t}" dy="${n}" result="offsetblur" />
218
+ <feFlood flood-color="${r}" />
219
+ <feComposite in2="offsetblur" operator="in" />
220
+ <feComponentTransfer>
221
+ <feFuncA type="linear" slope="${o}" />
222
+ </feComponentTransfer>
223
+ <feMerge>
224
+ <feMergeNode/>
225
+ <feMergeNode in="SourceGraphic"/>
226
+ </feMerge>
227
+ </filter>`.trim()}function cK(e={}){let t=cJ(e.amount,1),n=.7152-.7152*(1-t);return`
228
+ <filter>
229
+ <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"/>
230
+ </filter>
231
+ `.trim()}function c0(e={}){let t=cJ(e.amount,1);return`
232
+ <filter>
233
+ <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"/>
234
+ </filter>
235
+ `.trim()}function c1(e={}){let t=cJ(e.amount,1);return`
236
+ <filter>
237
+ <feColorMatrix type="saturate" values="${1-t}"/>
238
+ </filter>
239
+ `.trim()}function c2(e={}){let t=cJ(e.angle,0);return`
240
+ <filter>
241
+ <feColorMatrix type="hueRotate" values="${t}"/>
242
+ </filter>
243
+ `.trim()}function c3(e={}){let t=cJ(e.amount,1),n=1-t;return`
244
+ <filter>
245
+ <feComponentTransfer>
246
+ <feFuncR type="table" tableValues="${t} ${n}"/>
247
+ <feFuncG type="table" tableValues="${t} ${n}"/>
248
+ <feFuncB type="table" tableValues="${t} ${n}"/>
249
+ </feComponentTransfer>
250
+ </filter>
251
+ `.trim()}function c6(e={}){let t=cJ(e.amount,1);return`
252
+ <filter>
253
+ <feComponentTransfer>
254
+ <feFuncR type="linear" slope="${t}"/>
255
+ <feFuncG type="linear" slope="${t}"/>
256
+ <feFuncB type="linear" slope="${t}"/>
257
+ </feComponentTransfer>
258
+ </filter>
259
+ `.trim()}function c5(e={}){let t=cJ(e.amount,1),n=.5-t/2;return`
260
+ <filter>
261
+ <feComponentTransfer>
262
+ <feFuncR type="linear" slope="${t}" intercept="${n}"/>
263
+ <feFuncG type="linear" slope="${t}" intercept="${n}"/>
264
+ <feFuncB type="linear" slope="${t}" intercept="${n}"/>
265
+ </feComponentTransfer>
266
+ </filter>
267
+ `.trim()}(eg=tA||(tA={})).presets=Object.assign({},t5),eg.presets["flip-x"]=cU,eg.presets["flip-y"]=cG,eg.presets["flip-xy"]=cH,eg.registry=cI.create({type:"background pattern"}),eg.registry.register(eg.presets,!0),(ep=tT||(tT={})).presets=t4,ep.registry=cI.create({type:"filter"}),ep.registry.register(ep.presets,!0);let c4={},c8={position:hx("x","width","origin")},c9={position:hx("y","height","origin")},c7={position:hx("x","width","corner")},he={position:hx("y","height","corner")},ht={set:hw("width","width")},hn={set:hw("height","height")},hr={set:hw("rx","width")},hi={set:hw("ry","height")},ho={set:(p=hw("r","width"),m=hw("r","height"),function(e,t){let n=t.refBBox;return nV(n.height>n.width?p:m,this,e,t)})},hs={set(e,{refBBox:t}){let n,r=parseFloat(e),i=lU(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}}},hl={set:hw("cx","width")},ha={set:hw("cy","height")},hu={set:hE({resetOffset:!0})},hc={set:hE({resetOffset:!1})},hh={set:hS({resetOffset:!0})},hd={set:hS({resetOffset:!1})},hf=ho,hg=hu,hp=hh,hm=c8,hy=c9,hb=ht,hv=hn;function hx(e,t,n){return(r,{refBBox:i})=>{let o;if(null==r)return null;let s=parseFloat(r),l=lU(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 cd;return a[e]=o||0,a}}function hw(e,t){return function(n,{refBBox:r}){let i=parseFloat(n),o=lU(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 hC(e,t){let n="x6-shape",r=t&&t.resetOffset;return function(t,{elem:i,refBBox:o}){let s=ur(i,n);if(!s||s.value!==t){let r=e(t);ur(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 hE(e){let t=hC(function(e){return cR.parse(e)},e);return(e,n)=>({d:t(e,n).serialize()})}function hS(e){let t=hC(e=>new cE(e),e);return(e,n)=>({points:t(e,n).serialize()})}let hP={qualify:iE,set:(e,{view:t})=>`url(#${t.graph.defineGradient(e)})`},hk={qualify:iE,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)})`}},hM={qualify:(e,{attrs:t})=>null==t.textWrap||!iE(t.textWrap),set(e,{view:t,elem:n,attrs:r}){let i="x6-text",o=ur(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&&(ad(n),l.textPath=Object.assign({"xlink:href":`#${n.id}`},r))}}uu(n,`${e}`,l),ur(n,i,u)}}},hO={qualify:iE,set(e,{view:t,elem:n,attrs:r,refBBox:i}){let o,s=e.width||0;lU(s)?i.width*=parseFloat(s)/100:s<=0?i.width+=s:i.width=s;let l=e.height||0;lU(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?ud(`${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}):"",nV(hM.set,this,o,{view:t,elem:n,attrs:r,refBBox:i,cell:t.cell})}},hA=(e,{attrs:t})=>void 0!==t.text,hT={qualify:hA},hN={qualify:hA},hj={qualify:hA},hL={qualify:hA},hR={qualify:hA},h_={qualify:hA},hz={qualify:(e,{elem:t})=>t instanceof SVGElement,set(e,{elem:t}){let n="x6-title",r=`${e}`,i=ur(t,n);if(null==i||i!==r){ur(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)}}}},hI={offset:hV("x","width","right")},hD={offset:hV("y","height","bottom")},hB={offset:(e,{refBBox:t})=>e?{x:-t.x,y:-t.y}:{x:0,y:0}};function hV(e,t,n){return(r,{refBBox:i})=>{let o,s=new cd;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:lU(r)?i[t]*parseFloat(r)/100:0,s[e]=-(i[e]+o),s}}let hF={qualify:iE,set(e,{elem:t}){a7(t,e)}},h$={set(e,{elem:t}){t.innerHTML=`${e}`}},hU={qualify:iE,set:(e,{view:t})=>`url(#${t.graph.defineFilter(e)})`},hG={set:e=>null!=e&&"object"==typeof e&&e.id?e.id:e};function hH(e,t,n){let r,i;"object"==typeof t?(r=t.x,i=t.y):(r=t,i=n);let o=cR.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 hq=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 hW=e=>{var{size:t,width:n,height:r,offset:i,open:o}=e;return hX({size:t,width:n,height:r,offset:i},!0===o,!0,void 0,hq(e,["size","width","height","offset","open"]))},hJ=e=>{var{size:t,width:n,height:r,offset:i,factor:o}=e;return hX({size:t,width:n,height:r,offset:i},!1,!1,o,hq(e,["size","width","height","offset","factor"]))};function hX(e,t,n,r=3/4,i={}){let o=e.size||10,s=e.width||o,l=e.height||o,a=new cR,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=lV(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:hH(a.serialize(),{x:null!=e.offset?e.offset:-s/2})})}var hY=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 hQ=e=>{var{size:t,width:n,height:r,offset:i}=e,o=hY(e,["size","width","height","offset"]);let s=t||10,l=n||s,a=r||s,u=new cR;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:hH(u.serialize(),null==i?-l/2:i)})};var hZ=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 hK=e=>{var{d:t,offsetX:n,offsetY:r}=e;return Object.assign(Object.assign({},hZ(e,["d","offsetX","offsetY"])),{tagName:"path",d:hH(t,n,r)})};var h0=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 h1=e=>{var{size:t,width:n,height:r,offset:i}=e,o=h0(e,["size","width","height","offset"]);let s=t||10,l=n||s,a=r||s,u=new cR;return u.moveTo(0,0).lineTo(l,a).moveTo(0,a).lineTo(l,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:hH(u.serialize(),i||-l/2)})};var h2=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 h3=e=>{var{width:t,height:n,offset:r,open:i,flip:o}=e,s=h2(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 cR;return c.moveTo(0,l).lineTo(a,0),!0===i?u.fill="none":(c.lineTo(a,l),c.close()),u.d=hH(c.serialize(),{x:r||-a/2,y:l/2}),u};var h6=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 h5=e=>{var{r:t}=e,n=h6(e,["r"]);let r=t||5;return Object.assign(Object.assign({cx:r},n),{tagName:"circle",r:r})},h4=e=>{var{r:t}=e,n=h6(e,["r"]);let r=t||5,i=new cR;return i.moveTo(r,0).lineTo(r,2*r),i.moveTo(0,r).lineTo(2*r,r),{children:[Object.assign(Object.assign({},h5({r:r})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:hH(i.serialize(),-r)})]}};var h8=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 h9=e=>{var{rx:t,ry:n}=e,r=h8(e,["rx","ry"]);let i=t||5;return Object.assign(Object.assign({cx:i},r),{tagName:"ellipse",rx:i,ry:n||5})};(em=tN||(tN={})).presets=t8,em.registry=cI.create({type:"marker"}),em.registry.register(em.presets,!0),(tN||(tN={})).normalize=hH;var h7=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 de(e){return"string"==typeof e||iE(e)}let dt={qualify:de,set:(e,{view:t,attrs:n})=>di("marker-start",e,t,n)},dn={qualify:de,set:(e,{view:t,attrs:n})=>di("marker-end",e,t,n,{transform:"rotate(180)"})},dr={qualify:de,set:(e,{view:t,attrs:n})=>di("marker-mid",e,t,n)};function di(e,t,n,r,i={}){let o="string"==typeof t?{name:t}:t,{name:s,args:l}=o,a=h7(o,["name","args"]),u=a;if(s&&"string"==typeof s){let e=tN.registry.get(s);if(!e)return tN.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 ds=(e,{view:t})=>t.cell.isEdge(),dl={qualify:ds,set(e,t){var n,r,i,o;let s,l=t.view,a=e.reverse||!1,u=e.stubs||0;if(Number.isFinite(u)&&0!==u)if(a){let e,t,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[1])?void 0:r.divideAtLength(t))?void 0:i[0])?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()}}},da={qualify:ds,set:dg("getTangentAtLength",{rotate:!0})},du={qualify:ds,set:dg("getTangentAtLength",{rotate:!1})},dc={qualify:ds,set:dg("getTangentAtRatio",{rotate:!0})},dh={qualify:ds,set:dg("getTangentAtRatio",{rotate:!1})},dd=da,df=dc;function dg(e,t){let n={x:1,y:0};return(r,i)=>{let o,s,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})`}}}(tj||(tj={})).isValidDefinition=function(e,t,n){return!!(null!=e&&("string"==typeof e||"function"!=typeof e.qualify||nV(e.qualify,this,t,n)))||!1},(ey=tj||(tj={})).presets=Object.assign(Object.assign({},{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"}),t9),ey.registry=cI.create({type:"attribute definition"}),ey.registry.register(ey.presets,!0);let dp={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix:e=>`${dp.prefixCls}-${e}`},dm=dp.prefix("highlighted"),dy={highlight(e,t,n){al(t,n&&n.className||dm)},unhighlight(e,t,n){aa(t,n&&n.className||dm)}},db=dp.prefix("highlight-opacity"),dv={highlight(e,t){al(t,db)},unhighlight(e,t){aa(t,db)}};!function(e){let t=ab("svg");function n(e,t){let n=uj(e.x,e.y).matrixTransform(t);return new cd(n.x,n.y)}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 cf(a,c,u-a,h-c)}function i(e,t={}){let n;if(!e.ownerSVGElement||!af(e)){if(a_(e)){let{left:t,top:n,width:r,height:i}=o(e);return new cf(t,n,r,i)}return new cf(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,uW(e,s)):cf.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,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(a2(o,"borderLeft"),10),n+=parseInt(a2(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 cf(t("x"),t("y"),t("width"),t("height"));case"circle":return new cy(t("cx"),t("cy"),t("r"),t("r"));case"ellipse":return new cy(t("cx"),t("cy"),t("rx"),t("ry"));case"polyline":{let t=ux(e);return new cE(t)}case"polygon":{let t=ux(e);return t.length>1&&t.push(t[0]),new cE(t)}case"path":{let t=e.getAttribute("d");return cR.isValid(t)||(t=cR.normalize(t)),cR.parse(t)}case"line":return new cm(t("x1"),t("y1"),t("x2"),t("y2"))}return i(e)}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(),as(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.normalizeMarker=hH,e.transformPoint=n,e.transformLine=function(e,t){return new cm(n(e.start,t),n(e.end,t))},e.transformPolyline=function(e,t){let r=e instanceof cE?e.points:e;return Array.isArray(r)||(r=[]),new cE(r.map(e=>n(e,t)))},e.transformRectangle=r,e.bbox=function(e,t,n){let i,o=e.ownerSVGElement;if(!o)return new cf(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?cf.create(i):r(i,uW(e,n||o))},e.getBBox=i,e.getBoundingOffsetRect=o,e.toGeometryShape=s,e.translateAndAutoOrient=function(e,t,n,r){let o=cd.create(t),s=cd.create(n);r||(r=e instanceof SVGSVGElement?e:e.ownerSVGElement);let l=uq(e);e.setAttribute("transform","");let a=i(e,{target:r}).scale(l.sx,l.sy),u=uR();u.setTranslate(-a.x-a.width/2,-a.y-a.height/2);let c=uR(),h=o.angleBetween(s,o.clone().translate(1,0));h&&c.setRotate(h,0,0);let d=uR(),f=o.clone().move(s,a.width/2);d.setTranslate(2*o.x-f.x,2*o.y-f.y);let g=uW(e,r),p=uR();p.setMatrix(d.matrix.multiply(c.matrix.multiply(u.matrix.multiply(g.scale(l.sx,l.sy))))),e.setAttribute("transform",uz(p.matrix))},e.findShapeNode=l,e.getBBoxV2=function(e){let t=l(e);if(!af(t)){if(a_(e)){let{left:t,top:n,width:r,height:i}=o(e);return new cf(t,n,r,i)}return new cf(0,0,0,0)}return s(t).bbox()||cf.create()}}(tL||(tL={}));let dx={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},dw={highlight(e,t,n){let r,i,o=tR.getHighlighterId(t,n);if(tR.hasCache(o))return;n=o3({},n,dx);let s=uo.create(t);try{r=s.toPathData()}catch(e){i=tL.bbox(s.node,!0),r=uS(Object.assign(Object.assign({},n),i))}let l=ab("path");if(a$(l,Object.assign({d:r,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?aG(n.attrs):null)),e.isEdgeElement(t))a$(l,"d",e.getConnectionPathData());else{let t=s.getTransformToElement(e.container),r=n.padding;if(r){null==i&&(i=tL.bbox(s.node,!0));let e=i.x+i.width/2,n=i.y+i.height/2,o=Math.max((i=tL.transformRectangle(i,t)).width,1),l=Math.max(i.height,1),a=(o+r)/o,u=(l+r)/l,c=uL({a:a,b:0,c:0,d:u,e:e-a*e,f:n-u*n});t=t.multiply(c)}uU(l,t)}al(l,dp.prefix("highlight-stroke"));let a=e.cell,u=()=>tR.removeHighlighter(o);a.on("removed",u),a.model&&a.model.on("reseted",u),e.container.appendChild(l),tR.setCache(o,l)},unhighlight(e,t,n){tR.removeHighlighter(tR.getHighlighterId(t,n))}};function dC(e,t={}){return new cd(lG(t.x,e.width),lG(t.y,e.height))}function dE(e,t,n){return Object.assign({angle:t,position:e.toJSON()},n)}(eb=tR||(tR={})).getHighlighterId=function(e,t){return ad(e),e.id+JSON.stringify(t)},y={},eb.setCache=function(e,t){y[e]=t},eb.hasCache=function(e){return null!=y[e]},eb.removeHighlighter=function(e){let t=y[e];t&&(aM(t),delete y[e])},(t_||(t_={})).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`)},(ev=t_||(t_={})).presets=t7,ev.registry=cI.create({type:"highlighter"}),ev.registry.register(ev.presets,!0);let dS=(e,t)=>e.map(({x:e,y:n,angle:r})=>dE(dC(t,{x:e,y:n}),r||0)),dP=(e,t,n)=>{let r=n.start||0,i=n.step||20;return dM(e,t,r,(e,t)=>(e+.5-t/2)*i)},dk=(e,t,n)=>{let r=n.start||0,i=n.step||360/e.length;return dM(e,t,r,e=>e*i)};function dM(e,t,n,r){let i=t.getCenter(),o=t.getTopCenter(),s=t.width/t.height,l=cy.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),dE(c.round(),h,e)})}var dO=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 dA=(e,t,n)=>dR(e,dC(t,n.start||t.getOrigin()),dC(t,n.end||t.getCorner()),n),dT=(e,t,n)=>dR(e,t.getTopLeft(),t.getBottomLeft(),n),dN=(e,t,n)=>dR(e,t.getTopRight(),t.getBottomRight(),n),dj=(e,t,n)=>dR(e,t.getTopLeft(),t.getTopRight(),n),dL=(e,t,n)=>dR(e,t.getBottomLeft(),t.getBottomRight(),n);function dR(e,t,n,r){let i=new cm(t,n),o=e.length;return e.map((e,t)=>{var{strict:n}=e,s=dO(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),dE(a.round(),0,s)})}(ex=tz||(tz={})).presets=ne,ex.registry=cI.create({type:"port layout"}),ex.registry.register(ex.presets,!0);let d_={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function dz(e,t){let{x:n,y:r,angle:i,attrs:o}=t||{};return o3({},{angle:i,attrs:o,position:{x:n,y:r}},e,d_)}let dI=(e,t,n)=>dz({position:t.getTopLeft()},n),dD=(e,t,n)=>dz({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),dB=(e,t,n)=>dz({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),dV=(e,t,n)=>dz({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),dF=(e,t,n)=>dz({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),d$=(e,t,n)=>dq(e,t,!1,n),dU=(e,t,n)=>dq(e,t,!0,n),dG=(e,t,n)=>dW(e,t,!1,n),dH=(e,t,n)=>dW(e,t,!0,n);function dq(e,t,n,r){let i,o,s,l,a=null!=r.offset?r.offset:15,u=t.getCenter().theta(e),c=dJ(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"),dz({position:{x:Math.round(o),y:Math.round(s)},angle:h,attrs:{".":{y:i,"text-anchor":l}}},r)}function dW(e,t,n,r){let i,o,s,l,a=null!=r.offset?r.offset:15,u=t.getCenter().theta(e),c=dJ(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"),dz({position:{x:Math.round(o),y:Math.round(s)},angle:h,attrs:{".":{y:i,"text-anchor":l}}},r)}function dJ(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 dX=(e,t,n)=>dQ(e.diff(t.getCenter()),!1,n),dY=(e,t,n)=>dQ(e.diff(t.getCenter()),!0,n);function dQ(e,t,n){let r,i=null!=n.offset?n.offset:20,o=new cd(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",dz({position:l.round().toJSON(),angle:t?u:0,attrs:{".":{y:a,"text-anchor":r}}},n)}(ew=tI||(tI={})).presets=nt,ew.registry=cI.create({type:"port label layout"}),ew.registry.register(ew.presets,!0);class dZ extends sl{get priority(){return 2}constructor(){super(),this.cid=tD.uniqueId(),dZ.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return aO(e),this}unmount(e=this.container){return aM(e),this}remove(e=this.container){return e===this.container&&(this.removeEventListeners(document),this.onRemove(),delete dZ.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 al(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return aa(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return a7(t,e),this}setAttrs(e,t=this.container){return null!=e&&null!=t&&a$(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 dZ.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=aC(e)+1;n=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(n+=` > ${t}`),n=this.getSelector(e.parentNode,n)}return n}prefixClassName(e){return dp.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 tx.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 tx.on(this.container,e+this.getEventNamespace(),t,n),this}undelegateEvent(e,t,n){let r=e+this.getEventNamespace();return null==t?tx.off(this.container,r):"string"==typeof t?tx.off(this.container,r,t,n):tx.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&&tx.on(e,i+r,n,o)}),this}removeEventListeners(e){return null!=e&&tx.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${dp.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}__`;return null==t?null==n?{}:n[r]||{}:(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 dZ.normalizeEvent(e)}}(eC=dZ||(dZ={})).createElement=function(e,t){return t?ab(e||"g"):ay(e||"div")},eC.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(dp.useCSSSelector){let n=e.includes(">")?`:scope ${e}`:e;return{isCSSSelector:!0,elems:Array.prototype.slice.call(t.querySelectorAll(n))}}return{elems:[]}},eC.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},(eE=dZ||(dZ={})).views={},eE.getView=function(e){return eE.views[e]||null},eS=tD||(tD={}),b=0,eS.uniqueId=function(){let e=`v${b}`;return b+=1,e};class dK{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new cn,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);return null==t.matrix&&(t.matrix=uJ(e,this.view.container)),uL(t.matrix)}getShape(e){let t=this.get(e);return null==t.shape&&(t.shape=tL.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){let t=this.get(e);return null==t.boundingRect&&(t.boundingRect=tL.getBBoxV2(e)),t.boundingRect.clone()}}!function(e){function t(e){return null!=e&&"string"==typeof e}function n(e,t={ns:ag.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||ag.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?ay(n,t):am(n),a=e.attrs;a&&a$(l,aG(a));let u=e.style;u&&a7(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?ab("g"):am("div")}e.isJSONMarkup=function(e){return null!=e&&!t(e)},e.isStringMarkup=t,e.clone=function(e){return null==e||t(e)?e:oQ(e)},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=uo.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=uo.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:{}}}}(tB||(tB={})),(tB||(tB={})).getSelector=function e(t,n,r){if(null!=t){let i,o=t.tagName.toLowerCase();if(t===n)return"string"==typeof r?`> ${o} > ${r}`:`> ${o}`;let s=t.parentNode;if(s&&s.childNodes.length>1){let e=aC(t)+1;i=`${o}:nth-child(${e})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,n,i)}return r},(eP=tB||(tB={})).getPortContainerMarkup=function(){return"g"},eP.getPortMarkup=function(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}},eP.getPortLabelMarkup=function(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}},(tB||(tB={})).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"}}]},(tB||(tB={})).getForeignObjectMarkup=function(e=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:ag.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:ag.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:e?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}};class d0{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,s=[];return Object.keys(t).forEach(r=>{let i=t[r],o=this.getDefinition(r),l=nV(tj.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[aI.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 cn;return Object.keys(e).forEach(s=>{let l=e[s];if(!iE(l))return;let{isCSSSelector:a,elems:u}=dZ.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=sw(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)=>iq(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=nV(n.set,this.view,t,a());"object"==typeof r?i=Object.assign(Object.assign({},i),r):null!=r&&(i[e]=r)}}),e instanceof HTMLElement)return void this.view.setAttrs(i,e);let u=i.transform,c=u_(u?`${u}`:null),h=new cd(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=nV(n.position,this.view,t,a());null!=e&&(d=!0,h.translate(cd.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=tL.transformRectangle(t,c);Object.keys(l).forEach(t=>{let i=l[t],o=this.getDefinition(t);if(null!=o){let t=nV(o.offset,this.view,i,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:n});null!=t&&(f=!0,h.translate(cd.create(t)))}})}}(null!=u||d||f)&&(h.round(1),c.e=h.x,c.f=h.y,e.setAttribute("transform",uz(c)))}update(e,t,n){let r,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,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 cn;l.forEach(t=>{let i,o,s=t.node,l=t.refNode,u=null!=l&&null!=n.rotatableNode&&ak(n.rotatableNode,l);if(l&&(i=a.get(l)),!i){let t=u?n.rotatableNode:e;i=l?tL.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=u_(a$(n.rotatableNode,"transform"))),c=tL.transformRectangle(i,r)),this.updateRelativeAttrs(s,o,c)})}}class d1{get cell(){return this.view.cell}constructor(e,t,n=[]){this.view=e;const r={},i={};let 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}}var d2=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 d3 extends dZ{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){let t=(e,t)=>null!=t?sp([...Array.isArray(e)?e:[e],...Array.isArray(t)?t:[t]]):Array.isArray(e)?[...e]:[e],n=oQ(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:s}=e,l=d2(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)),iq(n,l)}get[Symbol.toStringTag](){return d3.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new d0(this),this.flag=new d1(this,this.options.actions,this.options.bootstrap),this.cache=new dK(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 dZ.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();!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=tB.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=nV(t,this.graph,this)),"object"==typeof t){let n=t[e];return"function"==typeof n&&(n=nV(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 tL.transformRectangle(t,i.multiply(r).multiply(n))}getUnrotatedBBoxOfElement(e){let t=this.getBoundingRectOfElement(e),n=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return tL.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 uL().translate(t.x,t.y)}getRootRotatedMatrix(){let e=uL(),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 cf),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,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=d6.isToolsView(e)?e:new d6(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);n===this||(this.onMouseLeave(e),n&&n.onMouseEnter(e))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}d3.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)}([d3.dispose()],d3.prototype,"dispose",null),(ek=d3||(d3={})).Flag=d1,ek.Attr=d0,(eM=d3||(d3={})).toStringTag=`X6.${eM.name}`,eM.isCellView=function(e){if(null==e)return!1;if(e instanceof eM)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eM.toStringTag)&&"function"==typeof e.isNodeView&&"function"==typeof e.isEdgeView&&"function"==typeof e.confirmUpdate},(eO=d3||(d3={})).priority=function(e){return function(t){t.config({priority:e})}},eO.bootstrap=function(e){return function(t){t.config({bootstrap:e})}},(d3||(d3={})).registry=cI.create({type:"view"});class d6 extends dZ{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return d6.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?dZ.createElement("g",!0):dZ.createElement("div",!1);return al(n,this.prefixClassName("cell-tools")),t.className&&al(n,t.className),n}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!d3.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(al(this.svgContainer,this.prefixClassName("edge-tools")),al(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(al(this.svgContainer,this.prefixClassName("node-tools")),al(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=>{d6.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,r=n[e];if(d6.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=tF.registry.get(e);if(!r)return tF.registry.onNotFound(e);t=new r(n)}else if(this.cell.isEdge()){let r=t$.registry.get(e);if(!r)return t$.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),aM(this.svgContainer),aM(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}}(eA=d6||(d6={})).toStringTag=`X6.${eA.name}`,eA.isToolsView=function(e){if(null==e)return!1;if(e instanceof eA)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eA.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 dZ{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){return iq(oQ(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=dZ.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),al(this.container,this.prefixClassName("cell-tool")),"string"==typeof this.options.className&&al(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()?al(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&al(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=tB.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=o9((t=e.name)?lz(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}}(d6||(d6={}));let d5=e=>e;function d4(e,t){return 0===t?"0%":`${Math.round(e/t*100)}%`}function d8(e){return(t,n,r,i)=>{var o,s,l,a,u;let c,h,d,f,g,p,m;return n.isEdgeElement(r)?function(e,t,n,r){let i=n.getConnection();if(!i)return t;let o=i.closestPointLength(r);return e?t.anchor={name:"ratio",args:{ratio:o/i.length()}}:t.anchor={name:"length",args:{length:o}},t}(e,t,n,i):(o=e,s=t,l=n,a=r,u=i,h=(c=l.cell).getAngle(),d=l.getUnrotatedBBoxOfElement(a),f=c.getBBox().getCenter(),p=(g=cd.create(u).rotate(h,f)).x-d.x,m=g.y-d.y,o&&(p=d4(p,d.width),m=d4(m,d.height)),s.anchor={name:"topLeft",args:{dx:p,dy:m,rotate:!0}},s)}}let d9=d8(!0),d7=d8(!1);function fe(e,t,n,r){return nV(tV.presets.pinRelative,this.graph,{},t,n,e,this.cell,r,{}).anchor}function ft(e,t){return t?e.cell.getBBox():e.cell.isEdge()?e.getConnection().bbox():e.getUnrotatedBBoxOfElement(e.container)}(eT=tV||(tV={})).presets=nn,eT.registry=cI.create({type:"connection strategy"}),eT.registry.register(eT.presets,!0);class fn extends d6.ToolItem{onRender(){al(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();uU(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=ft(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=lG(n,l.width),r=lG(r,l.height);let h=uL().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,r=this.cellView,{offset:i=0,distance:o=0,rotate:s}=this.options,l=lG(o,1);(e=l>=0&&l<=1?r.getTangentAtRatio(l):r.getTangentAtLength(l))?(t=e.start,n=e.vector().vectorAngle(new cd(1,0))||0):(t=r.getConnection().start,n=0);let a=uL().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&&nV(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(fn||(fn={})).config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}}),(eN=fn||(fn={})).Remove=eN.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 fr=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 fi extends d6.ToolItem{onRender(){if(al(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){let e=this.options.attrs,{class:t}=e,n=fr(e,["class"]);a$(this.container,aG(n)),t&&al(this.container,t)}this.update()}update(){let e=this.cellView,t=this.options,{useCellGeometry:n,rotate:r}=t,i=lq(t.padding),o=ft(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();uH(this.container,e,t.x,t.y,{absolute:!0})}else o=o.bbox(e)}return a$(this.container,o.toJSON()),this}}(fi||(fi={})).config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}});class fo extends d6.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:cd.create(r),next:cd.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)return void this.stopBatch(this.eventData(e).vertexAdded);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||tS.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()}}(ej=fo||(fo={})).Handle=class extends dZ{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=dZ.createElement("circle",!0);let e=this.options.attrs;if("function"==typeof e){let t=ej.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){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})}},eL=fo||(fo={}),v=dp.prefix("edge-tool-vertex-path"),eL.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:e=>new eL.Handle(e),markup:[{tagName:"path",selector:"connection",className:v,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${v}`]:"onPathMouseDown",[`touchstart .${v}`]:"onPathMouseDown"}});class fs extends d6.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){al(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=oQ(this.vertices),f=d[l],g=d[l+1],p=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&&p){if(y){let e=a.sourceAnchor.clone();e[s]=h[s];let t=nV(o,i,e,p,i.sourceMagnet||p.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(g?l===d.length-2?x.containsPoint(g)?(d.pop(),w=!0):(g[s]=h[s],C=!0):g[s]=h[s]:((g=i.targetAnchor.toJSON())[s]=h[s],x.containsPoint(g)?w=!0:(d.push(g),C=!0)),"function"==typeof o&&v){if(w){let e=a.targetAnchor.clone();e[s]=h[s];let t=nV(o,i,e,v,i.targetMagnet||v.container,"target",i,this);this.resetAnchor("target",t)}C&&this.resetAnchor("target",a.targetAnchorDef)}cd.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(e,f,g,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:oQ(this.cell.prop(["source","anchor"])),targetAnchorDef:oQ(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 cm(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 cd(1,0));e.updatePosition(t.x,t.y,s,this.cellView),e.show(),e.options.axis=n}}else e.hide()}onRemove(){this.resetHandles()}}(eR=fs||(fs={})).Handle=class extends dZ{constructor(e){super(),this.options=e,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=dZ.createElement("rect",!0);let e=this.options.attrs;if("function"==typeof e){let t=eR.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 cd(e,t))||new cd(e,t),o=uL().translate(i.x,i.y);if(i.equals({x:e,y:t}))o=o.rotate(n);else{let n=new cm(e,t,i.x,i.y).vector().vectorAngle(new cd(1,0));0!==n&&(n+=90),o=o.rotate(n)}this.setAttrs({transform:uz(o),cursor:n%180==0?"row-resize":"col-resize"})}onMouseDown(e){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"}},(e_=fs||(fs={})).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 e_.Handle(e),anchor:fe});class fl extends d6.ToolItem{get type(){return this.options.type}onRender(){al(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,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),a$(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){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,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=nV(u,r,a,i,l,n,r,this);a=cd.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=nV(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()}}(fl||(fl={})).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:fe,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}});let fa=fl.define({name:"source-anchor",type:"source"}),fu=fl.define({name:"target-anchor",type:"target"});var fc=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 fh extends d6.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=fc(e,["class"]);this.setAttrs(n,this.container),t&&al(this.container,t)}}onRender(){al(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 cd(1,0))||0;if(!r)return this;let o=uL().translate(r.x,r.y).rotate(i);return uU(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})}}(fh||(fh={})).config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}});let fd=fh.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"}}),ff=fh.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 fg extends d6.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=d6.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;return n.fontSize=`${r.fontSize}px`,n.fontFamily=r.fontFamily,n.color=r.color,n.backgroundColor=r.backgroundColor,t.innerText=this.getCellText()||"",this.setCellText(""),this}updateNodeEditorTransform(){let{graph:e,cell:t,editor:n}=this;if(!n)return;let r=cd.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=lG(s,e.width),l=lG(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=cd.create(),r=20,{style:i}=t,o=this.event.target,s=o.parentElement;if(s&&as(s,this.prefixClassName("edge-label"))){let e=s.getAttribute("data-index")||"0";this.labelIndex=parseInt(e,10);let{translation:t}=uI(s.getAttribute("transform"));n=new cd(t.tx,t.ty),r=tL.getBBox(o).width}else{if(!this.options.labelAddable)return this;n=e.clientToLocal(cd.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 nV(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)return void nV(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});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:{}};so(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()}}(fg||(fg={})).config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}}),(ez=fg||(fg={})).NodeEditor=ez.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),ez.EdgeEditor=ez.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"});var fp=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};(eI=tF||(tF={})).presets={boundary:fi,button:fn,"button-remove":fn.Remove,"node-editor":fg.NodeEditor},eI.registry=cI.create({type:"node tool",process(e,t){if("function"==typeof t)return t;let n=d6.ToolItem,{inherit:r}=t,i=fp(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)}}),eI.registry.register(eI.presets,!0),(eD=t$||(t$={})).presets={boundary:fi,vertices:fo,segments:fs,button:fn,"button-remove":fn.Remove,"source-anchor":fa,"target-anchor":fu,"source-arrowhead":fd,"target-arrowhead":ff,"edge-editor":fg.EdgeEditor},eD.registry=cI.create({type:"edge tool",process(e,t){if("function"==typeof t)return t;let n=d6.ToolItem,{inherit:r}=t,i=fp(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)}}),eD.registry.register(eD.presets,!0);let fm=fP("center"),fy=fP("topCenter"),fb=fP("bottomCenter"),fv=fP("leftMiddle"),fx=fP("rightMiddle"),fw=fP("topLeft"),fC=fP("topRight"),fE=fP("bottomLeft"),fS=fP("bottomRight");function fP(e){return function(t,n,r,i={}){let o=i.rotate?t.getUnrotatedBBoxOfElement(n):t.getBBoxOfElement(n),s=o[e];s.x+=lG(i.dx,o.width),s.y+=lG(i.dy,o.height);let l=t.cell;return i.rotate?s.rotate(-l.getAngle(),l.getBBox().getCenter()):s}}function fk(e){return function(t,n,r,i){if(r instanceof Element){let o,s=this.graph.findViewByElem(r);return o=s?s.isEdgeElement(r)?fM(s,null!=i.fixedAt?i.fixedAt:"50%"):s.getBBoxOfElement(r).getCenter():new cd,e.call(this,t,n,o,i)}return e.apply(this,arguments)}}function fM(e,t){let n=lU(t),r="string"==typeof t?parseFloat(t):t;return n?e.getPointAtRatio(r/100):e.getPointAtLength(r)}let fO=fk(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:e/Math.tan(tM.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(tM.toRad(i)),s.x+=e}return s}),fA=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},fT=fk(function(e,t,n,r){let i,o,s,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});(eB=tU||(tU={})).presets=nr,eB.registry=cI.create({type:"node endpoint"}),eB.registry.register(eB.presets,!0);let fN=function(e,t,n,r){let i=null!=r.ratio?r.ratio:.5;return i>1&&(i/=100),e.getPointAtRatio(i)},fj=function(e,t,n,r){let i=null!=r.length?r.length:20;return e.getPointAtLength(i)},fL=function(e,t,n,r){let i=e.getClosestPoint(n);return null!=i?i:new cd},fR=fk(fL),f_=fk(function(e,t,n,r){let i=e.getConnection(),o=e.getConnectionSubdivisions(),s=new cm(n.clone().translate(0,1e6),n.clone().translate(0,-1e6)),l=new cm(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?fM(e,r.fallbackAt):nV(fL,this,e,t,n,r)});function fz(e,t,n){let r;if("object"==typeof n){if(Number.isFinite(n.y)){let{start:r,end:i}=new cm(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 fI(e){let t=e.getAttribute("stroke-width");return null===t?0:parseFloat(t)||0}(eV=tG||(tG={})).presets=ni,eV.registry=cI.create({type:"edge endpoint"}),eV.registry.register(eV.presets,!0);let fD=function(e,t,n,r){let i=t.getBBoxOfElement(n);r.stroked&&i.inflate(fI(n)/2);let o=e.intersect(i);return fz(o&&o.length?e.start.closest(o):e.end,e.start,r.offset)},fB=function(e,t,n,r,i){let o=t.cell,s=o.isNode()?o.getAngle():0;if(0===s)return nV(fD,this,e,t,n,r,i);let l=t.getUnrotatedBBoxOfElement(n);r.stroked&&l.inflate(fI(n)/2);let a=l.getCenter(),u=e.clone().rotate(s,a),c=u.setLength(1e6).intersect(l);return fz(c&&c.length?u.start.closest(c).rotate(-s,a):e.end,e.start,r.offset)},fV=function(e,t,n,r){let i,o,s,l=e.end,a=r.selector;if(!af(i="string"==typeof a?t.findOne(a):Array.isArray(a)?si(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||!af(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),g=f.inverse(),p=tL.transformLine(e,g),m=p.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&&p.setLength(1e6),cR.isPath(u)){let e=r.precision||2;null==y.segmentSubdivisions&&(y.segmentSubdivisions=u.getSegmentSubdivisions({precision:e})),s={precision:e,segmentSubdivisions:y.segmentSubdivisions},o=p.intersect(u,s)}else o=p.intersect(u);o?Array.isArray(o)&&(o=m.closest(o)):!0===r.sticky&&(o=cf.isRectangle(u)?u.getNearestPointToPoint(m):cy.isEllipse(u)?u.intersectsWithLineFromCenterToPoint(m):u.closestPoint(m,s));let b=o?tL.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+=fI(i)/2):v+=fI(i)/2),fz(b,e.start,v)},fF=function(e,t,n,r){let{alignOffset:i,align:o}=r;return o&&function(e,t,n=0){let r,i,o,s,{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),fz(e.end,e.start,r.offset)};(eF=tH||(tH={})).presets=no,eF.registry=cI.create({type:"connection point"}),eF.registry.register(eF.presets,!0);let f$=function(e){return[...e]},fU=function(e,t,n){let r,i,o,s=t.side||"bottom",l=lq(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 fG(e){return new cf(e.x,e.y,0,0)}function fH(e={}){let t=lq(e.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function fq(e,t={}){return e.sourceBBox.clone().moveAndExpand(fH(t))}function fW(e,t={}){return e.targetBBox.clone().moveAndExpand(fH(t))}let fJ=function(e,t,n){let r=fq(n,t),i=fW(n,t),o=function(e,t={}){return e.sourceAnchor?e.sourceAnchor:fq(e,t).getCenter()}(n,t),s=function(e,t={}){return e.targetAnchor?e.targetAnchor:fW(e,t).getCenter()}(n,t);r=r.union(fG(o)),i=i.union(fG(s));let l=e.map(e=>cd.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!=tq.getBearing(s,c);if(0===e)e+1===n?r.intersectsWithRect(i.clone().inflate(1))?o=tq.insideNode(s,c,r,i):h||(o=tq.nodeToNode(s,c,r,i)):r.containsPoint(c)?o=tq.insideNode(s,c,r,fG(c).moveAndExpand(fH(t))):h||(o=tq.nodeToVertex(s,c,r));else if(e+1===n){let e=h&&tq.getBearing(c,s)===a;i.containsPoint(s)||e?o=tq.insideNode(s,c,fG(s).moveAndExpand(fH(t)),i,a):h||(o=tq.vertexToNode(s,c,i,a))}else h||(o=tq.vertexToVertex(s,c,a));o?(u.push(...o.points),a=o.direction):a=tq.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 cd(e.x,t.y);return n.containsPoint(r)&&(r=new cd(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 cd(e.x,n.y),s=new cd(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,a=[new cd(e.x,t.y),new cd(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=sU(a,u)[0];let c=cd.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=cd.create(e).move(c,-i(n,o(e,c))/2),d=cd.create(t).move(u,-i(r,o(t,u))/2),f=new cm(h,d).getCenter(),g=l(e,f,n),p=s(f,t,g.direction);a.points=[g.points[0],p.points[0]],a.direction=p.direction}}return a},e.insideNode=function(e,t,i,s,l){let a,u,c,h,d=i.union(s).inflate(1),f=d.getCenter(),g=f.distance(t)>f.distance(e),p=g?t:e,m=g?e:t;return l?(a=cd.fromPolar(d.width+d.height,n[l],p),a=d.getNearestPointToPoint(a).move(a,-1)):a=d.getNearestPointToPoint(p).move(p,1),u=r(a,m,d),a.round().equals(u.round())?(u=cd.fromPolar(d.width+d.height,tM.toRad(a.theta(p))+Math.PI/2,m),c=r(a,u=d.getNearestPointToPoint(u).move(m,1).round(),d),h=g?[u,c,a]:[a,c,u]):h=g?[u,a]:[a,u],{points:h,direction:g?o(a,t):o(u,t)}}}(tq||(tq={}));let fX={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 fY(this.step,this)},directions(){let e=fY(this.step,this),t=fY(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=fY(this.step,this);return{0:0,45:e/2,90:e/2}},paddingBox(){let e=fY(this.step,this);return{x:-e,y:-e,width:2*e,height:2*e}},fallbackRouter:fJ,draggingRouter:null,snapToGrid:!0};function fY(e,t){return"function"==typeof e?e.call(t):e}class fQ{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=1,this.values[e]=t;let n=sT(this.items,e,e=>this.values[e]);this.items.splice(n,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 fZ{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=sm(i,o.getAncestors().map(e=>e.id)));let s=e.getCell(t.getTargetCellId());s&&(i=sm(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 cd(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 fK(e,t){let n=e.sourceBBox.clone();return t&&t.paddingBox?n.moveAndExpand(t.paddingBox):n}function f0(e,t){let n=e.targetBBox.clone();return t&&t.paddingBox?n.moveAndExpand(t.paddingBox):n}function f1(e,t){return e.sourceAnchor?e.sourceAnchor:fK(e,t).getCenter()}function f2(e,t,n,r,i){var o,s,l;let a,u,c,h,d,f=360/n,g=e.theta((o=e,s=t,l=r,a=i.step,u=s.x-o.x,c=s.y-o.y,h=u/l.x,d=c/l.y,new cd(o.x+h*a,o.y+d*a))),p=tM.normalize(g+f/2);return f*Math.floor(p/f)}function f3(e,t){let n=Math.abs(e-t);return n>180?360-n:n}function f6(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 f5(e,t){return e.round(t)}function f4(e,t,n){var r;let i,o,s;return f5((r=e.clone(),i=t.source,o=tO.snapToGrid(r.x-i.x,t.x)+i.x,s=tO.snapToGrid(r.y-i.y,t.y)+i.y,new cd(o,s)),n)}function f8(e){return e.toString()}function f9(e){return new cd(0===e.x?0:Math.abs(e.x)/e.x,0===e.y?0:Math.abs(e.y)/e.y)}function f7(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 ge(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,u=s[a],c=new cd(e.x+u.x*(Math.abs(l.x)+t.width),e.y+u.y*(Math.abs(l.y)+t.height)),h=new cm(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=f4(d,r,o);t.containsPoint(e)&&(e=f4(e.translate(u.x*r.x,u.y*r.y),r,o)),i.push(e)}}return i},[]);return t.containsPoint(e)||a.push(f4(e,r,o)),a}let gt=function(e,t,n){let r,i,o=function(e){let t=Object.keys(e).reduce((t,n)=>("fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]=e[n]:t[n]=fY(e[n],e),t),{});if(t.padding){let e=lq(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 cd(0,0),n=new cd(e.offsetX,e.offsetY);e.angle=tM.normalize(t.theta(n))}),t}(t),s=fK(n,o),l=f0(n,o),a=f1(n,o),u=new fZ(o).build(n.graph.model,n.cell),c=e.map(e=>cd.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=nV(o.draggingRouter,n,e,t,o)}}if(null==f&&(f=function(e,t,n,r,i){var o,s;let l,a,u,c,h=i.precision;l=cf.isRectangle(t)?f5(f1(e,i).clone(),h):f5(t.clone(),h),a=cf.isRectangle(n)?f5((e.targetAnchor?e.targetAnchor:f0(e,i).getCenter()).clone(),h):f5(n.clone(),h);let d=(o=i.step,s=a,{source:l.clone(),x:f6(s.x-l.x,o),y:f6(s.y-l.y,o)}),f=a;if(u=cf.isRectangle(t)?ge(l,t,i.startDirections,d,i):[l],c=cf.isRectangle(n)?ge(a,n,i.endDirections,d,i):[f],u=u.filter(e=>r.isAccessible(e)),c=c.filter(e=>r.isAccessible(e)),u.length>0&&c.length>0){let e,t,n,o=new fQ,s={},a={},g={};for(let e=0,t=u.length;e<t;e+=1){let t=u[e],n=f8(t);o.add(n,f7(t,c)),s[n]=t,g[n]=0}let p=i.previousDirectionAngle,m=void 0===p,y=(n=i.step,i.directions.forEach(e=>{e.gridOffsetX=e.offsetX/n*d.x,e.gridOffsetY=e.offsetY/n*d.y}),i.directions),b=y.length,v=c.reduce((e,t)=>{let n=f8(t);return e.push(n),e},[]),x=cd.equalPoints(u,c),w=i.maxLoopCount;for(;!o.isEmpty()&&w>0;){let n,u=o.pop(),C=s[u],E=a[u],S=g[u],P=C.equals(l),k=null==E;if(n=k?m?P?null:f2(l,C,b,d,i):p:f2(E,C,b,d,i),!(k&&x)&&v.indexOf(u)>=0)return i.previousDirectionAngle=n,function(e,t,n,r,i){let o,s=[],l=f9(i.diff(n)),a=f8(n),u=e[a];for(;u;){let n=f9((o=t[a]).diff(u));n.equals(l)||(s.unshift(o),l=n),u=e[a=f8(u)]}let c=t[a];return f9(c.diff(r)).equals(l)||s.unshift(c),s}(a,s,C,l,f);for(let l=0;l<b;l+=1){let u=(e=y[l]).angle;if(t=f3(n,u),!(m&&P)&&t>i.maxDirectionChange)continue;let p=f4(C.clone().translate(e.gridOffsetX||0,e.gridOffsetY||0),d,h),x=f8(p);if(o.isClose(x)||!r.isAccessible(p)||v.indexOf(x)>=0&&!p.equals(f)&&f3(u,f2(p,f,b,d,i))>i.maxDirectionChange)continue;let w=S+e.cost+(P?0:i.penalties[t]);(!o.isOpen(x)||w<g[x])&&(s[x]=p,a[x]=C,g[x]=w,o.add(x,w+f7(p,c)))}w-=1}}return i.fallbackRoute?nV(i.fallbackRoute,this,l,f,i):null}(n,r,i,u,o)),null===f)return console.warn("Unable to execute manhattan algorithm, use orth instead"),nV(o.fallbackRouter,this,e,o,n);let g=f[0];g&&g.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},gn=function(e,t,n){return nV(gt,this,e,Object.assign(Object.assign({},fX),t),n)},gr={maxDirectionChange:45,directions(){let e=fY(this.step,this),t=fY(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 cm(e,l),u=90*Math.ceil(r/90),c=cd.fromPolar(a.squaredLength(),tM.toRad(u+135),l),h=new cm(t,c),d=a.intersectsWithLine(h),f=d||t,g=d?f:e,p=360/n.directions.length,m=g.theta(t),y=tM.normalize(m+p/2);return n.previousDirectionAngle=p*Math.floor(y/p),f&&i.push(f.round()),i.push(t),i}},gi=function(e,t,n){return nV(gn,this,e,Object.assign(Object.assign({},gr),t),n)},go=function(e,t,n){let r,i,o,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":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||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 g="L"===u||"R"===u;if(g){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 p=d.clone(),m=f.clone();if(p[r]+=o*(c[i]/2+a),m[r]-=o*(h[i]/2+a),g){let e=p.x,t=m.x,n=c.width/2+l,r=h.width/2+l;f.x>d.x?t<=e&&(p.x=Math.max(t,d.x+n),m.x=Math.min(e,f.x-r)):t>=e&&(p.x=Math.min(t,d.x-n),m.x=Math.max(e,f.x+r))}else{let e=p.y,t=m.y,n=c.height/2+l,r=h.height/2+l;f.y>d.y?t<=e&&(p.y=Math.max(t,d.y+n),m.y=Math.min(e,f.y-r)):t>=e&&(p.y=Math.min(t,d.y-n),m.y=Math.max(e,f.y+r))}return[p.toJSON(),...e,m.toJSON()]};function gs(e,t){if(null!=t&&!1!==t){let n="boolean"==typeof t?0:t;if(n>0){let t=cd.create(e[1]).move(e[2],n),r=cd.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 gl=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=tM.toRad(e),n=Math.sin(t),o=Math.cos(t),l=new cd(s.x+o*r,s.y+n*r),a=new cd(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 cm(t,e);return!a.containsPoint(e)&&!a.intersectsWithLine(n)},l=[0,90,180,270,45,135,225,315];if("number"==typeof o)return gs(e(o),t.merge);let u=a.getCenter();if(u.equals(s))return gs(e(0),t.merge);let c=u.angleBetween(s,u.clone().translate(1,0)),h=e(c);if(n(h[1]))return gs(h,t.merge);for(let t=1,r=l.length;t<r&&!n((h=e(c+l[t]))[1]);t+=1);return gs(h,t.merge)}{let e=new cm(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),g=new cm(f.start,c),p=new cm(f.end,c);if((a.containsPoint(c)||u.containsPoint(c)||a.intersectsWithLine(g)||a.intersectsWithLine(p)||u.intersectsWithLine(g)||u.intersectsWithLine(p))&&(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 cm(s,l),t=new cm(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 gs([h.toJSON(),c.toJSON(),d.toJSON()],t.merge)}};(e$=tW||(tW={})).presets=ns,e$.registry=cI.create({type:"router"}),e$.registry.register(e$.presets,!0);let ga=function(e,t,n,r={}){let i=[e,...n,t],o=new cE(i),s=new cR(o);return r.raw?s:s.serialize()},gu=function(e,t,n,r={}){let i=+(3!==n.length),o=cd.create(n[0+i]),s=cd.create(n[2+i]),l=cd.create(n[1+i]);if(!cd.equals(e,t)){let n=new cd((e.x+t.x)/2,(e.y+t.y)/2),r=n.angleBetween(cd.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=`
268
+ M ${e.x} ${e.y}
269
+ Q ${o.x} ${o.y} ${l.x} ${l.y}
270
+ Q ${s.x} ${s.y} ${t.x} ${t.y}
271
+ `;return r.raw?cR.parse(a):a},gc=function(e,t,n,r={}){let i,o,s=new cR;s.appendSegment(cR.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=cd.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),g=-Math.min(u,o),p=c.clone().move(h,f).round(),m=c.clone().move(d,g).round(),y=new cd(l*p.x+a*c.x,a*c.y+l*p.y),b=new cd(l*m.x+a*c.x,a*c.y+l*m.y);s.appendSegment(cR.createSegment("L",p)),s.appendSegment(cR.createSegment("C",y,b,m))}return s.appendSegment(cR.createSegment("L",t)),r.raw?s:s.serialize()},gh=function(e,t,n,r={}){let i,o=r.direction;if(n&&0!==n.length){let r=[e,...n,t],o=cS.throughPoints(r);i=new cR(o)}else if((i=new cR).appendSegment(cR.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(cR.createSegment("C",n,e.y,n,t.y,t.x,t.y))}else{let n=(e.y+t.y)/2;i.appendSegment(cR.createSegment("C",e.x,n,t.x,n,t.x,t.y))}return r.raw?i:i.serialize()},gd=1/3,gf=2/3;function gg(e,t,n=[]){let r=[e,...n,t],i=[];return r.forEach((e,t)=>{let n=r[t+1];null!=n&&i.push(new cm(e,n))}),i}function gp(e,t){return new cm(e,t).squaredLength()}function gm(e,t,n,r){let o,s=new cR;return o=cR.createSegment("M",e[0].start),s.appendSegment(o),e.forEach((l,a)=>{if(i.includes(l)){let e,r,i,a;if("arc"===n){let t;e=-90,((r=l.start.diff(l.end)).x<0||0===r.x&&r.y<0)&&(e+=180);let n=l.getCenter(),u=new cm(n,l.end).rotate(e,n);i=(t=new cm(l.start,n)).pointAt(2/3).rotate(e,l.start),a=u.pointAt(1/3).rotate(-e,u.end),o=cR.createSegment("C",i,a,u.end),s.appendSegment(o),t=new cm(n,l.end),i=u.pointAt(1/3).rotate(e,u.end),a=t.pointAt(1/3).rotate(-e,l.end),o=cR.createSegment("C",i,a,l.end),s.appendSegment(o)}else if("gap"===n)o=cR.createSegment("M",l.end),s.appendSegment(o);else if("cubic"===n){e=l.start.theta(l.end);let n=.6*t,u=1.35*t;((r=l.start.diff(l.end)).x<0||0===r.x&&r.y<0)&&(u*=-1),i=new cd(l.start.x+n,l.start.y+u).rotate(e,l.start),a=new cd(l.end.x-n,l.end.y+u).rotate(e,l.end),o=cR.createSegment("C",i,a,l.end),s.appendSegment(o)}}else{var u,c,h,d,f;let t,n,g,p,m,y,b,v,x,w=e[a+1];0===r||!w||i.includes(w)?(o=cR.createSegment("L",l.end),s.appendSegment(o)):(u=r,c=s,h=l.end,d=l.start,f=w.end,n=h.distance(d)/2,g=h.distance(f)/2,p=-Math.min(u,n),m=-Math.min(u,g),y=h.clone().move(d,p).round(),b=h.clone().move(f,m).round(),v=new cd(gd*y.x+gf*h.x,gf*h.y+gd*y.y),x=new cd(gd*b.x+gf*h.x,gf*h.y+gd*b.y),t=cR.createSegment("L",y),c.appendSegment(t),t=cR.createSegment("C",v,x,b),c.appendSegment(t))}}),s}let gy=function(e,t,n,r={}){i=[],o=[];var s=this;let l=s.graph._jumpOverUpdateList;if(null==l&&(l=s.graph._jumpOverUpdateList=[],s.graph.on("cell:mouseup",()=>{let e=s.graph._jumpOverUpdateList;setTimeout(()=>{for(let t=0;t<e.length;t+=1)e[t].update()})}),s.graph.on("model:reseted",()=>{l=s.graph._jumpOverUpdateList=[]})),0>l.indexOf(s)){l.push(s);let e=()=>l.splice(l.indexOf(s),1);s.cell.once("change:connector",e),s.cell.once("removed",e)}let a=r.size||5,u=r.type||"arc",c=r.radius||0,h=r.ignoreConnectors||["smooth"],d=this.graph,f=d.model.getEdges();if(1===f.length)return gm(gg(e,t,n),a,u,c);let g=this.cell,p=f.indexOf(g),m=d.options.connecting.connector||{},y=f.filter((e,t)=>{let n=e.getConnector()||m;return!h.includes(n.name)&&(!(t>p)||"jumpover"!==n.name)}),b=y.map(e=>d.findViewByCell(e)),v=gg(e,t,n),x=b.map(e=>null==e?[]:e===this?v:gg(e.sourcePoint,e.targetPoint,e.routePoints)),w=[];v.forEach(e=>{let t=y.reduce((t,n,r)=>{if(n!==g){var i;let n,o=(i=x[r],n=[],i.forEach(t=>{let r=e.intersectsWithLine(t);r&&n.push(r)}),n);t.push(...o)}return t},[]).sort((t,n)=>gp(e.start,t)-gp(e.start,n));if(t.length>0)w.push(...t.reduce((n,r,s)=>{if(o.includes(r))return n;let l=n.pop()||e,u=cd.create(r).move(l.start,-a),c=cd.create(r).move(l.start,+a),h=t[s+1];if(null!=h){let e=c.distance(h);e<=a&&(c=h.move(l.start,e),o.push(h))}else if(u.distance(l.end)<2*a+1)return n.push(l),n;if(c.distance(l.start)<2*a+1)return n.push(l),n;let d=new cm(u,c);return i.push(d),n.push(new cm(l.start,u),d,new cm(c,l.end)),n},[]));else w.push(e)});let C=gm(w,a,u,c);return i=[],o=[],r.raw?C:C.serialize()};(eU=tJ||(tJ={})).presets=nl,eU.registry=cI.create({type:"connector"}),eU.registry.register(eU.presets,!0);class gb extends sl{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(oQ(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=oQ(this.data),this.changed={});let s=this.data,l=this.previous,a=this.changed;if(Object.keys(e).forEach(t=>{let r=e[t];oM(s[t],r)||i.push(t),oM(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,r,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 si(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}so(i,r,t,"/");let u=oQ(this.data);n.rewrite&&ss(u,e,"/");let c=iq(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=oQ(this.get(r));i&&ss(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()?oQ(this.changed):null;let n=this.changing?this.previous:this.data,r={};for(let i in e){let o=e[i];oM(n[i],o)||(r[i]=o,t=!0)}return t?oQ(r):null}toJSON(){return oQ(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)}([sl.dispose()],gb.prototype,"dispose",null);class gv{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=o0(n,gv.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=>oM(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?tP[e]:e}getInterp(e,t,n){return e?e(t,n):"number"==typeof n?tk.number(t,n):"string"==typeof n?"#"===n[0]?tk.color(t,n):tk.unit(t,n):tk.object(t,n)}getArgs(e){let t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(gv||(gv={})).defaultOptions={delay:10,duration:100,timing:"linear"};var gx=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 gw extends sl{static config(e){let{markup:t,propHooks:n,attrHooks:r}=e,i=gx(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=iq({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:oQ(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((t,n)=>n?nV(n,e,t):t,t)}get[Symbol.toStringTag](){return gw.toStringTag}constructor(e={}){super();const t=this.constructor.getDefaults(!0),n=iq({},this.preprocess(t),this.preprocess(e));this.id=n.id||lD(),this.store=new gb(n),this.animation=new gv(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=lD()),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(iq({},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){return null==e?this.getProp():"string"==typeof e||Array.isArray(e)?1==arguments.length?this.getPropByPath(e):null==t?this.removePropByPath(e,n||{}):this.setPropByPath(e,t,n||{}):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):iq({},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]||tj.registry.get(e);if(!n){let r=lT(e);n=t[r]||tj.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){return null==e?this.getAttrByPath():"string"==typeof e||Array.isArray(e)?1==arguments.length?this.getAttrByPath(e):null==t?this.removeAttrByPath(e,n||{}):this.setAttrByPath(e,t,n||{}):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:iq({},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.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 gw.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 gw.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=oQ(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",gw.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=oQ(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 cf}getConnectionPoint(e,t){return new cd}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&&!iE(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&&oM(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&&oM(o,i)||(null==c[e]&&(c[e]={}),c[e][r]=i):Object.keys(i).forEach(t=>{let s=i[t];null!=n&&null!=o&&nc(o)&&oM(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:oA(c)?void 0:c});return null==h.attrs&&delete h.attrs,0===h.angle&&delete h.angle,oQ(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 gw.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()}}gw.defaults={},gw.attrHooks={},gw.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)}([sl.dispose()],gw.prototype,"dispose",null),(gw||(gw={})).normalizeTools=function(e){return"string"==typeof e?{items:[e]}:Array.isArray(e)?{items:e}:e.items?e:{items:[e]}},(eG=gw||(gw={})).toStringTag=`X6.${eG.name}`,eG.isCell=function(e){if(null==e)return!1;if(e instanceof eG)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eG.toStringTag)&&"function"==typeof e.isNode&&"function"==typeof e.isEdge&&"function"==typeof e.prop&&"function"==typeof e.attr},(eH=gw||(gw={})).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},eH.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},eH.deepClone=function(e){let t=[e,...e.getDescendants({deep:!0})];return eH.cloneCells(t)},eH.cloneCells=function(e){let t=sp(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},(eq=gw||(gw={})).config({propHooks(e){var{tools:t}=e,n=gx(e,["tools"]);return t&&(n.tools=eq.normalizeTools(t)),n}}),(eW=tX||(tX={})).exist=function(e,t){return t?null!=x&&x.exist(e):null!=w&&w.exist(e)},eW.setEdgeRegistry=function(e){x=e},eW.setNodeRegistry=function(e){w=e};class gC{constructor(e){this.ports=[],this.groups={},this.init(oQ(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,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=tz.registry.get(s);if(null==e)return tz.registry.onNotFound(s);n=e}else n=tz.presets.left;return n(r.map(e=>e&&e.position&&e.position.args||{}),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,cd.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=iq({},n.attrs,t.attrs),t.position=this.createPosition(n,t),t.label=iq({},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 iq({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=tI.registry.get(r)||tI.presets.left;return o?o(t,n,i):null}}var gE=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 gS extends gw{get[Symbol.toStringTag](){return gS.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){let{x:n,y:r,width:i,height:o}=e,s=gE(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=this.getSize();switch(r){case"left":case"right":t=i.height;break;case"top":case"bottom":e=i.width}let o={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[r],s=tM.normalize(this.getAngle()||0);n.absolute&&(o+=Math.floor((s+45)/90),o%=4);let l=this.getBBox(),a=(0===o?l.getBottomLeft():1===o?l.getCorner():2===o?l.getTopRight():l.getOrigin()).clone().rotate(-s,l.getCenter()),u=Math.sqrt(e*e+t*t)/2,c=o*Math.PI/2;c+=Math.atan(o%2==0?t/e:e/t),c-=tM.toRad(s);let h=cd.fromPolar(u,c,a).clone().translate(-(e/2),-(t/2));this.store.set("size",{width:e,height:t},n),this.setPosition(h.x,h.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:tk.object})),this.eachChild(r=>{var i;(null==(i=n.exclude)?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.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),gw.getCellsBBox(e)}return cf.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=cd.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}=gw.getCellsBBox(t),s=lq(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")||tB.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",tB.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||tB.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",tB.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||tB.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",tB.clone(e),t),this}get ports(){let e=this.store.get("ports",{items:[]});return null==e.items&&(e.items=[]),e}getPorts(){return oQ(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return oQ(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 cf(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){return null==t?this.getPortProp(e):"string"==typeof t||Array.isArray(t)?2==arguments.length?this.getPortProp(e,t):null==n?this.removePortProp(e,t,r):this.setPortProp(e,t,n,r):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&&!oA(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 lD()}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 gC(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})}}gS.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},(eJ=gS||(gS={})).toStringTag=`X6.${eJ.name}`,eJ.isNode=function(e){if(null==e)return!1;if(e instanceof eJ)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eJ.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},(gS||(gS={})).config({propHooks(e){var{ports:t}=e,n=gE(e,["ports"]);return t&&(n.ports=Array.isArray(t)?{items:t}:t),n}}),(eX=gS||(gS={})).registry=cI.create({type:"node",process(e,t){if(tX.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=eX,{inherit:r}=t,i=gE(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}}),tX.setNodeRegistry(eX.registry),eY=gS||(gS={}),C=0,eY.define=function(e){var t;let{constructorName:n,overwrite:r}=e,i=gE(e,["constructorName","overwrite"]),o=o9((t=n||i.shape)?lz(t):(C+=1,`CustomNode${C}`),this);return o.config(i),i.shape&&eY.registry.register(i.shape,o,r),o},eY.create=function(e){let t=e.shape||"rect",n=eY.registry.get(t);return n?new n(e):eY.registry.onNotFound(t)};var gP=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 gk extends gw{get[Symbol.toStringTag](){return gk.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=gP(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),h=e=>"string"==typeof e||"number"==typeof e;if(null!=n)if(gw.isCell(n))c.source={cell:n.id};else if(h(n))c.source={cell:n};else if(cd.isPoint(n))c.source=n.toJSON();else if(Array.isArray(n))c.source={x:n[0],y:n[1]};else{let e=n.cell;gw.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=h(r)?r:r.id;e?e.cell=t:e=c.source={cell:t}}null!=i&&e&&(e.port=i)}else null!=o&&(c.source=cd.create(o).toJSON());if(null!=s)if(gw.isCell(s))c.target={cell:s.id};else if(h(s))c.target={cell:s};else if(cd.isPoint(s))c.target=s.toJSON();else if(Array.isArray(s))c.target={x:s[0],y:s[1]};else{let e=s.cell;gw.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=h(l)?l:l.id;e?e.cell=t:e=c.target={cell:t}}null!=a&&e&&(e.port=a)}else null!=u&&(c.target=cd.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 gw.isCell(t)?this.store.set(e,iq({},n,{cell:t.id}),r):cd.isPoint(t)||null!=t.x&&null!=t.y?this.store.set(e,iq({},n,{x:t.x,y:t.y}),r):this.store.set(e,oQ(t),r),this}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){let t=this[e];if(cd.isPointLike(t))return cd.create(t);let n=this.getTerminalCell(e);return n?n.getConnectionPoint(this,e):new cd}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 oQ(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||oM(t,e))?null:t):t?[...t]:[],r=e&&t?e.filter(e=>t.find(t=>e===t||oM(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=>cd.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,cd.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=>cd.equals(t,e))?null:t):t?[...t]:[],r=e&&t?e.filter(e=>t.find(t=>cd.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")||tB.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=>cd.create(r).scale(e,t,n).toJSON(),r)}applyToPoints(e,t={}){let n={},r=this.getSource(),i=this.getTarget();cd.isPointLike(r)&&(n.source=e(r)),cd.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=>cd.create(e)),this.getTargetPoint()];return new cE(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:gw.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))}}gk.defaults={},(gk||(gk={})).equalTerminals=function(e,t){return e.cell===t.cell&&(e.port===t.port||null==e.port&&null==t.port)},(eQ=gk||(gk={})).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}},eQ.parseStringLabel=function(e){return{attrs:{label:{text:e}}}},(eZ=gk||(gk={})).toStringTag=`X6.${eZ.name}`,eZ.isEdge=function(e){if(null==e)return!1;if(e instanceof eZ)return!0;let t=e[Symbol.toStringTag];return(null==t||t===eZ.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},(eK=gk||(gk={})).registry=cI.create({type:"edge",process(e,t){if(tX.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=eK,{inherit:r="edge"}=t,i=gP(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}}),tX.setEdgeRegistry(eK.registry),e0=gk||(gk={}),E=0,e0.define=function(e){var t;let{constructorName:n,overwrite:r}=e,i=gP(e,["constructorName","overwrite"]),o=o9((t=n||i.shape)?lz(t):(E+=1,`CustomEdge${E}`),this);return o.config(i),i.shape&&e0.registry.register(i.shape,o,r),o},e0.create=function(e){let t=e.shape||"edge",n=e0.registry.get(t);return n?new n(e):e0.registry.onNotFound(t)},(e1=gk||(gk={})).config({shape:"basic.edge",propHooks(e){let{label:t,vertices:n}=e,r=gP(e,["label","vertices"]);if(t){null==r.labels&&(r.labels=[]);let e="string"==typeof t?e1.parseStringLabel(t):t;r.labels.push(e)}return n&&Array.isArray(n)&&(r.vertices=n.map(e=>cd.create(e).toJSON())),r}}),e1.registry.register("basic.edge",e1);class gM extends sl{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=sI(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)}([gM.dispose()],gM.prototype,"dispose",null);class gO extends sl{get[Symbol.toStringTag](){return gO.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new gM(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=gw.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=gw.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)=>(e.isEdge()?1:2)-(t.isEdge()?1:2));for(;e.length>0;){let t=e.shift();t&&t.remove(n)}},n),this}addNode(e,t={}){let n=gS.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 gS.create(e)}addEdge(e,t={}){let n=gk.isEdge(e)?e:this.createEdge(e);return this.addCell(n,t),n}createEdge(e){return gk.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=>{!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();!t.enclosed&&r&&o[r.id]&&s&&o[s.id]||(n.push(e),i[e.id]=!0)}})};e.forEach(e=>{!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})}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))}),gw.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 gw.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 cf(e,t,n,r):cf.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 cf(e,t,n,r):cf.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 gw.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])i[e.id]=!0,!1!==nV(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]||(i[e.id]=!0,!1===nV(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=tE.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 gO.toJSON(this.getCells(),e)}parseJSON(e){return gO.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)}([gO.dispose()],gO.prototype,"dispose",null),(e2=gO||(gO={})).toStringTag=`X6.${e2.name}`,e2.isModel=function(e){if(null==e)return!1;if(e instanceof e2)return!0;let t=e[Symbol.toStringTag];return(null==t||t===e2.toStringTag)&&"function"==typeof e.addNode&&"function"==typeof e.addEdge&&null!=e.collection},(e3=gO||(gO={})).toJSON=function(e,t={}){return{cells:e.map(e=>e.toJSON(t))}},e3.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(gS.registry.exist(t))return gS.create(e);if(gk.registry.exist(t))return gk.create(e)}throw Error("The `shape` should be specified when creating a node/edge instance")})};var gA=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 gT extends gS{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}}(e6=gT||(gT={})).bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},e6.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},e6.config({attrs:{text:Object.assign({},e6.labelAttr)},propHooks(e){let{label:t}=e,n=gA(e,["label"]);return t&&so(n,"attrs/text/text",t),n},visible:!0});var gN=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 gj(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({},gT.bodyAttr)}};return(n.parent||gT).define(iq(r,t,{shape:e}))}gj("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});let gL=gk.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"}}});gj("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var gR=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 g_ extends gT{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",g_.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}var gz=g_||(g_={});function gI(e){return"string"==typeof e?e:e.map(e=>Array.isArray(e)?e.join(","):cd.isPointLike(e)?`${e.x}, ${e.y}`:"").join(" ")}gz.pointsToString=gI,gz.config({propHooks(e){let{points:t}=e,n=gR(e,["points"]);if(t){let e=gI(t);e&&so(n,"attrs/body/refPoints",e)}return n}}),gj("polygon",{},{parent:g_}),gj("polyline",{},{parent:g_});var gD=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};gT.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=gD(e,["path"]);return t&&so(n,"attrs/body/refD",t),n}});var gB=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};gT.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},td.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:ag.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({},gT.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(e){let{text:t}=e,n=gB(e,["text"]);return t&&so(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 nV(tj.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()}}}}),gj("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:function(e="xlink:href"){return t=>{let{imageUrl:n,imageWidth:r,imageHeight:i}=t,o=gN(t,["imageUrl","imageWidth","imageHeight"]);return(null!=n||null!=r||null!=i)&&(o.attrs?null==o.attrs.image&&(o.attrs.image={}):o.attrs={image:{}},(()=>{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}}()},{selector:"image"}),gj("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class gV extends d3{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return gV.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")?aa(t,e):al(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(),dp.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(),dp.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 cf(0,0,n.width,n.height),selectors:this.selectors}),dp.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(),dp.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=>{aM(e.portElement)})}renderPorts(){let e=this.container,t=[];e.childNodes.forEach(e=>{t.push(e)});let n=sF(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?aN(n[Math.max(t,0)],r):aA(this.container,r)}getPortElement(e){let t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t,n,r=tB.renderMarkup(this.cell.getPortContainerMarkup()),i=r.elem;if(null==i)throw Error("Invalid port container markup.");let o=(r=tB.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}`),al(i,l),al(i,"x6-port"),al(o,"x6-port-body"),i.appendChild(o);let a=s;if(this.existPortLabel(e)){if(t=(r=tB.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)}al(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=cf.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=cf.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=cf.fromSize(t.labelSize)),this.updateAttrs(i.portLabelElement,s.attrs,e)}}}applyPortTransform(e,t,n=0){let r=t.angle,i=t.position;uU(e,uL().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){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;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?nV(o,r,{view:this,node:this.cell}).filter(e=>gw.isCell(e)&&this.cell.id!==e.id&&!e.isDescendantOf(this.cell)):r.model.getNodesUnderNode(n,{by:o});if(i.frontOnly&&s.length>0){let e=sF(s,"zIndex"),t=sq(Object.keys(e).map(e=>parseInt(e,10)));t&&(s=e[t])}s=s.filter(e=>e.visible);let l=null,a=t.candidateEmbedView,u=i.validate;for(let e=s.length-1;e>=0;e-=1){let t=s[e];if(a&&a.cell.id===t.id){l=a;break}{let e=t.findView(r);if(u&&nV(u,r,{child:this.cell,parent:e.cell,childView:this,parentView:e})){l=e;break}}}this.clearEmbedding(t),l&&l.highlight(null,{type:"embedding"}),t.candidateEmbedView=l;let c=r.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:n,node:n,view:r.findViewByCell(n),x:c.x,y:c.y,currentParent:n.getParent(),candidateParent:l?l.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||nV(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,r=this.graph.options.connecting.createEdge;return r&&(n=nV(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?nV(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=cd.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=tO.snapToGrid(t+l.x,o),c=tO.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)}}(e5=gV||(gV={})).toStringTag=`X6.${e5.name}`,e5.isNodeView=function(e){if(null==e)return!1;if(e instanceof e5)return!0;let t=e[Symbol.toStringTag];return(null==t||t===e5.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},gV.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"]}}),gV.registry.register("node",gV,!0);class gF extends d3{constructor(){super(...arguments),this.POINT_ROUNDING=2}get[Symbol.toStringTag](){return gF.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){let e=this.sourceView;if(!e){let e=this.cell.getSource();return new cf(e.x,e.y)}let t=this.sourceMagnet;return e.isEdgeElement(t)?new cf(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 cf(e.x,e.y)}let t=this.targetMagnet;return e.isEdgeElement(t)?new cf(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=ab("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,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&&r_(e.propertyValue,"markup");if("markup"!==n[2])return!1}}return!0}parseLabelMarkup(e){return e?"string"==typeof e?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){let t=uo.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()?uo.create("g").append(n):uo.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=iq({},r.attrs,s.attrs);this.updateAttrs(i,l,{selectors:o,rootBBox:s.size?cf.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 cE(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 cd.create(this.sourceAnchor);case"target":return cd.create(this.targetAnchor);default:throw Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return cd.create(this.sourcePoint);case"target":return cd.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 cE(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,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?cd.create(t):c?d:cd.create(a),i=this.getAnchor(l.anchor,u,h,n,e)}else i=cd.create(l);if(c){let e=cd.create(r||i);o=this.getAnchor(a.anchor,c,d,e,n)}else o=cd.isPointLike(a)?cd.create(a):new cd;return{[e]:i,[n]:o}}getAnchor(e,t,n,r,i){let o,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=tG.registry.get(u);if("function"!=typeof e)return tG.registry.onNotFound(u);o=nV(e,this,t,n,r,a.args||{},i)}else{let e=tU.registry.get(u);if("function"!=typeof e)return tU.registry.onNotFound(u);o=nV(e,this,t,n,r,a.args||{},i)}return o?o.round(this.POINT_ROUNDING):new cd}findRoutePoints(e=[]){let t,n=this.graph.options.connecting.router||tW.presets.normal,r=this.cell.getRouter()||n;if("function"==typeof r)t=nV(r,this,e,{},this);else{let n="string"==typeof r?r:r.name,i="string"==typeof r?{}:r.args||{},o=n?tW.registry.get(n):tW.presets.normal;if("function"!=typeof o)return tW.registry.onNotFound(n);t=nV(o,this,e,i,this)}return null==t?e.map(e=>cd.create(e)):t.map(e=>cd.create(e))}findConnectionPoints(e,t,n){let r,i,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 cm(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 cm(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=tH.registry.get(s);if("function"!=typeof a)return tH.registry.onNotFound(s);let u=nV(a,this,r,t,n,l||{},i);return u?u.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,n){let r,i,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,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=nV(o,this,t,n,e,Object.assign(Object.assign({},i),{raw:!0}),this);return"string"==typeof l?cR.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=iq({},r,this.normalizeLabelPosition(n.position)),s=this.getLabelTransformationMatrix(o);i.setAttribute("transform",uz(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){return null===e?null:void 0===e?null===t?null:t:iq({},t,e)}getConnection(){return null!=this.path?this.path.clone():null}getConnectionPathData(){if(null==this.path)return"";let e=this.cache.pathCache;return r_(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(null==this.path)return null;let e=this.cache.pathCache;return r_(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;let e=this.cache.pathCache;return r_(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:(lU(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,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()},g=new cd(e,t),p=d.closestPointT(g,f),m=this.getConnectionLength()||0,y=d.lengthAtT(p,f);if(c&&(y=m>0?y/m:0),h&&(y=-1*(m-y)||1),l.distance=y,u||(o=d.tangentAtT(p)),o)s=o.pointOffset(g);else{let e=d.pointAtT(p),t=g.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,n=this.normalizeLabelPosition(e),r=n.options||{},i=n.angle||0,o=n.distance,s=0,l={x:0,y:0},a=n.offset;a&&("number"==typeof a?s=a:(null!=a.x&&(l.x=a.x),null!=a.y&&(l.y=a.y)));let u=0!==l.x||0!==l.y||0===s,c=r.keepGradient,h=r.ensureLegibility,d=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},g=o>0&&o<=1?o*this.getConnectionLength():o,p=d.tangentAtLength(g,f),m=i;if(p){if(u)(t=p.start).translate(l);else{let e=p.clone();e.rotate(-90,p.start),e.setLength(s),t=e.end}c&&(m=p.angle()+i,h&&(m=tM.normalize((m+90)%180-90)))}else t=d.start,u&&t.translate(l);return uL().translate(t.x,t.y).rotate(m)}getVertexIndex(e,t){let n=this.cell.getVertices(),r=this.getClosestPointLength(new cd(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(aP(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if("edge:remove"===t)return void this.cell.remove({ui:!0});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){this.can("edgeMovable")?this.setEventData(e,{x:t,y:n,moving:!1,action:"drag-edge"}):this.notifyUnhandledMouseDown(e,t,n)}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,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,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,g=o?o.cell:null,p="target"===i?n:e,m="target"===i?r:t,y=!0,b=l=>{let a="source"===i?s?s.port:null:g?g.getSourcePortId():null,u="target"===i?s?s.port:null:g?g.getTargetPortId():null;return nV(l,this.graph,{edge:g,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&&gF.isEdgeView(p)&&(y=!1):y=b(c)),y&&null!=u&&null==m&&("boolean"==typeof u?!u&&gV.isNodeView(p)&&(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 nV(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||nV(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,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 cd(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 g=n.terminalType,p=n.closestView,m=n.closestMagnet,y=h!==m;if(c&&y&&c.unhighlight(h,{type:"magnetAdsorbed"}),p){if(!y)return;p.highlight(m,{type:"magnetAdsorbed"}),i=p.getEdgeTerminal(m,e,t,this.cell,g)}else i={x:e,y:t};this.cell.setTerminal(g,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){"remove"===e.fallbackAction?this.cell.remove({ui:!0}):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&&!gk.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:cd.create(r).toJSON(),c=i.cell?o.getCellById(i.cell):null,h=i.port,d=c?o.findViewByCell(c):null,f=c?null:cd.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"))return void this.notifyUnhandledMouseDown(e,t,n);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=iq({},this.cell.getLabelAt(r.index),{position:this.getLabelPosition(t,n,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,i)}stopLabelDragging(e,t,n){}}(e4=gF||(gF={})).toStringTag=`X6.${e4.name}`,e4.isEdgeView=function(e){if(null==e)return!1;if(e instanceof e4)return!0;let t=e[Symbol.toStringTag];return(null==t||t===e4.toStringTag)&&"function"==typeof e.isNodeView&&"function"==typeof e.isEdgeView&&"function"==typeof e.confirmUpdate&&"function"==typeof e.update&&"function"==typeof e.getConnection||!1},gF.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"]}}),gF.registry.register("edge",gF,!0);class g$ extends dZ{get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:n}=tB.parseJSONMarkup(g$.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=g$.snapshoot(this.container),al(this.container,this.prefixClassName("graph")),aA(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&&gw.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();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=nV(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||(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 uY(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);nV(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)}([dZ.dispose()],g$.prototype,"dispose",null),e8=g$||(g$={}),S=`${dp.prefixCls}-graph`,e8.markup=[{ns:ag.xhtml,tagName:"div",selector:"background",className:`${S}-background`},{ns:ag.xhtml,tagName:"div",selector:"grid",className:`${S}-grid`},{ns:ag.svg,tagName:"svg",selector:"svg",className:`${S}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":ag.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${S}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${S}-svg-primer`},{tagName:"g",selector:"stage",className:`${S}-svg-stage`},{tagName:"g",selector:"decorator",className:`${S}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${S}-svg-overlay`}]}]}],e8.snapshoot=function(e){let t=e.cloneNode();return e.childNodes.forEach(e=>t.appendChild(e)),()=>{for(aO(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))}},e9=g$||(g$={}),P=dp.prefixCls,e9.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${P}-cell`]:"onMouseEnter",[`mouseleave .${P}-cell`]:"onMouseLeave",[`mouseenter .${P}-cell-tools`]:"onMouseEnter",[`mouseleave .${P}-cell-tools`]:"onMouseLeave",[`mousedown .${P}-cell [event]`]:"onCustomEvent",[`touchstart .${P}-cell [event]`]:"onCustomEvent",[`mousedown .${P}-cell [data-event]`]:"onCustomEvent",[`touchstart .${P}-cell [data-event]`]:"onCustomEvent",[`dblclick .${P}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${P}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${P}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${P}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${P}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${P}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${P}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${P}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${P}-cell image`]:"onImageDragStart",[`mousedown .${P}-edge .${P}-edge-label`]:"onLabelMouseDown",[`touchstart .${P}-edge .${P}-edge-label`]:"onLabelMouseDown"},e9.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};let gU=`.x6-graph {
272
+ position: relative;
273
+ overflow: hidden;
274
+ outline: none;
275
+ touch-action: none;
276
+ }
277
+ .x6-graph-background,
278
+ .x6-graph-grid,
279
+ .x6-graph-svg {
280
+ position: absolute;
281
+ top: 0;
282
+ right: 0;
283
+ bottom: 0;
284
+ left: 0;
285
+ }
286
+ .x6-graph-background-stage,
287
+ .x6-graph-grid-stage,
288
+ .x6-graph-svg-stage {
289
+ user-select: none;
290
+ }
291
+ .x6-graph.x6-graph-pannable {
292
+ cursor: grab;
293
+ cursor: -moz-grab;
294
+ cursor: -webkit-grab;
295
+ }
296
+ .x6-graph.x6-graph-panning {
297
+ cursor: grabbing;
298
+ cursor: -moz-grabbing;
299
+ cursor: -webkit-grabbing;
300
+ user-select: none;
301
+ }
302
+ .x6-node {
303
+ cursor: move;
304
+ /* stylelint-disable-next-line */
305
+ }
306
+ .x6-node.x6-node-immovable {
307
+ cursor: default;
308
+ }
309
+ .x6-node * {
310
+ -webkit-user-drag: none;
311
+ }
312
+ .x6-node .scalable * {
313
+ vector-effect: non-scaling-stroke;
314
+ }
315
+ .x6-node [magnet='true'] {
316
+ cursor: crosshair;
317
+ transition: opacity 0.3s;
318
+ }
319
+ .x6-node [magnet='true']:hover {
320
+ opacity: 0.7;
321
+ }
322
+ .x6-node foreignObject {
323
+ display: block;
324
+ overflow: visible;
325
+ background-color: transparent;
326
+ }
327
+ .x6-node foreignObject > body {
328
+ position: static;
329
+ width: 100%;
330
+ height: 100%;
331
+ margin: 0;
332
+ padding: 0;
333
+ overflow: visible;
334
+ background-color: transparent;
335
+ }
336
+ .x6-edge .source-marker,
337
+ .x6-edge .target-marker {
338
+ vector-effect: non-scaling-stroke;
339
+ }
340
+ .x6-edge .connection {
341
+ stroke-linejoin: round;
342
+ fill: none;
343
+ }
344
+ .x6-edge .connection-wrap {
345
+ cursor: move;
346
+ opacity: 0;
347
+ fill: none;
348
+ stroke: #000;
349
+ stroke-width: 15;
350
+ stroke-linecap: round;
351
+ stroke-linejoin: round;
352
+ }
353
+ .x6-edge .connection-wrap:hover {
354
+ opacity: 0.4;
355
+ stroke-opacity: 0.4;
356
+ }
357
+ .x6-edge .vertices {
358
+ cursor: move;
359
+ opacity: 0;
360
+ }
361
+ .x6-edge .vertices .vertex {
362
+ fill: #1abc9c;
363
+ }
364
+ .x6-edge .vertices .vertex :hover {
365
+ fill: #34495e;
366
+ stroke: none;
367
+ }
368
+ .x6-edge .vertices .vertex-remove {
369
+ cursor: pointer;
370
+ fill: #fff;
371
+ }
372
+ .x6-edge .vertices .vertex-remove-area {
373
+ cursor: pointer;
374
+ opacity: 0.1;
375
+ }
376
+ .x6-edge .vertices .vertex-group:hover .vertex-remove-area {
377
+ opacity: 1;
378
+ }
379
+ .x6-edge .arrowheads {
380
+ cursor: move;
381
+ opacity: 0;
382
+ }
383
+ .x6-edge .arrowheads .arrowhead {
384
+ fill: #1abc9c;
385
+ }
386
+ .x6-edge .arrowheads .arrowhead :hover {
387
+ fill: #f39c12;
388
+ stroke: none;
389
+ }
390
+ .x6-edge .tools {
391
+ cursor: pointer;
392
+ opacity: 0;
393
+ }
394
+ .x6-edge .tools .tool-options {
395
+ display: none;
396
+ }
397
+ .x6-edge .tools .tool-remove circle {
398
+ fill: #f00;
399
+ }
400
+ .x6-edge .tools .tool-remove path {
401
+ fill: #fff;
402
+ }
403
+ .x6-edge:hover .vertices,
404
+ .x6-edge:hover .arrowheads,
405
+ .x6-edge:hover .tools {
406
+ opacity: 1;
407
+ }
408
+ .x6-highlight-opacity {
409
+ opacity: 0.3;
410
+ }
411
+ .x6-cell-tool-editor {
412
+ position: relative;
413
+ display: inline-block;
414
+ min-height: 1em;
415
+ margin: 0;
416
+ padding: 0;
417
+ line-height: 1;
418
+ white-space: normal;
419
+ text-align: center;
420
+ vertical-align: top;
421
+ overflow-wrap: normal;
422
+ outline: none;
423
+ transform-origin: 0 0;
424
+ -webkit-user-drag: none;
425
+ }
426
+ .x6-edge-tool-editor {
427
+ border: 1px solid #275fc5;
428
+ border-radius: 2px;
429
+ }
430
+ `;class gG extends na{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 gH extends gG{init(){dp.autoInsertCSS&&cu("core",gU)}dispose(){cc("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)}([gH.dispose()],gH.prototype,"dispose",null);var gq=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};(e7=tY||(tY={})).get=function(e){let{grid:t,panning:n,mousewheel:r,embedding:i}=e,o=gq(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=iq({},e7.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},(tY||(tY={})).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:dp.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:dp.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 gL},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 gW=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 gJ extends gG{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({},gW(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,uo.create("pattern",{id:s,patternUnits:"userSpaceOnUse"},uo.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 g=h.oy%h.height;g<0&&(g+=h.height),a$(d,{x:f,y:g,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 c$),this.instance}resolveGrid(e){if(!e)return[];let t=e.type;if(null==t)return[Object.assign(Object.assign({},c$.presets.dot),e.args)];let n=c$.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 c$.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)}([gG.dispose()],gJ.prototype,"dispose",null);class gX extends gG{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),uL(this.viewportMatrix)}setMatrix(e){let t=uL(e),n=uz(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 lB(e)||(e=this.container.clientWidth),lB(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return uV(this.getMatrix())}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 lV(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 uF(this.getMatrix())}rotate(e,t,n){if(null==t||null==n){let e=tL.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(){return u$(this.getMatrix())}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=lq(n),o=r.border||0,s=r.contentArea?cf.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,g=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+=g=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 p=this.getComputedSize(),m=h!==p.width||d!==p.height;return(f!==a.tx||g!==a.ty)&&this.translate(f,g),m&&this.resize(h,d),new cf(-f/u,-g/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=cd.create(t)}else n=this.getContentBBox(e),r=this.graph.graphToLocal(n);if(!n.width||!n.height)return;let o=lq(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=cf.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,g=i.height/n.height*d.sy;!1!==e.preserveAspectRatio&&(f=g=Math.min(f,g));let p=e.scaleGrid;if(p&&(f=p*Math.floor(f/p),g=p*Math.floor(g/p)),f=lV(f,a,u),g=lV(g,c,h),this.scale(f,g),t){let e=this.options,t=i.x-r.x*f-e.x,n=i.y-r.y*g-e.y;this.translate(t,n)}}getContentArea(e={}){return!1!==e.useCellGeometry?this.model.getAllCellsBBox()||new cf:tL.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){let e=cf.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){let n=cf.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=lG(t,Math.max(0,r.width)))<0&&(t=r.width+t),(n=lG(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=cf.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 gY extends gG{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=cf.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=tA.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)}([gG.dispose()],gY.prototype,"dispose",null);class gQ extends gG{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),tx.on(this.graph.container,"mousedown",this.onRightMouseDown),this.mousewheelHandle=new u0(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),tx.off(this.graph.container,"mousedown",this.onRightMouseDown),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return this.pannable&&tS.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(),tx.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)}),tx.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(),tx.off(document.body,".panning"),tx.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?(al(e,t),aa(e,n)):(aa(e,t),al(e,n)):(aa(e,t),aa(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;(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.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)}([gG.dispose()],gQ.prototype,"dispose",null);class gZ extends gG{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 u0(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))&&tS.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){let t=this.widgetOptions.guard;if((null==t||t(e))&&tS.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);if((r=lV(r,this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,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)}([na.dispose()],gZ.prototype,"dispose",null);class gK extends gG{init(){this.resetRenderArea=nD(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)}([gG.dispose()],gK.prototype,"dispose",null);class g0{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&tQ.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}}(te=tQ||(tQ={}))[te.Update=2]="Update",te[te.RenderEdge=4]="RenderEdge",te[te.RenderNode=8]="RenderNode",te[te.PRIOR=1048576]="PRIOR";class g1 extends na{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new g0,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,g1.FLAG_INSERT,t,tQ.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,n={},r=tQ.Update,i=!0){let o=e.cell.id,s=this.views[o];!s||(s.flag=t,s.options=n,(e.hasAction(t,["translate","resize","rotate"])||!1===n.async)&&(r=tQ.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===g1.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=g1.FLAG_INSERT;else{let r=this.createCellView(e);r&&(r.graph=this.graph,i=g1.FLAG_INSERT|r.getBootstrapFlag(),o={view:r,flag:i,options:t,state:g1.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)||o.state===g1.ViewState.MOUNTED?o.flag=s=this.updateView(e,t,n):o.state=g1.ViewState.WAITING,s&&r.isEdge()&&(s&e.getFlag(["source","target"]))==0&&this.queue.queueJob({id:i,priority:tQ.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===g1.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(d3.isCellView(e)){if(t&g1.FLAG_REMOVE)return this.removeView(e.cell),0;t&g1.FLAG_INSERT&&(this.insertView(e),t^=g1.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=g1.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&&a7(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=nV(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=d3.registry.get(r);return n?new n(e,t):d3.registry.onNotFound(r)}return e.isNode()?new gV(e,t):e.isEdge()?new gF(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()?tQ.RenderNode:tQ.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)}([na.dispose()],g1.prototype,"dispose",null),(tt=g1||(g1={})).FLAG_INSERT=0x40000000,tt.FLAG_REMOVE=0x20000000,tt.FLAG_RENDER=0x3ffffff,(tr=(tn=g1||(g1={})).ViewState||(tn.ViewState={}))[tr.CREATED=0]="CREATED",tr[tr.MOUNTED=1]="MOUNTED",tr[tr.WAITING=2]="WAITING";class g2 extends gG{constructor(){super(...arguments),this.schedule=new g1(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=gw.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&&tL.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=cf.create(e);return this.model.getCells().map(e=>this.findViewByCell(e)).filter(e=>{if(e){if(t.nodeOnly&&!e.isNodeView())return!1;let r=tL.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)}([gG.dispose()],g2.prototype,"dispose",null);var g3=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 g6 extends gG{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}-${lI(JSON.stringify(e))}`),!this.isDefined(t)){let r=tT.registry.get(n);if(null==r)return tT.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});uo.create(tB.sanitize(i),o).appendTo(this.defs)}return t}gradient(e){let t=e.id,n=e.type;if(t||(t=`gradient-${n}-${this.cid}-${lI(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);uo.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=g3(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]),u=t;if(u||(u=`marker-${this.cid}-${lI(JSON.stringify(e))}`),!this.isDefined(u)){"path"!==s&&delete a.d;let e=uo.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=g3(e,["tagName"]);return uo.create(`${t}`||"path",aG(Object.assign(Object.assign({},a),n)))}):[uo.create(s||"path",aG(a))]);this.defs.appendChild(e.node)}return u}remove(e){let t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class g5 extends gG{getClientMatrix(){return uL(this.view.stage.getScreenCTM())}getClientOffset(){let e=this.view.svg.getBoundingClientRect();return new cd(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=cd.create(e,t);return tL.transformPoint(n,this.graph.matrix())}localToClientPoint(e,t){let n=cd.create(e,t);return tL.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=cf.create(e,t,n,r);return tL.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,n,r){let i=cf.create(e,t,n,r);return tL.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=cd.create(e,t);return tL.transformPoint(n,this.graph.matrix().inverse())}clientToLocalPoint(e,t){let n=cd.create(e,t);return tL.transformPoint(n,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){let n=cd.create(e,t);return tL.transformPoint(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){let n=cd.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(n)}graphToLocalRect(e,t,n,r){let i=cf.create(e,t,n,r);return tL.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,n,r){let i=cf.create(e,t,n,r);return tL.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,n,r){let i=cf.create(e,t,n,r);return tL.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,n,r){let i=cf.create(e,t,n,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}class g4 extends gG{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=t_.registry.get(i);return null==o?t_.registry.onNotFound(i):(t_.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(e,t){return ad(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)}([g4.dispose()],g4.prototype,"dispose",null);class g8 extends gG{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&&tC.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(){tC.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)}([gG.dispose()],g8.prototype,"dispose",null);class g9 extends sl{get container(){return this.options.container}get[Symbol.toStringTag](){return g9.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=tY.get(e),this.css=new gH(this),this.view=new g$(this),this.defs=new g6(this),this.coord=new g5(this),this.transform=new gX(this),this.highlight=new g4(this),this.grid=new gJ(this),this.background=new gY(this),this.options.model?this.model=this.options.model:(this.model=new gO,this.model.graph=this),this.renderer=new g2(this),this.panning=new gQ(this),this.mousewheel=new gZ(this),this.virtualRender=new gK(this),this.size=new g8(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=>gS.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=>gk.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 gw.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return cf.isRectangleLike(e)?this.findViewsInArea(e):cd.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 cf.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 cf.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 cf.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 cf.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 cf.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 cf.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 cf.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)||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)||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.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)}([sl.dispose()],g9.prototype,"dispose",null),(ti=g9||(g9={})).View=g$,ti.Renderer=g2,ti.MouseWheel=gZ,ti.DefsManager=g6,ti.GridManager=gJ,ti.CoordManager=g5,ti.TransformManager=gX,ti.HighlightManager=g4,ti.BackgroundManager=gY,ti.PanningManager=gQ,(to=g9||(g9={})).toStringTag=`X6.${to.name}`,to.isGraph=function(e){if(null==e)return!1;if(e instanceof to)return!0;let t=e[Symbol.toStringTag];return null==t||t===to.toStringTag},(ts=g9||(g9={})).render=function(e,t){let n=e instanceof HTMLElement?new ts({container:e}):new ts(e);return null!=t&&n.fromJSON(t),n},(tl=g9||(g9={})).registerNode=gS.registry.register,tl.registerEdge=gk.registry.register,tl.registerView=d3.registry.register,tl.registerAttr=tj.registry.register,tl.registerGrid=c$.registry.register,tl.registerFilter=tT.registry.register,tl.registerNodeTool=tF.registry.register,tl.registerEdgeTool=t$.registry.register,tl.registerBackground=tA.registry.register,tl.registerHighlighter=t_.registry.register,tl.registerPortLayout=tz.registry.register,tl.registerPortLabelLayout=tI.registry.register,tl.registerMarker=tN.registry.register,tl.registerRouter=tW.registry.register,tl.registerConnector=tJ.registry.register,tl.registerAnchor=tU.registry.register,tl.registerEdgeAnchor=tG.registry.register,tl.registerConnectionPoint=tH.registry.register,(ta=g9||(g9={})).unregisterNode=gS.registry.unregister,ta.unregisterEdge=gk.registry.unregister,ta.unregisterView=d3.registry.unregister,ta.unregisterAttr=tj.registry.unregister,ta.unregisterGrid=c$.registry.unregister,ta.unregisterFilter=tT.registry.unregister,ta.unregisterNodeTool=tF.registry.unregister,ta.unregisterEdgeTool=t$.registry.unregister,ta.unregisterBackground=tA.registry.unregister,ta.unregisterHighlighter=t_.registry.unregister,ta.unregisterPortLayout=tz.registry.unregister,ta.unregisterPortLabelLayout=tI.registry.unregister,ta.unregisterMarker=tN.registry.unregister,ta.unregisterRouter=tW.registry.unregister,ta.unregisterConnector=tJ.registry.unregister,ta.unregisterAnchor=tU.registry.unregister,ta.unregisterEdgeAnchor=tG.registry.unregister,ta.unregisterConnectionPoint=tH.registry.unregister;var g7=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 gS{}var pt=pe||(pe={});class pn extends gV{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:e}){let t=pt.shapeMaps[this.cell.shape];if(t){let{effect:n}=t;(!n||n.includes(e))&&this.renderHTMLComponent()}}confirmUpdate(e){let t=super.confirmUpdate(e);return this.handleAction(t,pn.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){let e=this.selectors&&this.selectors.foContent;if(e){aO(e);let t=pt.shapeMaps[this.cell.shape];if(!t)return;let{html:n}=t;"function"==typeof n&&(n=n(this.cell)),n&&("string"==typeof n?e.innerHTML=n:aA(e,n))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,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)})([pn.dispose()],pn.prototype,"dispose",null),pt.View=pn,(tu=pn=pt.View||(pt.View={})).action="html",tu.config({bootstrap:[tu.action],actions:{html:tu.action}}),gV.registry.register("html-view",tu,!0),(tc=pe||(pe={})).config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},tB.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),gS.registry.register("html",tc,!0),(th=pe||(pe={})).shapeMaps={},th.register=function(e){let{shape:t,html:n,effect:r,inherit:i}=e,o=g7(e,["shape","html","effect","inherit"]);if(!t)throw Error("should specify shape in config");th.shapeMaps[t]={html:n,effect:r},g9.registerNode(t,Object.assign({inherit:i||"html"},o),!0)}},7085:function(e,t,n){e.exports={graphlib:n(8102),layout:n(6775),debug:n(9066),util:{time:n(3285).time,notime:n(3285).notime},version:n(7405)}},3597:function(e,t,n){"use strict";var r=n(6796),i=n(5390);e.exports={run:function(e){var t,n,o,s,l,a="greedy"===e.graph().acyclicer?i(e,(t=e,function(e){return t.edge(e).weight})):(n=e,o=[],s={},l={},r.forEach(n.nodes(),function e(t){r.has(l,t)||(l[t]=!0,s[t]=!0,r.forEach(n.outEdges(t),function(t){r.has(s,t.w)?o.push(t):e(t.w)}),delete s[t])}),o);r.forEach(a,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)}})}}},5544:function(e,t,n){var r=n(6796),i=n(3285);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})}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)}})}},6089:function(e,t,n){"use strict";var r=n(6796);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}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&i(e)},undo:function(e){var t,n,o=e.graph().rankdir.toLowerCase();("bt"===o||"rl"===o)&&(t=e,r.forEach(t.nodes(),function(e){s(t.node(e))}),r.forEach(t.edges(),function(e){var n=t.edge(e);r.forEach(n.points,s),r.has(n,"y")&&s(n)})),("lr"===o||"rl"===o)&&(n=e,r.forEach(n.nodes(),function(e){l(n.node(e))}),r.forEach(n.edges(),function(e){var t=n.edge(e);r.forEach(t.points,l),r.has(t,"x")&&l(t)}),i(e))}}},2912: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(", ")+"]"}},9066:function(e,t,n){var r=n(6796),i=n(3285),o=n(8102).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}}},8102:function(e,t,n){var r;try{r=n(4363)}catch(e){}r||(r=window.graphlib),e.exports=r},5390:function(e,t,n){var r=n(6796),i=n(8102).Graph,o=n(2912);e.exports=function(e,t){if(1>=e.nodeCount())return[];var n,u,c,h,d,f,g,p=(n=e,u=t||s,c=new i,h=0,d=0,r.forEach(n.nodes(),function(e){c.setNode(e,{v:e,in:0,out:0})}),r.forEach(n.edges(),function(e){var t=c.edge(e.v,e.w)||0,n=u(e);c.setEdge(e.v,e.w,t+n),d=Math.max(d,c.node(e.v).out+=n),h=Math.max(h,c.node(e.w).in+=n)}),f=r.range(d+h+3).map(function(){return new o}),g=h+1,r.forEach(c.nodes(),function(e){a(f,g,c.node(e))}),{graph:c,buckets:f,zeroIdx:g}),m=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}(p.graph,p.buckets,p.zeroIdx);return r.flatten(r.map(m,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)}},6775:function(e,t,n){"use strict";var r=n(6796),i=n(3597),o=n(8086),s=n(7160),l=n(3285).normalizeRanks,a=n(5215),u=n(3285).removeEmptyRanks,c=n(2686),h=n(5544),d=n(6089),f=n(3258),g=n(2833),p=n(3285),m=n(8102).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?p.time:p.notime;n("layout",function(){var t=n(" buildLayoutGraph",function(){var t,n,i;return t=e,n=new m({multigraph:!0,compound:!0}),i=k(t.graph()),n.setGraph(r.merge({},b,P(i,y),r.pick(i,v))),r.forEach(t.nodes(),function(e){var i=k(t.node(e));n.setNode(e,r.defaults(P(i,x),w)),n.setParent(e,t.parent(e))}),r.forEach(t.edges(),function(e){var i=k(t.edge(e));n.setEdge(e,r.merge({},E,P(i,C),r.pick(i,S)))}),n});n(" runLayout",function(){var e,m;e=t,(m=n)(" makeSpaceForEdgeLabels",function(){var t,n;n=(t=e).graph(),n.ranksep/=2,r.forEach(t.edges(),function(e){var r=t.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}),m(" removeSelfEdges",function(){var t;t=e,r.forEach(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),m(" acyclic",function(){i.run(e)}),m(" nestingGraph.run",function(){c.run(e)}),m(" rank",function(){s(p.asNonCompoundGraph(e))}),m(" injectEdgeLabelProxies",function(){var t;t=e,r.forEach(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};p.addDummyNode(t,"edge-proxy",i,"_ep")}})}),m(" removeEmptyRanks",function(){u(e)}),m(" nestingGraph.cleanup",function(){c.cleanup(e)}),m(" normalizeRanks",function(){l(e)}),m(" assignRankMinMax",function(){var t,n;t=e,n=0,r.forEach(t.nodes(),function(e){var i=t.node(e);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,n=r.max(n,i.maxRank))}),t.graph().maxRank=n}),m(" removeEdgeLabelProxies",function(){var t;t=e,r.forEach(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}),m(" normalize.run",function(){o.run(e)}),m(" parentDummyChains",function(){a(e)}),m(" addBorderSegments",function(){h(e)}),m(" order",function(){f(e)}),m(" insertSelfEdges",function(){var t,n;t=e,n=p.buildLayerMatrix(t),r.forEach(n,function(e){var n=0;r.forEach(e,function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,function(e){p.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),m(" adjustCoordinateSystem",function(){d.adjust(e)}),m(" position",function(){g(e)}),m(" positionSelfEdges",function(){var t;t=e,r.forEach(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,s=n.x-i,l=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),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}})}),m(" removeBorderNodes",function(){var t;t=e,r.forEach(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),s=t.node(r.last(n.borderLeft)),l=t.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(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}),m(" normalize.undo",function(){o.undo(e)}),m(" fixupEdgeLabelCoords",function(){var t;t=e,r.forEach(t.edges(),function(e){var n=t.edge(e);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}})}),m(" undoCoordinateSystem",function(){d.undo(e)}),m(" translateGraph",function(){!function(e){var t=1/0,n=0,i=1/0,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)}),m(" assignNodeIntersects",function(){var t;t=e,r.forEach(t.edges(),function(e){var n,r,i=t.edge(e),o=t.node(e.v),s=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=s,r=o),i.points.unshift(p.intersectRect(o,n)),i.points.push(p.intersectRect(s,r))})}),m(" reversePoints",function(){var t;t=e,r.forEach(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}),m(" acyclic.undo",function(){i.undo(e)})}),n(" updateInputGraph",function(){var n,i;n=e,i=t,r.forEach(n.nodes(),function(e){var t=n.node(e),r=i.node(e);t&&(t.x=r.x,t.y=r.y,i.children(e).length&&(t.width=r.width,t.height=r.height))}),r.forEach(n.edges(),function(e){var t=n.edge(e),o=i.edge(e);t.points=o.points,r.has(o,"x")&&(t.x=o.x,t.y=o.y)}),n.graph().width=i.graph().width,n.graph().height=i.graph().height})})};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 k(e){var t={};return r.forEach(e,function(e,n){t[n.toLowerCase()]=e}),t}},6796:function(e,t,n){var r;try{r={cloneDeep:n(1454),constant:n(4961),defaults:n(3079),each:n(5288),filter:n(1807),find:n(9010),flatten:n(9607),forEach:n(1423),forIn:n(9841),has:n(7497),isUndefined:n(7169),last:n(1853),map:n(3551),mapValues:n(8401),max:n(6567),merge:n(6265),min:n(9213),minBy:n(8552),now:n(8593),pick:n(8644),range:n(8312),reduce:n(275),sortBy:n(220),uniqueId:n(9043),values:n(2099),zipObject:n(5613)}}catch(e){}r||(r=window._),e.exports=r},2686:function(e,t,n){var r=n(6796),i=n(3285);e.exports={run:function(e){var t,n,o,s=i.addDummyNode(e,"root",{},"_root"),l=(t=e,n={},r.forEach(t.children(),function(e){!function e(i,o){var s=t.children(i);s&&s.length&&r.forEach(s,function(t){e(t,o+1)}),n[i]=o}(e,1)}),n),a=r.max(r.values(l))-1,u=2*a+1;e.graph().nestingRoot=s,r.forEach(e.edges(),function(t){e.edge(t).minlen*=u});var c=(o=e,r.reduce(o.edges(),function(e,t){return e+o.edge(t).weight},0)+1);r.forEach(e.children(),function(t){!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,g=i.borderTop?s:2*s,p=c!==f?1:l-a[u]+1;t.setEdge(h,c,{weight:g,minlen:p,nestingEdge:!0}),t.setEdge(f,d,{weight:g,minlen:p,nestingEdge:!0})}),t.parent(u)||t.setEdge(n,h,{weight:0,minlen:l+a[u]})}(e,s,u,c,a,l,t)}),e.graph().nodeRankFactor=u},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)})}}},8086:function(e,t,n){"use strict";var r=n(6796),i=n(3285);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)})}}},1337:function(e,t,n){var r=n(6796);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)return void t.setEdge(s,l);l=r}})}},8877:function(e,t,n){var r=n(6796);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}})}},8911:function(e,t,n){var r=n(6796),i=n(8102).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}},4912:function(e,t,n){"use strict";var r=n(6796);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}},3258:function(e,t,n){"use strict";var r=n(6796),i=n(4543),o=n(4912),s=n(531),l=n(8911),a=n(1337),u=n(8102).Graph,c=n(3285);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})})}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 g,p=1/0,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<p&&(y=0,g=r.cloneDeep(f),p=b)}d(e,g)}},4543:function(e,t,n){"use strict";var r=n(6796);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}},5776:function(e,t,n){"use strict";var r=n(6796);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){!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}))}},531:function(e,t,n){var r=n(6796),i=n(8877),o=n(5776),s=n(4456);e.exports=function e(t,n,l,a){var u,c,h=t.children(n),d=t.node(n),f=d?d.borderLeft:void 0,g=d?d.borderRight:void 0,p={};f&&(h=r.filter(h,function(e){return e!==f&&e!==g}));var m=i(t,h);r.forEach(m,function(n){if(t.children(n.v).length){var i,o,s=e(t,n.v,l,a);p[n.v]=s,r.has(s,"barycenter")&&(i=n,o=s,r.isUndefined(i.barycenter)?(i.barycenter=o.barycenter,i.weight=o.weight):(i.barycenter=(i.barycenter*i.weight+o.barycenter*o.weight)/(i.weight+o.weight),i.weight+=o.weight))}});var y=o(m,l);u=y,c=p,r.forEach(u,function(e){e.vs=r.flatten(e.vs.map(function(e){return c[e]?c[e].vs:e}),!0)});var b=s(y,a);if(f&&(b.vs=r.flatten([f,b.vs,g],!0),t.predecessors(f).length)){var v=t.node(t.predecessors(f)[0]),x=t.node(t.predecessors(g)[0]);r.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+v.order+x.order)/(b.weight+2),b.weight+=2}return b}},4456:function(e,t,n){var r=n(6796),i=n(3285);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}e.exports=function(e,t){var n,s=i.partition(e,function(e){return r.has(e,"barycenter")}),l=s.lhs,a=r.sortBy(s.rhs,function(e){return-e.i}),u=[],c=0,h=0,d=0;l.sort((n=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i})),d=o(u,a,d),r.forEach(l,function(e){d+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,h+=e.weight,d=o(u,a,d)});var f={vs:r.flatten(u,!0)};return h&&(f.barycenter=c/h,f.weight=h),f}},5215:function(e,t,n){var r=n(6796);e.exports=function(e){var t,n,i,o=(t=e,n={},i=0,r.forEach(t.children(),function e(o){var s=i;r.forEach(t.children(o),e),n[o]={low:s,lim:i++}}),n);r.forEach(e.graph().dummyChains,function(t){for(var n=e.node(t),r=n.edgeObj,i=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 s.push(i=e.parent(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,o,r.v,r.w),s=i.path,l=i.lca,a=0,u=s[0],c=!0;t!==r.w;){if(n=e.node(t),c){for(;(u=s[a])!==l&&e.node(u).maxRank<n.rank;)a++;u===l&&(c=!1)}if(!c){for(;a<s.length-1&&e.node(u=s[a+1]).minRank<=n.rank;)a++;u=s[a]}e.setParent(t,u),t=e.successors(t)[0]}})}},5386:function(e,t,n){"use strict";var r=n(6796),i=n(8102).Graph,o=n(3285);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}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,u,c,h,d,f,g,p,m,y={},b=(l=e,a=t,u=n,c=s,g=new i,m=(h=(p=l.graph()).nodesep,d=p.edgesep,f=c,function(e,t,n){var i,o,s=e.node(t),l=e.node(n);if(i=0+s.width/2,r.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":o=-s.width/2;break;case"r":o=s.width/2}if(o&&(i+=f?o:-o),o=0,i+=(s.dummy?d:h)/2,i+=(l.dummy?d:h)/2,i+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":o=l.width/2;break;case"r":o=-l.width/2}return o&&(i+=f?o:-o),o=0,i}),r.forEach(a,function(e){var t;r.forEach(e,function(e){var n=u[e];if(g.setNode(n),t){var r=u[t],i=g.edge(r,n);g.setEdge(r,n,Math.max(m(l,e,t),i||0))}t=e})}),g),v=s?"borderLeft":"borderRight";function x(e,t){for(var n=b.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 x(function(e){y[e]=b.inEdges(e).reduce(function(e,t){return Math.max(e,y[t.v]+b.edge(t))},0)},b.predecessors.bind(b)),x(function(t){var n=b.outEdges(t).reduce(function(e,t){return Math.min(e,y[t.w]-b.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==v&&(y[t]=Math.max(y[t],n))},b.successors.bind(b)),r.forEach(o,function(e){y[e]=y[n[e]]}),y}function d(e,t){return r.minBy(r.values(t),function(t){var n=-1/0,i=1/0;return r.forIn(t,function(t,r){var o,s,l=(o=e,s=r,o.node(s).width/2);n=Math.max(t+l,n),i=Math.min(t-l,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 g(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})}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),g(a,e.graph().align)},findType1Conflicts:s,findType2Conflicts:l,addConflict:a,hasConflict:u,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:f,findSmallestWidthAlignment:d,balance:g}},2833:function(e,t,n){"use strict";var r=n(6796),i=n(3285),o=n(5386).positionX;e.exports=function(e){var t,n,s,l;t=e=i.asNonCompoundGraph(e),n=i.buildLayerMatrix(t),s=t.graph().ranksep,l=0,r.forEach(n,function(e){var n=r.max(r.map(e,function(e){return t.node(e).height}));r.forEach(e,function(e){t.node(e).y=l+n/2}),l+=n+s}),r.forEach(o(e),function(t,n){e.node(n).x=t})}},7972:function(e,t,n){"use strict";var r=n(6796),i=n(8102).Graph,o=n(4642).slack;e.exports=function(e){var t,n,s,l,a=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(a.setNode(u,{});t=a,n=e,r.forEach(t.nodes(),function e(i){r.forEach(n.nodeEdges(i),function(r){var s=r.v,l=i===s?r.w:s;t.hasNode(l)||o(n,r)||(t.setNode(l,{}),t.setEdge(i,l,{}),e(l))})}),t.nodeCount()<c;)s=function(e,t){return r.minBy(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)})}(a,e),l=a.hasNode(s.v)?o(e,s):-o(e,s),function(e,t,n){r.forEach(e.nodes(),function(e){t.node(e).rank+=n})}(a,e,l);return a}},7160:function(e,t,n){"use strict";var r=n(4642).longestPath,i=n(7972),o=n(8833);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":var t;r(t=e),i(t);break;case"longest-path":s(e)}};var s=r},8833:function(e,t,n){"use strict";var r=n(6796),i=n(7972),o=n(4642).slack,s=n(4642).longestPath,l=n(8102).alg.preorder,a=n(8102).alg.postorder,u=n(3285).simplify;function c(e){s(e=u(e));var t,n,r=i(e);for(f(r),h(r,e);t=g(r);)n=p(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){var r,i,o,s;r=e,i=t,o=n,s=r.node(o).parent,r.edge(o,s).cutvalue=d(r,i,o)})}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,c,h,d=s===o,f=t.edge(r).weight;if(l+=d?f:-f,u=e,c=n,h=a,u.hasEdge(c,h)){var g=e.edge(n,a).cutvalue;l+=d?-g:g}}}),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 g(e){return r.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function p(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,s,a,u,c=n.v,d=n.w;e.removeEdge(c,d),e.setEdge(i.v,i.w,{}),f(e),h(e,t),o=e,s=t,a=r.find(o.nodes(),function(e){return!s.node(e).parent}),u=(u=l(o,a)).slice(1),r.forEach(u,function(e){var t=o.node(e).parent,n=s.edge(e,t),r=!1;n||(n=s.edge(t,e),r=!0),s.node(e).rank=s.node(t).rank+(r?n.minlen:-n.minlen)})}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=f,c.initCutValues=h,c.calcCutValue=d,c.leaveEdge=g,c.enterEdge=p,c.exchangeEdges=m},4642:function(e,t,n){"use strict";var r=n(6796);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===1/0||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}}},3285:function(e,t,n){"use strict";var r=n(6796),i=n(8102).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}function s(e){return r.max(r.map(e.nodes(),function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n}))}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()}}},7405:function(e){e.exports="0.8.5"},4363:function(e,t,n){var r=n(507);e.exports={Graph:r.Graph,json:n(4509),alg:n(6706),version:r.version}},12:function(e,t,n){var r=n(7298);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}},5617:function(e,t,n){var r=n(7298);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}},1060:function(e,t,n){var r=n(5194),i=n(7298);e.exports=function(e,t,n){return i.transform(e.nodes(),function(i,o){i[o]=r(e,o,t,n)},{})}},5194:function(e,t,n){var r=n(7298),i=n(3224);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:1/0;l[e]={distance:n},a.add(e,n)});a.size()>0&&(s=l[o=a.removeMin()]).distance!==1/0;)r(o).forEach(u);return l}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6075:function(e,t,n){var r=n(7298),i=n(1092);e.exports=function(e){return r.filter(i(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},2845:function(e,t,n){var r=n(7298);e.exports=function(e,t,n){var r,o,s,l,a;return r=e,o=t||i,s=n||function(t){return e.outEdges(t)},l={},(a=r.nodes()).forEach(function(e){l[e]={},l[e][e]={distance:0},a.forEach(function(t){e!==t&&(l[e][t]={distance:1/0})}),s(e).forEach(function(t){var n=t.v===e?t.w:t.v,r=o(t);l[e][n]={distance:r,predecessor:e}})}),a.forEach(function(e){var t=l[e];a.forEach(function(n){var r=l[n];a.forEach(function(n){var i=r[e],o=t[n],s=r[n],l=i.distance+o.distance;l<s.distance&&(s.distance=l,s.predecessor=o.predecessor)})})}),l};var i=r.constant(1)},6706:function(e,t,n){e.exports={components:n(12),dijkstra:n(5194),dijkstraAll:n(1060),findCycles:n(6075),floydWarshall:n(2845),isAcyclic:n(4637),postorder:n(3236),preorder:n(939),prim:n(6964),tarjan:n(1092),topsort:n(5509)}},4637:function(e,t,n){var r=n(5509);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},3236:function(e,t,n){var r=n(5617);e.exports=function(e,t){return r(e,t,"post")}},939:function(e,t,n){var r=n(5617);e.exports=function(e,t){return r(e,t,"pre")}},6964:function(e,t,n){var r=n(7298),i=n(6915),o=n(3224);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,1/0),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}},1092:function(e,t,n){var r=n(7298);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}},5509:function(e,t,n){var r=n(7298);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()},3224:function(e,t,n){var r=n(7298);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}},6915:function(e,t,n){"use strict";var r=n(7298);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)}function a(e,t){return l(e,t.v,t.w,t.name)}e.exports=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._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){return 0===(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))}},507:function(e,t,n){e.exports={Graph:n(6915),version:n(9235)}},4509:function(e,t,n){var r=n(7298),i=n(6915);e.exports={write:function(e){var t,n,i={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e,r.map(t.nodes(),function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o})),edges:(n=e,r.map(n.edges(),function(e){var t=n.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(t)||(i.value=t),i}))};return r.isUndefined(e.graph())||(i.value=r.clone(e.graph())),i},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}}},7298:function(e,t,n){var r;try{r={clone:n(5488),constant:n(4961),each:n(5288),filter:n(1807),has:n(7497),isArray:n(9464),isEmpty:n(5276),isFunction:n(6553),isUndefined:n(7169),keys:n(9125),map:n(3551),reduce:n(275),size:n(7932),transform:n(1753),union:n(1942),values:n(2099)}}catch(e){}r||(r=window._),e.exports=r},9235:function(e){e.exports="2.1.8"},7737:function(e,t,n){e.exports=n(3789)(n(5036),"DataView")},5072:function(e,t,n){var r=n(9763),i=n(3879),o=n(8150),s=n(7106),l=n(938);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},5332:function(e,t,n){var r=n(3023),i=n(4747),o=n(9978),s=n(6734),l=n(4710);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},16:function(e,t,n){e.exports=n(3789)(n(5036),"Map")},1708:function(e,t,n){var r=n(615),i=n(9859),o=n(5170),s=n(8470),l=n(7646);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},1767:function(e,t,n){e.exports=n(3789)(n(5036),"Promise")},7802:function(e,t,n){e.exports=n(3789)(n(5036),"Set")},6874:function(e,t,n){var r=n(1708),i=n(9871),o=n(1772);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},9310:function(e,t,n){var r=n(5332),i=n(9333),o=n(1893),s=n(9676),l=n(6536),a=n(3336);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},7432:function(e,t,n){e.exports=n(5036).Symbol},181:function(e,t,n){e.exports=n(5036).Uint8Array},20:function(e,t,n){e.exports=n(3789)(n(5036),"WeakMap")},9822: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)}},2130: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}},5773: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}},3574:function(e,t,n){var r=n(2712);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},9106: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}},6272:function(e,t,n){var r=n(8355),i=n(7933),o=n(9464),s=n(5752),l=n(1574),a=n(264),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,g=f?r(e.length,String):[],p=g.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,p)))&&g.push(m);return g}},6233: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}},1595: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}},2609: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}},119: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}},256:function(e,t,n){e.exports=n(4024)("length")},3688:function(e,t,n){var r=n(6571),i=n(9679);e.exports=function(e,t,n){(void 0===n||i(e[t],n))&&(void 0!==n||t in e)||r(e,t,n)}},6312:function(e,t,n){var r=n(6571),i=n(9679),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)}},5096:function(e,t,n){var r=n(9679);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},2516:function(e,t,n){var r=n(5634),i=n(9125);e.exports=function(e,t){return e&&r(t,i(t),e)}},5771:function(e,t,n){var r=n(5634),i=n(7798);e.exports=function(e,t){return e&&r(t,i(t),e)}},6571:function(e,t,n){var r=n(6514);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9192:function(e,t,n){var r=n(9310),i=n(2130),o=n(6312),s=n(2516),l=n(5771),a=n(1733),u=n(5240),c=n(6752),h=n(4239),d=n(1679),f=n(6628),g=n(1344),p=n(7928),m=n(4290),y=n(6082),b=n(9464),v=n(5752),x=n(6043),w=n(6130),C=n(6885),E=n(9125),S=n(7798),P="[object Arguments]",k="[object Function]",M="[object Object]",O={};O[P]=O["[object Array]"]=O["[object ArrayBuffer]"]=O["[object DataView]"]=O["[object Boolean]"]=O["[object Date]"]=O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Map]"]=O["[object Number]"]=O[M]=O["[object RegExp]"]=O["[object Set]"]=O["[object String]"]=O["[object Symbol]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O["[object Error]"]=O[k]=O["[object WeakMap]"]=!1,e.exports=function e(t,n,A,T,N,j){var L,R=1&n,_=2&n,z=4&n;if(A&&(L=N?A(t,T,N,j):A(t)),void 0!==L)return L;if(!w(t))return t;var I=b(t);if(I){if(L=p(t),!R)return u(t,L)}else{var D=g(t),B=D==k||"[object GeneratorFunction]"==D;if(v(t))return a(t,R);if(D==M||D==P||B&&!N){if(L=_||B?{}:y(t),!R)return _?h(t,l(L,t)):c(t,s(L,t))}else{if(!O[D])return N?t:{};L=m(t,D,R)}}j||(j=new r);var V=j.get(t);if(V)return V;j.set(t,L),C(t)?t.forEach(function(r){L.add(e(r,n,A,r,t,j))}):x(t)&&t.forEach(function(r,i){L.set(i,e(r,n,A,i,t,j))});var F=z?_?f:d:_?S:E,$=I?void 0:F(t);return i($||t,function(r,i){$&&(r=t[i=r]),o(L,i,e(r,n,A,i,t,j))}),L}},6309:function(e,t,n){var r=n(6130),i=Object.create;e.exports=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}}()},9040:function(e,t,n){var r=n(5828);e.exports=n(251)(r)},5330:function(e,t,n){var r=n(5733);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}},9479:function(e,t,n){var r=n(9040);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},8052: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}},5951:function(e,t,n){var r=n(1595),i=n(8352);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}},4350:function(e,t,n){e.exports=n(2294)()},5828:function(e,t,n){var r=n(4350),i=n(9125);e.exports=function(e,t){return e&&r(e,t,i)}},3117:function(e,t,n){var r=n(8328),i=n(1966);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}},4090:function(e,t,n){var r=n(1595),i=n(9464);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},6077:function(e,t,n){var r=n(7432),i=n(4444),o=n(3371),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)}},638:function(e){e.exports=function(e,t){return e>t}},4865:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},2282:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},2712:function(e,t,n){var r=n(8052),i=n(1264),o=n(7635);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},5301:function(e,t,n){var r=n(6077),i=n(4189);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},6161:function(e,t,n){var r=n(4715),i=n(4189);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)}},4715:function(e,t,n){var r=n(9310),i=n(8832),o=n(391),s=n(2132),l=n(1344),a=n(9464),u=n(5752),c=n(264),h="[object Arguments]",d="[object Array]",f="[object Object]",g=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,p,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,p,m,y):o(e,t,x,n,p,m,y);if(!(1&n)){var P=C&&g.call(e,"__wrapped__"),k=E&&g.call(t,"__wrapped__");if(P||k){var M=P?e.value():e,O=k?t.value():t;return y||(y=new r),m(M,O,n,p,y)}}return!!S&&(y||(y=new r),s(e,t,n,p,m,y))}},1939:function(e,t,n){var r=n(1344),i=n(4189);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},2272:function(e,t,n){var r=n(9310),i=n(6161);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 g=o(h,d,c,e,t,f);if(!(void 0===g?i(d,h,3,o,f):g))return!1}}return!0}},1264:function(e){e.exports=function(e){return e!=e}},9950:function(e,t,n){var r=n(6553),i=n(3909),o=n(6130),s=n(2760),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))}},8685:function(e,t,n){var r=n(1344),i=n(4189);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},8912:function(e,t,n){var r=n(6077),i=n(5841),o=n(4189),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)]}},2916:function(e,t,n){var r=n(3052),i=n(2273),o=n(515),s=n(9464),l=n(416);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)}},4829:function(e,t,n){var r=n(2632),i=n(9963),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}},9262:function(e,t,n){var r=n(6130),i=n(2632),o=n(312),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}},6609:function(e){e.exports=function(e,t){return e<t}},5703:function(e,t,n){var r=n(9040),i=n(623);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}},3052:function(e,t,n){var r=n(2272),i=n(3145),o=n(9738);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)}}},2273:function(e,t,n){var r=n(6161),i=n(613),o=n(8146),s=n(3297),l=n(1685),a=n(9738),u=n(1966);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)}}},7745:function(e,t,n){var r=n(9310),i=n(3688),o=n(4350),s=n(5243),l=n(6130),a=n(7798),u=n(8837);e.exports=function e(t,n,c,h,d){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)}},5243:function(e,t,n){var r=n(3688),i=n(1733),o=n(1058),s=n(5240),l=n(6082),a=n(7933),u=n(9464),c=n(8796),h=n(5752),d=n(6553),f=n(6130),g=n(6446),p=n(264),m=n(8837),y=n(1941);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)return void r(e,n,S);var P=x?x(C,E,n+"",e,t,w):void 0,k=void 0===P;if(k){var M=u(E),O=!M&&h(E),A=!M&&!O&&p(E);P=E,M||O||A?u(C)?P=C:c(C)?P=s(C):O?(k=!1,P=i(E,!0)):A?(k=!1,P=o(E,!0)):P=[]:g(E)||a(E)?(P=C,a(C)?P=y(C):(!f(C)||d(C))&&(P=l(E))):k=!1}k&&(w.set(E,P),v(P,E,b,x,w),w.delete(E)),r(e,n,P)}},5004:function(e,t,n){var r=n(6233),i=n(3117),o=n(2916),s=n(5703),l=n(4244),a=n(7746),u=n(8609),c=n(515),h=n(9464);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)})}},3612:function(e,t,n){var r=n(6333),i=n(8146);e.exports=function(e,t){return r(e,t,function(t,n){return i(e,n)})}},6333:function(e,t,n){var r=n(3117),i=n(6601),o=n(8328);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}},4024:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},4822:function(e,t,n){var r=n(3117);e.exports=function(e){return function(t){return r(t,e)}}},5888: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}},171: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}},8339:function(e,t,n){var r=n(515),i=n(4088),o=n(6218);e.exports=function(e,t){return o(i(e,t,r),e+"")}},6601:function(e,t,n){var r=n(6312),i=n(8328),o=n(1574),s=n(6130),l=n(1966);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]),g=n;if("__proto__"===f||"constructor"===f||"prototype"===f)break;if(u!=h){var p=d[f];void 0===(g=a?a(p,f,d):void 0)&&(g=s(p)?p:o(t[u+1])?[]:{})}r(d,f,g),d=d[f]}return e}},5193:function(e,t,n){var r=n(4961),i=n(6514),o=n(515);e.exports=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o},4244:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8355:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},8761:function(e,t,n){var r=n(7432),i=n(6233),o=n(9464),s=n(5733),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}},7625:function(e,t,n){var r=n(5531),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7746:function(e){e.exports=function(e){return function(t){return e(t)}}},4900:function(e,t,n){var r=n(6874),i=n(3574),o=n(9106),s=n(4854),l=n(754),a=n(4886);e.exports=function(e,t,n){var u=-1,c=i,h=e.length,d=!0,f=[],g=f;if(n)d=!1,c=o;else if(h>=200){var p=t?null:l(e);if(p)return a(p);d=!1,c=s,g=new r}else g=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=g.length;b--;)if(g[b]===y)continue e;t&&g.push(y),f.push(m)}else c(g,y,n)||(g!==f&&g.push(y),f.push(m))}return f}},4923:function(e,t,n){var r=n(6233);e.exports=function(e,t){return r(t,function(t){return e[t]})}},3141: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}},4854:function(e){e.exports=function(e,t){return e.has(t)}},8795:function(e,t,n){var r=n(515);e.exports=function(e){return"function"==typeof e?e:r}},8328:function(e,t,n){var r=n(9464),i=n(3297),o=n(5643),s=n(8753);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},990:function(e,t,n){var r=n(181);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},1733:function(e,t,n){e=n.nmd(e);var r=n(5036),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}},9842:function(e,t,n){var r=n(990);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},7054: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}},6923:function(e,t,n){var r=n(7432),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1058:function(e,t,n){var r=n(990);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},5619:function(e,t,n){var r=n(5733);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}},8609:function(e,t,n){var r=n(5619);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}},5240: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}},5634:function(e,t,n){var r=n(6312),i=n(6571);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}},6752:function(e,t,n){var r=n(5634),i=n(1809);e.exports=function(e,t){return r(e,i(e),t)}},4239:function(e,t,n){var r=n(5634),i=n(9242);e.exports=function(e,t){return r(e,i(e),t)}},4780:function(e,t,n){e.exports=n(5036)["__core-js_shared__"]},1094:function(e,t,n){var r=n(8339),i=n(4661);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})}},251:function(e,t,n){var r=n(623);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}}},2294: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}}},5207:function(e,t,n){var r=n(2916),i=n(623),o=n(9125);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}}},9335:function(e,t,n){var r=n(5888),i=n(4661),o=n(5187);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)}}},754:function(e,t,n){var r=n(7802),i=n(3125),o=n(4886);e.exports=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i},6514:function(e,t,n){var r=n(3789);e.exports=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},8832:function(e,t,n){var r=n(6874),i=n(119),o=n(4854);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 g=-1,p=!0,m=2&n?new r:void 0;for(a.set(e,t),a.set(t,e);++g<c;){var y=e[g],b=t[g];if(s)var v=u?s(b,y,g,t,e,a):s(y,b,g,e,t,a);if(void 0!==v){if(v)continue;p=!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)})){p=!1;break}}else if(!(y===b||l(y,b,n,s,a))){p=!1;break}}return a.delete(e),a.delete(t),p}},391:function(e,t,n){var r=n(7432),i=n(181),o=n(9679),s=n(8832),l=n(5860),a=n(4886),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 g=1&r;if(f||(f=a),e.size!=t.size&&!g)break;var p=d.get(e);if(p)return p==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}},2132:function(e,t,n){var r=n(1679),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),g=l.get(t);if(f&&g)return f==t&&g==e;var p=!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)){p=!1;break}m||(m="constructor"==d)}if(p&&!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)&&(p=!1)}return l.delete(e),l.delete(t),p}},565:function(e,t,n){var r=n(9607),i=n(4088),o=n(6218);e.exports=function(e){return o(i(e,void 0,r),e+"")}},8565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},1679:function(e,t,n){var r=n(4090),i=n(1809),o=n(9125);e.exports=function(e){return r(e,o,i)}},6628:function(e,t,n){var r=n(4090),i=n(9242),o=n(7798);e.exports=function(e){return r(e,o,i)}},5930:function(e,t,n){var r=n(29);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},3145:function(e,t,n){var r=n(1685),i=n(9125);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}},3789:function(e,t,n){var r=n(9950),i=n(8869);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},4754:function(e,t,n){e.exports=n(2344)(Object.getPrototypeOf,Object)},4444:function(e,t,n){var r=n(7432),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}},1809:function(e,t,n){var r=n(5773),i=n(3864),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols;e.exports=s?function(e){return null==e?[]:r(s(e=Object(e)),function(t){return o.call(e,t)})}:i},9242:function(e,t,n){var r=n(1595),i=n(4754),o=n(1809),s=n(3864);e.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:s},1344:function(e,t,n){var r=n(7737),i=n(16),o=n(1767),s=n(7802),l=n(20),a=n(6077),u=n(2760),c="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",g="[object DataView]",p=u(r),m=u(i),y=u(o),b=u(s),v=u(l),x=a;(r&&x(new r(new ArrayBuffer(1)))!=g||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 p:return g;case m:return c;case y:return h;case b:return d;case v:return f}return t}),e.exports=x},8869:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},3773:function(e,t,n){var r=n(8328),i=n(7933),o=n(9464),s=n(1574),l=n(5841),a=n(1966);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))}},5675:function(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},9763:function(e,t,n){var r=n(267);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3879:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},8150:function(e,t,n){var r=n(267),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}},7106:function(e,t,n){var r=n(267),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},938:function(e,t,n){var r=n(267);e.exports=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},7928: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}},4290:function(e,t,n){var r=n(990),i=n(9842),o=n(7054),s=n(6923),l=n(1058);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)}}},6082:function(e,t,n){var r=n(6309),i=n(4754),o=n(2632);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},8352:function(e,t,n){var r=n(7432),i=n(7933),o=n(9464),s=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(s&&e&&e[s])}},1574: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}},4661:function(e,t,n){var r=n(9679),i=n(623),o=n(1574),s=n(6130);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)}},3297:function(e,t,n){var r=n(9464),i=n(5733),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)}},29:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},3909:function(e,t,n){var r,i=n(4780),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},2632:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},1685:function(e,t,n){var r=n(6130);e.exports=function(e){return e==e&&!r(e)}},3023:function(e){e.exports=function(){this.__data__=[],this.size=0}},4747:function(e,t,n){var r=n(5096),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)}},9978:function(e,t,n){var r=n(5096);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},6734:function(e,t,n){var r=n(5096);e.exports=function(e){return r(this.__data__,e)>-1}},4710:function(e,t,n){var r=n(5096);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}},615:function(e,t,n){var r=n(5072),i=n(5332),o=n(16);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},9859:function(e,t,n){var r=n(5930);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=!!t,t}},5170:function(e,t,n){var r=n(5930);e.exports=function(e){return r(this,e).get(e)}},8470:function(e,t,n){var r=n(5930);e.exports=function(e){return r(this,e).has(e)}},7646:function(e,t,n){var r=n(5930);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=+(n.size!=i),this}},5860:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},9738:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},5647:function(e,t,n){var r=n(7105);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},267:function(e,t,n){e.exports=n(3789)(Object,"create")},9963:function(e,t,n){e.exports=n(2344)(Object.keys,Object)},312:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},1172:function(e,t,n){e=n.nmd(e);var r=n(8565),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},3371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},2344:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},4088:function(e,t,n){var r=n(9822),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)}}},5036:function(e,t,n){var r=n(8565),i="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||i||Function("return this")()},8837:function(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},9871:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1772:function(e){e.exports=function(e){return this.__data__.has(e)}},4886:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},6218:function(e,t,n){var r=n(5193);e.exports=n(5366)(r)},5366: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)}}},9333:function(e,t,n){var r=n(5332);e.exports=function(){this.__data__=new r,this.size=0}},1893:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},9676:function(e){e.exports=function(e){return this.__data__.get(e)}},6536:function(e){e.exports=function(e){return this.__data__.has(e)}},3336:function(e,t,n){var r=n(5332),i=n(16),o=n(1708);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}},7635: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}},2399:function(e,t,n){var r=n(256),i=n(5675),o=n(84);e.exports=function(e){return i(e)?o(e):r(e)}},5643:function(e,t,n){var r=n(5647),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g;e.exports=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})},1966:function(e,t,n){var r=n(5733),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}},2760: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""}},5531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},84: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}},5488:function(e,t,n){var r=n(9192);e.exports=function(e){return r(e,4)}},1454:function(e,t,n){var r=n(9192);e.exports=function(e){return r(e,5)}},4961:function(e){e.exports=function(e){return function(){return e}}},3079:function(e,t,n){var r=n(8339),i=n(9679),o=n(4661),s=n(7798),l=Object.prototype,a=l.hasOwnProperty;e.exports=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 g=h[d],p=e[g];(void 0===p||i(p,l[g])&&!a.call(e,g))&&(e[g]=c[g])}return e})},5288:function(e,t,n){e.exports=n(1423)},9679:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},1807:function(e,t,n){var r=n(5773),i=n(9479),o=n(2916),s=n(9464);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},9010:function(e,t,n){e.exports=n(5207)(n(3276))},3276:function(e,t,n){var r=n(8052),i=n(2916),o=n(464),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)}},9607:function(e,t,n){var r=n(5951);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},1423:function(e,t,n){var r=n(2130),i=n(9040),o=n(8795),s=n(9464);e.exports=function(e,t){return(s(e)?r:i)(e,o(t))}},9841:function(e,t,n){var r=n(4350),i=n(8795),o=n(7798);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},613:function(e,t,n){var r=n(3117);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},7497:function(e,t,n){var r=n(4865),i=n(3773);e.exports=function(e,t){return null!=e&&i(e,t,r)}},8146:function(e,t,n){var r=n(2282),i=n(3773);e.exports=function(e,t){return null!=e&&i(e,t,r)}},515:function(e){e.exports=function(e){return e}},7933:function(e,t,n){var r=n(5301),i=n(4189),o=Object.prototype,s=o.hasOwnProperty,l=o.propertyIsEnumerable;e.exports=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!l.call(e,"callee")}},9464:function(e){e.exports=Array.isArray},623:function(e,t,n){var r=n(6553),i=n(5841);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},8796:function(e,t,n){var r=n(623),i=n(4189);e.exports=function(e){return i(e)&&r(e)}},5752:function(e,t,n){e=n.nmd(e);var r=n(5036),i=n(8042),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},5276:function(e,t,n){var r=n(4829),i=n(1344),o=n(7933),s=n(9464),l=n(623),a=n(5752),u=n(2632),c=n(264),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}},6553:function(e,t,n){var r=n(6077),i=n(6130);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}},5841:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},6043:function(e,t,n){var r=n(1939),i=n(7746),o=n(1172),s=o&&o.isMap;e.exports=s?i(s):r},6130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},4189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},6446:function(e,t,n){var r=n(6077),i=n(4754),o=n(4189),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}},6885:function(e,t,n){var r=n(8685),i=n(7746),o=n(1172),s=o&&o.isSet;e.exports=s?i(s):r},7072:function(e,t,n){var r=n(6077),i=n(9464),o=n(4189);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},5733:function(e,t,n){var r=n(6077),i=n(4189);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},264:function(e,t,n){var r=n(8912),i=n(7746),o=n(1172),s=o&&o.isTypedArray;e.exports=s?i(s):r},7169:function(e){e.exports=function(e){return void 0===e}},9125:function(e,t,n){var r=n(6272),i=n(4829),o=n(623);e.exports=function(e){return o(e)?r(e):i(e)}},7798:function(e,t,n){var r=n(6272),i=n(9262),o=n(623);e.exports=function(e){return o(e)?r(e,!0):i(e)}},1853:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},3551:function(e,t,n){var r=n(6233),i=n(2916),o=n(5703),s=n(9464);e.exports=function(e,t){return(s(e)?r:o)(e,i(t,3))}},8401:function(e,t,n){var r=n(6571),i=n(5828),o=n(2916);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}},6567:function(e,t,n){var r=n(5330),i=n(638),o=n(515);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},7105:function(e,t,n){var r=n(1708);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},6265:function(e,t,n){var r=n(7745);e.exports=n(1094)(function(e,t,n){r(e,t,n)})},9213:function(e,t,n){var r=n(5330),i=n(6609),o=n(515);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},8552:function(e,t,n){var r=n(5330),i=n(2916),o=n(6609);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3125:function(e){e.exports=function(){}},8593:function(e,t,n){var r=n(5036);e.exports=function(){return r.Date.now()}},8644:function(e,t,n){var r=n(3612);e.exports=n(565)(function(e,t){return null==e?{}:r(e,t)})},416:function(e,t,n){var r=n(4024),i=n(4822),o=n(3297),s=n(1966);e.exports=function(e){return o(e)?r(s(e)):i(e)}},8312:function(e,t,n){e.exports=n(9335)()},275:function(e,t,n){var r=n(2609),i=n(9040),o=n(2916),s=n(171),l=n(9464);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)}},7932:function(e,t,n){var r=n(4829),i=n(1344),o=n(623),s=n(7072),l=n(2399);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}},220:function(e,t,n){var r=n(5951),i=n(5004),o=n(8339),s=n(4661);e.exports=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),[])})},3864:function(e){e.exports=function(){return[]}},8042:function(e){e.exports=function(){return!1}},5187:function(e,t,n){var r=n(2909),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}},464:function(e,t,n){var r=n(5187);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},2909:function(e,t,n){var r=n(7625),i=n(6130),o=n(5733),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}},1941:function(e,t,n){var r=n(5634),i=n(7798);e.exports=function(e){return r(e,i(e))}},8753:function(e,t,n){var r=n(8761);e.exports=function(e){return null==e?"":r(e)}},1753:function(e,t,n){var r=n(2130),i=n(6309),o=n(5828),s=n(2916),l=n(4754),a=n(9464),u=n(5752),c=n(6553),h=n(6130),d=n(264);e.exports=function(e,t,n){var f=a(e),g=f||u(e)||d(e);if(t=s(t,4),null==n){var p=e&&e.constructor;n=g?f?new p:[]:h(e)&&c(p)?i(l(e)):{}}return(g?r:o)(e,function(e,r,i){return t(n,e,r,i)}),n}},1942:function(e,t,n){var r=n(5951),i=n(8339),o=n(4900),s=n(8796);e.exports=i(function(e){return o(r(e,1,s,!0))})},9043:function(e,t,n){var r=n(8753),i=0;e.exports=function(e){var t=++i;return r(e)+t}},2099:function(e,t,n){var r=n(4923),i=n(9125);e.exports=function(e){return null==e?[]:r(e,i(e))}},5613:function(e,t,n){var r=n(6312),i=n(3141);e.exports=function(e,t){return i(e||[],t||[],r)}},9006:function(e,t,n){"use strict";var r,i,o,s,l,a,u=n(9155),c=n(7433);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 g(e,t){p(e,t),p(e+"Capture",t)}function p(e,t){for(f[e]=t,e=0;e<t.length;e++)d.add(t[e])}var m="u">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;(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 k=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),O=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),L=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),D=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var B=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var V=Symbol.iterator;function F(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=V&&e[V]||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 J(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function X(e){e._valueTracker||(e._valueTracker=function(e){var t=J(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 Y(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=J(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Q(e){if(void 0===(e=e||("u">typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(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 K(e,t){var n=null==t.defaultValue?"":t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:n=W(null!=t.value?t.value: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)return void e.removeAttribute("value");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,eg=(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)}},"u">typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return ed(e,t,n,r)})}:ed);function ep(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,ek=null,eM=null;function eO(e){if(e=rz(e)){if("function"!=typeof eP)throw Error(h(280));var t=e.stateNode;t&&(t=rD(t),eP(e.stateNode,e.type,t))}}function eA(e){ek?eM?eM.push(e):eM=[e]:ek=e}function eT(){if(ek){var e=ek,t=eM;if(eM=ek=null,eO(e),t)for(e=0;e<t.length;e++)eO(t[e])}}function eN(e,t){return e(t)}function ej(){}var eL=!1;function eR(e,t,n){if(eL)return e(t,n);eL=!0;try{return eN(e,t,n)}finally{eL=!1,(null!==ek||null!==eM)&&(ej(),eT())}}function e_(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 ez=!1;if(m)try{var eI={};Object.defineProperty(eI,"passive",{get:function(){ez=!0}}),window.addEventListener("test",eI,eI),window.removeEventListener("test",eI,eI)}catch(e){ez=!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 eB=!1,eV=null,eF=!1,e$=null,eU={onError:function(e){eB=!0,eV=e}};function eG(e,t,n,r,i,o,s,l,a){eB=!1,eV=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 eJ(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 eX=c.unstable_scheduleCallback,eY=c.unstable_cancelCallback,eQ=c.unstable_shouldYield,eZ=c.unstable_requestPaint,eK=c.unstable_now,e0=c.unstable_getCurrentPriorityLevel,e1=c.unstable_ImmediatePriority,e2=c.unstable_UserBlockingPriority,e3=c.unstable_NormalPriority,e6=c.unstable_LowPriority,e5=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)[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,tg,tp,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 tk(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 tM(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=rz(t))&&tf(t)):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i)),e}function tO(e){var t=r_(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(){tg(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 tA(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=tV(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=rz(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){tA(e)&&n.delete(t)}function tN(){ty=!1,null!==tv&&tA(tv)&&(tv=null),null!==tx&&tA(tx)&&(tx=null),null!==tw&&tA(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 tL(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;)tO(n),null===n.blockedOn&&tS.shift()}var tR=k.ReactCurrentBatchConfig,t_=!0;function tz(e,t,n,r){var i=tc,o=tR.transition;tR.transition=null;try{tc=1,tD(e,t,n,r)}finally{tc=i,tR.transition=o}}function tI(e,t,n,r){var i=tc,o=tR.transition;tR.transition=null;try{tc=4,tD(e,t,n,r)}finally{tc=i,tR.transition=o}}function tD(e,t,n,r){if(t_){var i=tV(e,t,n,r);if(null===i)rl(e,t,r,tB,n),tk(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return tv=tM(tv,e,t,n,r,i),!0;case"dragenter":return tx=tM(tx,e,t,n,r,i),!0;case"mouseover":return tw=tM(tw,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return tC.set(o,tM(tC.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,tE.set(o,tM(tE.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(tk(e,r),4&t&&-1<tP.indexOf(e)){for(;null!==i;){var o=rz(i);if(null!==o&&td(o),null===(o=tV(e,t,n,r))&&rl(e,t,r,tB,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else rl(e,t,r,null,n)}}var tB=null;function tV(e,t,n,r){if(tB=null,null!==(e=r_(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 tB=e,null}function tF(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 e6:return 16;case e5: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 tJ(){return!1}function tX(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:tJ,this.isPropagationStopped=tJ,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 tY,tQ,tZ,tK={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},t0=tX(tK),t1=U({},tK,{view:0,detail:0}),t2=tX(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!==tZ&&(tZ&&"mousemove"===e.type?(tY=e.screenX-tZ.screenX,tQ=e.screenY-tZ.screenY):tQ=tY=0,tZ=e),tY)},movementY:function(e){return"movementY"in e?e.movementY:tQ}}),t6=tX(t3),t5=tX(U({},t3,{dataTransfer:0})),t4=tX(U({},t1,{relatedTarget:0})),t8=tX(U({},tK,{animationName:0,elapsedTime:0,pseudoElement:0})),t9=tX(U({},tK,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),t7=tX(U({},tK,{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=tX(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=tX(U({},t3,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nl=tX(U({},t1,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ni})),na=tX(U({},tK,{propertyName:0,elapsedTime:0,pseudoElement:0})),nu=tX(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,ng=m&&(!nh||nd&&8<nd&&11>=nd),np=!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){eA(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(Y(rI(e)))return e}function nk(e,t){if("change"===e)return t}var nM=!1;if(m){if(m){var nO="oninput"in document;if(!nO){var nA=document.createElement("div");nA.setAttribute("oninput","return;"),nO="function"==typeof nA.oninput}r=nO}else r=!1;nM=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)),eR(nS,t)}}function nj(e,t,n){"focusin"===e?(nT(),nC=t,nE=n,nC.attachEvent("onpropertychange",nN)):"focusout"===e&&nT()}function nL(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return nP(nE)}function nR(e,t){if("click"===e)return nP(t)}function n_(e,t){if("input"===e||"change"===e)return nP(t)}var nz="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function nI(e,t){if(nz(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)||!nz(e[i],t[i]))return!1}return!0}function nD(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nB(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 nV(){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 nF(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)&&nF(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&&nI(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 nJ(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var nX={animationend:nJ("Animation","AnimationEnd"),animationiteration:nJ("Animation","AnimationIteration"),animationstart:nJ("Animation","AnimationStart"),transitionend:nJ("Transition","TransitionEnd")},nY={},nQ={};function nZ(e){if(nY[e])return nY[e];if(!nX[e])return e;var t,n=nX[e];for(t in n)if(n.hasOwnProperty(t)&&t in nQ)return nY[e]=n[t];return e}m&&(nQ=document.createElement("div").style,"AnimationEvent"in window||(delete nX.animationend.animation,delete nX.animationiteration.animation,delete nX.animationstart.animation),"TransitionEvent"in window||delete nX.transitionend.transition);var nK=nZ("animationend"),n0=nZ("animationiteration"),n1=nZ("animationstart"),n2=nZ("transitionend"),n3=new Map,n6="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 n5(e,t){n3.set(e,t),g(t,[e])}for(var n4=0;n4<n6.length;n4++){var n8=n6[n4];n5(n8.toLowerCase(),"on"+(n8[0].toUpperCase()+n8.slice(1)))}n5(nK,"onAnimationEnd"),n5(n0,"onAnimationIteration"),n5(n1,"onAnimationStart"),n5("dblclick","onDoubleClick"),n5("focusin","onFocus"),n5("focusout","onBlur"),n5(n2,"onTransitionEnd"),p("onMouseEnter",["mouseout","mouseover"]),p("onMouseLeave",["mouseout","mouseover"]),p("onPointerEnter",["pointerout","pointerover"]),p("onPointerLeave",["pointerout","pointerover"]),g("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),g("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),g("onBeforeInput",["compositionend","keypress","textInput","paste"]),g("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),g("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),g("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),eB){if(eB){var u=eV;eB=!1,eV=null}else throw Error(h(198));eF||(eF=!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(eF)throw e=e$,eF=!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(tF(t)){case 1:var i=tz;break;case 4:i=tI;break;default:i=tD}n=i.bind(null,t,n,e),i=void 0,ez&&("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=r_(l)))return;if(5===(a=s.tag)||6===a){r=o=s;continue t}l=l.parentNode}}r=r.return}eR(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=t6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":a=t5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":a=nl;break;case nK: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,g=r;null!==g;){var p=(f=g).stateNode;if(5===f.tag&&null!==p&&(f=p,null!==d&&null!=(p=e_(g,d))&&c.push(ra(g,p,f))),h)break;g=g.return}0<c.length&&(l=new a(l,u,null,n,i),s.push({event:l,listeners:c}))}}if(0==(7&t)){if((l="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e,!(l&&n!==eE&&(u=n.relatedTarget||n.fromElement)&&(r_(u)||u[rN])))&&(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?r_(u):null)&&(h=eH(u),u!==h||5!==u.tag&&6!==u.tag)&&(u=null)):(a=null,u=r),a!==u)){if(c=t6,p="onMouseLeave",d="onMouseEnter",g="mouse",("pointerout"===e||"pointerover"===e)&&(c=ns,p="onPointerLeave",d="onPointerEnter",g="pointer"),h=null==a?l:rI(a),f=null==u?l:rI(u),(l=new c(p,g+"leave",a,n,i)).target=h,l.relatedTarget=f,p=null,r_(i)===r&&((c=new c(d,g+"enter",u,n,i)).target=f,c.relatedTarget=h,p=c),h=p,a&&u)n:{for(c=a,d=u,g=0,f=c;f;f=rc(f))g++;for(f=0,p=d;p;p=rc(p))f++;for(;0<g-f;)c=rc(c),g--;for(;0<f-g;)d=rc(d),f--;for(;g--;){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?rI(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===a&&"file"===l.type)var m,y=nk;else if(nx(l))if(nM)y=n_;else{y=nL;var b=nj}else(a=l.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(y=nR);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?rI(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&&(ng&&"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 np=!0," ";case"textInput":return" "===(e=t.data)&&np?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 ng&&"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=e_(e,n))&&r.unshift(ra(e,o,i)),null!=(o=e_(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=e_(n,o))&&s.unshift(ra(n,a,l)):i||null!=(a=e_(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 rg(e){return("string"==typeof e?e:""+e).replace(rd,"\n").replace(rf,"")}function rp(e,t,n){if(t=rg(t),rg(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),tL(t);return}r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);tL(t)}function rk(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 rM(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 rO=Math.random().toString(36).slice(2),rA="__reactFiber$"+rO,rT="__reactProps$"+rO,rN="__reactContainer$"+rO,rj="__reactEvents$"+rO,rL="__reactListeners$"+rO,rR="__reactHandles$"+rO;function r_(e){var t=e[rA];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rN]||n[rA]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=rM(e);null!==e;){if(n=e[rA])return n;e=rM(e)}return t}n=(e=n).parentNode}return null}function rz(e){return(e=e[rA]||e[rN])&&(5===e.tag||6===e.tag||13===e.tag||3===e.tag)?e:null}function rI(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(h(33))}function rD(e){return e[rT]||null}var rB=[],rV=-1;function rF(e){return{current:e}}function r$(e){0>rV||(e.current=rB[rV],rB[rV]=null,rV--)}function rU(e,t){rB[++rV]=e.current,e.current=t}var rG={},rH=rF(rG),rq=rF(!1),rW=rG;function rJ(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 rX(e){return null!=(e=e.childContextTypes)}function rY(){r$(rq),r$(rH)}function rQ(e,t,n){if(rH.current!==rG)throw Error(h(168));rU(rH,t),rU(rq,n)}function rZ(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 A:return"Fragment";case O:return"Portal";case N:return"Profiler";case T:return"StrictMode";case _:return"Suspense";case z:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case L:return(t.displayName||"Context")+".Consumer";case j:return(t._context.displayName||"Context")+".Provider";case R:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case I: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 rK(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?(r.__reactInternalMemoizedMergedChildContext=e=rZ(e,t,rW),r$(rq),r$(rH),rU(rH,e)):r$(rq),rU(rq,n)}var r1=null,r2=!1,r3=!1;function r6(e){null===r1?r1=[e]:r1.push(e)}function r5(){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)),eX(e1,r5),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,ig=null;function ip(e,t){var n=lX(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=rk(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)&&(e.memoizedState={dehydrated:t,treeContext:n=null!==ir?{id:ii,overflow:io}:null,retryLane:0x40000000},(n=lX(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=rk(n.nextSibling);var r=ic;t&&im(e,t)?ip(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;)ip(e,t),t=rk(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=rk(e.nextSibling);break t}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ih=null}}else ih=ic?rk(e.stateNode.nextSibling):null;return!0}function iw(){for(var e=ih;e;)e=rk(e.nextSibling)}function iC(){ih=ic=null,id=!1}function iE(e){null===ig?ig=[e]:ig.push(e)}var iS=k.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 ik=rF(null),iM=null,iO=null,iA=null;function iT(){iA=iO=iM=null}function iN(e){var t=ik.current;r$(ik),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 iL(e,t){iM=e,iA=iO=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(sa=!0),e.firstContext=null)}function iR(e){var t=e._currentValue;if(iA!==e)if(e={context:e,memoizedValue:t,next:null},null===iO){if(null===iM)throw Error(h(308));iO=e,iM.dependencies={lanes:0,firstContext:e}}else iO=iO.next=e;return t}var i_=null;function iz(e){null===i_?i_=[e]:i_.push(e)}function iI(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,iz(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 iB=!1;function iV(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iF(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&s5)){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,iz(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;iB=!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 g=e,p=l;switch(d=t,f=n,p.tag){case 1:if("function"==typeof(g=p.payload)){h=g.call(f,h,d);break t}h=g;break t;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(d="function"==typeof(g=p.payload)?g.call(f,h,d):g))break t;h=U({},h,d);break t;case 2:iB=!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 iJ=(new u.Component).refs;function iX(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 iY={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||!nI(n,r)||!nI(i,o)}function iZ(e,t,n){var r=!1,i=rG,o=t.contextType;return"object"==typeof o&&null!==o?o=iR(o):(i=rX(t)?rW:rH.current,o=(r=null!=(r=t.contextTypes))?rJ(e,i):rG),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=iY,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function iK(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&&iY.enqueueReplaceState(t,t.state,null)}function i0(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=iJ,iV(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=iR(o):i.context=rJ(e,o=rX(t)?rW:rH.current),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(iX(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&&iY.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===iJ&&(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 i6(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=lQ(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=l1(n,e.mode,r)).return=e:(t=i(t,n)).return=e,t}function a(e,t,n,r){var o=n.type;return o===A?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=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=l2(n,e.mode,r)).return=e:(t=i(t,n.children||[])).return=e,t}function c(e,t,n,r,o){return null===t||7!==t.tag?(t=lK(n,e.mode,r,o)).return=e:(t=i(t,n)).return=e,t}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=l1(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case M:return(n=lZ(t.type,t.key,t.props,null,e.mode,n)).ref=i1(e,null,t),n.return=e,n;case O:return(t=l2(t,e.mode,n)).return=e,t;case D:return d(e,(0,t._init)(t._payload),n)}if(ei(t)||F(t))return(t=lK(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 M:return n.key===i?a(e,t,n,r):null;case O: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)||F(n))return null!==i?null:c(e,t,n,r,null);i2(e,n)}return null}function g(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 M:return a(t,e=e.get(null===r.key?n:r.key)||null,r,i);case O:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case D:return g(e,t,n,(0,r._init)(r._payload),i)}if(ei(r)||F(r))return c(t,e=e.get(n)||null,r,i,null);i2(t,r)}return null}return function l(a,u,c,p){if("object"==typeof c&&null!==c&&c.type===A&&null===c.key&&(c=c.props.children),"object"==typeof c&&null!==c){switch(c.$$typeof){case M:t:{for(var m=c.key,y=u;null!==y;){if(y.key===m){if((m=c.type)===A){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===A?((u=lK(c.props.children,a.mode,p,c.key)).return=a,a=u):((p=lZ(c.type,c.key,c.props,null,a.mode,p)).ref=i1(a,u,c),p.return=a,a=p)}return s(a);case O: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=l2(c,a.mode,p)).return=a,a=u}return s(a);case D:return l(a,u,(y=c._init)(c._payload),p)}if(ei(c))return function(i,s,l,a){for(var u=null,c=null,h=s,p=s=0,m=null;null!==h&&p<l.length;p++){h.index>p?(m=h,h=null):m=h.sibling;var y=f(i,h,l[p],a);if(null===y){null===h&&(h=m);break}e&&h&&null===y.alternate&&t(i,h),s=o(y,s,p),null===c?u=y:c.sibling=y,c=y,h=m}if(p===l.length)return n(i,h),id&&is(i,p),u;if(null===h){for(;p<l.length;p++)null!==(h=d(i,l[p],a))&&(s=o(h,s,p),null===c?u=h:c.sibling=h,c=h);return id&&is(i,p),u}for(h=r(i,h);p<l.length;p++)null!==(m=g(h,i,p,l[p],a))&&(e&&null!==m.alternate&&h.delete(null===m.key?p:m.key),s=o(m,s,p),null===c?u=m:c.sibling=m,c=m);return e&&h.forEach(function(e){return t(i,e)}),id&&is(i,p),u}(a,u,c,p);if(F(c))return function(i,s,l,a){var u=F(l);if("function"!=typeof u)throw Error(h(150));if(null==(l=u.call(l)))throw Error(h(151));for(var c=u=null,p=s,m=s=0,y=null,b=l.next();null!==p&&!b.done;m++,b=l.next()){p.index>m?(y=p,p=null):y=p.sibling;var v=f(i,p,b.value,a);if(null===v){null===p&&(p=y);break}e&&p&&null===v.alternate&&t(i,p),s=o(v,s,m),null===c?u=v:c.sibling=v,c=v,p=y}if(b.done)return n(i,p),id&&is(i,m),u;if(null===p){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(p=r(i,p);!b.done;m++,b=l.next())null!==(b=g(p,i,m,b.value,a))&&(e&&null!==b.alternate&&p.delete(null===b.key?m:b.key),s=o(b,s,m),null===c?u=b:c.sibling=b,c=b);return e&&p.forEach(function(e){return t(i,e)}),id&&is(i,m),u}(a,u,c,p);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=l1(c,a.mode,p)).return=a),s(a=u)):n(a,u)}}var i5=i6(!0),i4=i6(!1),i8={},i9=rF(i8),i7=rF(i8),oe=rF(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=eh(t=(e=8===e?t.parentNode:t).namespaceURI||null,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=rF(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=k.ReactCurrentDispatcher,oh=k.ReactCurrentBatchConfig,od=0,of=null,og=null,op=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(!nz(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?o5:o4,e=n(r,i),oy){o=0;do{if(oy=!1,ob=0,25<=o)throw Error(h(301));o+=1,op=og=null,t.updateQueue=null,oc.current=o8,e=n(r,i)}while(oy)}if(oc.current=o6,t=null!==og&&null!==og.next,od=0,op=og=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===op?of.memoizedState=op=e:op=op.next=e,op}function oP(){if(null===og){var e=of.alternate;e=null!==e?e.memoizedState:null}else e=og.next;var t=null===op?of.memoizedState:op.next;if(null!==t)op=t,og=e;else{if(null===e)throw Error(h(310));e={memoizedState:(og=e).memoizedState,baseState:og.baseState,baseQueue:og.baseQueue,queue:og.queue,next:null},null===op?of.memoizedState=op=e:op=op.next=e}return op}function ok(e,t){return"function"==typeof t?t(e):t}function oM(e){var t=oP(),n=t.queue;if(null===n)throw Error(h(311));n.lastRenderedReducer=e;var r=og,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,nz(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 oO(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);nz(o,t.memoizedState)||(sa=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function oA(){}function oT(e,t){var n=of,r=oP(),i=t(),o=!nz(r.memoizedState,i);if(o&&(r.memoizedState=i,sa=!0),r=r.queue,o$(oL.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==op&&1&op.memoizedState.tag){if(n.flags|=2048,oI(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,oR(t)&&o_(e)}function oL(e,t,n){return n(function(){oR(t)&&o_(e)})}function oR(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nz(e,n)}catch(e){return!0}}function o_(e){var t=iD(e,1);null!==t&&lE(t,e,1,-1)}function oz(e){var t=oS();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,t.queue=e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ok,lastRenderedState:e},e=e.dispatch=o0.bind(null,of,e),[t.memoizedState,e]}function oI(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 oB(e,t,n,r){var i=oS();of.flags|=e,i.memoizedState=oI(1|t,n,void 0,void 0===r?null:r)}function oV(e,t,n,r){var i=oP();r=void 0===r?null:r;var o=void 0;if(null!==og){var s=og.memoizedState;if(o=s.destroy,null!==r&&ow(r,s.deps)){i.memoizedState=oI(t,n,o,r);return}}of.flags|=e,i.memoizedState=oI(1|t,n,o,r)}function oF(e,t){return oB(8390656,8,e,t)}function o$(e,t){return oV(2048,8,e,t)}function oU(e,t){return oV(4,2,e,t)}function oG(e,t){return oV(4,4,e,t)}function oH(e,t){return"function"==typeof t?(t(e=e()),function(){t(null)}):null!=t?(t.current=e=e(),function(){t.current=null}):void 0}function oq(e,t,n){return n=null!=n?n.concat([e]):null,oV(4,4,oH.bind(null,t,e),n)}function oW(){}function oJ(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 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=e(),t],e)}function oY(e,t,n){return 0==(21&od)?(e.baseState&&(e.baseState=!1,sa=!0),e.memoizedState=n):(nz(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 oZ(){return oP().memoizedState}function oK(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=iI(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,nz(l,s)){var a=t.interleaved;null===a?(i.next=i,iz(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch(e){}finally{}null!==(n=iI(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,t.lanes=n|=r,tu(e,n)}}var o6={readContext:iR,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},o5={readContext:iR,useCallback:function(e,t){return oS().memoizedState=[e,void 0===t?null:t],e},useContext:iR,useEffect:oF,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,oB(4194308,4,oH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return oB(4194308,4,e,t)},useInsertionEffect:function(e,t){return oB(4,2,e,t)},useMemo:function(e,t){return t=void 0===t?null:t,oS().memoizedState=[e=e(),t],e},useReducer:function(e,t,n){var r=oS();return r.memoizedState=r.baseState=t=void 0!==n?n(t):t,r.queue=e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},e=e.dispatch=oK.bind(null,of,e),[r.memoizedState,e]},useRef:function(e){return oS().memoizedState={current:e}},useState:oz,useDebugValue:oW,useDeferredValue:function(e){return oS().memoizedState=e},useTransition:function(){var e=oz(!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,oF(oL.bind(null,r,o,e),[e]),r.flags|=2048,oI(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:iR,useCallback:oJ,useContext:iR,useEffect:o$,useImperativeHandle:oq,useInsertionEffect:oU,useLayoutEffect:oG,useMemo:oX,useReducer:oM,useRef:oD,useState:function(){return oM(ok)},useDebugValue:oW,useDeferredValue:function(e){return oY(oP(),og.memoizedState,e)},useTransition:function(){return[oM(ok)[0],oP().memoizedState]},useMutableSource:oA,useSyncExternalStore:oT,useId:oZ,unstable_isNewReconciler:!1},o8={readContext:iR,useCallback:oJ,useContext:iR,useEffect:o$,useImperativeHandle:oq,useInsertionEffect:oU,useLayoutEffect:oG,useMemo:oX,useReducer:oO,useRef:oD,useState:function(){return oO(ok)},useDebugValue:oW,useDeferredValue:function(e){var t=oP();return null===og?t.memoizedState=e:oY(t,og.memoizedState,e)},useTransition:function(){return[oO(ok)[0],oP().memoizedState]},useMutableSource:oA,useSyncExternalStore:oT,useId:oZ,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 q(e.type,!1);case 11:return q(e.type.render,!1);case 1:return 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.flags|=65536,e.lanes=i),e}var sl=k.ReactCurrentOwner,sa=!1;function su(e,t,n,r){t.child=null===e?i4(t,null,n,r):i5(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var o=t.ref;return(iL(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,sA(e,t,i))}function sh(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||lY(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:nI)(s,r)&&e.ref===t.ref)return sA(e,t,i)}return t.flags|=1,(e=lQ(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(nI(o,r)&&e.ref===t.ref)if(sa=!1,t.pendingProps=r=o,0==(e.lanes&i))return t.lanes=e.lanes,sA(e,t,i);else 0!=(131072&e.flags)&&(sa=!0)}return sp(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 sg(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function sp(e,t,n,r,i){var o=rX(n)?rW:rH.current;return(o=rJ(t,o),iL(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,sA(e,t,i))}function sm(e,t,n,r,i){if(rX(n)){var o=!0;rK(t)}else o=!1;if(iL(t,i),null===t.stateNode)sO(e,t),iZ(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?iR(u):rJ(t,u=rX(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)&&iK(t,s,r,u),iB=!1;var d=t.memoizedState;s.state=d,iq(t,r,s,i),a=t.memoizedState,l!==r||d!==a||rq.current||iB?("function"==typeof c&&(iX(t,n,c,r),a=t.memoizedState),(l=iB||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,iF(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?iR(a):rJ(t,a=rX(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)&&iK(t,s,r,a),iB=!1,d=t.memoizedState,s.state=d,iq(t,r,s,i);var g=t.memoizedState;l!==h||d!==g||rq.current||iB?("function"==typeof f&&(iX(t,n,f,r),g=t.memoizedState),(u=iB||iQ(t,n,u,r,d,g,a)||!1)?(c||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(r,g,a),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,g,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=g),s.props=r,s.state=g,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){sg(e,t);var s=0!=(128&t.flags);if(!r&&!s)return i&&r0(t,n,!1),sA(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=i5(t,e.child,null,o),t.child=i5(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=l0(l,i,0,null),e=lK(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)){var a=e,u=t,c=l,d=i,f=r,g=o,p=n;if(c)return 256&u.flags?(u.flags&=-257,sS(a,u,p,d=o7(Error(h(422))))):null!==u.memoizedState?(u.child=a.child,u.flags|=128,null):(g=d.fallback,f=u.mode,d=l0({mode:"visible",children:d.children},f,0,null),g=lK(g,f,p,null),g.flags|=2,d.return=u,g.return=u,d.sibling=g,u.child=d,0!=(1&u.mode)&&i5(u,a.child,null,p),u.child.memoizedState=sw(p),u.memoizedState=sx,g);if(0==(1&u.mode))return sS(a,u,p,null);if("$!"===f.data){if(d=f.nextSibling&&f.nextSibling.dataset)var m=d.dgst;return d=m,sS(a,u,p,d=o7(g=Error(h(419)),d,void 0))}if(m=0!=(p&a.childLanes),sa||m){if(null!==(d=s4)){switch(p&-p){case 4:f=2;break;case 16:f=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:f=32;break;case 0x20000000:f=0x10000000;break;default:f=0}0!==(f=0!=(f&(d.suspendedLanes|p))?0:f)&&f!==g.retryLane&&(g.retryLane=f,iD(a,f),lE(d,a,f,-1))}return lz(),sS(a,u,p,d=o7(Error(h(421))))}return"$?"===f.data?(u.flags|=128,u.child=a.child,u=lq.bind(null,a),f._reactRetry=u,null):(a=g.treeContext,ih=rk(f.nextSibling),ic=u,id=!0,ig=null,null!==a&&(ie[it++]=ii,ie[it++]=io,ie[it++]=ir,ii=a.id,io=a.overflow,ir=u),u=sE(u,d.children),u.flags|=4096,u)}if(s){s=i.fallback,l=t.mode,r=(o=e.child).sibling;var y={mode:"hidden",children:i.children};return 0==(1&l)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=y,t.deletions=null):(i=lQ(o,y)).subtreeFlags=0xe00000&o.subtreeFlags,null!==r?s=lQ(r,s):(s=lK(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=lQ(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=l0({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function sS(e,t,n,r){return null!==r&&iE(r),i5(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 sk(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 sM(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),sk(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}sk(t,!0,n,null,o);break;case"together":sk(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sO(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sA(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=lQ(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=lQ(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=Z(e,i),r=Z(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,sL=!1,sR="function"==typeof WeakSet?WeakSet:Set,s_=null;function sz(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 sI(e,t,n){try{n()}catch(n){lU(e,t,n)}}var sD=!1;function sB(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&&sI(t,n,o)}i=i.next}while(i!==r)}}function sV(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 sF(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||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:sL||sz(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),tL(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(!sL&&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)?sI(n,t,s):0!=(4&o)&&sI(n,t,s)),i=i.next}while(i!==r)}sq(e,t,n);break;case 1:if(!sL&&(sz(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?(sL=(r=sL)||null!==n.memoizedState,sq(e,t,n),sL=r):sq(e,t,n)}}function sJ(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new sR),t.forEach(function(t){var r=lW.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function sX(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;)sY(t,e),t=t.sibling}function sY(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sX(t,e),sQ(e),4&r){try{sB(3,e,e.return),sV(3,e)}catch(t){lU(e,e.return,t)}try{sB(5,e,e.return)}catch(t){lU(e,e.return,t)}}break;case 1:sX(t,e),sQ(e),512&r&&null!==n&&sz(n,n.return);break;case 5:if(sX(t,e),sQ(e),512&r&&null!==n&&sz(n,n.return),32&e.flags){var i=e.stateNode;try{ep(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?eg(i,d):"children"===c?ep(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 g=o.value;null!=g?eo(i,!!o.multiple,g,!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(sX(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(sX(t,e),sQ(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{tL(t.containerInfo)}catch(t){lU(e,e.return,t)}break;case 4:default:sX(t,e),sQ(e);break;case 13:sX(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=eK())),4&r&&sJ(e);break;case 22:if(c=null!==n&&null!==n.memoizedState,1&e.mode?(sL=(u=sL)||c,sX(t,e),sL=u):sX(t,e),sQ(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!c&&0!=(1&e.mode))for(s_=e,c=e.child;null!==c;){for(d=s_=c;null!==s_;){switch(g=(f=s_).child,f.tag){case 0:case 11:case 14:case 15:sB(4,f,f.return);break;case 1:sz(f,f.return);var p=f.stateNode;if("function"==typeof p.componentWillUnmount){r=f,n=f.return;try{p.props=(t=r).memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(e){lU(r,n,e)}}break;case 5:sz(f,f.return);break;case 22:if(null!==f.memoizedState){sK(d);continue}}null!==g?(g.return=f,s_=g):sK(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:sX(t,e),sQ(e),4&r&&sJ(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&&(ep(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 sZ(e){for(;null!==s_;){var t=s_;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:sL||sV(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!sL)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&&tL(d)}}}break;default:throw Error(h(163))}sL||512&t.flags&&sF(t)}catch(e){lU(t,t.return,e)}}if(t===e){s_=null;break}if(null!==(n=t.sibling)){n.return=t.return,s_=n;break}s_=t.return}}function sK(e){for(;null!==s_;){var t=s_;if(t===e){s_=null;break}var n=t.sibling;if(null!==n){n.return=t.return,s_=n;break}s_=t.return}}function s0(e){for(;null!==s_;){var t=s_;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{sV(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{sF(t)}catch(e){lU(t,o,e)}break;case 5:var s=t.return;try{sF(t)}catch(e){lU(t,s,e)}}}catch(e){lU(t,t.return,e)}if(t===e){s_=null;break}var l=t.sibling;if(null!==l){l.return=t.return,s_=l;break}s_=t.return}}var s1=Math.ceil,s2=k.ReactCurrentDispatcher,s3=k.ReactCurrentOwner,s6=k.ReactCurrentBatchConfig,s5=0,s4=null,s8=null,s9=0,s7=0,le=rF(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,lg=!1,lp=null,lm=0,ly=0,lb=null,lv=-1,lx=0;function lw(){return 0!=(6&s5)?eK():-1!==lv?lv:lv=eK()}function lC(e){return 0==(1&e.mode)?1:0!=(2&s5)&&0!==s9?s9&-s9:null!==iS.transition?(0===lx&&(lx=ts()),lx):0!==(e=tc)?e:e=void 0===(e=window.event)?16:tF(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&s5)||e!==s4)&&(e===s4&&(0==(2&s5)&&(li|=n),4===lt&&lO(e,s9)),lS(e,r),1===n&&0===s5&&0==(1&t.mode)&&(lu=eK()+500,r2&&r5()))}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&&eY(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(null!=r&&eY(r),1===t)0===e.tag?(n=lA.bind(null,e),r2=!0,r6(n)):r6(lA.bind(null,e)),rE(function(){0==(6&s5)&&r5()}),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=e5}r=eX(r,lP.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function lP(e,t){if(lv=-1,lx=0,0!=(6&s5))throw Error(h(327));var n=e.callbackNode;if(lF()&&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=lI(e,r);else{t=r;var i=s5;s5|=2;var o=l_();for((s4!==e||s9!==t)&&(lc=null,lu=eK()+500,lL(e,t));;)try{for(;null!==s8&&!eQ();)lD(s8);break}catch(t){lR(e,t)}iT(),s2.current=o,s5=i,null!==s8?t=0:(s4=null,s9=0,t=lt)}if(0!==t){if(2===t&&0!==(i=to(e))&&(r=i,t=lk(e,i)),1===t)throw n=ln,lL(e,0),lO(e,r),lS(e,eK()),n;if(6===t)lO(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(!nz(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=lI(e,r))&&0!==(o=to(e))&&(r=o,t=lk(e,o)),1===t))throw n=ln,lL(e,0),lO(e,r),lS(e,eK()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(h(345));case 2:case 5:lV(e,ll,lc);break;case 3:if(lO(e,r),(0x7c00000&r)===r&&10<(t=la+500-eK())){if(0!==ti(e,0))break;if(((i=e.suspendedLanes)&r)!==r){lw(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=rx(lV.bind(null,e,ll,lc),t);break}lV(e,ll,lc);break;case 4:if(lO(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=eK()-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(lV.bind(null,e,ll,lc),r);break}lV(e,ll,lc);break;default:throw Error(h(329))}}}return lS(e,eK()),e.callbackNode===n?lP.bind(null,e):null}function lk(e,t){var n=ls;return e.current.memoizedState.isDehydrated&&(lL(e,t).flags|=256),2!==(e=lI(e,t))&&(t=ll,ll=n,null!==t&&lM(t)),e}function lM(e){null===ll?ll=e:ll.push.apply(ll,e)}function lO(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 lA(e){if(0!=(6&s5))throw Error(h(327));lF();var t=ti(e,0);if(0==(1&t))return lS(e,eK()),null;var n=lI(e,t);if(0!==e.tag&&2===n){var r=to(e);0!==r&&(t=r,n=lk(e,r))}if(1===n)throw n=ln,lL(e,0),lO(e,t),lS(e,eK()),n;if(6===n)throw Error(h(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,lV(e,ll,lc),lS(e,eK()),null}function lT(e,t){var n=s5;s5|=1;try{return e(t)}finally{0===(s5=n)&&(lu=eK()+500,r2&&r5())}}function lN(e){null!==lp&&0===lp.tag&&0==(6&s5)&&lF();var t=s5;s5|=1;var n=s6.transition,r=tc;try{if(s6.transition=null,tc=1,e)return e()}finally{tc=r,s6.transition=n,0==(6&(s5=t))&&r5()}}function lj(){s7=le.current,r$(le)}function lL(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)&&rY();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=lQ(e.current,null),s9=s7=t,lt=0,ln=null,lo=li=lr=0,ll=ls=null,null!==i_){for(t=0;t<i_.length;t++)if(null!==(r=(n=i_[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}i_=null}return e}function lR(e,t){for(;;){var n=s8;try{if(iT(),oc.current=o6,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,op=og=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 g=so(s);if(null!==g){g.flags&=-257,ss(g,s,l,o,t),1&g.mode&&si(o,u,t),t=g,a=u;var p=t.updateQueue;if(null===p){var m=new Set;m.add(a),t.updateQueue=m}else p.add(a);break t}if(0==(1&t)){si(o,u,t),lz();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)}lB(n)}catch(e){t=e,s8===n&&null!==n&&(s8=n=n.return);continue}break}}function l_(){var e=s2.current;return s2.current=o6,null===e?o6:e}function lz(){(0===lt||3===lt||2===lt)&&(lt=4),null===s4||0==(0xfffffff&lr)&&0==(0xfffffff&li)||lO(s4,s9)}function lI(e,t){var n=s5;s5|=2;var r=l_();for((s4!==e||s9!==t)&&(lc=null,lL(e,t));;)try{for(;null!==s8;)lD(s8);break}catch(t){lR(e,t)}if(iT(),s5=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?lB(e):s8=t,s3.current=null}function lB(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 rX(t.type)&&rY(),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!==ig&&(lM(ig),ig=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[rA]=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":K(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&&rp(r.textContent,d,e),a=["children",d]):"number"==typeof d&&r.textContent!==""+d&&(!0!==u.suppressHydrationWarning&&rp(r.textContent,d,e),a=["children",""+d]):f.hasOwnProperty(c)&&null!=d&&"onScroll"===c&&rn("scroll",r)}switch(n){case"input":X(r),en(r,u,!0);break;case"textarea":X(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[rA]=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":K(e,r),a=Z(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 g=d[u];"style"===u?ev(e,g):"dangerouslySetInnerHTML"===u?null!=(g=g?g.__html:void 0)&&eg(e,g):"children"===u?"string"==typeof g?("textarea"!==n||""!==g)&&ep(e,g):"number"==typeof g&&ep(e,""+g):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(f.hasOwnProperty(u)?null!=g&&"onScroll"===u&&rn("scroll",e):null!=g&&P(e,u,g,c))}switch(n){case"input":X(e),en(e,r,!1);break;case"textarea":X(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[rA]=t,(u=r.nodeValue!==n)&&null!==(e=ic))switch(e.tag){case 3:rp(r.nodeValue,n,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&rp(r.nodeValue,n,0!=(1&e.mode))}u&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[rA]=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[rA]=t}else iC(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;sN(t),u=!1}else null!==ig&&(lM(ig),ig=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):lz())),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&&eK()>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*eK()-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=eK(),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 rX(t.type)&&rY(),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 lV(e,t,n){var r=tc,i=s6.transition;try{s6.transition=null,tc=1,function(e,t,n,r){do lF();while(null!==lp);if(0!=(6&s5))throw Error(h(327));n=e.finishedWork;var i=e.finishedLanes;if(null!==n){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,s=e,l=o,a=s.pendingLanes&~l;s.pendingLanes=l,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=l,s.mutableReadLanes&=l,s.entangledLanes&=l,l=s.entanglements;var u=s.eventTimes;for(s=s.expirationTimes;0<a;){var c=31-e9(a),d=1<<c;l[c]=0,u[c]=-1,s[c]=-1,a&=~d}if(e===s4&&(s8=s4=null,s9=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||lg||(lg=!0,function(e,t){eX(e,t)}(e3,function(){return lF(),null})),o=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||o){o=s6.transition,s6.transition=null;var f,g,p,m=tc;tc=1;var y=s5;s5|=4,s3.current=null,function(e,t){if(ry=t_,nF(e=nV())){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,g=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);)g=f,f=i;for(;;){if(f===e)break n;if(g===n&&++c===o&&(a=l),g===s&&++d===r&&(u=l),null!==(i=f.nextSibling))break;g=(f=g).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},t_=!1,s_=t;null!==s_;)if(e=(t=s_).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,s_=e;else for(;null!==s_;){t=s_;try{var p=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!==p){var m=p.memoizedProps,y=p.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,s_=e;break}s_=t.return}p=sD,sD=!1}(e,n),sY(n,e),function(e){var t=nV(),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&&nF(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=nB(n,o);var s=nB(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),t_=!!ry,rb=ry=null,e.current=n,f=n,g=e,p=i,s_=f,function e(t,n,r){for(var i=0!=(1&t.mode);null!==s_;){var o=s_,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||sL;a=sj;var c=sL;if(sj=l,(sL=u)&&!c)for(s_=o;null!==s_;)u=(l=s_).child,22===l.tag&&null!==l.memoizedState?s0(o):null!==u?(u.return=l,s_=u):s0(o);for(;null!==s;)s_=s,e(s,n,r),s=s.sibling;s_=o,sj=a,sL=c}sZ(t,n,r)}else 0!=(8772&o.subtreeFlags)&&null!==s?(s.return=o,s_=s):sZ(t,n,r)}}(f,g,p),eZ(),s5=y,tc=m,s6.transition=o}else e.current=n;lg&&(lg=!1,lp=e,lm=i),0===(o=e.pendingLanes)&&(lf=null);var b=n.stateNode;if(e8&&"function"==typeof e8.onCommitFiberRoot)try{e8.onCommitFiberRoot(e4,b,void 0,128==(128&b.current.flags))}catch(e){}if(lS(e,eK()),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&&lF(),0!=(1&(o=e.pendingLanes))?e===lb?ly++:(ly=0,lb=e):ly=0,r5()}}(e,t,n,r)}finally{s6.transition=i,tc=r}return null}function lF(){if(null!==lp){var e=th(lm),t=s6.transition,n=tc;try{if(s6.transition=null,tc=16>e?16:e,null===lp)var r=!1;else{if(e=lp,lp=null,lm=0,0!=(6&s5))throw Error(h(331));var i=s5;for(s5|=4,s_=e.current;null!==s_;){var o=s_,s=o.child;if(0!=(16&s_.flags)){var l=o.deletions;if(null!==l){for(var a=0;a<l.length;a++){var u=l[a];for(s_=u;null!==s_;){var c=s_;switch(c.tag){case 0:case 11:case 15:sB(8,c,o)}var d=c.child;if(null!==d)d.return=c,s_=d;else for(;null!==s_;){var f=(c=s_).sibling,g=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[rA],delete n[rT],delete n[rj],delete n[rL],delete n[rR]),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){s_=null;break}if(null!==f){f.return=g,s_=f;break}s_=g}}}var p=o.alternate;if(null!==p){var m=p.child;if(null!==m){p.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}s_=o}}if(0!=(2064&o.subtreeFlags)&&null!==s)s.return=o,s_=s;else for(;null!==s_;){if(o=s_,0!=(2048&o.flags))switch(o.tag){case 0:case 11:case 15:sB(9,o,o.return)}var b=o.sibling;if(null!==b){b.return=o.return,s_=b;break}s_=o.return}}var v=e.current;for(s_=v;null!==s_;){var x=(s=s_).child;if(0!=(2064&s.subtreeFlags)&&null!==x)x.return=s,s_=x;else for(s=v;null!==s_;){if(l=s_,0!=(2048&l.flags))try{switch(l.tag){case 0:case 11:case 15:sV(9,l)}}catch(e){lU(l,l.return,e)}if(l===s){s_=null;break}var w=l.sibling;if(null!==w){w.return=l.return,s_=w;break}s_=l.return}}if(s5=i,r5(),e8&&"function"==typeof e8.onPostCommitFiberRoot)try{e8.onPostCommitFiberRoot(e4,e)}catch(e){}r=!0}return r}finally{tc=n,s6.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>eK()-la?lL(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 lJ(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 lX(e,t,n,r){return new lJ(e,t,n,r)}function lY(e){return!(!(e=e.prototype)||!e.isReactComponent)}function lQ(e,t){var n=e.alternate;return null===n?((n=lX(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)lY(e)&&(s=1);else if("string"==typeof e)s=5;else t:switch(e){case A:return lK(n.children,i,o,t);case T:s=8,i|=8;break;case N:return(e=lX(12,n,t,2|i)).elementType=N,e.lanes=o,e;case _:return(e=lX(13,n,t,i)).elementType=_,e.lanes=o,e;case z:return(e=lX(19,n,t,i)).elementType=z,e.lanes=o,e;case B:return l0(n,i,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case j:s=10;break t;case L:s=9;break t;case R:s=11;break t;case I:s=14;break t;case D:s=16,r=null;break t}throw Error(h(130,null==e?e:typeof e,""))}return(t=lX(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function lK(e,t,n,r){return(e=lX(7,e,r,t)).lanes=n,e}function l0(e,t,n,r){return(e=lX(22,e,r,t)).elementType=B,e.lanes=n,e.stateNode={isHidden:!1},e}function l1(e,t,n){return(e=lX(6,e,null,t)).lanes=n,e}function l2(e,t,n){return(t=lX(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function l3(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 l3(e,t,n,l,a),1===t?(t=1,!0===o&&(t|=8)):t=0,o=lX(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},iV(o),e}function l5(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(rX(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(rX(n))return rZ(e,n,t)}return t}function l4(e,t,n,r,i,o,s,l,a){return(e=l6(n,r,!0,e,i,o,s,l,a)).context=l5(null),n=e.current,(o=i$(r=lw(),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 l8(e,t,n,r){var i=t.current,o=lw(),s=lC(i);return n=l5(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 l9(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function l7(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ae(e,t){l7(e,t),(e=e.alternate)&&l7(e,t)}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:rX(t.type)&&rK(t);break;case 4:on(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;rU(ik,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=sA(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 sM(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 sA(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;sO(e,t),e=t.pendingProps;var i=rJ(t,rH.current);iL(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,rX(r)?(o=!0,rK(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,iV(t),i.updater=iY,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(sO(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return+!!lY(e);if(null!=e){if((e=e.$$typeof)===R)return 11;if(e===I)return 14}return 2}(r),e=iP(r,e),i){case 0:t=sp(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),sp(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,iF(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=rk(t.stateNode.containerInfo.firstChild),ic=t,id=!0,ig=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=sA(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),sg(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=i5(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(ik,r._currentValue),r._currentValue=s,null!==o)if(nz(o.value,s)){if(o.children===i.children&&!rq.current){t=sA(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,iL(t,n),r=r(i=iR(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),sO(e,t),t.tag=1,rX(r)?(e=!0,rK(t)):e=!1,iL(t,n),iZ(t,r,i),i0(t,r,i,n),sy(null,t,r,!0,e,n);case 19:return sM(e,t,n);case 22:return sf(e,t,n)}throw Error(h(156,t.tag))};var at="function"==typeof reportError?reportError:function(e){console.error(e)};function an(e){this._internalRoot=e}function ar(e){this._internalRoot=e}function ai(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function ao(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function as(){}function al(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=l9(s);l.call(e)}}l8(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=l9(s);o.call(e)}}var s=l4(t,r,e,0,null,!1,!1,"",as);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=l9(a);l.call(e)}}var a=l6(e,0,!1,null,null,!1,!1,"",as);return e._reactRootContainer=a,e[rN]=a.current,ro(8===e.nodeType?e.parentNode:e),lN(function(){l8(t,a,n,r)}),a}(n,t,e,i,r);return l9(s)}ar.prototype.render=an.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(h(409));l8(e,t,null,null)},ar.prototype.unmount=an.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;lN(function(){l8(null,e,null,null)}),t[rN]=null}},ar.prototype.unstable_scheduleHydration=function(e){if(e){var t=tp();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&&tO(e)}},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,eK()),0==(6&s5)&&(lu=eK()+500,r5()))}break;case 13:lN(function(){var t=iD(e,1);null!==t&&lE(t,e,1,lw())}),ae(e,1)}},tf=function(e){if(13===e.tag){var t=iD(e,0x8000000);null!==t&&lE(t,e,0x8000000,lw()),ae(e,0x8000000)}},tg=function(e){if(13===e.tag){var t=lC(e),n=iD(e,t);null!==n&&lE(n,e,t,lw()),ae(e,t)}},tp=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));Y(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 aa={findFiberByHostInstance:r_,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},au={bundleType:aa.bundleType,version:aa.version,rendererPackageName:aa.rendererPackageName,rendererConfig:aa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=eJ(e))?null:e.stateNode},findFiberByHostInstance:aa.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ac.isDisabled&&ac.supportsFiber)try{e4=ac.inject(au),e8=ac}catch(e){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED={usingClientEntryPoint:!1,Events:[rz,rI,rD,eA,eT,lT]},t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ai(t))throw Error(h(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:O,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!ai(e))throw Error(h(299));var n=!1,r="",i=at;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 an(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 null===(e=eJ(t))?null:e.stateNode},t.flushSync=function(e){return lN(e)},t.hydrate=function(e,t,n){if(!ao(t))throw Error(h(200));return al(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!ai(e))throw Error(h(405));var r=null!=n&&n.hydratedSources||null,i=!1,o="",s=at;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=l4(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 ar(t)},t.render=function(e,t,n){if(!ao(t))throw Error(h(200));return al(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!ao(e))throw Error(h(40));return!!e._reactRootContainer&&(lN(function(){al(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(!ao(n))throw Error(h(200));if(null==e||void 0===e._reactInternals)throw Error(h(38));return al(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},9827:function(e,t,n){"use strict";var r=n(1098);t.createRoot=r.createRoot,r.hydrateRoot},1098:function(e,t,n){"use strict";!function e(){if("u">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(9006)},4006: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,g=3,p=!1,m=!1,y=!1,b="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,x="u">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,L(E);else{var t=r(h);null!==t&&R(C,t.startTime-e)}}function E(e,n){m=!1,y&&(y=!1,v(k),k=-1),p=!0;var o=g;try{for(w(n),f=r(c);null!==f&&(!(f.expirationTime>n)||e&&!A());){var s=f.callback;if("function"==typeof s){f.callback=null,g=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&&R(C,u.startTime-n),a=!1}return a}finally{f=null,g=o,p=!1}}"u">typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S=!1,P=null,k=-1,M=5,O=-1;function A(){return!(t.unstable_now()-O<M)}function T(){if(null!==P){var e=t.unstable_now();O=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("u">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 L(e){P=e,S||(S=!0,s())}function R(e,n){k=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||p||(m=!0,L(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"):M=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(g){case 1:case 2:case 3:var t=3;break;default:t=g}var n=g;g=t;try{return e()}finally{g=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=g;g=e;try{return t()}finally{g=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,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(k),k=-1):y=!0,R(C,o-s))):(e.sortIndex=l,n(c,e),m||p||(m=!0,L(E))),e},t.unstable_shouldYield=A,t.unstable_wrapCallback=function(e){var t=g;return function(){var n=g;g=t;try{return e.apply(this,arguments)}finally{g=n}}}},7433:function(e,t,n){"use strict";e.exports=n(4006)}}]);