@squeed/flow-sdk 0.1.1 → 0.1.3
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.
- package/dist/index.cjs +47 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +157 -11
- package/dist/index.js +14276 -13324
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("react/jsx-runtime"),Re=require("react"),Ee=require("@chakra-ui/react"),bt=require("react-icons/pi"),$L=require("react-icons/hi2"),VL=require("react-icons/gr"),vu=require("react-icons/vsc"),GL=require("react-icons/tb"),O1=require("react-icons/io5"),FR=Re.createContext(null);function si(){const r=Re.useContext(FR);if(!r)throw new Error("useFlowDiagramContext must be used within FlowDiagram");return r}function WL({config:r,callbacks:e,children:t}){const n=Re.useRef(null),[a,i]=Re.useState([]),[o,s]=Re.useState(!1),[u,l]=Re.useState(!1),[c,v]=Re.useState(!1),[h,g]=Re.useState(r.edgeHandles!==!1),[p,E]=Re.useState(!1),[m,b]=Re.useState(!0),w=Re.useRef(e);w.current=e;const x=Re.useMemo(()=>{const $=G=>(...U)=>{var J,W;return(W=(J=w.current)==null?void 0:J[G])==null?void 0:W.call(J,...U)};return{onNodeSelect:$("onNodeSelect"),onNodeDeselect:$("onNodeDeselect"),onNodeDoubleClick:$("onNodeDoubleClick"),onEdgeCreate:$("onEdgeCreate"),onEdgeSelect:$("onEdgeSelect"),onEdgeDeselect:$("onEdgeDeselect"),onEdgeRemove:$("onEdgeRemove"),onViewportChange:$("onViewportChange"),onNodeHoverAction:$("onNodeHoverAction"),onNodeCreate:$("onNodeCreate"),onCyInit:$("onCyInit"),onDirectionChange:$("onDirectionChange"),onNodeColorChange:$("onNodeColorChange"),onEdgeColorChange:$("onEdgeColorChange"),onArrayModeChange:$("onArrayModeChange"),onNodeDelete:$("onNodeDelete")}},[]),_=r.themeColor||"blue.500",C=r.colorMode||"light",R=r.direction||"LR",S=r.readOnly??!1,A=r.minZoom,P=r.maxZoom,I=r.backgroundPattern,D=r.edgeColor,M=r.edgeHandles;r.initialViewport;const O=Re.useRef(r);O.current=r;const N=Re.useMemo(()=>({get direction(){return O.current.direction},get themeColor(){return O.current.themeColor},get colorMode(){return O.current.colorMode},get readOnly(){return O.current.readOnly},get minZoom(){return O.current.minZoom},get maxZoom(){return O.current.maxZoom},get backgroundPattern(){return O.current.backgroundPattern},get edgeColor(){return O.current.edgeColor},get edgeHandles(){return O.current.edgeHandles},get initialViewport(){return O.current.initialViewport},get nodeOverlayActions(){return O.current.nodeOverlayActions},get renderNodeOverlay(){return O.current.renderNodeOverlay},get renderSelectedNodeToolbar(){return O.current.renderSelectedNodeToolbar}}),[]),V=Re.useMemo(()=>({themeColor:_,colorMode:C,direction:R,selectedNodeIds:a,setSelectedNodeIds:i,isZoomMode:o,setIsZoomMode:s,isMultiSelectMode:u,setIsMultiSelectMode:l,isDragMode:c,setIsDragMode:v,isEdgeHandlesEnabled:h,setIsEdgeHandlesEnabled:g,isArrayNodeMode:p,setIsArrayNodeMode:E,isPinned:m,setIsPinned:b,cyRef:n,callbacks:x,config:N,readOnly:S}),[_,C,R,a,o,u,c,h,p,m,A,P,I,D,M,S,x,N]);return me.jsx(FR.Provider,{value:V,children:t})}const UL=({children:r,pattern:e="dot"})=>{const t=Ee.useColorModeValue("--chakra-colors-gray-500","--chakra-colors-gray-700"),n=Ee.useColorModeValue("--chakra-colors-gray-800","--chakra-colors-gray-700");return e==="none"?me.jsx(Ee.Box,{width:"100%",height:"100%",padding:0,children:r}):me.jsxs(Ee.Box,{position:"relative",width:"100%",height:"100%",padding:0,children:[me.jsx(Ee.Box,{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",zIndex:0,pointerEvents:"none",style:{backgroundImage:e==="dot"?`radial-gradient(var(${t}) 8%, transparent 8%)`:e==="steel"?`repeating-linear-gradient(45deg, var(${n}) 0, var(${n}) 1px, transparent 1px, transparent 20px)`:`linear-gradient(var(${n}) 1px, transparent 1px), linear-gradient(90deg, var(${n}) 1px, transparent 1px)`,backgroundSize:"20px 20px",opacity:.3}}),me.jsx(Ee.Box,{position:"relative",width:"100%",height:"100%",zIndex:1,padding:0,children:r})]})};function $u(r,e=.2){const t=r.replace(/^#/,""),n=parseInt(t,16);let a=n>>16&255,i=n>>8&255,o=n&255;return a=Math.max(0,Math.floor(a*(1-e))),i=Math.max(0,Math.floor(i*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),"#"+((1<<24)+(a<<16)+(i<<8)+o).toString(16).slice(1).toUpperCase()}const Pn=r=>r!=null&&r.startsWith("#")?{background:r,highlight:$u(r,.1),border:$u(r,.5),property:"gray.900",boolean:"green.200",string:"gray.900",number:"orange.800"}:r==="gray"?{background:"gray.950",highlight:"gray.800",border:"gray.700",property:"gray.200",boolean:"green.400",string:"gray.200",number:"orange.600"}:r==="white"?{background:"white",highlight:"gray.200",border:"gray.400",property:"gray.900",boolean:"green.400",string:"gray.900",number:"orange.600"}:{background:r+".100",highlight:r+".200",border:r+".700",property:"gray.900",boolean:"green.800",string:"gray.900",number:"orange.800"},zR=r=>{let e=r;if(e!=null&&e.startsWith("#"))return{secondary:$u(r)};let t=String(Number(r.slice(-3))+200);t=r.slice(0,-3).concat(t);let n=String(Number(r.slice(-3))-100);return n=r.slice(0,-3).concat(n),{primary:e,secondary:t,light:n}},Pt=(r,e)=>{if(r!=null&&r.startsWith("#"))return r;if(!r)return"whitesmoke";const t=r.replace(/\./g,"-"),n=`var(--chakra-colors-${t})`;try{const i=getComputedStyle(document.documentElement).getPropertyValue(`--chakra-colors-${t}`).trim();if(i&&i!=="")return i}catch{}return n};function os(r){const[e]=(r==null?void 0:r.split("."))||[],{secondary:t}=zR(r),n=Pn(e).background,a=Pn(e).highlight,i=Pn(e).border,o=Pn(e).property,s=Pn(e).property;let u=Pn(e).background,l=Pn(e).highlight;return u=Pt(u)+50,l=Pt(l)+20,{bgColor:n,highlightColor:a,borderColor:i,textColor:o,propertyColor:s,secondary:t,bgColorFaint:u,highlightColorFaint:l}}function ss(r=null){const e=r==null?void 0:r.includes("gray"),t=Ee.useColorModeValue("gray.100","gray.900"),n=Ee.useColorModeValue("gray.200","blackAlpha.400"),a=Ee.useColorModeValue("gray.200","blackAlpha.600"),i=Ee.useColorModeValue("gray.500","gray.800"),o=Ee.useColorModeValue("gray.700","gray.700"),s=Ee.useColorModeValue("gray.900","gray.900"),u=Ee.useColorModeValue("gray.400","gray.500"),l=Ee.useColorModeValue("gray.400","gray.700"),c=Ee.useColorModeValue("gray.900","gray.200"),v=Ee.useColorModeValue(e?"gray.900":"gray.200",e?"gray.200":"gray.900"),h=Ee.useColorModeValue("gray.900","gray.200"),g=Ee.useColorModeValue(r&&"#000000",r||"#ffffff"),p=Ee.useColorModeValue(r||"#ffffff",r?"#000000":"#ffffff"),E=o,m=Ee.useColorModeValue("gray.300","gray.800"),b=Ee.useColorModeValue("white","blackAlpha.400"),w=Ee.useColorModeValue("green.100","green.700");return{background:t,backgroundSecondary:n,darkBackgroundSecondary:a,border:i,darkColor:s,backgroundWhiteColor:b,borderSecondary:o,colorActive:u,colorInactive:l,iconColor:h,moreIconColor:E,colorText:c,themedColorText:v,logoColor:g,logoColorSecondary:p,darkColorActive:m,greenColor:w}}const HL=({icon:r,label:e,onClick:t,color:n,boxSize:a=6,...i})=>{const{background:o,border:s,colorText:u}=ss();return me.jsx(Ee.Tooltip,{bgColor:i.bgColor||o,borderColor:i.borderColor||s,borderWidth:1,color:i.textColor||u,label:e,borderRadius:15,placement:i.placement||"top",fontWeight:300,fontSize:"sm",p:2,px:4,shadow:"none",children:me.jsx(Ee.Flex,{children:me.jsx(Ee.Icon,{as:r,boxSize:a,color:n,cursor:t?"pointer":void 0,onClick:t})})})},KL=({data:r,children:e,isInverted:t,isParent:n,childNodes:a})=>{const{selectedNodeIds:i,setSelectedNodeIds:o,isMultiSelectMode:s,cyRef:u,callbacks:l,config:c}=si(),{background:v,border:h,colorText:g}=ss(),p=Re.useRef(null),E=Re.useRef(null),[m,b]=Re.useState(!1),w=r==null?void 0:r.id,x=i.includes(w),_=c.nodeOverlayActions,C=c.renderNodeOverlay,R=(()=>{var D;try{const M=(D=u.current)==null?void 0:D.zoom();return M!==void 0&&M<.08}catch{return!1}})(),S=Re.useCallback(()=>{var D,M,O;if(s){const N=i.includes(w),V=N?i.filter($=>$!==w):[...i,w];o(V),N?(D=l.onNodeDeselect)==null||D.call(l):(M=l.onNodeSelect)==null||M.call(l,w,r)}else o([w]),(O=l.onNodeSelect)==null||O.call(l,w,r)},[w,r,i,s,o,l]),A=Re.useCallback(()=>{var D;(D=l.onNodeDoubleClick)==null||D.call(l,w,r)},[w,r,l]),P=Re.useCallback(()=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>b(!0),100)},[]),I=Re.useCallback(()=>{E.current&&clearTimeout(E.current),b(!1)},[]);return n?me.jsx(Ee.Box,{ref:p,children:e({id:w,data:r,isActive:x,isLowZoom:R})}):me.jsxs(Ee.Box,{ref:p,onClick:S,onDoubleClick:A,onMouseEnter:P,onMouseLeave:I,cursor:"pointer",transition:"transform 0.1s ease",position:"relative",children:[(C||_&&_.length>0)&&m&&!R&&me.jsxs(me.Fragment,{children:[me.jsx(Ee.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>b(!0),onMouseLeave:I}),C?me.jsx(Ee.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>b(!0),onMouseLeave:I,willChange:"transform",children:C({nodeId:w,nodeData:r,isRoot:w==="root",isParent:!!n,isHovered:m,setIsHovered:b})}):me.jsx(Ee.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:v,p:3,borderColor:h,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>b(!0),onMouseLeave:I,willChange:"transform",children:me.jsx(Ee.HStack,{px:2,spacing:2,children:_.map((D,M)=>me.jsxs(Ee.Box,{display:"contents",children:[M>0&&me.jsx(Ee.Box,{borderColor:h,height:5,borderRightWidth:1}),me.jsx(HL,{icon:D.icon,label:D.label,color:g,bgColor:v,borderColor:h,textColor:g,boxSize:5,onClick:O=>{var N;O.stopPropagation(),(N=l.onNodeHoverAction)==null||N.call(l,D.id,w,r)}})]},D.id))})})]}),e({id:w,data:r,isActive:x,isLowZoom:R})]})},nl=Re.memo(KL),jL=({id:r,data:e,isActive:t})=>{var u,l,c;const{themeColor:n}=si(),{bgColor:a,borderColor:i,textColor:o}=os(((u=e==null?void 0:e.viewProps)==null?void 0:u.bgColor)||n),s=Pt(((l=e==null?void 0:e.viewProps)==null?void 0:l.textColor)||o);return me.jsx(Ee.Box,{borderRadius:(c=e==null?void 0:e.viewProps)==null?void 0:c.borderRadius,bgColor:a,borderColor:t?"white":i,_hover:{borderColor:"white"},borderWidth:2,py:14,px:20,whiteSpace:"normal",children:me.jsx(Ee.Flex,{justifyContent:"start",w:900,fontSize:"5xl",lineHeight:"normal",children:me.jsx(Ee.Text,{color:s,fontWeight:"bold",children:(e==null?void 0:e.label)||(e==null?void 0:e.text)||""})})})},YL=({id:r,isActive:e,data:t})=>{var v,h,g,p;const{themeColor:n}=si(),a=((v=t==null?void 0:t.viewProps)==null?void 0:v.bgColor)||n,{borderColor:i,highlightColor:o,textColor:s}=os(a),u=Pt(((h=t==null?void 0:t.viewProps)==null?void 0:h.textColor)||s),l=Pt(((g=t==null?void 0:t.viewProps)==null?void 0:g.borderColor)||i),c=a!=null&&a.startsWith("#")?a:Pt(o);return me.jsx(Ee.Flex,{align:"center",borderRadius:(p=t==null?void 0:t.viewProps)==null?void 0:p.borderRadius,bgColor:c,style:{backgroundColor:c},textTransform:"capitalize",borderColor:e?"white":l,_hover:{borderColor:"white"},borderWidth:2,px:50,whiteSpace:"nowrap",children:me.jsx(Ee.Flex,{justifyContent:"start",py:14,fontSize:"5xl",lineHeight:"normal",w:900,children:me.jsx(Ee.Text,{color:u,fontWeight:"bold",children:(t==null?void 0:t.label)||(t==null?void 0:t.text)||""})})})},$R=(r,e)=>{var u,l,c;const t=((u=r==null?void 0:r.viewProps)==null?void 0:u.bgColor)||e,[n]=t.split("."),a=os(t),i=t!=null&&t.startsWith("#")?Pt(t):Pt(a.bgColor),o=Pt(((l=r==null?void 0:r.viewProps)==null?void 0:l.textColor)||a.textColor),s=Pt(((c=r==null?void 0:r.viewProps)==null?void 0:c.borderColor)||a.borderColor);return{...a,bg:t,wordBeforeDot:n,hexbgColor:i,hextextColor:o,hexborderColor:s}},ZL=(r,e=350)=>`${String(r).substring(0,e)}${String(r).length>e?"...":""}`,VR=r=>r!=null&&r.includes("root")?r.replace("root","untitled"):r,XL=r=>{const e=Math.max(...Object.keys(r||{}).map(n=>n.length),0);return Math.max(e*28+30,200)},GR=r=>me.jsx(nl,{...r,children:e=>me.jsx(jL,{...e})}),WR=r=>me.jsx(nl,{...r,children:e=>me.jsx(YL,{...e})}),UR=r=>{const{themeColor:e}=si();return me.jsx(nl,{...r,children:({data:t,isActive:n,isLowZoom:a})=>{var u,l,c;const i=$R(t,e),o=Object.entries(t.description||{}).length>0,s=XL(t.description);return me.jsx(Ee.Flex,{justifyContent:"space-between",...t==null?void 0:t.viewProps,direction:"column",p:0,borderRadius:(u=t==null?void 0:t.viewProps)==null?void 0:u.borderRadius,overflow:"hidden",alignItems:"center",style:{backgroundColor:i.hexbgColor,transition:"border-color 0.2s ease-in-out"},width:"100%",borderColor:n?"white":i.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:me.jsxs(Ee.Flex,{width:"100%",direction:"column",borderRadius:(l=t==null?void 0:t.viewProps)==null?void 0:l.borderRadius,borderColor:i.hexborderColor,borderWidth:0,overflow:"hidden",children:[t.headerTitle&&me.jsx(Ee.Flex,{justify:"flex-start",direction:"row",p:Object.entries(t.description||{}).length?8:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",textOverflow:"ellipsis",alignItems:"center",fontWeight:"bold",textColor:i.propertyColor,bgColor:i.highlightColor,borderBottomColor:o?i.hexborderColor:"transparent",children:me.jsx(Ee.Text,{fontSize:"5xl",noOfLines:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(c=t==null?void 0:t.viewProps)==null?void 0:c.textColor,children:VR(t.headerTitle)})}),me.jsx(Ee.Box,{children:Object.entries(t.description||{}).map(([v,h],g)=>{var m,b;const p=Pn(i.wordBeforeDot)[typeof h],E=Pn(i.wordBeforeDot).property;return me.jsxs(Ee.Box,{children:[me.jsxs(Ee.Flex,{flexWrap:"nowrap",overflow:"hidden",children:[me.jsx(Ee.Flex,{justifyContent:"start",align:"center",background:i.highlightColor,width:`${s}px`,minWidth:`${s}px`,borderRightColor:i.hexborderColor,borderRightWidth:1,children:me.jsx(Ee.Text,{py:5,px:10,w:"100%",whiteSpace:"nowrap",fontWeight:"bold",fontSize:"4xl",textColor:((m=t==null?void 0:t.viewProps)==null?void 0:m.textColor)||E,children:v})}),me.jsx(Ee.Flex,{flex:1,justifyContent:"start",overflow:"hidden",p:4,background:i.hexbgColor,w:600,maxH:200,children:me.jsx(Ee.Text,{overflow:"hidden",py:3,px:4,whiteSpace:"normal",textOverflow:"ellipsis",fontSize:"4xl",textColor:((b=t==null?void 0:t.viewProps)==null?void 0:b.textColor)||p,fontWeight:400,children:ZL(h)})})]}),g!==Object.entries(t.description||{}).length-1&&me.jsx(Ee.Divider,{borderWidth:1,orientation:"horizontal",my:0,borderColor:i.hexborderColor})]},g)})})]})})}})},HR=r=>{const{themeColor:e}=si();return me.jsx(nl,{...r,children:({data:t,isActive:n})=>{var i,o;const a=$R(t,e);return me.jsx(Ee.Flex,{justifyContent:"space-between",...t==null?void 0:t.viewProps,direction:"column",p:0,borderRadius:((i=t==null?void 0:t.viewProps)==null?void 0:i.borderRadius)||15,overflow:"hidden",bgColor:a.bgColor,position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",style:{backgroundColor:a.hexbgColor,transition:"border-color 0.2s ease-in-out"},borderColor:n?"white":a.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:t.headerTitle&&me.jsx(Ee.Flex,{justify:"flex-start",direction:"row",p:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",alignItems:"center",fontWeight:"bold",textColor:a.propertyColor,bgColor:a.highlightColor,borderBottomColor:a.hexborderColor,children:me.jsx(Ee.Text,{fontSize:"5xl",noOfLines:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(o=t==null?void 0:t.viewProps)==null?void 0:o.textColor,children:VR(t.headerTitle)})})})}})};GR.displayName="text";WR.displayName="arrayView";UR.displayName="NodeJsonObjectView";HR.displayName="ParentContainerView";const ic={objectView:Re.memo(UR),arrayView:Re.memo(WR),text:Re.memo(GR),parentContainer:Re.memo(HR)},QL=r=>[{selector:"node",style:{"outline-opacity":0,"background-opacity":0,"background-color":"transparent","border-color":"transparent",color:"transparent","border-opacity":0,"text-valign":"center","text-halign":"center","border-width":0,"outline-width":0,width:60,height:60}},{selector:"node:selected",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:"node:active",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:":parent",style:{shape:"round-rectangle","background-opacity":.4,"corner-radius":50,"line-color":r("light"),"background-color":r(),"border-color":r(),"border-width":6,"border-style":"solid","border-opacity":1,padding:"120px","text-valign":"top","font-size":"70px","font-weight":"bold","text-margin-y":90,"text-background-opacity":0,"text-background-padding":"45px","z-index":1e3,"compound-sizing-wrt-labels":"include",label:"data(label)"}},{selector:"edge",style:{width:6,label:"data(label)","z-index":-100,"control-point-step-size":10,"taxi-direction":"horizontal","curve-style":"round-taxi","edge-distances":"intersection","line-color":r("light"),color:r("light"),"text-rotation":"autorotate","target-arrow-color":r("light"),"source-arrow-color":r("light"),"target-arrow-shape":"triangle","arrow-scale":"3","text-background-color":r("dark"),"text-background-opacity":1,"text-background-padding":"15px","taxi-radius":500,"source-arrow-fill":"filled","target-arrow-fill":"filled","text-max-width":"200px","font-size":"45px","text-wrap":"wrap","text-margin-x":50,"transition-duration":"0.5s","source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","source-distance-from-node":40,"target-distance-from-node":40}}],oc=(r,e,t,n)=>{if(!r)return{controlPointDistances:[0],controlPointWeights:[.5]};const a=r.edges().filter(l=>{const c=l.data();return c.source===e&&c.target===t||c.source===t&&c.target===e});if(a.length<=1)return{controlPointDistances:[0],controlPointWeights:[.5]};let i=0;a.forEach((l,c)=>{l.data().id===n&&(i=c)});const o=a.length;return{controlPointDistances:[(i-(o-1)/2)*60],controlPointWeights:[.5]}},JL=r=>{const n=1/(Math.cbrt(r)*.8);let a=Math.round(650*n),i=Math.round(350*n);return a=Math.max(40,Math.min(450,a)),i=Math.max(30,Math.min(300,i)),{edgeSep:a,rankSep:i}};function eq({cytoInstance:r,id:e,source:t,type:n,target:a,label:i,children:o,layout:s,styleCallback:u}){const l=Re.useRef(null),c=Re.useRef(null),[v,h]=Re.useState(2);let g,p;function E(C){if(u){const R=u(C,t,a);g=R.hasOwnProperty("line-style"),p=R.hasOwnProperty("source-arrow-shape"),C.style(R)}}const m=Re.useCallback(()=>{if(!g)return;const C=r.getElementById(e);if(C.length===0)return;const P=Date.now()*.1%(20*50),I=p?P:-P;C.style("line-dash-offset",I),c.current=requestAnimationFrame(m)},[g,r,e,p]);function b(C){const R=oc(r,t,a,e),S=r.add({data:{...C,controlPointDistances:R.controlPointDistances,controlPointWeights:R.controlPointWeights}});E(S),g&&(c.current=requestAnimationFrame(m))}function w(C,R){let S=2;return r.getElementById(C).length===1&&(S-=1),r.getElementById(R).length===1&&(S-=1),S}if(Re.useEffect(()=>{if(w(t,a)===0){const R=r.getElementById(e);if(R.length===0){const S=oc(r,t,a,e),A=r.add({data:{id:e,source:t,target:a,label:i,type:n,controlPointDistances:S.controlPointDistances,controlPointWeights:S.controlPointWeights}});E(A),g&&(c.current=requestAnimationFrame(m))}else{const S=oc(r,t,a,e);R.data({source:t,target:a,label:i,type:n,controlPointDistances:S.controlPointDistances,controlPointWeights:S.controlPointWeights}),E(R)}}},[t,a,e,i,n,r,g,m]),Re.useEffect(()=>{function C(S){const A=S.target.id();if(A===t||A===a){const P=w(t,a);P!==v&&h(P),P===0&&b({id:e,source:t,target:a,label:i,type:n})}}function R(S){const A=S.target.id();if(A===t||A===a){const P=w(t,a);P!==v&&h(P),P>0&&(r.getElementById(e).remove(),c.current&&cancelAnimationFrame(c.current))}}return r.on("add","node",C),r.on("remove","node",R),g&&v===0&&(c.current=requestAnimationFrame(m)),()=>{r.getElementById(e).remove(),r.off("add","node",C),r.off("remove","node",R),c.current&&cancelAnimationFrame(c.current)}},[]),Re.useEffect(()=>(g&&v===0?c.current||(c.current=requestAnimationFrame(m)):!g&&c.current&&(cancelAnimationFrame(c.current),c.current=null),()=>{c.current&&cancelAnimationFrame(c.current)}),[g,v,m]),Re.useEffect(()=>{s()},[e,o]),Re.useEffect(()=>{if(!v){const C=r.getElementById(e);E(C)}},[u,v]),v>0)return null;function x(C){return Re.cloneElement(C,{cytoInstance:r,layout:s})}const _=Re.Children.map(o,x);return me.jsx("div",{ref:l,className:"cytoscape-react-edge",children:_})}function am(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function rq(r){if(Array.isArray(r))return r}function tq(r){if(Array.isArray(r))return am(r)}function Da(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nq(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,jR(n.key),n)}}function Ia(r,e,t){return e&&nq(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function Ft(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Cm(r))||e){t&&(r=t);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){t=t.call(r)},n:function(){var
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kr(r,e){return rq(r)||iq(r,e)||Cm(r,e)||oq()}function Vu(r){return tq(r)||aq(r)||Cm(r)||sq()}function uq(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function jR(r){var e=uq(r,"string");return typeof e=="symbol"?e:e+""}function et(r){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(r)}function Cm(r,e){if(r){if(typeof r=="string")return am(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?am(r,e):void 0}}var Qr=typeof window>"u"?null:window,M1=Qr?Qr.navigator:null;Qr&&Qr.document;var lq=et(""),YR=et({}),fq=et(function(){}),cq=typeof HTMLElement>"u"?"undefined":et(HTMLElement),us=function(e){return e&&e.instanceString&&Nr(e.instanceString)?e.instanceString():null},Ge=function(e){return e!=null&&et(e)==lq},Nr=function(e){return e!=null&&et(e)===fq},Sr=function(e){return!jt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},pr=function(e){return e!=null&&et(e)===YR&&!Sr(e)&&e.constructor===Object},dq=function(e){return e!=null&&et(e)===YR},De=function(e){return e!=null&&et(e)===et(1)&&!isNaN(e)},vq=function(e){return De(e)&&Math.floor(e)===e},Gu=function(e){if(cq!=="undefined")return e!=null&&e instanceof HTMLElement},jt=function(e){return ls(e)||ZR(e)},ls=function(e){return us(e)==="collection"&&e._private.single},ZR=function(e){return us(e)==="collection"&&!e._private.single},Sm=function(e){return us(e)==="core"},XR=function(e){return us(e)==="stylesheet"},hq=function(e){return us(e)==="event"},xa=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},gq=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},pq=function(e){return pr(e)&&De(e.x1)&&De(e.x2)&&De(e.y1)&&De(e.y2)},yq=function(e){return dq(e)&&Nr(e.then)},mq=function(){return M1&&M1.userAgent.match(/msie|trident|edge/i)},Qi=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function(){var i=this,o=arguments,s,u=t.apply(i,o),l=n.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return n.cache={},n},Tm=Qi(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),al=Qi(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),QR=Qi(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),k1=function(e){return xa(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ga=function(e,t){return e.slice(-1*t.length)===t},Jr="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",bq="rgb[a]?\\(("+Jr+"[%]?)\\s*,\\s*("+Jr+"[%]?)\\s*,\\s*("+Jr+"[%]?)(?:\\s*,\\s*("+Jr+"))?\\)",wq="rgb[a]?\\((?:"+Jr+"[%]?)\\s*,\\s*(?:"+Jr+"[%]?)\\s*,\\s*(?:"+Jr+"[%]?)(?:\\s*,\\s*(?:"+Jr+"))?\\)",xq="hsl[a]?\\(("+Jr+")\\s*,\\s*("+Jr+"[%])\\s*,\\s*("+Jr+"[%])(?:\\s*,\\s*("+Jr+"))?\\)",Eq="hsl[a]?\\((?:"+Jr+")\\s*,\\s*(?:"+Jr+"[%])\\s*,\\s*(?:"+Jr+"[%])(?:\\s*,\\s*(?:"+Jr+"))?\\)",_q="\\#[0-9a-fA-F]{3}",Cq="\\#[0-9a-fA-F]{6}",JR=function(e,t){return e<t?-1:e>t?1:0},Sq=function(e,t){return-1*JR(e,t)},He=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];r[o]=n[o]}}return r},Tq=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,n,a,i,o=16;return t?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},Rq=function(e){var t,n,a,i,o,s,u,l;function c(p,E,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(E-p)*6*m:m<1/2?E:m<2/3?p+(E-p)*(2/3-m)*6:p}var v=new RegExp("^"+xq+"$").exec(e);if(v){if(n=parseInt(v[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(v[2]),a<0||a>100||(a=a/100,i=parseFloat(v[3]),i<0||i>100)||(i=i/100,o=v[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)s=u=l=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,g=2*i-h;s=Math.round(255*c(g,h,n+1/3)),u=Math.round(255*c(g,h,n)),l=Math.round(255*c(g,h,n-1/3))}t=[s,u,l,o]}return t},Aq=function(e){var t,n=new RegExp("^"+bq+"$").exec(e);if(n){t=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var s=a[1]||a[2]||a[3],u=a[1]&&a[2]&&a[3];if(s&&!u)return;var l=n[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},Pq=function(e){return Dq[e.toLowerCase()]},e2=function(e){return(Sr(e)?e:null)||Pq(e)||Tq(e)||Aq(e)||Rq(e)},Dq={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},r2=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to set map with object key");i<n.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},t2=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to get map with object key");if(t=t[o],t==null)return t}return t},hu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var sc,L1;function cs(){if(L1)return sc;L1=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return sc=r,sc}var uc,q1;function Iq(){if(q1)return uc;q1=1;var r=typeof hu=="object"&&hu&&hu.Object===Object&&hu;return uc=r,uc}var lc,N1;function il(){if(N1)return lc;N1=1;var r=Iq(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return lc=t,lc}var fc,F1;function Bq(){if(F1)return fc;F1=1;var r=il(),e=function(){return r.Date.now()};return fc=e,fc}var cc,z1;function Oq(){if(z1)return cc;z1=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return cc=e,cc}var dc,$1;function Mq(){if($1)return dc;$1=1;var r=Oq(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return dc=t,dc}var vc,V1;function Rm(){if(V1)return vc;V1=1;var r=il(),e=r.Symbol;return vc=e,vc}var hc,G1;function kq(){if(G1)return hc;G1=1;var r=Rm(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),u=o[a];try{o[a]=void 0;var l=!0}catch{}var c=n.call(o);return l&&(s?o[a]=u:delete o[a]),c}return hc=i,hc}var gc,W1;function Lq(){if(W1)return gc;W1=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return gc=t,gc}var pc,U1;function n2(){if(U1)return pc;U1=1;var r=Rm(),e=kq(),t=Lq(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return pc=o,pc}var yc,H1;function qq(){if(H1)return yc;H1=1;function r(e){return e!=null&&typeof e=="object"}return yc=r,yc}var mc,K1;function ds(){if(K1)return mc;K1=1;var r=n2(),e=qq(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return mc=n,mc}var bc,j1;function Nq(){if(j1)return bc;j1=1;var r=Mq(),e=cs(),t=ds(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(t(l))return n;if(e(l)){var c=typeof l.valueOf=="function"?l.valueOf():l;l=e(c)?c+"":c}if(typeof l!="string")return l===0?l:+l;l=r(l);var v=i.test(l);return v||o.test(l)?s(l.slice(2),v?2:8):a.test(l)?n:+l}return bc=u,bc}var wc,Y1;function Fq(){if(Y1)return wc;Y1=1;var r=cs(),e=Bq(),t=Nq(),n="Expected a function",a=Math.max,i=Math.min;function o(s,u,l){var c,v,h,g,p,E,m=0,b=!1,w=!1,x=!0;if(typeof s!="function")throw new TypeError(n);u=t(u)||0,r(l)&&(b=!!l.leading,w="maxWait"in l,h=w?a(t(l.maxWait)||0,u):h,x="trailing"in l?!!l.trailing:x);function _(O){var N=c,V=v;return c=v=void 0,m=O,g=s.apply(V,N),g}function C(O){return m=O,p=setTimeout(A,u),b?_(O):g}function R(O){var N=O-E,V=O-m,$=u-N;return w?i($,h-V):$}function S(O){var N=O-E,V=O-m;return E===void 0||N>=u||N<0||w&&V>=h}function A(){var O=e();if(S(O))return P(O);p=setTimeout(A,R(O))}function P(O){return p=void 0,x&&c?_(O):(c=v=void 0,g)}function I(){p!==void 0&&clearTimeout(p),m=0,c=E=v=p=void 0}function D(){return p===void 0?g:P(e())}function M(){var O=e(),N=S(O);if(c=arguments,v=this,E=O,N){if(p===void 0)return C(E);if(w)return clearTimeout(p),p=setTimeout(A,u),_(E)}return p===void 0&&(p=setTimeout(A,u)),g}return M.cancel=I,M.flush=D,M}return wc=o,wc}var zq=Fq(),vs=fs(zq),xc=Qr?Qr.performance:null,a2=xc&&xc.now?function(){return xc.now()}:function(){return Date.now()},$q=(function(){if(Qr){if(Qr.requestAnimationFrame)return function(r){Qr.requestAnimationFrame(r)};if(Qr.mozRequestAnimationFrame)return function(r){Qr.mozRequestAnimationFrame(r)};if(Qr.webkitRequestAnimationFrame)return function(r){Qr.webkitRequestAnimationFrame(r)};if(Qr.msRequestAnimationFrame)return function(r){Qr.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(a2())},1e3/60)}})(),Wu=function(e){return $q(e)},jn=a2,Xa=9261,i2=65599,Vi=5381,o2=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xa,n=t,a;a=e.next(),!a.done;)n=n*i2+a.value|0;return n},Yo=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xa;return t*i2+e|0},Zo=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vi;return(t<<5)+t+e|0},Vq=function(e,t){return e*2097152+t},da=function(e){return e[0]*2097152+e[1]},gu=function(e,t){return[Yo(e[0],t[0]),Zo(e[1],t[1])]},Z1=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return o2(o,t)},ti=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return o2(o,t)},s2=function(){return Gq(arguments)},Gq=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];n===0?t=ti(a):t=ti(a,t)}return t};function Wq(r,e,t,n,a){var i=a*Math.PI/180,o=Math.cos(i)*(r-t)-Math.sin(i)*(e-n)+t,s=Math.sin(i)*(r-t)+Math.cos(i)*(e-n)+n;return{x:o,y:s}}var Uq=function(e,t,n,a,i,o){return{x:(e-n)*i+n,y:(t-a)*o+a}};function Hq(r,e,t){if(t===0)return r;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=Wq(r.x,r.y,n,a,t),u=Uq(s.x,s.y,n,a,i,o);return{x:u.x,y:u.y}}var X1=!0,Kq=console.warn!=null,jq=console.trace!=null,Am=Number.MAX_SAFE_INTEGER||9007199254740991,u2=function(){return!0},Uu=function(){return!1},Q1=function(){return 0},Pm=function(){},Mr=function(e){throw new Error(e)},l2=function(e){if(e!==void 0)X1=!!e;else return X1},Er=function(e){l2()&&(Kq?console.warn(e):(console.log(e),jq&&console.trace()))},Yq=function(e){return He({},e)},Dn=function(e){return e==null?e:Sr(e)?e.slice():pr(e)?Yq(e):e},Zq=function(e){return e.slice()},f2=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},Xq={},c2=function(){return Xq},ht=function(e){var t=Object.keys(e);return function(n){for(var a={},i=0;i<t.length;i++){var o=t[i],s=n==null?void 0:n[o];a[o]=s===void 0?e[o]:s}return a}},Ea=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},Dm=function(e){e.splice(0,e.length)},Qq=function(e,t){for(var n=0;n<t.length;n++){var a=t[n];e.push(a)}},qt=function(e,t,n){return n&&(t=QR(n,t)),e[t]},Hn=function(e,t,n,a){n&&(t=QR(n,t)),e[t]=a},Jq=(function(){function r(){Da(this,r),this._obj={}}return Ia(r,[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])})(),Kn=typeof Map<"u"?Map:Jq,eN="undefined",rN=(function(){function r(e){if(Da(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var n=0;n<t.length;n++)this.add(t[n])}}return Ia(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;n[t]!==1&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;n[t]===1&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])})(),ro=(typeof Set>"u"?"undefined":et(Set))!==eN?Set:rN,ol=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Sm(e)){Mr("An element must have a core reference and parameters set");return}var a=t.group;if(a==null&&(t.data&&t.data.source!=null&&t.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Mr("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?a==="edges":!!t.pannable,active:!1,classes:new ro,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Sr(t.classes)?l=t.classes:Ge(t.classes)&&(l=t.classes.split(/\s+/));for(var c=0,v=l.length;c<v;c++){var h=l[c];!h||h===""||i.classes.add(h)}this.createEmitter(),(n===void 0||n)&&this.restore();var g=t.style||t.css;g&&(Er("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(g))},J1=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;pr(n)&&!jt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!Nr(a)?a:i,a=Nr(a)?a:function(){};for(var s=this._private.cy,u=n=Ge(n)?this.filter(n):n,l=[],c=[],v={},h={},g={},p=0,E,m=this.byGroup(),b=m.nodes,w=m.edges,x=0;x<u.length;x++){var _=u[x],C=_.id();_.isNode()&&(l.unshift(_),e.bfs&&(g[C]=!0,c.push(_)),h[C]=0)}for(var R=function(){var O=e.bfs?l.shift():l.pop(),N=O.id();if(e.dfs){if(g[N])return 0;g[N]=!0,c.push(O)}var V=h[N],$=v[N],G=$!=null?$.source():null,U=$!=null?$.target():null,J=$==null?void 0:O.same(G)?U[0]:G[0],W;if(W=a(O,$,J,p++,V),W===!0)return E=O,1;if(W===!1)return 1;for(var H=O.connectedEdges().filter(function(j){return(!i||j.source().same(O))&&w.has(j)}),Z=0;Z<H.length;Z++){var ne=H[Z],F=ne.connectedNodes().filter(function(j){return!j.same(O)&&b.has(j)}),z=F.id();F.length!==0&&!g[z]&&(F=F[0],l.push(F),e.bfs&&(g[z]=!0,c.push(F)),v[z]=ne,h[z]=h[N]+1)}},S;l.length!==0&&(S=R(),!(S!==0&&S===1)););for(var A=s.collection(),P=0;P<c.length;P++){var I=c[P],D=v[I.id()];D!=null&&A.push(D),A.push(I)}return{path:s.collection(A),found:s.collection(E)}}},Xo={breadthFirstSearch:J1({bfs:!0}),depthFirstSearch:J1({dfs:!0})};Xo.bfs=Xo.breadthFirstSearch;Xo.dfs=Xo.depthFirstSearch;var Au={exports:{}},tN=Au.exports,ew;function nN(){return ew||(ew=1,(function(r,e){(function(){var t,n,a,i,o,s,u,l,c,v,h,g,p,E,m;a=Math.floor,v=Math.min,n=function(b,w){return b<w?-1:b>w?1:0},c=function(b,w,x,_,C){var R;if(x==null&&(x=0),C==null&&(C=n),x<0)throw new Error("lo must be non-negative");for(_==null&&(_=b.length);x<_;)R=a((x+_)/2),C(w,b[R])<0?_=R:x=R+1;return[].splice.apply(b,[x,x-x].concat(w)),w},s=function(b,w,x){return x==null&&(x=n),b.push(w),E(b,0,b.length-1,x)},o=function(b,w){var x,_;return w==null&&(w=n),x=b.pop(),b.length?(_=b[0],b[0]=x,m(b,0,w)):_=x,_},l=function(b,w,x){var _;return x==null&&(x=n),_=b[0],b[0]=w,m(b,0,x),_},u=function(b,w,x){var _;return x==null&&(x=n),b.length&&x(b[0],w)<0&&(_=[b[0],w],w=_[0],b[0]=_[1],m(b,0,x)),w},i=function(b,w){var x,_,C,R,S,A;for(w==null&&(w=n),R=(function(){A=[];for(var P=0,I=a(b.length/2);0<=I?P<I:P>I;0<=I?P++:P--)A.push(P);return A}).apply(this).reverse(),S=[],_=0,C=R.length;_<C;_++)x=R[_],S.push(m(b,x,w));return S},p=function(b,w,x){var _;if(x==null&&(x=n),_=b.indexOf(w),_!==-1)return E(b,0,_,x),m(b,_,x)},h=function(b,w,x){var _,C,R,S,A;if(x==null&&(x=n),C=b.slice(0,w),!C.length)return C;for(i(C,x),A=b.slice(w),R=0,S=A.length;R<S;R++)_=A[R],u(C,_,x);return C.sort(x).reverse()},g=function(b,w,x){var _,C,R,S,A,P,I,D,M;if(x==null&&(x=n),w*10<=b.length){if(R=b.slice(0,w).sort(x),!R.length)return R;for(C=R[R.length-1],I=b.slice(w),S=0,P=I.length;S<P;S++)_=I[S],x(_,C)<0&&(c(R,_,0,null,x),R.pop(),C=R[R.length-1]);return R}for(i(b,x),M=[],A=0,D=v(w,b.length);0<=D?A<D:A>D;0<=D?++A:--A)M.push(o(b,x));return M},E=function(b,w,x,_){var C,R,S;for(_==null&&(_=n),C=b[x];x>w;){if(S=x-1>>1,R=b[S],_(C,R)<0){b[x]=R,x=S;continue}break}return b[x]=C},m=function(b,w,x){var _,C,R,S,A;for(x==null&&(x=n),C=b.length,A=w,R=b[w],_=2*w+1;_<C;)S=_+1,S<C&&!(x(b[_],b[S])<0)&&(_=S),b[w]=b[_],w=_,_=2*w+1;return b[w]=R,E(b,A,w,x)},t=(function(){b.push=s,b.pop=o,b.replace=l,b.pushpop=u,b.heapify=i,b.updateItem=p,b.nlargest=h,b.nsmallest=g;function b(w){this.cmp=w??n,this.nodes=[]}return b.prototype.push=function(w){return s(this.nodes,w,this.cmp)},b.prototype.pop=function(){return o(this.nodes,this.cmp)},b.prototype.peek=function(){return this.nodes[0]},b.prototype.contains=function(w){return this.nodes.indexOf(w)!==-1},b.prototype.replace=function(w){return l(this.nodes,w,this.cmp)},b.prototype.pushpop=function(w){return u(this.nodes,w,this.cmp)},b.prototype.heapify=function(){return i(this.nodes,this.cmp)},b.prototype.updateItem=function(w){return p(this.nodes,w,this.cmp)},b.prototype.clear=function(){return this.nodes=[]},b.prototype.empty=function(){return this.nodes.length===0},b.prototype.size=function(){return this.nodes.length},b.prototype.clone=function(){var w;return w=new b,w.nodes=this.nodes.slice(0),w},b.prototype.toArray=function(){return this.nodes.slice(0)},b.prototype.insert=b.prototype.push,b.prototype.top=b.prototype.peek,b.prototype.front=b.prototype.peek,b.prototype.has=b.prototype.contains,b.prototype.copy=b.prototype.clone,b})(),(function(b,w){return r.exports=w()})(this,function(){return t})}).call(tN)})(Au)),Au.exports}var Ec,rw;function aN(){return rw||(rw=1,Ec=nN()),Ec}var iN=aN(),hs=fs(iN),oN=ht({root:null,weight:function(e){return 1},directed:!1}),sN={dijkstra:function(e){if(!pr(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=oN(e),a=n.root,i=n.weight,o=n.directed,s=this,u=i,l=Ge(a)?this.filter(a)[0]:a[0],c={},v={},h={},g=this.byGroup(),p=g.nodes,E=g.edges;E.unmergeBy(function(V){return V.isLoop()});for(var m=function($){return c[$.id()]},b=function($,G){c[$.id()]=G,w.updateItem($)},w=new hs(function(V,$){return m(V)-m($)}),x=0;x<p.length;x++){var _=p[x];c[_.id()]=_.same(l)?0:1/0,w.push(_)}for(var C=function($,G){for(var U=(o?$.edgesTo(G):$.edgesWith(G)).intersect(E),J=1/0,W,H=0;H<U.length;H++){var Z=U[H],ne=u(Z);(ne<J||!W)&&(J=ne,W=Z)}return{edge:W,dist:J}};w.size()>0;){var R=w.pop(),S=m(R),A=R.id();if(h[A]=S,S!==1/0)for(var P=R.neighborhood().intersect(p),I=0;I<P.length;I++){var D=P[I],M=D.id(),O=C(R,D),N=S+O.dist;N<m(D)&&(b(D,N),v[M]={node:R,edge:O.edge})}}return{distanceTo:function($){var G=Ge($)?p.filter($)[0]:$[0];return h[G.id()]},pathTo:function($){var G=Ge($)?p.filter($)[0]:$[0],U=[],J=G,W=J.id();if(G.length>0)for(U.unshift(G);v[W];){var H=v[W];U.unshift(H.edge),U.unshift(H.node),J=H.node,W=J.id()}return s.spawn(U)}}}},uN={kruskal:function(e){e=e||function(x){return 1};for(var t=this.byGroup(),n=t.nodes,a=t.edges,i=n.length,o=new Array(i),s=n,u=function(_){for(var C=0;C<o.length;C++){var R=o[C];if(R.has(_))return C}},l=0;l<i;l++)o[l]=this.spawn(n[l]);for(var c=a.sort(function(x,_){return e(x)-e(_)}),v=0;v<c.length;v++){var h=c[v],g=h.source()[0],p=h.target()[0],E=u(g),m=u(p),b=o[E],w=o[m];E!==m&&(s.merge(h),b.merge(w),o.splice(m,1))}return s}},lN=ht({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),fN={aStar:function(e){var t=this.cy(),n=lN(e),a=n.root,i=n.goal,o=n.heuristic,s=n.directed,u=n.weight;a=t.collection(a)[0],i=t.collection(i)[0];var l=a.id(),c=i.id(),v={},h={},g={},p=new hs(function(W,H){return h[W.id()]-h[H.id()]}),E=new ro,m={},b={},w=function(H,Z){p.push(H),E.add(Z)},x,_,C=function(){x=p.pop(),_=x.id(),E.delete(_)},R=function(H){return E.has(H)};w(a,l),v[l]=0,h[l]=o(a);for(var S=0;p.size()>0;){if(C(),S++,_===c){for(var A=[],P=i,I=c,D=b[I];A.unshift(P),D!=null&&A.unshift(D),P=m[I],P!=null;)I=P.id(),D=b[I];return{found:!0,distance:v[_],path:this.spawn(A),steps:S}}g[_]=!0;for(var M=x._private.edges,O=0;O<M.length;O++){var N=M[O];if(this.hasElementWithId(N.id())&&!(s&&N.data("source")!==_)){var V=N.source(),$=N.target(),G=V.id()!==_?V:$,U=G.id();if(this.hasElementWithId(U)&&!g[U]){var J=v[_]+u(N);if(!R(U)){v[U]=J,h[U]=J+o(G),w(G,U),m[U]=x,b[U]=N;continue}J<v[U]&&(v[U]=J,h[U]=J+o(G),m[U]=x,b[U]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:S}}},cN=ht({weight:function(e){return 1},directed:!1}),dN={floydWarshall:function(e){for(var t=this.cy(),n=cN(e),a=n.weight,i=n.directed,o=a,s=this.byGroup(),u=s.nodes,l=s.edges,c=u.length,v=c*c,h=function(ne){return u.indexOf(ne)},g=function(ne){return u[ne]},p=new Array(v),E=0;E<v;E++){var m=E%c,b=(E-m)/c;b===m?p[E]=0:p[E]=1/0}for(var w=new Array(v),x=new Array(v),_=0;_<l.length;_++){var C=l[_],R=C.source()[0],S=C.target()[0];if(R!==S){var A=h(R),P=h(S),I=A*c+P,D=o(C);if(p[I]>D&&(p[I]=D,w[I]=P,x[I]=C),!i){var M=P*c+A;!i&&p[M]>D&&(p[M]=D,w[M]=A,x[M]=C)}}}for(var O=0;O<c;O++)for(var N=0;N<c;N++)for(var V=N*c+O,$=0;$<c;$++){var G=N*c+$,U=O*c+$;p[V]+p[U]<p[G]&&(p[G]=p[V]+p[U],w[G]=w[V])}var J=function(ne){return(Ge(ne)?t.filter(ne):ne)[0]},W=function(ne){return h(J(ne))},H={distance:function(ne,F){var z=W(ne),j=W(F);return p[z*c+j]},path:function(ne,F){var z=W(ne),j=W(F),ee=g(z);if(z===j)return ee.collection();if(w[z*c+j]==null)return t.collection();var ie=t.collection(),oe=z,Y;for(ie.merge(ee);z!==j;)oe=z,z=w[z*c+j],Y=x[oe*c+z],ie.merge(Y),ie.merge(g(z));return ie}};return H}},vN=ht({weight:function(e){return 1},directed:!1,root:null}),hN={bellmanFord:function(e){var t=this,n=vN(e),a=n.weight,i=n.directed,o=n.root,s=a,u=this,l=this.cy(),c=this.byGroup(),v=c.edges,h=c.nodes,g=h.length,p=new Kn,E=!1,m=[];o=l.collection(o)[0],v.unmergeBy(function(ue){return ue.isLoop()});for(var b=v.length,w=function(Se){var Ae=p.get(Se.id());return Ae||(Ae={},p.set(Se.id(),Ae)),Ae},x=function(Se){return(Ge(Se)?l.$(Se):Se)[0]},_=function(Se){return w(x(Se)).dist},C=function(Se){for(var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Te=x(Se),Pe=[],Ie=Te;;){if(Ie==null)return t.spawn();var Le=w(Ie),Fe=Le.edge,je=Le.pred;if(Pe.unshift(Ie[0]),Ie.same(Ae)&&Pe.length>0)break;Fe!=null&&Pe.unshift(Fe),Ie=je}return u.spawn(Pe)},R=0;R<g;R++){var S=h[R],A=w(S);S.same(o)?A.dist=0:A.dist=1/0,A.pred=null,A.edge=null}for(var P=!1,I=function(Se,Ae,Te,Pe,Ie,Le){var Fe=Pe.dist+Le;Fe<Ie.dist&&!Te.same(Pe.edge)&&(Ie.dist=Fe,Ie.pred=Se,Ie.edge=Te,P=!0)},D=1;D<g;D++){P=!1;for(var M=0;M<b;M++){var O=v[M],N=O.source(),V=O.target(),$=s(O),G=w(N),U=w(V);I(N,V,O,G,U,$),i||I(V,N,O,U,G,$)}if(!P)break}if(P)for(var J=[],W=0;W<b;W++){var H=v[W],Z=H.source(),ne=H.target(),F=s(H),z=w(Z).dist,j=w(ne).dist;if(z+F<j||!i&&j+F<z)if(E||(Er("Graph contains a negative weight cycle for Bellman-Ford"),E=!0),e.findNegativeWeightCycles!==!1){var ee=[];z+F<j&&ee.push(Z),!i&&j+F<z&&ee.push(ne);for(var ie=ee.length,oe=0;oe<ie;oe++){var Y=ee[oe],X=[Y];X.push(w(Y).edge);for(var re=w(Y).pred;X.indexOf(re)===-1;)X.push(re),X.push(w(re).edge),re=w(re).pred;X=X.slice(X.indexOf(re));for(var le=X[0].id(),he=0,be=2;be<X.length;be+=2)X[be].id()<le&&(le=X[be].id(),he=be);X=X.slice(he).concat(X.slice(0,he)),X.push(X[0]);var fe=X.map(function(ue){return ue.id()}).join(",");J.indexOf(fe)===-1&&(m.push(u.spawn(X)),J.push(fe))}}else break}return{distanceTo:_,pathTo:C,hasNegativeWeightCycle:E,negativeWeightCycles:m}}},gN=Math.sqrt(2),pN=function(e,t,n){n.length===0&&Mr("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],s=t[i],u=t[o],l=n,c=l.length-1;c>=0;c--){var v=l[c],h=v[1],g=v[2];(t[h]===s&&t[g]===u||t[h]===u&&t[g]===s)&&l.splice(c,1)}for(var p=0;p<l.length;p++){var E=l[p];E[1]===u?(l[p]=E.slice(),l[p][1]=s):E[2]===u&&(l[p]=E.slice(),l[p][2]=s)}for(var m=0;m<t.length;m++)t[m]===u&&(t[m]=s);return l},_c=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=pN(i,e,t),n--}return t},yN={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,a=t.edges;a.unmergeBy(function(U){return U.isLoop()});var i=n.length,o=a.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/gN);if(i<2){Mr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],c=0;c<o;c++){var v=a[c];l.push([c,n.indexOf(v.source()),n.indexOf(v.target())])}for(var h=1/0,g=[],p=new Array(i),E=new Array(i),m=new Array(i),b=function(J,W){for(var H=0;H<i;H++)W[H]=J[H]},w=0;w<=s;w++){for(var x=0;x<i;x++)E[x]=x;var _=_c(E,l.slice(),i,u),C=_.slice();b(E,m);var R=_c(E,_,u,2),S=_c(m,C,u,2);R.length<=S.length&&R.length<h?(h=R.length,g=R,b(E,p)):S.length<=R.length&&S.length<h&&(h=S.length,g=S,b(m,p))}for(var A=this.spawn(g.map(function(U){return a[U[0]]})),P=this.spawn(),I=this.spawn(),D=p[0],M=0;M<p.length;M++){var O=p[M],N=n[M];O===D?P.merge(N):I.merge(N)}var V=function(J){var W=e.spawn();return J.forEach(function(H){W.merge(H),H.connectedEdges().forEach(function(Z){e.contains(Z)&&!A.contains(Z)&&W.merge(Z)})}),W},$=[V(P),V(I)],G={cut:A,components:$,partition1:P,partition2:I};return G}},Cc,mN=function(e){return{x:e.x,y:e.y}},sl=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},d2=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Gi=function(e){return{x:e[0],y:e[1]}},bN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},wN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},xN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=t;o<n;o++){var s=e[o];isFinite(s)&&(a+=s,i++)}return a/i},EN=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(h,g){return h-g});var c=e.length,v=Math.floor(c/2);return c%2!==0?e[v+1+s]:(e[v-1+s]+e[v+s])/2},_N=function(e){return Math.PI*e/180},pu=function(e,t){return Math.atan2(t,e)-Math.PI/2},Im=Math.log2||function(r){return Math.log(r)/Math.log(2)},Bm=function(e){return e>0?1:e<0?-1:0},ni=function(e,t){return Math.sqrt(Ya(e,t))},Ya=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},CN=function(e){for(var t=e.length,n=0,a=0;a<t;a++)n+=e[a];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},at=function(e,t,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*t+a*a*n},Ki=function(e,t,n,a){return{x:at(e.x,t.x,n.x,a),y:at(e.y,t.y,n.y,a)}},SN=function(e,t,n,a){var i={x:t.x-e.x,y:t.y-e.y},o=ni(e,t),s={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+s.x*a,y:e.y+s.y*a}},Qo=function(e,t,n){return Math.max(e,Math.min(n,t))},Dt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},TN=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},RN=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},AN=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},v2=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Pu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Du=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(t.length===1)n=a=i=o=t[0];else if(t.length===2)n=i=t[0],o=a=t[1];else if(t.length===4){var s=Kr(t,4);n=s[0],a=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tw=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Om=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},pa=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},nw=function(e,t){return pa(e,t.x,t.y)},h2=function(e,t){return pa(e,t.x1,t.y1)&&pa(e,t.x2,t.y2)},PN=(Cc=Math.hypot)!==null&&Cc!==void 0?Cc:function(r,e){return Math.sqrt(r*r+e*e)};function DN(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(A,P){return{x:A.x+P.x,y:A.y+P.y}},n=function(A,P){return{x:A.x-P.x,y:A.y-P.y}},a=function(A,P){return{x:A.x*P,y:A.y*P}},i=function(A,P){return A.x*P.y-A.y*P.x},o=function(A){var P=PN(A.x,A.y);return P===0?{x:0,y:0}:{x:A.x/P,y:A.y/P}},s=function(A){for(var P=0,I=0;I<A.length;I++){var D=A[I],M=A[(I+1)%A.length];P+=D.x*M.y-M.x*D.y}return P/2},u=function(A,P,I,D){var M=n(P,A),O=n(D,I),N=i(M,O);if(Math.abs(N)<1e-9)return t(A,a(M,.5));var V=i(n(I,A),O)/N;return t(A,a(M,V))},l=r.map(function(S){return{x:S.x,y:S.y}});s(l)<0&&l.reverse();for(var c=l.length,v=[],h=0;h<c;h++){var g=l[h],p=l[(h+1)%c],E=n(p,g),m=o({x:E.y,y:-E.x});v.push(m)}for(var b=v.map(function(S,A){var P=t(l[A],a(S,e)),I=t(l[(A+1)%c],a(S,e));return{p1:P,p2:I}}),w=[],x=0;x<c;x++){var _=b[(x-1+c)%c],C=b[x],R=u(_.p1,_.p2,C.p1,C.p2);w.push(R)}return w}function IN(r,e,t,n,a,i){var o=zN(r,e,t,n,a),s=DN(o,i),u=Dt();return s.forEach(function(l){return v2(u,l.x,l.y)}),u}var g2=function(e,t,n,a,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?_a(i,o):u,c=i/2,v=o/2;l=Math.min(l,c,v);var h=l!==c,g=l!==v,p;if(h){var E=n-c+l-s,m=a-v-s,b=n+c-l+s,w=m;if(p=ya(e,t,n,a,E,m,b,w,!1),p.length>0)return p}if(g){var x=n+c+s,_=a-v+l-s,C=x,R=a+v-l+s;if(p=ya(e,t,n,a,x,_,C,R,!1),p.length>0)return p}if(h){var S=n-c+l-s,A=a+v+s,P=n+c-l+s,I=A;if(p=ya(e,t,n,a,S,A,P,I,!1),p.length>0)return p}if(g){var D=n-c-s,M=a-v+l-s,O=D,N=a+v-l+s;if(p=ya(e,t,n,a,D,M,O,N,!1),p.length>0)return p}var V;{var $=n-c+l,G=a-v+l;if(V=Lo(e,t,n,a,$,G,l+s),V.length>0&&V[0]<=$&&V[1]<=G)return[V[0],V[1]]}{var U=n+c-l,J=a-v+l;if(V=Lo(e,t,n,a,U,J,l+s),V.length>0&&V[0]>=U&&V[1]<=J)return[V[0],V[1]]}{var W=n+c-l,H=a+v-l;if(V=Lo(e,t,n,a,W,H,l+s),V.length>0&&V[0]>=W&&V[1]>=H)return[V[0],V[1]]}{var Z=n-c+l,ne=a+v-l;if(V=Lo(e,t,n,a,Z,ne,l+s),V.length>0&&V[0]<=Z&&V[1]>=ne)return[V[0],V[1]]}return[]},BN=function(e,t,n,a,i,o,s){var u=s,l=Math.min(n,i),c=Math.max(n,i),v=Math.min(a,o),h=Math.max(a,o);return l-u<=e&&e<=c+u&&v-u<=t&&t<=h+u},ON=function(e,t,n,a,i,o,s,u,l){var c={x1:Math.min(n,s,i)-l,x2:Math.max(n,s,i)+l,y1:Math.min(a,u,o)-l,y2:Math.max(a,u,o)+l};return!(e<c.x1||e>c.x2||t<c.y1||t>c.y2)},MN=function(e,t,n,a){n-=a;var i=t*t-4*e*n;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-t+o)/s,l=(-t-o)/s;return[u,l]},kN=function(e,t,n,a,i){var o=1e-5;e===0&&(e=o),t/=e,n/=e,a/=e;var s,u,l,c,v,h,g,p;if(u=(3*n-t*t)/9,l=-(27*a)+t*(9*n-2*(t*t)),l/=54,s=u*u*u+l*l,i[1]=0,g=t/3,s>0){v=l+Math.sqrt(s),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),h=l-Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-g+v+h,g+=(v+h)/2,i[4]=i[2]=-g,g=Math.sqrt(3)*(-h+v)/2,i[3]=g,i[5]=-g;return}if(i[5]=i[3]=0,s===0){p=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-g+2*p,i[4]=i[2]=-(p+g);return}u=-u,c=u*u*u,c=Math.acos(l/Math.sqrt(c)),p=2*Math.sqrt(u),i[0]=-g+p*Math.cos(c/3),i[2]=-g+p*Math.cos((c+2*Math.PI)/3),i[4]=-g+p*Math.cos((c+4*Math.PI)/3)},LN=function(e,t,n,a,i,o,s,u){var l=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*u+4*o*o-4*o*u+u*u,c=9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*u-6*o*o+3*o*u,v=3*n*n-6*n*i+n*s-n*e+2*i*i+2*i*e-s*e+3*a*a-6*a*o+a*u-a*t+2*o*o+2*o*t-u*t,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*t-o*t,g=[];kN(l,c,v,h,g);for(var p=1e-7,E=[],m=0;m<6;m+=2)Math.abs(g[m+1])<p&&g[m]>=0&&g[m]<=1&&E.push(g[m]);E.push(1),E.push(0);for(var b=-1,w,x,_,C=0;C<E.length;C++)w=Math.pow(1-E[C],2)*n+2*(1-E[C])*E[C]*i+E[C]*E[C]*s,x=Math.pow(1-E[C],2)*a+2*(1-E[C])*E[C]*o+E[C]*E[C]*u,_=Math.pow(w-e,2)+Math.pow(x-t,2),b>=0?_<b&&(b=_):b=_;return b},qN=function(e,t,n,a,i,o){var s=[e-n,t-a],u=[i-n,o-a],l=u[0]*u[0]+u[1]*u[1],c=s[0]*s[0]+s[1]*s[1],v=s[0]*u[0]+s[1]*u[1],h=v*v/l;return v<0?c:h>l?(e-i)*(e-i)+(t-o)*(t-o):c-h},Nt=function(e,t,n){for(var a,i,o,s,u,l=0,c=0;c<n.length/2;c++)if(a=n[c*2],i=n[c*2+1],c+1<n.length/2?(o=n[(c+1)*2],s=n[(c+1)*2+1]):(o=n[(c+1-n.length/2)*2],s=n[(c+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)u=(e-a)/(o-a)*(s-i)+i,u>t&&l++;else continue;return l%2!==0},Yn=function(e,t,n,a,i,o,s,u,l){var c=new Array(n.length),v;u[0]!=null?(v=Math.atan(u[1]/u[0]),u[0]<0?v=v+Math.PI/2:v=-v-Math.PI/2):v=u;for(var h=Math.cos(-v),g=Math.sin(-v),p=0;p<c.length/2;p++)c[p*2]=o/2*(n[p*2]*h-n[p*2+1]*g),c[p*2+1]=s/2*(n[p*2+1]*h+n[p*2]*g),c[p*2]+=a,c[p*2+1]+=i;var E;if(l>0){var m=Ku(c,-l);E=Hu(m)}else E=c;return Nt(e,t,E)},NN=function(e,t,n,a,i,o,s,u){for(var l=new Array(n.length*2),c=0;c<u.length;c++){var v=u[c];l[c*4+0]=v.startX,l[c*4+1]=v.startY,l[c*4+2]=v.stopX,l[c*4+3]=v.stopY;var h=Math.pow(v.cx-e,2)+Math.pow(v.cy-t,2);if(h<=Math.pow(v.radius,2))return!0}return Nt(e,t,l)},Hu=function(e){for(var t=new Array(e.length/2),n,a,i,o,s,u,l,c,v=0;v<e.length/4;v++){n=e[v*4],a=e[v*4+1],i=e[v*4+2],o=e[v*4+3],v<e.length/4-1?(s=e[(v+1)*4],u=e[(v+1)*4+1],l=e[(v+1)*4+2],c=e[(v+1)*4+3]):(s=e[0],u=e[1],l=e[2],c=e[3]);var h=ya(n,a,i,o,s,u,l,c,!0);t[v*2]=h[0],t[v*2+1]=h[1]}return t},Ku=function(e,t){for(var n=new Array(e.length*2),a,i,o,s,u=0;u<e.length/2;u++){a=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,c=-(o-a),v=Math.sqrt(l*l+c*c),h=l/v,g=c/v;n[u*4]=a+h*t,n[u*4+1]=i+g*t,n[u*4+2]=o+h*t,n[u*4+3]=s+g*t}return n},FN=function(e,t,n,a,i,o){var s=n-e,u=a-t;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),c=l-1;if(c<0)return[];var v=c/l;return[(n-e)*v+e,(a-t)*v+t]},ei=function(e,t,n,a,i,o,s){return e-=i,t-=o,e/=n/2+s,t/=a/2+s,e*e+t*t<=1},Lo=function(e,t,n,a,i,o,s){var u=[n-e,a-t],l=[e-i,t-o],c=u[0]*u[0]+u[1]*u[1],v=2*(l[0]*u[0]+l[1]*u[1]),h=l[0]*l[0]+l[1]*l[1]-s*s,g=v*v-4*c*h;if(g<0)return[];var p=(-v+Math.sqrt(g))/(2*c),E=(-v-Math.sqrt(g))/(2*c),m=Math.min(p,E),b=Math.max(p,E),w=[];if(m>=0&&m<=1&&w.push(m),b>=0&&b<=1&&w.push(b),w.length===0)return[];var x=w[0]*u[0]+e,_=w[0]*u[1]+t;if(w.length>1){if(w[0]==w[1])return[x,_];var C=w[1]*u[0]+e,R=w[1]*u[1]+t;return[x,_,C,R]}else return[x,_]},Sc=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},ya=function(e,t,n,a,i,o,s,u,l){var c=e-i,v=n-e,h=s-i,g=t-o,p=a-t,E=u-o,m=h*g-E*c,b=v*g-p*c,w=E*v-h*p;if(w!==0){var x=m/w,_=b/w,C=.001,R=0-C,S=1+C;return R<=x&&x<=S&&R<=_&&_<=S?[e+x*v,t+x*p]:l?[e+x*v,t+x*p]:[]}else return m===0||b===0?Sc(e,n,s)===s?[s,u]:Sc(e,n,i)===i?[i,o]:Sc(i,s,n)===n?[n,a]:[]:[]},zN=function(e,t,n,a,i){var o=[],s=a/2,u=i/2,l=t,c=n;o.push({x:l+s*e[0],y:c+u*e[1]});for(var v=1;v<e.length/2;v++)o.push({x:l+s*e[v*2],y:c+u*e[v*2+1]});return o},Jo=function(e,t,n,a,i,o,s,u){var l=[],c,v=new Array(n.length),h=!0;o==null&&(h=!1);var g;if(h){for(var p=0;p<v.length/2;p++)v[p*2]=n[p*2]*o+a,v[p*2+1]=n[p*2+1]*s+i;if(u>0){var E=Ku(v,-u);g=Hu(E)}else g=v}else g=n;for(var m,b,w,x,_=0;_<g.length/2;_++)m=g[_*2],b=g[_*2+1],_<g.length/2-1?(w=g[(_+1)*2],x=g[(_+1)*2+1]):(w=g[0],x=g[1]),c=ya(e,t,a,i,m,b,w,x),c.length!==0&&l.push(c[0],c[1]);return l},$N=function(e,t,n,a,i,o,s,u,l){var c=[],v,h=new Array(n.length*2);l.forEach(function(w,x){x===0?(h[h.length-2]=w.startX,h[h.length-1]=w.startY):(h[x*4-2]=w.startX,h[x*4-1]=w.startY),h[x*4]=w.stopX,h[x*4+1]=w.stopY,v=Lo(e,t,a,i,w.cx,w.cy,w.radius),v.length!==0&&c.push(v[0],v[1])});for(var g=0;g<h.length/4;g++)v=ya(e,t,a,i,h[g*4],h[g*4+1],h[g*4+2],h[g*4+3],!1),v.length!==0&&c.push(v[0],v[1]);if(c.length>2){for(var p=[c[0],c[1]],E=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),m=1;m<c.length/2;m++){var b=Math.pow(c[m*2]-e,2)+Math.pow(c[m*2+1]-t,2);b<=E&&(p[0]=c[m*2],p[1]=c[m*2+1],E=b)}return p}return c},yu=function(e,t,n){var a=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*a[0],t[1]+o*a[1]]},At=function(e,t){var n=im(e,t);return n=p2(n),n},p2=function(e){for(var t,n,a=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<a;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),u=Math.max(u,n);for(var c=2/(s-i),v=2/(u-o),h=0;h<a;h++)t=e[2*h]=e[2*h]*c,n=e[2*h+1]=e[2*h+1]*v,i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),u=Math.max(u,n);if(o<-1)for(var g=0;g<a;g++)n=e[2*g+1]=e[2*g+1]+(-1-o);return e},im=function(e,t){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=t;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*n+a,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},_a=function(e,t){return Math.min(e/4,t/4,8)},y2=function(e,t){return Math.min(e/10,t/10,8)},Mm=function(){return 8},VN=function(e,t,n){return[e-2*t+n,2*(t-e),e]},om=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Tc(r,e){function t(v){for(var h=[],g=0;g<v.length;g++){var p=v[g],E=v[(g+1)%v.length],m={x:E.x-p.x,y:E.y-p.y},b={x:-m.y,y:m.x},w=Math.sqrt(b.x*b.x+b.y*b.y);h.push({x:b.x/w,y:b.y/w})}return h}function n(v,h){var g=1/0,p=-1/0,E=Ft(v),m;try{for(E.s();!(m=E.n()).done;){var b=m.value,w=b.x*h.x+b.y*h.y;g=Math.min(g,w),p=Math.max(p,w)}}catch(x){E.e(x)}finally{E.f()}return{min:g,max:p}}function a(v,h){return!(v.max<h.min||h.max<v.min)}var i=[].concat(Vu(t(r)),Vu(t(e))),o=Ft(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=n(r,u),c=n(e,u);if(!a(l,c))return!1}}catch(v){o.e(v)}finally{o.f()}return!0}var GN=ht({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),WN={pageRank:function(e){for(var t=GN(e),n=t.dampingFactor,a=t.precision,i=t.iterations,o=t.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,c=u.edges,v=l.length,h=v*v,g=c.length,p=new Array(h),E=new Array(v),m=(1-n)/v,b=0;b<v;b++){for(var w=0;w<v;w++){var x=b*v+w;p[x]=0}E[b]=0}for(var _=0;_<g;_++){var C=c[_],R=C.data("source"),S=C.data("target");if(R!==S){var A=l.indexOfId(R),P=l.indexOfId(S),I=o(C),D=P*v+A;p[D]+=I,E[A]+=I}}for(var M=1/v+m,O=0;O<v;O++)if(E[O]===0)for(var N=0;N<v;N++){var V=N*v+O;p[V]=M}else for(var $=0;$<v;$++){var G=$*v+O;p[G]=p[G]/E[O]+m}for(var U=new Array(v),J=new Array(v),W,H=0;H<v;H++)U[H]=1;for(var Z=0;Z<i;Z++){for(var ne=0;ne<v;ne++)J[ne]=0;for(var F=0;F<v;F++)for(var z=0;z<v;z++){var j=F*v+z;J[F]+=p[j]*U[z]}CN(J),W=U,U=J,J=W;for(var ee=0,ie=0;ie<v;ie++){var oe=W[ie]-U[ie];ee+=oe*oe}if(ee<a)break}var Y={rank:function(re){return re=s.collection(re)[0],U[l.indexOf(re)]}};return Y}},aw=ht({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ji={degreeCentralityNormalized:function(e){e=aw(e);var t=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},v={},h=0,g=0,p=0;p<a;p++){var E=n[p],m=E.id();e.root=E;var b=this.degreeCentrality(e);h<b.indegree&&(h=b.indegree),g<b.outdegree&&(g=b.outdegree),c[m]=b.indegree,v[m]=b.outdegree}return{indegree:function(x){return h==0?0:(Ge(x)&&(x=t.filter(x)),c[x.id()]/h)},outdegree:function(x){return g===0?0:(Ge(x)&&(x=t.filter(x)),v[x.id()]/g)}}}else{for(var i={},o=0,s=0;s<a;s++){var u=n[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(x){return o===0?0:(Ge(x)&&(x=t.filter(x)),i[x.id()]/o)}}}},degreeCentrality:function(e){e=aw(e);var t=this.cy(),n=this,a=e,i=a.root,o=a.weight,s=a.directed,u=a.alpha;if(i=t.collection(i)[0],s){for(var g=i.connectedEdges(),p=g.filter(function(R){return R.target().same(i)&&n.has(R)}),E=g.filter(function(R){return R.source().same(i)&&n.has(R)}),m=p.length,b=E.length,w=0,x=0,_=0;_<p.length;_++)w+=o(p[_]);for(var C=0;C<E.length;C++)x+=o(E[C]);return{indegree:Math.pow(m,1-u)*Math.pow(w,u),outdegree:Math.pow(b,1-u)*Math.pow(x,u)}}else{for(var l=i.connectedEdges().intersection(n),c=l.length,v=0,h=0;h<l.length;h++)v+=o(l[h]);return{degree:Math.pow(c,1-u)*Math.pow(v,u)}}}};ji.dc=ji.degreeCentrality;ji.dcn=ji.degreeCentralityNormalised=ji.degreeCentralityNormalized;var iw=ht({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Yi={closenessCentralityNormalized:function(e){for(var t=iw(e),n=t.harmonic,a=t.weight,i=t.directed,o=this.cy(),s={},u=0,l=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),v=0;v<l.length;v++){for(var h=0,g=l[v],p=0;p<l.length;p++)if(v!==p){var E=c.distance(g,l[p]);n?h+=1/E:h+=E}n||(h=1/h),u<h&&(u=h),s[g.id()]=h}return{closeness:function(b){return u==0?0:(Ge(b)?b=o.filter(b)[0].id():b=b.id(),s[b]/u)}}},closenessCentrality:function(e){var t=iw(e),n=t.root,a=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var s=this.dijkstra({root:n,weight:a,directed:i}),u=0,l=this.nodes(),c=0;c<l.length;c++){var v=l[c];if(!v.same(n)){var h=s.distanceTo(v);o?u+=1/h:u+=h}}return o?u:1/u}};Yi.cc=Yi.closenessCentrality;Yi.ccn=Yi.closenessCentralityNormalised=Yi.closenessCentralityNormalized;var UN=ht({weight:null,directed:!1}),sm={betweennessCentrality:function(e){for(var t=UN(e),n=t.directed,a=t.weight,i=a!=null,o=this.cy(),s=this.nodes(),u={},l={},c=0,v={set:function(x,_){l[x]=_,_>c&&(c=_)},get:function(x){return l[x]}},h=0;h<s.length;h++){var g=s[h],p=g.id();n?u[p]=g.outgoers().nodes():u[p]=g.openNeighborhood().nodes(),v.set(p,0)}for(var E=function(){for(var x=s[m].id(),_=[],C={},R={},S={},A=new hs(function(F,z){return S[F]-S[z]}),P=0;P<s.length;P++){var I=s[P].id();C[I]=[],R[I]=0,S[I]=1/0}for(R[x]=1,S[x]=0,A.push(x);!A.empty();){var D=A.pop();if(_.push(D),i)for(var M=0;M<u[D].length;M++){var O=u[D][M],N=o.getElementById(D),V=void 0;N.edgesTo(O).length>0?V=N.edgesTo(O)[0]:V=O.edgesTo(N)[0];var $=a(V);O=O.id(),S[O]>S[D]+$&&(S[O]=S[D]+$,A.nodes.indexOf(O)<0?A.push(O):A.updateItem(O),R[O]=0,C[O]=[]),S[O]==S[D]+$&&(R[O]=R[O]+R[D],C[O].push(D))}else for(var G=0;G<u[D].length;G++){var U=u[D][G].id();S[U]==1/0&&(A.push(U),S[U]=S[D]+1),S[U]==S[D]+1&&(R[U]=R[U]+R[D],C[U].push(D))}}for(var J={},W=0;W<s.length;W++)J[s[W].id()]=0;for(;_.length>0;){for(var H=_.pop(),Z=0;Z<C[H].length;Z++){var ne=C[H][Z];J[ne]=J[ne]+R[ne]/R[H]*(1+J[H])}H!=s[m].id()&&v.set(H,v.get(H)+J[H])}},m=0;m<s.length;m++)E();var b={betweenness:function(x){var _=o.collection(x).id();return v.get(_)},betweennessNormalized:function(x){if(c==0)return 0;var _=o.collection(x).id();return v.get(_)/c}};return b.betweennessNormalised=b.betweennessNormalized,b}};sm.bc=sm.betweennessCentrality;var HN=ht({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),KN=function(e){return HN(e)},jN=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},YN=function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n},m2=function(e,t){for(var n,a=0;a<t;a++){n=0;for(var i=0;i<t;i++)n+=e[i*t+a];for(var o=0;o<t;o++)e[o*t+a]=e[o*t+a]/n}},ZN=function(e,t,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var s=0;s<n;s++)for(var u=0;u<n;u++)a[i*n+u]+=e[i*n+s]*t[s*n+u]}return a},XN=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=ZN(e,a,t);return e},QN=function(e,t,n){for(var a=new Array(t*t),i=0;i<t*t;i++)a[i]=Math.pow(e[i],n);return m2(a,t),a},JN=function(e,t,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),s=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s)return!1}return!0},eF=function(e,t,n,a){for(var i=[],o=0;o<t;o++){for(var s=[],u=0;u<t;u++)Math.round(e[o*t+u]*1e3)/1e3>0&&s.push(n[u]);s.length!==0&&i.push(a.collection(s))}return i},rF=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},tF=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&rF(e[t],e[n])&&e.splice(n,1);return e},ow=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=KN(e),o={},s=0;s<t.length;s++)o[t[s].id()]=s;for(var u=t.length,l=u*u,c=new Array(l),v,h=0;h<l;h++)c[h]=0;for(var g=0;g<n.length;g++){var p=n[g],E=o[p.source().id()],m=o[p.target().id()],b=jN(p,i.attributes);c[E*u+m]+=b,c[m*u+E]+=b}YN(c,u,i.multFactor),m2(c,u);for(var w=!0,x=0;w&&x<i.maxIterations;)w=!1,v=XN(c,u,i.expandFactor),c=QN(v,u,i.inflateFactor),JN(c,v,l,4)||(w=!0),x++;var _=eF(c,u,t,a);return _=tF(_),_},nF={markovClustering:ow,mcl:ow},aF=function(e){return e},b2=function(e,t){return Math.abs(t-e)},sw=function(e,t,n){return e+b2(t,n)},uw=function(e,t,n){return e+Math.pow(n-t,2)},iF=function(e){return Math.sqrt(e)},oF=function(e,t,n){return Math.max(e,b2(t,n))},Po=function(e,t,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:aF,s=a,u,l,c=0;c<e;c++)u=t(c),l=n(c),s=i(s,u,l);return o(s)},Ji={euclidean:function(e,t,n){return e>=2?Po(e,t,n,0,uw,iF):Po(e,t,n,0,sw)},squaredEuclidean:function(e,t,n){return Po(e,t,n,0,uw)},manhattan:function(e,t,n){return Po(e,t,n,0,sw)},max:function(e,t,n){return Po(e,t,n,-1/0,oF)}};Ji["squared-euclidean"]=Ji.squaredEuclidean;Ji.squaredeuclidean=Ji.squaredEuclidean;function ul(r,e,t,n,a,i){var o;return Nr(r)?o=r:o=Ji[r]||Ji.euclidean,e===0&&Nr(r)?o(a,i):o(e,t,n,a,i)}var sF=ht({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),km=function(e){return sF(e)},ju=function(e,t,n,a,i){var o=i!=="kMedoids",s=o?function(v){return n[v]}:function(v){return a[v](n)},u=function(h){return a[h](t)},l=n,c=t;return ul(e,a.length,s,u,l,c)},Rc=function(e,t,n){for(var a=n.length,i=new Array(a),o=new Array(a),s=new Array(t),u=null,l=0;l<a;l++)i[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var c=0;c<t;c++){u=[];for(var v=0;v<a;v++)u[v]=Math.random()*(o[v]-i[v])+i[v];s[c]=u}return s},w2=function(e,t,n,a,i){for(var o=1/0,s=0,u=0;u<t.length;u++){var l=ju(n,e,t[u],a,i);l<o&&(o=l,s=u)}return s},x2=function(e,t,n){for(var a=[],i=null,o=0;o<t.length;o++)i=t[o],n[i.id()]===e&&a.push(i);return a},uF=function(e,t,n){return Math.abs(t-e)<=n},lF=function(e,t,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-t[a][i]);if(o>n)return!1}return!0},fF=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},lw=function(e,t){var n=new Array(t);if(e.length<50)for(var a=0;a<t;a++){for(var i=e[Math.floor(Math.random()*e.length)];fF(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},fw=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=ju("manhattan",t[i],e,n,"kMedoids");return a},cF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=km(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=Rc(n,i.k,i.attributes)):et(i.testCentroids)==="object"?u=i.testCentroids:u=Rc(n,i.k,i.attributes):u=Rc(n,i.k,i.attributes);for(var l=!0,c=0;l&&c<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],s[a.id()]=w2(a,u,i.distance,i.attributes,"kMeans");l=!1;for(var h=0;h<i.k;h++){var g=x2(h,n,s);if(g.length!==0){for(var p=i.attributes.length,E=u[h],m=new Array(p),b=new Array(p),w=0;w<p;w++){b[w]=0;for(var x=0;x<g.length;x++)a=g[x],b[w]+=i.attributes[w](a);m[w]=b[w]/g.length,uF(m[w],E[w],i.sensitivityThreshold)||(l=!0)}u[h]=m,o[h]=t.collection(g)}}c++}return o},dF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=km(e),o=new Array(i.k),s,u={},l,c=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(et(i.testCentroids)==="object"?s=i.testCentroids:s=lw(n,i.k)):s=lw(n,i.k);for(var v=!0,h=0;v&&h<i.maxIterations;){for(var g=0;g<n.length;g++)a=n[g],u[a.id()]=w2(a,s,i.distance,i.attributes,"kMedoids");v=!1;for(var p=0;p<s.length;p++){var E=x2(p,n,u);if(E.length!==0){c[p]=fw(s[p],E,i.attributes);for(var m=0;m<E.length;m++)l=fw(E[m],E,i.attributes),l<c[p]&&(c[p]=l,s[p]=E[m],v=!0);o[p]=t.collection(E)}}h++}return o},vF=function(e,t,n,a,i){for(var o,s,u=0;u<t.length;u++)for(var l=0;l<e.length;l++)a[u][l]=Math.pow(n[u][l],i.m);for(var c=0;c<e.length;c++)for(var v=0;v<i.attributes.length;v++){o=0,s=0;for(var h=0;h<t.length;h++)o+=a[h][c]*i.attributes[v](t[h]),s+=a[h][c];e[c][v]=o/s}},hF=function(e,t,n,a,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var s,u,l,c=2/(i.m-1),v=0;v<n.length;v++)for(var h=0;h<a.length;h++){s=0;for(var g=0;g<n.length;g++)u=ju(i.distance,a[h],n[v],i.attributes,"cmeans"),l=ju(i.distance,a[h],n[g],i.attributes,"cmeans"),s+=Math.pow(u/l,c);e[h][v]=1/s}},gF=function(e,t,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<t.length;l++){s=-1/0,u=-1;for(var c=0;c<t[0].length;c++)t[l][c]>s&&(s=t[l][c],u=c);i[u].push(e[l])}for(var v=0;v<i.length;v++)i[v]=a.collection(i[v]);return i},cw=function(e){var t=this.cy(),n=this.nodes(),a=km(e),i,o,s,u,l;u=new Array(n.length);for(var c=0;c<n.length;c++)u[c]=new Array(a.k);s=new Array(n.length);for(var v=0;v<n.length;v++)s[v]=new Array(a.k);for(var h=0;h<n.length;h++){for(var g=0,p=0;p<a.k;p++)s[h][p]=Math.random(),g+=s[h][p];for(var E=0;E<a.k;E++)s[h][E]=s[h][E]/g}o=new Array(a.k);for(var m=0;m<a.k;m++)o[m]=new Array(a.attributes.length);l=new Array(n.length);for(var b=0;b<n.length;b++)l[b]=new Array(a.k);for(var w=!0,x=0;w&&x<a.maxIterations;)w=!1,vF(o,n,s,l,a),hF(s,u,o,n,a),lF(s,u,a.sensitivityThreshold)||(w=!0),x++;return i=gF(n,s,a,t),{clusters:i,degreeOfMembership:s}},pF={kMeans:cF,kMedoids:dF,fuzzyCMeans:cw,fcm:cw},yF=ht({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),mF={single:"min",complete:"max"},bF=function(e){var t=yF(e),n=mF[t.linkage];return n!=null&&(t.linkage=n),t},dw=function(e,t,n,a,i){for(var o=0,s=1/0,u,l=i.attributes,c=function(P,I){return ul(i.distance,l.length,function(D){return l[D](P)},function(D){return l[D](I)},P,I)},v=0;v<e.length;v++){var h=e[v].key,g=n[h][a[h]];g<s&&(o=h,s=g)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=t[o],E=t[a[o]],m;i.mode==="dendrogram"?m={left:p,right:E,key:p.key}:m={value:p.value.concat(E.value),key:p.key},e[p.index]=m,e.splice(E.index,1),t[p.key]=m;for(var b=0;b<e.length;b++){var w=e[b];p.key===w.key?u=1/0:i.linkage==="min"?(u=n[p.key][w.key],n[p.key][w.key]>n[E.key][w.key]&&(u=n[E.key][w.key])):i.linkage==="max"?(u=n[p.key][w.key],n[p.key][w.key]<n[E.key][w.key]&&(u=n[E.key][w.key])):i.linkage==="mean"?u=(n[p.key][w.key]*p.size+n[E.key][w.key]*E.size)/(p.size+E.size):i.mode==="dendrogram"?u=c(w.value,p.value):u=c(w.value[0],p.value[0]),n[p.key][w.key]=n[w.key][p.key]=u}for(var x=0;x<e.length;x++){var _=e[x].key;if(a[_]===p.key||a[_]===E.key){for(var C=_,R=0;R<e.length;R++){var S=e[R].key;n[_][S]<n[_][C]&&(C=S)}a[_]=C}e[x].index=x}return p.key=E.key=p.index=E.index=null,!0},Wi=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Wi(e.left,t),e.right&&Wi(e.right,t)))},um=function(e,t){if(!e)return"";if(e.left&&e.right){var n=um(e.left,t),a=um(e.right,t),i=t.add({group:"nodes",data:{id:n+","+a}});return t.add({group:"edges",data:{source:n,target:i.id()}}),t.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},lm=function(e,t,n){if(!e)return[];var a=[],i=[],o=[];return t===0?(e.left&&Wi(e.left,a),e.right&&Wi(e.right,i),o=a.concat(i),[n.collection(o)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Wi(e.left,a),e.right&&Wi(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=lm(e.left,t-1,n)),e.right&&(i=lm(e.right,t-1,n)),a.concat(i))},vw=function(e){for(var t=this.cy(),n=this.nodes(),a=bF(e),i=a.attributes,o=function(x,_){return ul(a.distance,i.length,function(C){return i[C](x)},function(C){return i[C](_)},x,_)},s=[],u=[],l=[],c=[],v=0;v<n.length;v++){var h={value:a.mode==="dendrogram"?n[v]:[n[v]],key:v,index:v};s[v]=h,c[v]=h,u[v]=[],l[v]=0}for(var g=0;g<s.length;g++)for(var p=0;p<=g;p++){var E=void 0;a.mode==="dendrogram"?E=g===p?1/0:o(s[g].value,s[p].value):E=g===p?1/0:o(s[g].value[0],s[p].value[0]),u[g][p]=E,u[p][g]=E,E<u[g][l[g]]&&(l[g]=p)}for(var m=dw(s,c,u,l,a);m;)m=dw(s,c,u,l,a);var b;return a.mode==="dendrogram"?(b=lm(s[0],a.dendrogramDepth,t),a.addDendrogram&&um(s[0],t)):(b=new Array(s.length),s.forEach(function(w,x){w.key=w.index=null,b[x]=t.collection(w.value)})),b},wF={hierarchicalClustering:vw,hca:vw},xF=ht({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),EF=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Mr("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||De(n)||Mr("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),xF(e)},_F=function(e,t,n,a){var i=function(s,u){return a[u](s)};return-ul(e,a.length,function(o){return i(t,o)},function(o){return i(n,o)},t,n)},CF=function(e,t){var n=null;return t==="median"?n=EN(e):t==="mean"?n=xN(e):t==="min"?n=bN(e):t==="max"?n=wN(e):n=t,n},SF=function(e,t,n){for(var a=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&a.push(i);return a},hw=function(e,t,n){for(var a=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<n.length;u++){var l=n[u];t[i*e+l]>s&&(o=l,s=t[i*e+l])}o>0&&a.push(o)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},TF=function(e,t,n){for(var a=hw(e,t,n),i=0;i<n.length;i++){for(var o=[],s=0;s<a.length;s++)a[s]===n[i]&&o.push(s);for(var u=-1,l=-1/0,c=0;c<o.length;c++){for(var v=0,h=0;h<o.length;h++)v+=t[o[h]*e+o[c]];v>l&&(u=c,l=v)}n[i]=o[u]}return a=hw(e,t,n),a},gw=function(e){for(var t=this.cy(),n=this.nodes(),a=EF(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var s,u,l,c,v,h;s=n.length,u=s*s,l=new Array(u);for(var g=0;g<u;g++)l[g]=-1/0;for(var p=0;p<s;p++)for(var E=0;E<s;E++)p!==E&&(l[p*s+E]=_F(a.distance,n[p],n[E],a.attributes));c=CF(l,a.preference);for(var m=0;m<s;m++)l[m*s+m]=c;v=new Array(u);for(var b=0;b<u;b++)v[b]=0;h=new Array(u);for(var w=0;w<u;w++)h[w]=0;for(var x=new Array(s),_=new Array(s),C=new Array(s),R=0;R<s;R++)x[R]=0,_[R]=0,C[R]=0;for(var S=new Array(s*a.minIterations),A=0;A<S.length;A++)S[A]=0;var P;for(P=0;P<a.maxIterations;P++){for(var I=0;I<s;I++){for(var D=-1/0,M=-1/0,O=-1,N=0,V=0;V<s;V++)x[V]=v[I*s+V],N=h[I*s+V]+l[I*s+V],N>=D?(M=D,D=N,O=V):N>M&&(M=N);for(var $=0;$<s;$++)v[I*s+$]=(1-a.damping)*(l[I*s+$]-D)+a.damping*x[$];v[I*s+O]=(1-a.damping)*(l[I*s+O]-M)+a.damping*x[O]}for(var G=0;G<s;G++){for(var U=0,J=0;J<s;J++)x[J]=h[J*s+G],_[J]=Math.max(0,v[J*s+G]),U+=_[J];U-=_[G],_[G]=v[G*s+G],U+=_[G];for(var W=0;W<s;W++)h[W*s+G]=(1-a.damping)*Math.min(0,U-_[W])+a.damping*x[W];h[G*s+G]=(1-a.damping)*(U-_[G])+a.damping*x[G]}for(var H=0,Z=0;Z<s;Z++){var ne=h[Z*s+Z]+v[Z*s+Z]>0?1:0;S[P%a.minIterations*s+Z]=ne,H+=ne}if(H>0&&(P>=a.minIterations-1||P==a.maxIterations-1)){for(var F=0,z=0;z<s;z++){C[z]=0;for(var j=0;j<a.minIterations;j++)C[z]+=S[j*s+z];(C[z]===0||C[z]===a.minIterations)&&F++}if(F===s)break}}for(var ee=SF(s,v,h),ie=TF(s,l,ee),oe={},Y=0;Y<ee.length;Y++)oe[ee[Y]]=[];for(var X=0;X<n.length;X++){var re=i[n[X].id()],le=ie[re];le!=null&&oe[le].push(n[X])}for(var he=new Array(ee.length),be=0;be<ee.length;be++)he[be]=t.collection(oe[ee[be]]);return he},RF={affinityPropagation:gw,ap:gw},AF=ht({root:void 0,directed:!1}),PF={hierholzer:function(e){if(!pr(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=AF(e),a=n.root,i=n.directed,o=this,s=!1,u,l,c;a&&(c=Ge(a)?this.filter(a)[0].id():a[0].id());var v={},h={};i?o.forEach(function(w){var x=w.id();if(w.isNode()){var _=w.indegree(!0),C=w.outdegree(!0),R=_-C,S=C-_;R==1?u?s=!0:u=x:S==1?l?s=!0:l=x:(S>1||R>1)&&(s=!0),v[x]=[],w.outgoers().forEach(function(A){A.isEdge()&&v[x].push(A.id())})}else h[x]=[void 0,w.target().id()]}):o.forEach(function(w){var x=w.id();if(w.isNode()){var _=w.degree(!0);_%2&&(u?l?s=!0:l=x:u=x),v[x]=[],w.connectedEdges().forEach(function(C){return v[x].push(C.id())})}else h[x]=[w.source().id(),w.target().id()]});var g={found:!1,trail:void 0};if(s)return g;if(l&&u)if(i){if(c&&l!=c)return g;c=l}else{if(c&&l!=c&&u!=c)return g;c||(c=l)}else c||(c=o[0].id());var p=function(x){for(var _=x,C=[x],R,S,A;v[_].length;)R=v[_].shift(),S=h[R][0],A=h[R][1],_!=A?(v[A]=v[A].filter(function(P){return P!=R}),_=A):!i&&_!=S&&(v[S]=v[S].filter(function(P){return P!=R}),_=S),C.unshift(R),C.unshift(_);return C},E=[],m=[];for(m=p(c);m.length!=1;)v[m[0]].length==0?(E.unshift(o.getElementById(m.shift())),E.unshift(o.getElementById(m.shift()))):m=p(m.shift()).concat(m);E.unshift(o.getElementById(m.shift()));for(var b in v)if(v[b].length)return g;return g.found=!0,g.trail=this.spawn(E,!0),g}},mu=function(){var e=this,t={},n=0,a=0,i=[],o=[],s={},u=function(h,g){for(var p=o.length-1,E=[],m=e.spawn();o[p].x!=h||o[p].y!=g;)E.push(o.pop().edge),p--;E.push(o.pop().edge),E.forEach(function(b){var w=b.connectedNodes().intersection(e);m.merge(b),w.forEach(function(x){var _=x.id(),C=x.connectedEdges().intersection(e);m.merge(x),t[_].cutVertex?m.merge(C.filter(function(R){return R.isLoop()})):m.merge(C)})}),i.push(m)},l=function(h,g,p){h===p&&(a+=1),t[g]={id:n,low:n++,cutVertex:!1};var E=e.getElementById(g).connectedEdges().intersection(e);if(E.size()===0)i.push(e.spawn(e.getElementById(g)));else{var m,b,w,x;E.forEach(function(_){m=_.source().id(),b=_.target().id(),w=m===g?b:m,w!==p&&(x=_.id(),s[x]||(s[x]=!0,o.push({x:g,y:w,edge:_})),w in t?t[g].low=Math.min(t[g].low,t[w].id):(l(h,w,g),t[g].low=Math.min(t[g].low,t[w].low),t[g].id<=t[w].low&&(t[g].cutVertex=!0,u(g,w))))})}};e.forEach(function(v){if(v.isNode()){var h=v.id();h in t||(a=0,l(h,h),t[h].cutVertex=a>1)}});var c=Object.keys(t).filter(function(v){return t[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(c),components:i}},DF={hopcroftTarjanBiconnected:mu,htbc:mu,htb:mu,hopcroftTarjanBiconnectedComponents:mu},bu=function(){var e=this,t={},n=0,a=[],i=[],o=e.spawn(e),s=function(l){i.push(l),t[l]={index:n,low:n++,explored:!1};var c=e.getElementById(l).connectedEdges().intersection(e);if(c.forEach(function(E){var m=E.target().id();m!==l&&(m in t||s(m),t[m].explored||(t[l].low=Math.min(t[l].low,t[m].low)))}),t[l].index===t[l].low){for(var v=e.spawn();;){var h=i.pop();if(v.merge(e.getElementById(h)),t[h].low=t[l].index,t[h].explored=!0,h===l)break}var g=v.edgesWith(v),p=v.merge(g);a.push(p),o=o.difference(p)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||s(l)}}),{cut:o,components:a}},IF={tarjanStronglyConnected:bu,tsc:bu,tscc:bu,tarjanStronglyConnectedComponents:bu},E2={};[Xo,sN,uN,fN,dN,hN,yN,WN,ji,Yi,sm,nF,pF,wF,RF,PF,DF,IF].forEach(function(r){He(E2,r)});/*!
|
|
1
|
+
"use strict";var ZL=Object.create;var k1=Object.defineProperty;var XL=Object.getOwnPropertyDescriptor;var QL=Object.getOwnPropertyNames;var JL=Object.getPrototypeOf,eq=Object.prototype.hasOwnProperty;var rq=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of QL(e))!eq.call(r,a)&&a!==t&&k1(r,a,{get:()=>e[a],enumerable:!(n=XL(e,a))||n.enumerable});return r};var Rr=(r,e,t)=>(t=r!=null?ZL(JL(r)):{},rq(e||!r||!r.__esModule?k1(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react/jsx-runtime"),Se=require("react"),pe=require("@chakra-ui/react"),Dr=require("react-icons/pi"),tq=require("react-icons/hi2"),nq=require("react-icons/gr"),hu=require("react-icons/vsc"),aq=require("react-icons/tb"),O1=require("react-icons/io5"),G2=Se.createContext(null);function Da(){const r=Se.useContext(G2);if(!r)throw new Error("useFlowDiagramContext must be used within FlowDiagram");return r}function iq({config:r,callbacks:e,children:t}){const n=Se.useRef(null),[a,i]=Se.useState([]),[o,s]=Se.useState(null),[l,u]=Se.useState(!0),[c,d]=Se.useState(!1),[h,g]=Se.useState(!0),[p,E]=Se.useState(r.edgeHandles===!0),[y,b]=Se.useState(!1),[w,x]=Se.useState(!0),[C,T]=Se.useState(!1),S=Se.useRef(e);S.current=e;const _=Se.useMemo(()=>{const K=j=>(...ee)=>{var le,W;return(W=(le=S.current)==null?void 0:le[j])==null?void 0:W.call(le,...ee)};return{onNodeSelect:K("onNodeSelect"),onNodeDeselect:K("onNodeDeselect"),onNodeDoubleClick:K("onNodeDoubleClick"),onNodeCreate:K("onNodeCreate"),onNodeDelete:K("onNodeDelete"),onNodeLabelChange:K("onNodeLabelChange"),onNodeCollapse:K("onNodeCollapse"),onNodeColorChange:K("onNodeColorChange"),onNodeIconChange:K("onNodeIconChange"),onNodeHoverAction:K("onNodeHoverAction"),onEdgeCreate:K("onEdgeCreate"),onEdgeSelect:K("onEdgeSelect"),onEdgeDeselect:K("onEdgeDeselect"),onEdgeRemove:K("onEdgeRemove"),onEdgeColorChange:K("onEdgeColorChange"),onEdgeLabelChange:K("onEdgeLabelChange"),onEdgeStyleChange:K("onEdgeStyleChange"),onViewportChange:K("onViewportChange"),onDirectionChange:K("onDirectionChange"),onArrayModeChange:K("onArrayModeChange"),onCyInit:K("onCyInit")}},[]),A=r.themeColor||"blue.500",P=r.edgeColor||"",I=r.colorMode||"light",D=r.direction||"LR",k=r.readOnly??!1,M=r.isZoomMode!==void 0?r.isZoomMode:l,N=r.isMultiSelectMode!==void 0?r.isMultiSelectMode:c,z=r.isEdgeHandlesEnabled!==void 0?r.isEdgeHandlesEnabled:p,$=r.isDragMode!==void 0?r.isDragMode:h,q=Se.useRef(r);q.current=r;const V=Se.useMemo(()=>({get direction(){return q.current.direction},get themeColor(){return q.current.themeColor},get colorMode(){return q.current.colorMode},get readOnly(){return q.current.readOnly},get editable(){return q.current.editable},get minZoom(){return q.current.minZoom},get maxZoom(){return q.current.maxZoom},get backgroundPattern(){return q.current.backgroundPattern},get edgeColor(){return q.current.edgeColor},get backgroundColor(){return q.current.backgroundColor},get edgeHandles(){return q.current.edgeHandles},get initialViewport(){return q.current.initialViewport},get nodeOverlayActions(){return q.current.nodeOverlayActions},get renderNodeOverlay(){return q.current.renderNodeOverlay},get renderSelectedNodeToolbar(){return q.current.renderSelectedNodeToolbar},get renderSelectedEdgeToolbar(){return q.current.renderSelectedEdgeToolbar},get renderBottomBar(){return q.current.renderBottomBar},get autoCollapse(){return q.current.autoCollapse},get customViews(){return q.current.customViews},get disableKeyboardShortcuts(){return q.current.disableKeyboardShortcuts},get isZoomMode(){return q.current.isZoomMode},get isMultiSelectMode(){return q.current.isMultiSelectMode},get isEdgeHandlesEnabled(){return q.current.isEdgeHandlesEnabled},get isDragMode(){return q.current.isDragMode}}),[]),Z=Se.useMemo(()=>({themeColor:A,edgeColor:P,colorMode:I,direction:D,selectedNodeIds:a,setSelectedNodeIds:i,selectedEdgeId:o,setSelectedEdgeId:s,isZoomMode:M,setIsZoomMode:u,isMultiSelectMode:N,setIsMultiSelectMode:d,isDragMode:$,setIsDragMode:g,isEdgeHandlesEnabled:z,setIsEdgeHandlesEnabled:E,isArrayNodeMode:y,setIsArrayNodeMode:b,isPinned:w,setIsPinned:x,isPerformanceMode:C,setIsPerformanceMode:T,cyRef:n,callbacks:_,config:V,readOnly:k}),[A,P,I,D,a,o,M,N,$,z,y,w,C,k,_,V]);return ue.jsx(G2.Provider,{value:Z,children:t})}const oq=({children:r,pattern:e="dot",backgroundColor:t})=>{const n=pe.useColorModeValue("--chakra-colors-gray-500","--chakra-colors-gray-700"),a=pe.useColorModeValue("--chakra-colors-gray-800","--chakra-colors-gray-700");return e==="none"?ue.jsx(pe.Box,{width:"100%",height:"100%",padding:0,bg:t,children:r}):ue.jsxs(pe.Box,{position:"relative",width:"100%",height:"100%",padding:0,bg:t,children:[ue.jsx(pe.Box,{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",zIndex:0,pointerEvents:"none",style:{backgroundImage:e==="dot"?`radial-gradient(var(${n}) 8%, transparent 8%)`:e==="steel"?`repeating-linear-gradient(45deg, var(${a}) 0, var(${a}) 1px, transparent 1px, transparent 20px)`:`linear-gradient(var(${a}) 1px, transparent 1px), linear-gradient(90deg, var(${a}) 1px, transparent 1px)`,backgroundSize:"20px 20px",opacity:.3}}),ue.jsx(pe.Box,{position:"relative",width:"100%",height:"100%",zIndex:1,padding:0,children:r})]})};function Vu(r,e=.2){const t=r.replace(/^#/,""),n=parseInt(t,16);let a=n>>16&255,i=n>>8&255,o=n&255;return a=Math.max(0,Math.floor(a*(1-e))),i=Math.max(0,Math.floor(i*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),"#"+((1<<24)+(a<<16)+(i<<8)+o).toString(16).slice(1).toUpperCase()}const In=r=>r!=null&&r.startsWith("#")?{background:r,highlight:Vu(r,.1),border:Vu(r,.5),property:"gray.900",boolean:"green.200",string:"gray.900",number:"orange.800"}:r==="gray"?{background:"gray.950",highlight:"gray.800",border:"gray.700",property:"gray.200",boolean:"green.400",string:"gray.200",number:"orange.600"}:r==="white"?{background:"white",highlight:"gray.200",border:"gray.400",property:"gray.900",boolean:"green.400",string:"gray.900",number:"orange.600"}:{background:r+".100",highlight:r+".200",border:r+".700",property:"gray.900",boolean:"green.800",string:"gray.900",number:"orange.800"},W2=r=>{let e=r;if(e!=null&&e.startsWith("#"))return{secondary:Vu(r)};let t=String(Number(r.slice(-3))+200);t=r.slice(0,-3).concat(t);let n=String(Number(r.slice(-3))-100);return n=r.slice(0,-3).concat(n),{primary:e,secondary:t,light:n}},L1={red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#EBF8FF",100:"#BEE3F8",200:"#90CDF4",300:"#63B3ED",400:"#4299E1",500:"#3182CE",600:"#2B6CB0",700:"#2C5282",800:"#2A4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923",950:"#0d1117"}},ht=(r,e)=>{var i;if(r!=null&&r.startsWith("#"))return r;if(!r)return"whitesmoke";const t=r.replace(/\./g,"-");try{const s=getComputedStyle(document.documentElement).getPropertyValue(`--chakra-colors-${t}`).trim();if(s&&s!=="")return s}catch{}const[n,a]=r.split(".");return n&&a&&((i=L1[n])!=null&&i[Number(a)])?L1[n][Number(a)]:`var(--chakra-colors-${t})`};function ss(r){const[e]=(r==null?void 0:r.split("."))||[],{secondary:t}=W2(r),n=In(e).background,a=In(e).highlight,i=In(e).border,o=In(e).property,s=In(e).property;let l=In(e).background,u=In(e).highlight;return l=ht(l)+50,u=ht(u)+20,{bgColor:n,highlightColor:a,borderColor:i,textColor:o,propertyColor:s,secondary:t,bgColorFaint:l,highlightColorFaint:u}}function us(r=null){const e=r==null?void 0:r.includes("gray"),t=pe.useColorModeValue("gray.100","gray.900"),n=pe.useColorModeValue("gray.200","blackAlpha.400"),a=pe.useColorModeValue("gray.200","blackAlpha.600"),i=pe.useColorModeValue("gray.500","gray.800"),o=pe.useColorModeValue("gray.700","gray.700"),s=pe.useColorModeValue("gray.900","gray.900"),l=pe.useColorModeValue("gray.400","gray.500"),u=pe.useColorModeValue("gray.400","gray.700"),c=pe.useColorModeValue("gray.900","gray.200"),d=pe.useColorModeValue(e?"gray.900":"gray.200",e?"gray.200":"gray.900"),h=pe.useColorModeValue("gray.900","gray.200"),g=pe.useColorModeValue(r&&"#000000",r||"#ffffff"),p=pe.useColorModeValue(r||"#ffffff",r?"#000000":"#ffffff"),E=o,y=pe.useColorModeValue("gray.300","gray.800"),b=pe.useColorModeValue("white","blackAlpha.400"),w=pe.useColorModeValue("green.100","green.700");return{background:t,backgroundSecondary:n,darkBackgroundSecondary:a,border:i,darkColor:s,backgroundWhiteColor:b,borderSecondary:o,colorActive:l,colorInactive:u,iconColor:h,moreIconColor:E,colorText:c,themedColorText:d,logoColor:g,logoColorSecondary:p,darkColorActive:y,greenColor:w}}const q1=({icon:r,label:e,onClick:t,color:n,boxSize:a=6,...i})=>{const{background:o,border:s,colorText:l}=us();return ue.jsx(pe.Tooltip,{bgColor:i.bgColor||o,borderColor:i.borderColor||s,borderWidth:1,color:i.textColor||l,label:e,borderRadius:15,placement:i.placement||"top",fontWeight:300,fontSize:"sm",p:2,px:4,shadow:"none",children:ue.jsx(pe.Flex,{children:ue.jsx(pe.Icon,{as:r,boxSize:a,color:n,cursor:t?"pointer":void 0,onClick:t})})})},sq=({data:r,children:e,isInverted:t,isParent:n})=>{var z,$;const{selectedNodeIds:a,setSelectedNodeIds:i,isMultiSelectMode:o,isPerformanceMode:s,cyRef:l,callbacks:u,config:c,themeColor:d,direction:h}=Da(),{background:g,border:p,colorText:E}=us(),y=Se.useRef(null),b=Se.useRef(null),[w,x]=Se.useState(!1),[C,T]=Se.useState(!1),S=r==null?void 0:r.id,_=a.includes(S),A=c.nodeOverlayActions,P=c.renderNodeOverlay,I=(()=>{var q;try{const V=(q=l.current)==null?void 0:q.zoom();return V!==void 0&&V<.08}catch{return!1}})(),D=Se.useCallback(()=>{var q,V,Z;if(!C)if(o){const K=a.includes(S),j=K?a.filter(ee=>ee!==S):[...a,S];i(j),K?(q=u.onNodeDeselect)==null||q.call(u):(V=u.onNodeSelect)==null||V.call(u,S,r)}else i([S]),(Z=u.onNodeSelect)==null||Z.call(u,S,r)},[S,r,a,o,C,i,u]),k=Se.useCallback(()=>{var q;C||(q=u.onNodeDoubleClick)==null||q.call(u,S,r)},[S,r,C,u]),M=Se.useCallback(()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>x(!0),100)},[]),N=Se.useCallback(()=>{b.current&&clearTimeout(b.current),x(!1)},[]);return n?ue.jsxs(pe.Box,{ref:y,onClick:D,onDoubleClick:k,onMouseEnter:M,onMouseLeave:N,cursor:"pointer",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!I&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(pe.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!0,isHovered:w,setIsHovered:x})}):ue.jsx(pe.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(pe.HStack,{px:2,spacing:2,children:A.map((q,V)=>ue.jsxs(pe.Box,{display:"contents",children:[V>0&&ue.jsx(pe.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(q1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:Z=>{var K;Z.stopPropagation(),(K=u.onNodeHoverAction)==null||K.call(u,q.id,S,r)}})]},q.id))})})]}),e({id:S,data:r,isActive:_,isLowZoom:I,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)}),((z=r==null?void 0:r.config)==null?void 0:z.collapsed)!==void 0&&(()=>{var Z;const q=h==="TB"||h==="BT",V=t||h==="RL";return ue.jsx(pe.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:V?void 0:"-75px",left:V?"-75px":void 0,top:"50%",transform:"translateY(-50%)"},"aria-label":r.config.collapsed?"Expand":"Collapse",icon:r.config.collapsed?ue.jsx(Dr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Dr.PiMinusBold,{size:30,color:"gray.800"}),onClick:K=>{var j;K.stopPropagation(),(j=u.onNodeCollapse)==null||j.call(u,S,!r.config.collapsed)},bgColor:ht(((Z=r==null?void 0:r.viewProps)==null?void 0:Z.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4})})()]}):ue.jsxs(pe.Box,{ref:y,onClick:D,onDoubleClick:k,onMouseEnter:M,onMouseLeave:N,cursor:"pointer",transition:"transform 0.1s ease",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!I&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(pe.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!!n,isHovered:w,setIsHovered:x})}):ue.jsx(pe.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(pe.HStack,{px:2,spacing:2,children:A.map((q,V)=>ue.jsxs(pe.Box,{display:"contents",children:[V>0&&ue.jsx(pe.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(q1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:Z=>{var K;Z.stopPropagation(),(K=u.onNodeHoverAction)==null||K.call(u,q.id,S,r)}})]},q.id))})})]}),ue.jsxs(pe.Box,{position:"relative",display:"flex",h:"100%",w:"100%",children:[(($=r==null?void 0:r.config)==null?void 0:$.collapsed)!==void 0&&!n&&(()=>{var Z;const q=h==="TB"||h==="BT",V=t||h==="RL";return ue.jsx(pe.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:V?void 0:"-75px",left:V?"-75px":void 0,alignSelf:"center"},"aria-label":r.config.collapsed?"Expand":"Collapse",icon:r.config.collapsed?ue.jsx(Dr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Dr.PiMinusBold,{size:30,color:"gray.800"}),onClick:K=>{var j;K.stopPropagation(),(j=u.onNodeCollapse)==null||j.call(u,S,!r.config.collapsed)},bgColor:ht(((Z=r==null?void 0:r.viewProps)==null?void 0:Z.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4})})(),e({id:S,data:r,isActive:_,isLowZoom:I,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)})]})]})},al=Se.memo(sq);function U2(r=!0){const e=Se.useRef(null);return Se.useEffect(()=>{if(!r||!e.current)return;const t=i=>{i.stopPropagation(),i.stopImmediatePropagation()},n=e.current,a=["mousedown","mouseup","click","pointerdown","pointerup","keydown","keyup","keypress","input","focus"];return a.forEach(i=>n.addEventListener(i,t,!0)),()=>{a.forEach(i=>n.removeEventListener(i,t,!0))}},[r]),e}const H2=({nodeId:r,label:e,color:t,fontWeight:n="bold",fontSize:a="5xl",isEditing:i,onEditStart:o,onEditEnd:s})=>{const{callbacks:l,config:u,readOnly:c}=Da(),d=u.editable&&!c,[h,g]=Se.useState(e),p=Se.useRef(null),E=Se.useRef(!1),y=U2(i);Se.useEffect(()=>{i&&(E.current=!1,p.current&&(p.current.focus(),p.current.select()))},[i]);const b=()=>{var x;if(E.current)return;E.current=!0;const w=h.trim();w&&w!==e&&((x=l.onNodeLabelChange)==null||x.call(l,r,w)),s()};return!d||!i?ue.jsx(pe.Text,{color:t,fontWeight:n,fontSize:a,onDoubleClick:d?w=>{w.stopPropagation(),g(e),o()}:void 0,cursor:d?"text":void 0,children:e}):ue.jsx("div",{ref:y,children:ue.jsx(pe.Input,{ref:p,value:h,onChange:w=>g(w.target.value),onBlur:b,onKeyDown:w=>{w.key==="Enter"&&b(),w.key==="Escape"&&s()},color:t,fontWeight:n,fontSize:a,variant:"unstyled",p:0,h:"auto",lineHeight:"normal"})})},uq=({id:r,data:e,isActive:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var d,h,g;const{themeColor:o}=Da(),{bgColor:s,borderColor:l,textColor:u}=ss(((d=e==null?void 0:e.viewProps)==null?void 0:d.bgColor)||o),c=ht(((h=e==null?void 0:e.viewProps)==null?void 0:h.textColor)||u);return ue.jsx(pe.Box,{borderRadius:(g=e==null?void 0:e.viewProps)==null?void 0:g.borderRadius,bgColor:s,borderColor:t?"white":l,_hover:{borderColor:"white"},borderWidth:2,py:14,px:20,whiteSpace:"normal",children:ue.jsx(pe.Flex,{justifyContent:"start",w:900,fontSize:"5xl",lineHeight:"normal",children:ue.jsx(H2,{nodeId:r,label:(e==null?void 0:e.label)||(e==null?void 0:e.text)||"",color:c,isEditing:n,onEditStart:a,onEditEnd:i})})})},lq=({id:r,isActive:e,data:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var p,E,y,b;const{themeColor:o}=Da(),s=((p=t==null?void 0:t.viewProps)==null?void 0:p.bgColor)||o,{borderColor:l,highlightColor:u,textColor:c}=ss(s),d=ht(((E=t==null?void 0:t.viewProps)==null?void 0:E.textColor)||c),h=ht(((y=t==null?void 0:t.viewProps)==null?void 0:y.borderColor)||l),g=s!=null&&s.startsWith("#")?s:ht(u);return ue.jsx(pe.Flex,{align:"center",borderRadius:(b=t==null?void 0:t.viewProps)==null?void 0:b.borderRadius,bgColor:g,style:{backgroundColor:g},textTransform:"capitalize",borderColor:e?"white":h,_hover:{borderColor:"white"},borderWidth:2,px:50,whiteSpace:"nowrap",children:ue.jsx(pe.Flex,{justifyContent:"start",py:14,fontSize:"5xl",lineHeight:"normal",w:900,children:ue.jsx(H2,{nodeId:r,label:(t==null?void 0:t.label)||(t==null?void 0:t.text)||"",color:d,isEditing:n,onEditStart:a,onEditEnd:i})})})},_m=({name:r,...e})=>{const[t,n]=Se.useState(null),[a,i]=Se.useState(!0),[o,s]=Se.useState(!1);return Se.useEffect(()=>{if(!r||r.length<2){n(null),i(!1);return}i(!0),s(!1),(async()=>{try{let u;if(r.startsWith("Md"))u="md";else if(r.startsWith("Fa"))u="fa6";else if(r.startsWith("Io5"))u="io5";else if(r.startsWith("Io"))u="io";else if(r.startsWith("Ti"))u="ti";else if(r.startsWith("Go"))u="go";else if(r.startsWith("Fi"))u="fi";else if(r.startsWith("Di"))u="di";else if(r.startsWith("Ai"))u="ai";else if(r.startsWith("Bs"))u="bs";else if(r.startsWith("Ri"))u="ri";else if(r.startsWith("Fc"))u="fc";else if(r.startsWith("Gi"))u="gi";else if(r.startsWith("Hi2"))u="hi2";else if(r.startsWith("Hi"))u="hi";else if(r.startsWith("Si"))u="si";else if(r.startsWith("Sl"))u="sl";else if(r.startsWith("Im"))u="im";else if(r.startsWith("Bi"))u="bi";else if(r.startsWith("Pi"))u="pi";else if(r.startsWith("Vsc"))u="vsc";else if(r.startsWith("Tb"))u="tb";else if(r.startsWith("Tfi"))u="tfi";else if(r.startsWith("Cg"))u="cg";else if(r.startsWith("Lia"))u="lia";else if(r.startsWith("Lu"))u="lu";else throw new Error(`Unknown library prefix for icon: ${r}`);let c;switch(u){case"md":c=await import("react-icons/md");break;case"fa6":c=await import("react-icons/fa6");break;case"io5":c=await import("react-icons/io5");break;case"io":c=await import("react-icons/io");break;case"ti":c=await import("react-icons/ti");break;case"go":c=await import("react-icons/go");break;case"fi":c=await import("react-icons/fi");break;case"di":c=await import("react-icons/di");break;case"ai":c=await import("react-icons/ai");break;case"bs":c=await import("react-icons/bs");break;case"ri":c=await import("react-icons/ri");break;case"fc":c=await import("react-icons/fc");break;case"gi":c=await import("react-icons/gi");break;case"hi2":c=await import("react-icons/hi2");break;case"hi":c=await import("react-icons/hi");break;case"si":c=await import("react-icons/si");break;case"sl":c=await import("react-icons/sl");break;case"im":c=await import("react-icons/im");break;case"bi":c=await import("react-icons/bi");break;case"pi":c=await import("react-icons/pi");break;case"vsc":c=await import("react-icons/vsc");break;case"tb":c=await import("react-icons/tb");break;case"tfi":c=await import("react-icons/tfi");break;case"cg":c=await import("react-icons/cg");break;case"lia":c=await import("react-icons/lia");break;case"lu":c=await import("react-icons/lu");break;default:throw new Error(`Unsupported library: ${u}`)}const d=c[r];if(!d)throw new Error(`Icon ${r} not found in library ${u}`);n(()=>d)}catch(u){console.warn(`Failed to load icon ${r}:`,u.message),s(!0),n(null)}finally{i(!1)}})()},[r]),a||!t?null:ue.jsx(t,{...e})},K2=(r,e)=>{var l,u,c;const t=((l=r==null?void 0:r.viewProps)==null?void 0:l.bgColor)||e,[n]=t.split("."),a=ss(t),i=t!=null&&t.startsWith("#")?ht(t):ht(a.bgColor),o=ht(((u=r==null?void 0:r.viewProps)==null?void 0:u.textColor)||a.textColor),s=ht(((c=r==null?void 0:r.viewProps)==null?void 0:c.borderColor)||a.borderColor);return{...a,bg:t,wordBeforeDot:n,hexbgColor:i,hextextColor:o,hexborderColor:s}},fq=(r,e=350)=>`${String(r).substring(0,e)}${String(r).length>e?"...":""}`,j2=r=>r!=null&&r.includes("root")?r.replace("root","untitled"):r,cq=r=>{const e=Math.max(...Object.keys(r||{}).map(n=>n.length),0);return Math.max(e*28+30,200)},Y2=r=>ue.jsx(al,{...r,children:e=>ue.jsx(uq,{...e})}),Z2=r=>ue.jsx(al,{...r,children:e=>ue.jsx(lq,{...e})}),X2=r=>{const{themeColor:e}=Da(),[t,n]=Se.useState(!1);return ue.jsx(al,{...r,children:({data:a,isActive:i,isLowZoom:o})=>{var h,g,p,E,y,b,w,x;const s=K2(a,e),l=Object.entries(a.description||{}).length>0,u=cq(a.description),c=(g=(h=r.data)==null?void 0:h.config)==null?void 0:g.icon,d=(E=(p=r.data)==null?void 0:p.config)==null?void 0:E.content;return ue.jsx(pe.Flex,{justifyContent:"space-between",...a==null?void 0:a.viewProps,direction:"column",p:0,borderRadius:(y=a==null?void 0:a.viewProps)==null?void 0:y.borderRadius,overflow:"hidden",alignItems:"center",style:{backgroundColor:s.hexbgColor,transition:"border-color 0.2s ease-in-out"},width:"100%",borderColor:i?"white":s.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:ue.jsxs(pe.Flex,{width:"100%",direction:"column",borderRadius:(b=a==null?void 0:a.viewProps)==null?void 0:b.borderRadius,borderColor:s.hexborderColor,borderWidth:0,overflow:"hidden",children:[a.headerTitle&&ue.jsxs(pe.Flex,{justify:"flex-start",direction:"row",p:Object.entries(a.description||{}).length?8:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:d?"left":"center",textOverflow:"ellipsis",alignItems:"center",fontWeight:"bold",textColor:s.propertyColor,bgColor:s.highlightColor,borderBottomColor:!l&&!d?"transparent":s.hexborderColor,children:[!!c&&ue.jsx(pe.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(_m,{name:c,size:80,color:s.hextextColor},s.hextextColor)}),ue.jsx(pe.Text,{fontSize:"5xl",noOfLines:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(w=a==null?void 0:a.viewProps)==null?void 0:w.textColor,children:j2(a.headerTitle)}),!!d&&ue.jsx(pe.Box,{ml:10,onClick:()=>n(!t),children:t?ue.jsx(Dr.PiGear,{size:30,style:{cursor:"pointer"}}):ue.jsx(Dr.PiNotepad,{size:30,style:{cursor:"pointer"}})})]}),d&&!t?ue.jsx(pe.Flex,{w:"100%",overflow:"auto",justifyContent:"start",background:s.highlightColor,p:10,fontSize:"5xl",lineHeight:"normal",cursor:"text",children:ue.jsx(pe.Text,{whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis",color:(x=a==null?void 0:a.viewProps)==null?void 0:x.textColor,children:d})}):ue.jsx(pe.Box,{children:Object.entries(a.description||{}).map(([C,T],S)=>{var P,I;const _=In(s.wordBeforeDot)[typeof T],A=In(s.wordBeforeDot).property;return ue.jsxs(pe.Box,{children:[ue.jsxs(pe.Flex,{flexWrap:"nowrap",overflow:"hidden",children:[ue.jsx(pe.Flex,{justifyContent:"start",align:"center",background:s.highlightColor,width:`${u}px`,minWidth:`${u}px`,borderRightColor:s.hexborderColor,borderRightWidth:1,children:ue.jsx(pe.Text,{py:5,px:10,w:"100%",whiteSpace:"nowrap",fontWeight:"bold",fontSize:"4xl",textColor:((P=a==null?void 0:a.viewProps)==null?void 0:P.textColor)||A,children:C})}),ue.jsx(pe.Flex,{flex:1,justifyContent:"start",overflow:"hidden",p:4,background:s.hexbgColor,w:600,maxH:200,children:ue.jsx(pe.Text,{overflow:"hidden",py:3,px:4,whiteSpace:"normal",textOverflow:"ellipsis",fontSize:"4xl",textColor:((I=a==null?void 0:a.viewProps)==null?void 0:I.textColor)||_,fontWeight:400,children:fq(T)})})]}),S!==Object.entries(a.description||{}).length-1&&ue.jsx(pe.Divider,{borderWidth:1,orientation:"horizontal",my:0,borderColor:s.hexborderColor})]},S)})})]})})}})},Q2=r=>{const{themeColor:e}=Da();return ue.jsx(al,{...r,children:({data:t,isActive:n})=>{var o,s,l,u;const a=K2(t,e),i=(s=(o=r.data)==null?void 0:o.config)==null?void 0:s.icon;return ue.jsx(pe.Flex,{justifyContent:"space-between",...t==null?void 0:t.viewProps,direction:"column",p:0,borderRadius:((l=t==null?void 0:t.viewProps)==null?void 0:l.borderRadius)||15,overflow:"hidden",bgColor:a.bgColor,position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",style:{backgroundColor:a.hexbgColor,transition:"border-color 0.2s ease-in-out"},borderColor:n?"white":a.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:t.headerTitle&&ue.jsxs(pe.Flex,{justify:"flex-start",direction:"row",p:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",alignItems:"center",fontWeight:"bold",textColor:a.propertyColor,bgColor:a.highlightColor,borderBottomColor:a.hexborderColor,children:[!!i&&ue.jsx(pe.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(_m,{name:i,size:80,color:a.hextextColor},a.hextextColor)}),ue.jsx(pe.Text,{fontSize:"5xl",noOfLines:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(u=t==null?void 0:t.viewProps)==null?void 0:u.textColor,children:j2(t.headerTitle)})]})})}})};Y2.displayName="text";Z2.displayName="arrayView";X2.displayName="NodeJsonObjectView";Q2.displayName="ParentContainerView";const dq={objectView:X2,arrayView:Z2,text:Y2,parentContainer:Q2},vq=r=>[{selector:"node",style:{"outline-opacity":0,"background-opacity":0,"background-color":"transparent","border-color":"transparent",color:"transparent","border-opacity":0,"text-valign":"center","text-halign":"center","border-width":0,"outline-width":0,width:60,height:60}},{selector:"node:selected",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:"node:active",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:":parent",style:{shape:"round-rectangle","background-opacity":.4,"corner-radius":50,"line-color":r("light"),"background-color":r(),"border-color":r(),"border-width":6,"border-style":"solid","border-opacity":1,padding:"120px","text-valign":"top","font-size":"70px","font-weight":"bold","text-margin-y":90,"text-background-opacity":0,"text-background-padding":"45px","z-index":1e3,"compound-sizing-wrt-labels":"include",label:"data(label)"}},{selector:"edge",style:{width:6,label:"data(label)","z-index":-100,"control-point-step-size":10,"taxi-direction":"horizontal","curve-style":"round-taxi","edge-distances":"intersection","line-color":r("light"),color:r("light"),"text-rotation":"autorotate","target-arrow-color":r("light"),"source-arrow-color":r("light"),"target-arrow-shape":"triangle","arrow-scale":"3","text-background-color":r("dark"),"text-background-opacity":1,"text-background-padding":"15px","taxi-radius":500,"source-arrow-fill":"filled","target-arrow-fill":"filled","text-max-width":"200px","font-size":"45px","text-wrap":"wrap","text-margin-x":50,"transition-duration":"0.5s","source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","source-distance-from-node":120,"target-distance-from-node":120}}],oc=(r,e,t,n)=>{if(!r)return{controlPointDistances:[0],controlPointWeights:[.5]};const a=r.edges().filter(u=>{const c=u.data();return c.source===e&&c.target===t||c.source===t&&c.target===e});if(a.length<=1)return{controlPointDistances:[0],controlPointWeights:[.5]};let i=0;a.forEach((u,c)=>{u.data().id===n&&(i=c)});const o=a.length;return{controlPointDistances:[(i-(o-1)/2)*60],controlPointWeights:[.5]}},hq=r=>{const n=1/(Math.cbrt(r)*.8);let a=Math.round(650*n),i=Math.round(350*n);return a=Math.max(40,Math.min(450,a)),i=Math.max(30,Math.min(300,i)),{edgeSep:a,rankSep:i}};function gq({cytoInstance:r,id:e,source:t,type:n,target:a,label:i,children:o,layout:s,styleCallback:l,isPerformanceMode:u}){const c=Se.useRef(null),d=Se.useRef(null),[h,g]=Se.useState(2);let p,E;function y(S){if(l){const _=l(S,t,a);p=_.hasOwnProperty("line-style"),E=_.hasOwnProperty("source-arrow-shape"),S.style(_)}}const b=Se.useCallback(()=>{if(!p||u)return;const S=r.getElementById(e);if(S.length===0)return;const I=Date.now()*.1%(20*50),D=E?I:-I;S.style("line-dash-offset",D),d.current=requestAnimationFrame(b)},[p,r,e,E,u]);function w(S){const _=oc(r,t,a,e),A=r.add({data:{...S,controlPointDistances:_.controlPointDistances,controlPointWeights:_.controlPointWeights}});y(A),p&&(d.current=requestAnimationFrame(b))}function x(S,_){let A=2;return r.getElementById(S).length===1&&(A-=1),r.getElementById(_).length===1&&(A-=1),A}if(Se.useEffect(()=>{if(x(t,a)===0){const _=r.getElementById(e);if(_.length===0){const A=oc(r,t,a,e),P=r.add({data:{id:e,source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}});y(P),p&&(d.current=requestAnimationFrame(b))}else{const A=oc(r,t,a,e);_.data({source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}),y(_)}}},[t,a,e,i,n,r,p,b]),Se.useEffect(()=>{function S(A){const P=A.target.id();if(P===t||P===a){const I=x(t,a);I!==h&&g(I),I===0&&w({id:e,source:t,target:a,label:i,type:n})}}function _(A){const P=A.target.id();if(P===t||P===a){const I=x(t,a);I!==h&&g(I),I>0&&(r.getElementById(e).remove(),d.current&&cancelAnimationFrame(d.current))}}return r.on("add","node",S),r.on("remove","node",_),p&&h===0&&(d.current=requestAnimationFrame(b)),()=>{r.getElementById(e).remove(),r.off("add","node",S),r.off("remove","node",_),d.current&&cancelAnimationFrame(d.current)}},[]),Se.useEffect(()=>(p&&h===0?d.current||(d.current=requestAnimationFrame(b)):!p&&d.current&&(cancelAnimationFrame(d.current),d.current=null),()=>{d.current&&cancelAnimationFrame(d.current)}),[p,h,b]),Se.useEffect(()=>{s()},[e,o]),Se.useEffect(()=>{if(!h){const S=r.getElementById(e);y(S)}},[l,h]),h>0)return null;function C(S){return Se.cloneElement(S,{cytoInstance:r,layout:s})}const T=Se.Children.map(o,C);return ue.jsx("div",{ref:c,className:"cytoscape-react-edge",children:T})}function am(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function pq(r){if(Array.isArray(r))return r}function yq(r){if(Array.isArray(r))return am(r)}function Ba(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function mq(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,eR(n.key),n)}}function Ma(r,e,t){return e&&mq(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function zt(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Sm(r))||e){t&&(r=t);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return o=l.done,l},e:function(l){s=!0,i=l},f:function(){try{o||t.return==null||t.return()}finally{if(s)throw i}}}}function J2(r,e,t){return(e=eR(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bq(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function wq(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,a,i,o,s=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}function xq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eq(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yr(r,e){return pq(r)||wq(r,e)||Sm(r,e)||xq()}function Gu(r){return yq(r)||bq(r)||Sm(r)||Eq()}function Cq(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function eR(r){var e=Cq(r,"string");return typeof e=="symbol"?e:e+""}function tt(r){"@babel/helpers - typeof";return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tt(r)}function Sm(r,e){if(r){if(typeof r=="string")return am(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?am(r,e):void 0}}var et=typeof window>"u"?null:window,N1=et?et.navigator:null;et&&et.document;var _q=tt(""),rR=tt({}),Sq=tt(function(){}),Tq=typeof HTMLElement>"u"?"undefined":tt(HTMLElement),ls=function(e){return e&&e.instanceString&&zr(e.instanceString)?e.instanceString():null},Ke=function(e){return e!=null&&tt(e)==_q},zr=function(e){return e!=null&&tt(e)===Sq},Sr=function(e){return!Yt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},pr=function(e){return e!=null&&tt(e)===rR&&!Sr(e)&&e.constructor===Object},Rq=function(e){return e!=null&&tt(e)===rR},Me=function(e){return e!=null&&tt(e)===tt(1)&&!isNaN(e)},Aq=function(e){return Me(e)&&Math.floor(e)===e},Wu=function(e){if(Tq!=="undefined")return e!=null&&e instanceof HTMLElement},Yt=function(e){return fs(e)||tR(e)},fs=function(e){return ls(e)==="collection"&&e._private.single},tR=function(e){return ls(e)==="collection"&&!e._private.single},Tm=function(e){return ls(e)==="core"},nR=function(e){return ls(e)==="stylesheet"},Pq=function(e){return ls(e)==="event"},Ca=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Iq=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Dq=function(e){return pr(e)&&Me(e.x1)&&Me(e.x2)&&Me(e.y1)&&Me(e.y2)},Bq=function(e){return Rq(e)&&zr(e.then)},Mq=function(){return N1&&N1.userAgent.match(/msie|trident|edge/i)},Ji=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function(){var i=this,o=arguments,s,l=t.apply(i,o),u=n.cache;return(s=u[l])||(s=u[l]=e.apply(i,o)),s};return n.cache={},n},Rm=Ji(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),il=Ji(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),aR=Ji(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),F1=function(e){return Ca(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ya=function(e,t){return e.slice(-1*t.length)===t},rt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",kq="rgb[a]?\\(("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)(?:\\s*,\\s*("+rt+"))?\\)",Oq="rgb[a]?\\((?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)(?:\\s*,\\s*(?:"+rt+"))?\\)",Lq="hsl[a]?\\(("+rt+")\\s*,\\s*("+rt+"[%])\\s*,\\s*("+rt+"[%])(?:\\s*,\\s*("+rt+"))?\\)",qq="hsl[a]?\\((?:"+rt+")\\s*,\\s*(?:"+rt+"[%])\\s*,\\s*(?:"+rt+"[%])(?:\\s*,\\s*(?:"+rt+"))?\\)",Nq="\\#[0-9a-fA-F]{3}",Fq="\\#[0-9a-fA-F]{6}",iR=function(e,t){return e<t?-1:e>t?1:0},zq=function(e,t){return-1*iR(e,t)},Ye=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];r[o]=n[o]}}return r},$q=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,n,a,i,o=16;return t?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},Vq=function(e){var t,n,a,i,o,s,l,u;function c(p,E,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(E-p)*6*y:y<1/2?E:y<2/3?p+(E-p)*(2/3-y)*6:p}var d=new RegExp("^"+Lq+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(d[2]),a<0||a>100||(a=a/100,i=parseFloat(d[3]),i<0||i>100)||(i=i/100,o=d[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)s=l=u=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,g=2*i-h;s=Math.round(255*c(g,h,n+1/3)),l=Math.round(255*c(g,h,n)),u=Math.round(255*c(g,h,n-1/3))}t=[s,l,u,o]}return t},Gq=function(e){var t,n=new RegExp("^"+kq+"$").exec(e);if(n){t=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var s=a[1]||a[2]||a[3],l=a[1]&&a[2]&&a[3];if(s&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;t.push(u)}}return t},Wq=function(e){return Uq[e.toLowerCase()]},oR=function(e){return(Sr(e)?e:null)||Wq(e)||$q(e)||Gq(e)||Vq(e)},Uq={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},sR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to set map with object key");i<n.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},uR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to get map with object key");if(t=t[o],t==null)return t}return t},gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var sc,z1;function ds(){if(z1)return sc;z1=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return sc=r,sc}var uc,$1;function Hq(){if($1)return uc;$1=1;var r=typeof gu=="object"&&gu&&gu.Object===Object&&gu;return uc=r,uc}var lc,V1;function ol(){if(V1)return lc;V1=1;var r=Hq(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return lc=t,lc}var fc,G1;function Kq(){if(G1)return fc;G1=1;var r=ol(),e=function(){return r.Date.now()};return fc=e,fc}var cc,W1;function jq(){if(W1)return cc;W1=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return cc=e,cc}var dc,U1;function Yq(){if(U1)return dc;U1=1;var r=jq(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return dc=t,dc}var vc,H1;function Am(){if(H1)return vc;H1=1;var r=ol(),e=r.Symbol;return vc=e,vc}var hc,K1;function Zq(){if(K1)return hc;K1=1;var r=Am(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[a]=l:delete o[a]),c}return hc=i,hc}var gc,j1;function Xq(){if(j1)return gc;j1=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return gc=t,gc}var pc,Y1;function lR(){if(Y1)return pc;Y1=1;var r=Am(),e=Zq(),t=Xq(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return pc=o,pc}var yc,Z1;function Qq(){if(Z1)return yc;Z1=1;function r(e){return e!=null&&typeof e=="object"}return yc=r,yc}var mc,X1;function vs(){if(X1)return mc;X1=1;var r=lR(),e=Qq(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return mc=n,mc}var bc,Q1;function Jq(){if(Q1)return bc;Q1=1;var r=Yq(),e=ds(),t=vs(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=r(u);var d=i.test(u);return d||o.test(u)?s(u.slice(2),d?2:8):a.test(u)?n:+u}return bc=l,bc}var wc,J1;function eN(){if(J1)return wc;J1=1;var r=ds(),e=Kq(),t=Jq(),n="Expected a function",a=Math.max,i=Math.min;function o(s,l,u){var c,d,h,g,p,E,y=0,b=!1,w=!1,x=!0;if(typeof s!="function")throw new TypeError(n);l=t(l)||0,r(u)&&(b=!!u.leading,w="maxWait"in u,h=w?a(t(u.maxWait)||0,l):h,x="trailing"in u?!!u.trailing:x);function C(M){var N=c,z=d;return c=d=void 0,y=M,g=s.apply(z,N),g}function T(M){return y=M,p=setTimeout(A,l),b?C(M):g}function S(M){var N=M-E,z=M-y,$=l-N;return w?i($,h-z):$}function _(M){var N=M-E,z=M-y;return E===void 0||N>=l||N<0||w&&z>=h}function A(){var M=e();if(_(M))return P(M);p=setTimeout(A,S(M))}function P(M){return p=void 0,x&&c?C(M):(c=d=void 0,g)}function I(){p!==void 0&&clearTimeout(p),y=0,c=E=d=p=void 0}function D(){return p===void 0?g:P(e())}function k(){var M=e(),N=_(M);if(c=arguments,d=this,E=M,N){if(p===void 0)return T(E);if(w)return clearTimeout(p),p=setTimeout(A,l),C(E)}return p===void 0&&(p=setTimeout(A,l)),g}return k.cancel=I,k.flush=D,k}return wc=o,wc}var rN=eN(),hs=cs(rN),xc=et?et.performance:null,fR=xc&&xc.now?function(){return xc.now()}:function(){return Date.now()},tN=(function(){if(et){if(et.requestAnimationFrame)return function(r){et.requestAnimationFrame(r)};if(et.mozRequestAnimationFrame)return function(r){et.mozRequestAnimationFrame(r)};if(et.webkitRequestAnimationFrame)return function(r){et.webkitRequestAnimationFrame(r)};if(et.msRequestAnimationFrame)return function(r){et.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(fR())},1e3/60)}})(),Uu=function(e){return tN(e)},Yn=fR,Ja=9261,cR=65599,Gi=5381,dR=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ja,n=t,a;a=e.next(),!a.done;)n=n*cR+a.value|0;return n},Zo=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ja;return t*cR+e|0},Xo=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gi;return(t<<5)+t+e|0},nN=function(e,t){return e*2097152+t},ha=function(e){return e[0]*2097152+e[1]},pu=function(e,t){return[Zo(e[0],t[0]),Xo(e[1],t[1])]},ew=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return dR(o,t)},ai=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return dR(o,t)},vR=function(){return aN(arguments)},aN=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];n===0?t=ai(a):t=ai(a,t)}return t};function iN(r,e,t,n,a){var i=a*Math.PI/180,o=Math.cos(i)*(r-t)-Math.sin(i)*(e-n)+t,s=Math.sin(i)*(r-t)+Math.cos(i)*(e-n)+n;return{x:o,y:s}}var oN=function(e,t,n,a,i,o){return{x:(e-n)*i+n,y:(t-a)*o+a}};function sN(r,e,t){if(t===0)return r;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=iN(r.x,r.y,n,a,t),l=oN(s.x,s.y,n,a,i,o);return{x:l.x,y:l.y}}var rw=!0,uN=console.warn!=null,lN=console.trace!=null,Pm=Number.MAX_SAFE_INTEGER||9007199254740991,hR=function(){return!0},Hu=function(){return!1},tw=function(){return 0},Im=function(){},Lr=function(e){throw new Error(e)},gR=function(e){if(e!==void 0)rw=!!e;else return rw},Er=function(e){gR()&&(uN?console.warn(e):(console.log(e),lN&&console.trace()))},fN=function(e){return Ye({},e)},Dn=function(e){return e==null?e:Sr(e)?e.slice():pr(e)?fN(e):e},cN=function(e){return e.slice()},pR=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},dN={},yR=function(){return dN},yt=function(e){var t=Object.keys(e);return function(n){for(var a={},i=0;i<t.length;i++){var o=t[i],s=n==null?void 0:n[o];a[o]=s===void 0?e[o]:s}return a}},_a=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},Dm=function(e){e.splice(0,e.length)},vN=function(e,t){for(var n=0;n<t.length;n++){var a=t[n];e.push(a)}},Nt=function(e,t,n){return n&&(t=aR(n,t)),e[t]},Kn=function(e,t,n,a){n&&(t=aR(n,t)),e[t]=a},hN=(function(){function r(){Ba(this,r),this._obj={}}return Ma(r,[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])})(),jn=typeof Map<"u"?Map:hN,gN="undefined",pN=(function(){function r(e){if(Ba(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var n=0;n<t.length;n++)this.add(t[n])}}return Ma(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;n[t]!==1&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;n[t]===1&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])})(),to=(typeof Set>"u"?"undefined":tt(Set))!==gN?Set:pN,sl=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Tm(e)){Lr("An element must have a core reference and parameters set");return}var a=t.group;if(a==null&&(t.data&&t.data.source!=null&&t.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Lr("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?a==="edges":!!t.pannable,active:!1,classes:new to,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,s=e.pan(),l=e.zoom();i.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];Sr(t.classes)?u=t.classes:Ke(t.classes)&&(u=t.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var h=u[c];!h||h===""||i.classes.add(h)}this.createEmitter(),(n===void 0||n)&&this.restore();var g=t.style||t.css;g&&(Er("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(g))},nw=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;pr(n)&&!Yt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!zr(a)?a:i,a=zr(a)?a:function(){};for(var s=this._private.cy,l=n=Ke(n)?this.filter(n):n,u=[],c=[],d={},h={},g={},p=0,E,y=this.byGroup(),b=y.nodes,w=y.edges,x=0;x<l.length;x++){var C=l[x],T=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(g[T]=!0,c.push(C)),h[T]=0)}for(var S=function(){var M=e.bfs?u.shift():u.pop(),N=M.id();if(e.dfs){if(g[N])return 0;g[N]=!0,c.push(M)}var z=h[N],$=d[N],q=$!=null?$.source():null,V=$!=null?$.target():null,Z=$==null?void 0:M.same(q)?V[0]:q[0],K;if(K=a(M,$,Z,p++,z),K===!0)return E=M,1;if(K===!1)return 1;for(var j=M.connectedEdges().filter(function(Y){return(!i||Y.source().same(M))&&w.has(Y)}),ee=0;ee<j.length;ee++){var le=j[ee],W=le.connectedNodes().filter(function(Y){return!Y.same(M)&&b.has(Y)}),G=W.id();W.length!==0&&!g[G]&&(W=W[0],u.push(W),e.bfs&&(g[G]=!0,c.push(W)),d[G]=le,h[G]=h[N]+1)}},_;u.length!==0&&(_=S(),!(_!==0&&_===1)););for(var A=s.collection(),P=0;P<c.length;P++){var I=c[P],D=d[I.id()];D!=null&&A.push(D),A.push(I)}return{path:s.collection(A),found:s.collection(E)}}},Qo={breadthFirstSearch:nw({bfs:!0}),depthFirstSearch:nw({dfs:!0})};Qo.bfs=Qo.breadthFirstSearch;Qo.dfs=Qo.depthFirstSearch;var Pu={exports:{}},yN=Pu.exports,aw;function mN(){return aw||(aw=1,(function(r,e){(function(){var t,n,a,i,o,s,l,u,c,d,h,g,p,E,y;a=Math.floor,d=Math.min,n=function(b,w){return b<w?-1:b>w?1:0},c=function(b,w,x,C,T){var S;if(x==null&&(x=0),T==null&&(T=n),x<0)throw new Error("lo must be non-negative");for(C==null&&(C=b.length);x<C;)S=a((x+C)/2),T(w,b[S])<0?C=S:x=S+1;return[].splice.apply(b,[x,x-x].concat(w)),w},s=function(b,w,x){return x==null&&(x=n),b.push(w),E(b,0,b.length-1,x)},o=function(b,w){var x,C;return w==null&&(w=n),x=b.pop(),b.length?(C=b[0],b[0]=x,y(b,0,w)):C=x,C},u=function(b,w,x){var C;return x==null&&(x=n),C=b[0],b[0]=w,y(b,0,x),C},l=function(b,w,x){var C;return x==null&&(x=n),b.length&&x(b[0],w)<0&&(C=[b[0],w],w=C[0],b[0]=C[1],y(b,0,x)),w},i=function(b,w){var x,C,T,S,_,A;for(w==null&&(w=n),S=(function(){A=[];for(var P=0,I=a(b.length/2);0<=I?P<I:P>I;0<=I?P++:P--)A.push(P);return A}).apply(this).reverse(),_=[],C=0,T=S.length;C<T;C++)x=S[C],_.push(y(b,x,w));return _},p=function(b,w,x){var C;if(x==null&&(x=n),C=b.indexOf(w),C!==-1)return E(b,0,C,x),y(b,C,x)},h=function(b,w,x){var C,T,S,_,A;if(x==null&&(x=n),T=b.slice(0,w),!T.length)return T;for(i(T,x),A=b.slice(w),S=0,_=A.length;S<_;S++)C=A[S],l(T,C,x);return T.sort(x).reverse()},g=function(b,w,x){var C,T,S,_,A,P,I,D,k;if(x==null&&(x=n),w*10<=b.length){if(S=b.slice(0,w).sort(x),!S.length)return S;for(T=S[S.length-1],I=b.slice(w),_=0,P=I.length;_<P;_++)C=I[_],x(C,T)<0&&(c(S,C,0,null,x),S.pop(),T=S[S.length-1]);return S}for(i(b,x),k=[],A=0,D=d(w,b.length);0<=D?A<D:A>D;0<=D?++A:--A)k.push(o(b,x));return k},E=function(b,w,x,C){var T,S,_;for(C==null&&(C=n),T=b[x];x>w;){if(_=x-1>>1,S=b[_],C(T,S)<0){b[x]=S,x=_;continue}break}return b[x]=T},y=function(b,w,x){var C,T,S,_,A;for(x==null&&(x=n),T=b.length,A=w,S=b[w],C=2*w+1;C<T;)_=C+1,_<T&&!(x(b[C],b[_])<0)&&(C=_),b[w]=b[C],w=C,C=2*w+1;return b[w]=S,E(b,A,w,x)},t=(function(){b.push=s,b.pop=o,b.replace=u,b.pushpop=l,b.heapify=i,b.updateItem=p,b.nlargest=h,b.nsmallest=g;function b(w){this.cmp=w??n,this.nodes=[]}return b.prototype.push=function(w){return s(this.nodes,w,this.cmp)},b.prototype.pop=function(){return o(this.nodes,this.cmp)},b.prototype.peek=function(){return this.nodes[0]},b.prototype.contains=function(w){return this.nodes.indexOf(w)!==-1},b.prototype.replace=function(w){return u(this.nodes,w,this.cmp)},b.prototype.pushpop=function(w){return l(this.nodes,w,this.cmp)},b.prototype.heapify=function(){return i(this.nodes,this.cmp)},b.prototype.updateItem=function(w){return p(this.nodes,w,this.cmp)},b.prototype.clear=function(){return this.nodes=[]},b.prototype.empty=function(){return this.nodes.length===0},b.prototype.size=function(){return this.nodes.length},b.prototype.clone=function(){var w;return w=new b,w.nodes=this.nodes.slice(0),w},b.prototype.toArray=function(){return this.nodes.slice(0)},b.prototype.insert=b.prototype.push,b.prototype.top=b.prototype.peek,b.prototype.front=b.prototype.peek,b.prototype.has=b.prototype.contains,b.prototype.copy=b.prototype.clone,b})(),(function(b,w){return r.exports=w()})(this,function(){return t})}).call(yN)})(Pu)),Pu.exports}var Ec,iw;function bN(){return iw||(iw=1,Ec=mN()),Ec}var wN=bN(),gs=cs(wN),xN=yt({root:null,weight:function(e){return 1},directed:!1}),EN={dijkstra:function(e){if(!pr(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=xN(e),a=n.root,i=n.weight,o=n.directed,s=this,l=i,u=Ke(a)?this.filter(a)[0]:a[0],c={},d={},h={},g=this.byGroup(),p=g.nodes,E=g.edges;E.unmergeBy(function(z){return z.isLoop()});for(var y=function($){return c[$.id()]},b=function($,q){c[$.id()]=q,w.updateItem($)},w=new gs(function(z,$){return y(z)-y($)}),x=0;x<p.length;x++){var C=p[x];c[C.id()]=C.same(u)?0:1/0,w.push(C)}for(var T=function($,q){for(var V=(o?$.edgesTo(q):$.edgesWith(q)).intersect(E),Z=1/0,K,j=0;j<V.length;j++){var ee=V[j],le=l(ee);(le<Z||!K)&&(Z=le,K=ee)}return{edge:K,dist:Z}};w.size()>0;){var S=w.pop(),_=y(S),A=S.id();if(h[A]=_,_!==1/0)for(var P=S.neighborhood().intersect(p),I=0;I<P.length;I++){var D=P[I],k=D.id(),M=T(S,D),N=_+M.dist;N<y(D)&&(b(D,N),d[k]={node:S,edge:M.edge})}}return{distanceTo:function($){var q=Ke($)?p.filter($)[0]:$[0];return h[q.id()]},pathTo:function($){var q=Ke($)?p.filter($)[0]:$[0],V=[],Z=q,K=Z.id();if(q.length>0)for(V.unshift(q);d[K];){var j=d[K];V.unshift(j.edge),V.unshift(j.node),Z=j.node,K=Z.id()}return s.spawn(V)}}}},CN={kruskal:function(e){e=e||function(x){return 1};for(var t=this.byGroup(),n=t.nodes,a=t.edges,i=n.length,o=new Array(i),s=n,l=function(C){for(var T=0;T<o.length;T++){var S=o[T];if(S.has(C))return T}},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var c=a.sort(function(x,C){return e(x)-e(C)}),d=0;d<c.length;d++){var h=c[d],g=h.source()[0],p=h.target()[0],E=l(g),y=l(p),b=o[E],w=o[y];E!==y&&(s.merge(h),b.merge(w),o.splice(y,1))}return s}},_N=yt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),SN={aStar:function(e){var t=this.cy(),n=_N(e),a=n.root,i=n.goal,o=n.heuristic,s=n.directed,l=n.weight;a=t.collection(a)[0],i=t.collection(i)[0];var u=a.id(),c=i.id(),d={},h={},g={},p=new gs(function(K,j){return h[K.id()]-h[j.id()]}),E=new to,y={},b={},w=function(j,ee){p.push(j),E.add(ee)},x,C,T=function(){x=p.pop(),C=x.id(),E.delete(C)},S=function(j){return E.has(j)};w(a,u),d[u]=0,h[u]=o(a);for(var _=0;p.size()>0;){if(T(),_++,C===c){for(var A=[],P=i,I=c,D=b[I];A.unshift(P),D!=null&&A.unshift(D),P=y[I],P!=null;)I=P.id(),D=b[I];return{found:!0,distance:d[C],path:this.spawn(A),steps:_}}g[C]=!0;for(var k=x._private.edges,M=0;M<k.length;M++){var N=k[M];if(this.hasElementWithId(N.id())&&!(s&&N.data("source")!==C)){var z=N.source(),$=N.target(),q=z.id()!==C?z:$,V=q.id();if(this.hasElementWithId(V)&&!g[V]){var Z=d[C]+l(N);if(!S(V)){d[V]=Z,h[V]=Z+o(q),w(q,V),y[V]=x,b[V]=N;continue}Z<d[V]&&(d[V]=Z,h[V]=Z+o(q),y[V]=x,b[V]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},TN=yt({weight:function(e){return 1},directed:!1}),RN={floydWarshall:function(e){for(var t=this.cy(),n=TN(e),a=n.weight,i=n.directed,o=a,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=function(le){return l.indexOf(le)},g=function(le){return l[le]},p=new Array(d),E=0;E<d;E++){var y=E%c,b=(E-y)/c;b===y?p[E]=0:p[E]=1/0}for(var w=new Array(d),x=new Array(d),C=0;C<u.length;C++){var T=u[C],S=T.source()[0],_=T.target()[0];if(S!==_){var A=h(S),P=h(_),I=A*c+P,D=o(T);if(p[I]>D&&(p[I]=D,w[I]=P,x[I]=T),!i){var k=P*c+A;!i&&p[k]>D&&(p[k]=D,w[k]=A,x[k]=T)}}}for(var M=0;M<c;M++)for(var N=0;N<c;N++)for(var z=N*c+M,$=0;$<c;$++){var q=N*c+$,V=M*c+$;p[z]+p[V]<p[q]&&(p[q]=p[z]+p[V],w[q]=w[z])}var Z=function(le){return(Ke(le)?t.filter(le):le)[0]},K=function(le){return h(Z(le))},j={distance:function(le,W){var G=K(le),Y=K(W);return p[G*c+Y]},path:function(le,W){var G=K(le),Y=K(W),re=g(G);if(G===Y)return re.collection();if(w[G*c+Y]==null)return t.collection();var de=t.collection(),se=G,X;for(de.merge(re);G!==Y;)se=G,G=w[G*c+Y],X=x[se*c+G],de.merge(X),de.merge(g(G));return de}};return j}},AN=yt({weight:function(e){return 1},directed:!1,root:null}),PN={bellmanFord:function(e){var t=this,n=AN(e),a=n.weight,i=n.directed,o=n.root,s=a,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,h=c.nodes,g=h.length,p=new jn,E=!1,y=[];o=u.collection(o)[0],d.unmergeBy(function(U){return U.isLoop()});for(var b=d.length,w=function(fe){var xe=p.get(fe.id());return xe||(xe={},p.set(fe.id(),xe)),xe},x=function(fe){return(Ke(fe)?u.$(fe):fe)[0]},C=function(fe){return w(x(fe)).dist},T=function(fe){for(var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ge=x(fe),be=[],Ae=ge;;){if(Ae==null)return t.spawn();var De=w(Ae),Be=De.edge,Le=De.pred;if(be.unshift(Ae[0]),Ae.same(xe)&&be.length>0)break;Be!=null&&be.unshift(Be),Ae=Le}return l.spawn(be)},S=0;S<g;S++){var _=h[S],A=w(_);_.same(o)?A.dist=0:A.dist=1/0,A.pred=null,A.edge=null}for(var P=!1,I=function(fe,xe,ge,be,Ae,De){var Be=be.dist+De;Be<Ae.dist&&!ge.same(be.edge)&&(Ae.dist=Be,Ae.pred=fe,Ae.edge=ge,P=!0)},D=1;D<g;D++){P=!1;for(var k=0;k<b;k++){var M=d[k],N=M.source(),z=M.target(),$=s(M),q=w(N),V=w(z);I(N,z,M,q,V,$),i||I(z,N,M,V,q,$)}if(!P)break}if(P)for(var Z=[],K=0;K<b;K++){var j=d[K],ee=j.source(),le=j.target(),W=s(j),G=w(ee).dist,Y=w(le).dist;if(G+W<Y||!i&&Y+W<G)if(E||(Er("Graph contains a negative weight cycle for Bellman-Ford"),E=!0),e.findNegativeWeightCycles!==!1){var re=[];G+W<Y&&re.push(ee),!i&&Y+W<G&&re.push(le);for(var de=re.length,se=0;se<de;se++){var X=re[se],Q=[X];Q.push(w(X).edge);for(var ae=w(X).pred;Q.indexOf(ae)===-1;)Q.push(ae),Q.push(w(ae).edge),ae=w(ae).pred;Q=Q.slice(Q.indexOf(ae));for(var te=Q[0].id(),ce=0,_e=2;_e<Q.length;_e+=2)Q[_e].id()<te&&(te=Q[_e].id(),ce=_e);Q=Q.slice(ce).concat(Q.slice(0,ce)),Q.push(Q[0]);var ve=Q.map(function(U){return U.id()}).join(",");Z.indexOf(ve)===-1&&(y.push(l.spawn(Q)),Z.push(ve))}}else break}return{distanceTo:C,pathTo:T,hasNegativeWeightCycle:E,negativeWeightCycles:y}}},IN=Math.sqrt(2),DN=function(e,t,n){n.length===0&&Lr("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],s=t[i],l=t[o],u=n,c=u.length-1;c>=0;c--){var d=u[c],h=d[1],g=d[2];(t[h]===s&&t[g]===l||t[h]===l&&t[g]===s)&&u.splice(c,1)}for(var p=0;p<u.length;p++){var E=u[p];E[1]===l?(u[p]=E.slice(),u[p][1]=s):E[2]===l&&(u[p]=E.slice(),u[p][2]=s)}for(var y=0;y<t.length;y++)t[y]===l&&(t[y]=s);return u},Cc=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=DN(i,e,t),n--}return t},BN={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,a=t.edges;a.unmergeBy(function(V){return V.isLoop()});var i=n.length,o=a.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/IN);if(i<2){Lr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],c=0;c<o;c++){var d=a[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var h=1/0,g=[],p=new Array(i),E=new Array(i),y=new Array(i),b=function(Z,K){for(var j=0;j<i;j++)K[j]=Z[j]},w=0;w<=s;w++){for(var x=0;x<i;x++)E[x]=x;var C=Cc(E,u.slice(),i,l),T=C.slice();b(E,y);var S=Cc(E,C,l,2),_=Cc(y,T,l,2);S.length<=_.length&&S.length<h?(h=S.length,g=S,b(E,p)):_.length<=S.length&&_.length<h&&(h=_.length,g=_,b(y,p))}for(var A=this.spawn(g.map(function(V){return a[V[0]]})),P=this.spawn(),I=this.spawn(),D=p[0],k=0;k<p.length;k++){var M=p[k],N=n[k];M===D?P.merge(N):I.merge(N)}var z=function(Z){var K=e.spawn();return Z.forEach(function(j){K.merge(j),j.connectedEdges().forEach(function(ee){e.contains(ee)&&!A.contains(ee)&&K.merge(ee)})}),K},$=[z(P),z(I)],q={cut:A,components:$,partition1:P,partition2:I};return q}},_c,MN=function(e){return{x:e.x,y:e.y}},ul=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},mR=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Wi=function(e){return{x:e[0],y:e[1]}},kN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},ON=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},LN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=t;o<n;o++){var s=e[o];isFinite(s)&&(a+=s,i++)}return a/i},qN=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var s=0,l=e.length-1;l>=0;l--){var u=e[l];o?isFinite(u)||(e[l]=-1/0,s++):e.splice(l,1)}i&&e.sort(function(h,g){return h-g});var c=e.length,d=Math.floor(c/2);return c%2!==0?e[d+1+s]:(e[d-1+s]+e[d+s])/2},NN=function(e){return Math.PI*e/180},yu=function(e,t){return Math.atan2(t,e)-Math.PI/2},Bm=Math.log2||function(r){return Math.log(r)/Math.log(2)},Mm=function(e){return e>0?1:e<0?-1:0},ii=function(e,t){return Math.sqrt(Xa(e,t))},Xa=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},FN=function(e){for(var t=e.length,n=0,a=0;a<t;a++)n+=e[a];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},ot=function(e,t,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*t+a*a*n},ji=function(e,t,n,a){return{x:ot(e.x,t.x,n.x,a),y:ot(e.y,t.y,n.y,a)}},zN=function(e,t,n,a){var i={x:t.x-e.x,y:t.y-e.y},o=ii(e,t),s={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+s.x*a,y:e.y+s.y*a}},Jo=function(e,t,n){return Math.max(e,Math.min(n,t))},Dt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},$N=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},VN=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},GN=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},bR=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Iu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Du=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(t.length===1)n=a=i=o=t[0];else if(t.length===2)n=i=t[0],o=a=t[1];else if(t.length===4){var s=Yr(t,4);n=s[0],a=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ow=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},km=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},ma=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},sw=function(e,t){return ma(e,t.x,t.y)},wR=function(e,t){return ma(e,t.x1,t.y1)&&ma(e,t.x2,t.y2)},WN=(_c=Math.hypot)!==null&&_c!==void 0?_c:function(r,e){return Math.sqrt(r*r+e*e)};function UN(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(A,P){return{x:A.x+P.x,y:A.y+P.y}},n=function(A,P){return{x:A.x-P.x,y:A.y-P.y}},a=function(A,P){return{x:A.x*P,y:A.y*P}},i=function(A,P){return A.x*P.y-A.y*P.x},o=function(A){var P=WN(A.x,A.y);return P===0?{x:0,y:0}:{x:A.x/P,y:A.y/P}},s=function(A){for(var P=0,I=0;I<A.length;I++){var D=A[I],k=A[(I+1)%A.length];P+=D.x*k.y-k.x*D.y}return P/2},l=function(A,P,I,D){var k=n(P,A),M=n(D,I),N=i(k,M);if(Math.abs(N)<1e-9)return t(A,a(k,.5));var z=i(n(I,A),M)/N;return t(A,a(k,z))},u=r.map(function(_){return{x:_.x,y:_.y}});s(u)<0&&u.reverse();for(var c=u.length,d=[],h=0;h<c;h++){var g=u[h],p=u[(h+1)%c],E=n(p,g),y=o({x:E.y,y:-E.x});d.push(y)}for(var b=d.map(function(_,A){var P=t(u[A],a(_,e)),I=t(u[(A+1)%c],a(_,e));return{p1:P,p2:I}}),w=[],x=0;x<c;x++){var C=b[(x-1+c)%c],T=b[x],S=l(C.p1,C.p2,T.p1,T.p2);w.push(S)}return w}function HN(r,e,t,n,a,i){var o=rF(r,e,t,n,a),s=UN(o,i),l=Dt();return s.forEach(function(u){return bR(l,u.x,u.y)}),l}var xR=function(e,t,n,a,i,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Sa(i,o):l,c=i/2,d=o/2;u=Math.min(u,c,d);var h=u!==c,g=u!==d,p;if(h){var E=n-c+u-s,y=a-d-s,b=n+c-u+s,w=y;if(p=ba(e,t,n,a,E,y,b,w,!1),p.length>0)return p}if(g){var x=n+c+s,C=a-d+u-s,T=x,S=a+d-u+s;if(p=ba(e,t,n,a,x,C,T,S,!1),p.length>0)return p}if(h){var _=n-c+u-s,A=a+d+s,P=n+c-u+s,I=A;if(p=ba(e,t,n,a,_,A,P,I,!1),p.length>0)return p}if(g){var D=n-c-s,k=a-d+u-s,M=D,N=a+d-u+s;if(p=ba(e,t,n,a,D,k,M,N,!1),p.length>0)return p}var z;{var $=n-c+u,q=a-d+u;if(z=qo(e,t,n,a,$,q,u+s),z.length>0&&z[0]<=$&&z[1]<=q)return[z[0],z[1]]}{var V=n+c-u,Z=a-d+u;if(z=qo(e,t,n,a,V,Z,u+s),z.length>0&&z[0]>=V&&z[1]<=Z)return[z[0],z[1]]}{var K=n+c-u,j=a+d-u;if(z=qo(e,t,n,a,K,j,u+s),z.length>0&&z[0]>=K&&z[1]>=j)return[z[0],z[1]]}{var ee=n-c+u,le=a+d-u;if(z=qo(e,t,n,a,ee,le,u+s),z.length>0&&z[0]<=ee&&z[1]>=le)return[z[0],z[1]]}return[]},KN=function(e,t,n,a,i,o,s){var l=s,u=Math.min(n,i),c=Math.max(n,i),d=Math.min(a,o),h=Math.max(a,o);return u-l<=e&&e<=c+l&&d-l<=t&&t<=h+l},jN=function(e,t,n,a,i,o,s,l,u){var c={x1:Math.min(n,s,i)-u,x2:Math.max(n,s,i)+u,y1:Math.min(a,l,o)-u,y2:Math.max(a,l,o)+u};return!(e<c.x1||e>c.x2||t<c.y1||t>c.y2)},YN=function(e,t,n,a){n-=a;var i=t*t-4*e*n;if(i<0)return[];var o=Math.sqrt(i),s=2*e,l=(-t+o)/s,u=(-t-o)/s;return[l,u]},ZN=function(e,t,n,a,i){var o=1e-5;e===0&&(e=o),t/=e,n/=e,a/=e;var s,l,u,c,d,h,g,p;if(l=(3*n-t*t)/9,u=-(27*a)+t*(9*n-2*(t*t)),u/=54,s=l*l*l+u*u,i[1]=0,g=t/3,s>0){d=u+Math.sqrt(s),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),h=u-Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-g+d+h,g+=(d+h)/2,i[4]=i[2]=-g,g=Math.sqrt(3)*(-h+d)/2,i[3]=g,i[5]=-g;return}if(i[5]=i[3]=0,s===0){p=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-g+2*p,i[4]=i[2]=-(p+g);return}l=-l,c=l*l*l,c=Math.acos(u/Math.sqrt(c)),p=2*Math.sqrt(l),i[0]=-g+p*Math.cos(c/3),i[2]=-g+p*Math.cos((c+2*Math.PI)/3),i[4]=-g+p*Math.cos((c+4*Math.PI)/3)},XN=function(e,t,n,a,i,o,s,l){var u=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*l+4*o*o-4*o*l+l*l,c=9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*l-6*o*o+3*o*l,d=3*n*n-6*n*i+n*s-n*e+2*i*i+2*i*e-s*e+3*a*a-6*a*o+a*l-a*t+2*o*o+2*o*t-l*t,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*t-o*t,g=[];ZN(u,c,d,h,g);for(var p=1e-7,E=[],y=0;y<6;y+=2)Math.abs(g[y+1])<p&&g[y]>=0&&g[y]<=1&&E.push(g[y]);E.push(1),E.push(0);for(var b=-1,w,x,C,T=0;T<E.length;T++)w=Math.pow(1-E[T],2)*n+2*(1-E[T])*E[T]*i+E[T]*E[T]*s,x=Math.pow(1-E[T],2)*a+2*(1-E[T])*E[T]*o+E[T]*E[T]*l,C=Math.pow(w-e,2)+Math.pow(x-t,2),b>=0?C<b&&(b=C):b=C;return b},QN=function(e,t,n,a,i,o){var s=[e-n,t-a],l=[i-n,o-a],u=l[0]*l[0]+l[1]*l[1],c=s[0]*s[0]+s[1]*s[1],d=s[0]*l[0]+s[1]*l[1],h=d*d/u;return d<0?c:h>u?(e-i)*(e-i)+(t-o)*(t-o):c-h},Ft=function(e,t,n){for(var a,i,o,s,l,u=0,c=0;c<n.length/2;c++)if(a=n[c*2],i=n[c*2+1],c+1<n.length/2?(o=n[(c+1)*2],s=n[(c+1)*2+1]):(o=n[(c+1-n.length/2)*2],s=n[(c+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)l=(e-a)/(o-a)*(s-i)+i,l>t&&u++;else continue;return u%2!==0},Zn=function(e,t,n,a,i,o,s,l,u){var c=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var h=Math.cos(-d),g=Math.sin(-d),p=0;p<c.length/2;p++)c[p*2]=o/2*(n[p*2]*h-n[p*2+1]*g),c[p*2+1]=s/2*(n[p*2+1]*h+n[p*2]*g),c[p*2]+=a,c[p*2+1]+=i;var E;if(u>0){var y=ju(c,-u);E=Ku(y)}else E=c;return Ft(e,t,E)},JN=function(e,t,n,a,i,o,s,l){for(var u=new Array(n.length*2),c=0;c<l.length;c++){var d=l[c];u[c*4+0]=d.startX,u[c*4+1]=d.startY,u[c*4+2]=d.stopX,u[c*4+3]=d.stopY;var h=Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2);if(h<=Math.pow(d.radius,2))return!0}return Ft(e,t,u)},Ku=function(e){for(var t=new Array(e.length/2),n,a,i,o,s,l,u,c,d=0;d<e.length/4;d++){n=e[d*4],a=e[d*4+1],i=e[d*4+2],o=e[d*4+3],d<e.length/4-1?(s=e[(d+1)*4],l=e[(d+1)*4+1],u=e[(d+1)*4+2],c=e[(d+1)*4+3]):(s=e[0],l=e[1],u=e[2],c=e[3]);var h=ba(n,a,i,o,s,l,u,c,!0);t[d*2]=h[0],t[d*2+1]=h[1]}return t},ju=function(e,t){for(var n=new Array(e.length*2),a,i,o,s,l=0;l<e.length/2;l++){a=e[l*2],i=e[l*2+1],l<e.length/2-1?(o=e[(l+1)*2],s=e[(l+1)*2+1]):(o=e[0],s=e[1]);var u=s-i,c=-(o-a),d=Math.sqrt(u*u+c*c),h=u/d,g=c/d;n[l*4]=a+h*t,n[l*4+1]=i+g*t,n[l*4+2]=o+h*t,n[l*4+3]=s+g*t}return n},eF=function(e,t,n,a,i,o){var s=n-e,l=a-t;s/=i,l/=o;var u=Math.sqrt(s*s+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(a-t)*d+t]},ti=function(e,t,n,a,i,o,s){return e-=i,t-=o,e/=n/2+s,t/=a/2+s,e*e+t*t<=1},qo=function(e,t,n,a,i,o,s){var l=[n-e,a-t],u=[e-i,t-o],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),h=u[0]*u[0]+u[1]*u[1]-s*s,g=d*d-4*c*h;if(g<0)return[];var p=(-d+Math.sqrt(g))/(2*c),E=(-d-Math.sqrt(g))/(2*c),y=Math.min(p,E),b=Math.max(p,E),w=[];if(y>=0&&y<=1&&w.push(y),b>=0&&b<=1&&w.push(b),w.length===0)return[];var x=w[0]*l[0]+e,C=w[0]*l[1]+t;if(w.length>1){if(w[0]==w[1])return[x,C];var T=w[1]*l[0]+e,S=w[1]*l[1]+t;return[x,C,T,S]}else return[x,C]},Sc=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},ba=function(e,t,n,a,i,o,s,l,u){var c=e-i,d=n-e,h=s-i,g=t-o,p=a-t,E=l-o,y=h*g-E*c,b=d*g-p*c,w=E*d-h*p;if(w!==0){var x=y/w,C=b/w,T=.001,S=0-T,_=1+T;return S<=x&&x<=_&&S<=C&&C<=_?[e+x*d,t+x*p]:u?[e+x*d,t+x*p]:[]}else return y===0||b===0?Sc(e,n,s)===s?[s,l]:Sc(e,n,i)===i?[i,o]:Sc(i,s,n)===n?[n,a]:[]:[]},rF=function(e,t,n,a,i){var o=[],s=a/2,l=i/2,u=t,c=n;o.push({x:u+s*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)o.push({x:u+s*e[d*2],y:c+l*e[d*2+1]});return o},es=function(e,t,n,a,i,o,s,l){var u=[],c,d=new Array(n.length),h=!0;o==null&&(h=!1);var g;if(h){for(var p=0;p<d.length/2;p++)d[p*2]=n[p*2]*o+a,d[p*2+1]=n[p*2+1]*s+i;if(l>0){var E=ju(d,-l);g=Ku(E)}else g=d}else g=n;for(var y,b,w,x,C=0;C<g.length/2;C++)y=g[C*2],b=g[C*2+1],C<g.length/2-1?(w=g[(C+1)*2],x=g[(C+1)*2+1]):(w=g[0],x=g[1]),c=ba(e,t,a,i,y,b,w,x),c.length!==0&&u.push(c[0],c[1]);return u},tF=function(e,t,n,a,i,o,s,l,u){var c=[],d,h=new Array(n.length*2);u.forEach(function(w,x){x===0?(h[h.length-2]=w.startX,h[h.length-1]=w.startY):(h[x*4-2]=w.startX,h[x*4-1]=w.startY),h[x*4]=w.stopX,h[x*4+1]=w.stopY,d=qo(e,t,a,i,w.cx,w.cy,w.radius),d.length!==0&&c.push(d[0],d[1])});for(var g=0;g<h.length/4;g++)d=ba(e,t,a,i,h[g*4],h[g*4+1],h[g*4+2],h[g*4+3],!1),d.length!==0&&c.push(d[0],d[1]);if(c.length>2){for(var p=[c[0],c[1]],E=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),y=1;y<c.length/2;y++){var b=Math.pow(c[y*2]-e,2)+Math.pow(c[y*2+1]-t,2);b<=E&&(p[0]=c[y*2],p[1]=c[y*2+1],E=b)}return p}return c},mu=function(e,t,n){var a=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*a[0],t[1]+o*a[1]]},It=function(e,t){var n=im(e,t);return n=ER(n),n},ER=function(e){for(var t,n,a=e.length/2,i=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u<a;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),l=Math.max(l,n);for(var c=2/(s-i),d=2/(l-o),h=0;h<a;h++)t=e[2*h]=e[2*h]*c,n=e[2*h+1]=e[2*h+1]*d,i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),l=Math.max(l,n);if(o<-1)for(var g=0;g<a;g++)n=e[2*g+1]=e[2*g+1]+(-1-o);return e},im=function(e,t){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=t;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*n+a,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Sa=function(e,t){return Math.min(e/4,t/4,8)},CR=function(e,t){return Math.min(e/10,t/10,8)},Om=function(){return 8},nF=function(e,t,n){return[e-2*t+n,2*(t-e),e]},om=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Tc(r,e){function t(d){for(var h=[],g=0;g<d.length;g++){var p=d[g],E=d[(g+1)%d.length],y={x:E.x-p.x,y:E.y-p.y},b={x:-y.y,y:y.x},w=Math.sqrt(b.x*b.x+b.y*b.y);h.push({x:b.x/w,y:b.y/w})}return h}function n(d,h){var g=1/0,p=-1/0,E=zt(d),y;try{for(E.s();!(y=E.n()).done;){var b=y.value,w=b.x*h.x+b.y*h.y;g=Math.min(g,w),p=Math.max(p,w)}}catch(x){E.e(x)}finally{E.f()}return{min:g,max:p}}function a(d,h){return!(d.max<h.min||h.max<d.min)}var i=[].concat(Gu(t(r)),Gu(t(e))),o=zt(i),s;try{for(o.s();!(s=o.n()).done;){var l=s.value,u=n(r,l),c=n(e,l);if(!a(u,c))return!1}}catch(d){o.e(d)}finally{o.f()}return!0}var aF=yt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),iF={pageRank:function(e){for(var t=aF(e),n=t.dampingFactor,a=t.precision,i=t.iterations,o=t.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,h=d*d,g=c.length,p=new Array(h),E=new Array(d),y=(1-n)/d,b=0;b<d;b++){for(var w=0;w<d;w++){var x=b*d+w;p[x]=0}E[b]=0}for(var C=0;C<g;C++){var T=c[C],S=T.data("source"),_=T.data("target");if(S!==_){var A=u.indexOfId(S),P=u.indexOfId(_),I=o(T),D=P*d+A;p[D]+=I,E[A]+=I}}for(var k=1/d+y,M=0;M<d;M++)if(E[M]===0)for(var N=0;N<d;N++){var z=N*d+M;p[z]=k}else for(var $=0;$<d;$++){var q=$*d+M;p[q]=p[q]/E[M]+y}for(var V=new Array(d),Z=new Array(d),K,j=0;j<d;j++)V[j]=1;for(var ee=0;ee<i;ee++){for(var le=0;le<d;le++)Z[le]=0;for(var W=0;W<d;W++)for(var G=0;G<d;G++){var Y=W*d+G;Z[W]+=p[Y]*V[G]}FN(Z),K=V,V=Z,Z=K;for(var re=0,de=0;de<d;de++){var se=K[de]-V[de];re+=se*se}if(re<a)break}var X={rank:function(ae){return ae=s.collection(ae)[0],V[u.indexOf(ae)]}};return X}},uw=yt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Yi={degreeCentralityNormalized:function(e){e=uw(e);var t=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},d={},h=0,g=0,p=0;p<a;p++){var E=n[p],y=E.id();e.root=E;var b=this.degreeCentrality(e);h<b.indegree&&(h=b.indegree),g<b.outdegree&&(g=b.outdegree),c[y]=b.indegree,d[y]=b.outdegree}return{indegree:function(x){return h==0?0:(Ke(x)&&(x=t.filter(x)),c[x.id()]/h)},outdegree:function(x){return g===0?0:(Ke(x)&&(x=t.filter(x)),d[x.id()]/g)}}}else{for(var i={},o=0,s=0;s<a;s++){var l=n[s];e.root=l;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[l.id()]=u.degree}return{degree:function(x){return o===0?0:(Ke(x)&&(x=t.filter(x)),i[x.id()]/o)}}}},degreeCentrality:function(e){e=uw(e);var t=this.cy(),n=this,a=e,i=a.root,o=a.weight,s=a.directed,l=a.alpha;if(i=t.collection(i)[0],s){for(var g=i.connectedEdges(),p=g.filter(function(S){return S.target().same(i)&&n.has(S)}),E=g.filter(function(S){return S.source().same(i)&&n.has(S)}),y=p.length,b=E.length,w=0,x=0,C=0;C<p.length;C++)w+=o(p[C]);for(var T=0;T<E.length;T++)x+=o(E[T]);return{indegree:Math.pow(y,1-l)*Math.pow(w,l),outdegree:Math.pow(b,1-l)*Math.pow(x,l)}}else{for(var u=i.connectedEdges().intersection(n),c=u.length,d=0,h=0;h<u.length;h++)d+=o(u[h]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}}};Yi.dc=Yi.degreeCentrality;Yi.dcn=Yi.degreeCentralityNormalised=Yi.degreeCentralityNormalized;var lw=yt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Zi={closenessCentralityNormalized:function(e){for(var t=lw(e),n=t.harmonic,a=t.weight,i=t.directed,o=this.cy(),s={},l=0,u=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),d=0;d<u.length;d++){for(var h=0,g=u[d],p=0;p<u.length;p++)if(d!==p){var E=c.distance(g,u[p]);n?h+=1/E:h+=E}n||(h=1/h),l<h&&(l=h),s[g.id()]=h}return{closeness:function(b){return l==0?0:(Ke(b)?b=o.filter(b)[0].id():b=b.id(),s[b]/l)}}},closenessCentrality:function(e){var t=lw(e),n=t.root,a=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var s=this.dijkstra({root:n,weight:a,directed:i}),l=0,u=this.nodes(),c=0;c<u.length;c++){var d=u[c];if(!d.same(n)){var h=s.distanceTo(d);o?l+=1/h:l+=h}}return o?l:1/l}};Zi.cc=Zi.closenessCentrality;Zi.ccn=Zi.closenessCentralityNormalised=Zi.closenessCentralityNormalized;var oF=yt({weight:null,directed:!1}),sm={betweennessCentrality:function(e){for(var t=oF(e),n=t.directed,a=t.weight,i=a!=null,o=this.cy(),s=this.nodes(),l={},u={},c=0,d={set:function(x,C){u[x]=C,C>c&&(c=C)},get:function(x){return u[x]}},h=0;h<s.length;h++){var g=s[h],p=g.id();n?l[p]=g.outgoers().nodes():l[p]=g.openNeighborhood().nodes(),d.set(p,0)}for(var E=function(){for(var x=s[y].id(),C=[],T={},S={},_={},A=new gs(function(W,G){return _[W]-_[G]}),P=0;P<s.length;P++){var I=s[P].id();T[I]=[],S[I]=0,_[I]=1/0}for(S[x]=1,_[x]=0,A.push(x);!A.empty();){var D=A.pop();if(C.push(D),i)for(var k=0;k<l[D].length;k++){var M=l[D][k],N=o.getElementById(D),z=void 0;N.edgesTo(M).length>0?z=N.edgesTo(M)[0]:z=M.edgesTo(N)[0];var $=a(z);M=M.id(),_[M]>_[D]+$&&(_[M]=_[D]+$,A.nodes.indexOf(M)<0?A.push(M):A.updateItem(M),S[M]=0,T[M]=[]),_[M]==_[D]+$&&(S[M]=S[M]+S[D],T[M].push(D))}else for(var q=0;q<l[D].length;q++){var V=l[D][q].id();_[V]==1/0&&(A.push(V),_[V]=_[D]+1),_[V]==_[D]+1&&(S[V]=S[V]+S[D],T[V].push(D))}}for(var Z={},K=0;K<s.length;K++)Z[s[K].id()]=0;for(;C.length>0;){for(var j=C.pop(),ee=0;ee<T[j].length;ee++){var le=T[j][ee];Z[le]=Z[le]+S[le]/S[j]*(1+Z[j])}j!=s[y].id()&&d.set(j,d.get(j)+Z[j])}},y=0;y<s.length;y++)E();var b={betweenness:function(x){var C=o.collection(x).id();return d.get(C)},betweennessNormalized:function(x){if(c==0)return 0;var C=o.collection(x).id();return d.get(C)/c}};return b.betweennessNormalised=b.betweennessNormalized,b}};sm.bc=sm.betweennessCentrality;var sF=yt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),uF=function(e){return sF(e)},lF=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},fF=function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n},_R=function(e,t){for(var n,a=0;a<t;a++){n=0;for(var i=0;i<t;i++)n+=e[i*t+a];for(var o=0;o<t;o++)e[o*t+a]=e[o*t+a]/n}},cF=function(e,t,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var s=0;s<n;s++)for(var l=0;l<n;l++)a[i*n+l]+=e[i*n+s]*t[s*n+l]}return a},dF=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=cF(e,a,t);return e},vF=function(e,t,n){for(var a=new Array(t*t),i=0;i<t*t;i++)a[i]=Math.pow(e[i],n);return _R(a,t),a},hF=function(e,t,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),s=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s)return!1}return!0},gF=function(e,t,n,a){for(var i=[],o=0;o<t;o++){for(var s=[],l=0;l<t;l++)Math.round(e[o*t+l]*1e3)/1e3>0&&s.push(n[l]);s.length!==0&&i.push(a.collection(s))}return i},pF=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},yF=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&pF(e[t],e[n])&&e.splice(n,1);return e},fw=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=uF(e),o={},s=0;s<t.length;s++)o[t[s].id()]=s;for(var l=t.length,u=l*l,c=new Array(u),d,h=0;h<u;h++)c[h]=0;for(var g=0;g<n.length;g++){var p=n[g],E=o[p.source().id()],y=o[p.target().id()],b=lF(p,i.attributes);c[E*l+y]+=b,c[y*l+E]+=b}fF(c,l,i.multFactor),_R(c,l);for(var w=!0,x=0;w&&x<i.maxIterations;)w=!1,d=dF(c,l,i.expandFactor),c=vF(d,l,i.inflateFactor),hF(c,d,u,4)||(w=!0),x++;var C=gF(c,l,t,a);return C=yF(C),C},mF={markovClustering:fw,mcl:fw},bF=function(e){return e},SR=function(e,t){return Math.abs(t-e)},cw=function(e,t,n){return e+SR(t,n)},dw=function(e,t,n){return e+Math.pow(n-t,2)},wF=function(e){return Math.sqrt(e)},xF=function(e,t,n){return Math.max(e,SR(t,n))},Io=function(e,t,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:bF,s=a,l,u,c=0;c<e;c++)l=t(c),u=n(c),s=i(s,l,u);return o(s)},eo={euclidean:function(e,t,n){return e>=2?Io(e,t,n,0,dw,wF):Io(e,t,n,0,cw)},squaredEuclidean:function(e,t,n){return Io(e,t,n,0,dw)},manhattan:function(e,t,n){return Io(e,t,n,0,cw)},max:function(e,t,n){return Io(e,t,n,-1/0,xF)}};eo["squared-euclidean"]=eo.squaredEuclidean;eo.squaredeuclidean=eo.squaredEuclidean;function ll(r,e,t,n,a,i){var o;return zr(r)?o=r:o=eo[r]||eo.euclidean,e===0&&zr(r)?o(a,i):o(e,t,n,a,i)}var EF=yt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Lm=function(e){return EF(e)},Yu=function(e,t,n,a,i){var o=i!=="kMedoids",s=o?function(d){return n[d]}:function(d){return a[d](n)},l=function(h){return a[h](t)},u=n,c=t;return ll(e,a.length,s,l,u,c)},Rc=function(e,t,n){for(var a=n.length,i=new Array(a),o=new Array(a),s=new Array(t),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,o[u]=e.max(n[u]).value;for(var c=0;c<t;c++){l=[];for(var d=0;d<a;d++)l[d]=Math.random()*(o[d]-i[d])+i[d];s[c]=l}return s},TR=function(e,t,n,a,i){for(var o=1/0,s=0,l=0;l<t.length;l++){var u=Yu(n,e,t[l],a,i);u<o&&(o=u,s=l)}return s},RR=function(e,t,n){for(var a=[],i=null,o=0;o<t.length;o++)i=t[o],n[i.id()]===e&&a.push(i);return a},CF=function(e,t,n){return Math.abs(t-e)<=n},_F=function(e,t,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-t[a][i]);if(o>n)return!1}return!0},SF=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},vw=function(e,t){var n=new Array(t);if(e.length<50)for(var a=0;a<t;a++){for(var i=e[Math.floor(Math.random()*e.length)];SF(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},hw=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=Yu("manhattan",t[i],e,n,"kMedoids");return a},TF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=Lm(e),o=new Array(i.k),s={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=Rc(n,i.k,i.attributes)):tt(i.testCentroids)==="object"?l=i.testCentroids:l=Rc(n,i.k,i.attributes):l=Rc(n,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],s[a.id()]=TR(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var g=RR(h,n,s);if(g.length!==0){for(var p=i.attributes.length,E=l[h],y=new Array(p),b=new Array(p),w=0;w<p;w++){b[w]=0;for(var x=0;x<g.length;x++)a=g[x],b[w]+=i.attributes[w](a);y[w]=b[w]/g.length,CF(y[w],E[w],i.sensitivityThreshold)||(u=!0)}l[h]=y,o[h]=t.collection(g)}}c++}return o},RF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=Lm(e),o=new Array(i.k),s,l={},u,c=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(tt(i.testCentroids)==="object"?s=i.testCentroids:s=vw(n,i.k)):s=vw(n,i.k);for(var d=!0,h=0;d&&h<i.maxIterations;){for(var g=0;g<n.length;g++)a=n[g],l[a.id()]=TR(a,s,i.distance,i.attributes,"kMedoids");d=!1;for(var p=0;p<s.length;p++){var E=RR(p,n,l);if(E.length!==0){c[p]=hw(s[p],E,i.attributes);for(var y=0;y<E.length;y++)u=hw(E[y],E,i.attributes),u<c[p]&&(c[p]=u,s[p]=E[y],d=!0);o[p]=t.collection(E)}}h++}return o},AF=function(e,t,n,a,i){for(var o,s,l=0;l<t.length;l++)for(var u=0;u<e.length;u++)a[l][u]=Math.pow(n[l][u],i.m);for(var c=0;c<e.length;c++)for(var d=0;d<i.attributes.length;d++){o=0,s=0;for(var h=0;h<t.length;h++)o+=a[h][c]*i.attributes[d](t[h]),s+=a[h][c];e[c][d]=o/s}},PF=function(e,t,n,a,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var s,l,u,c=2/(i.m-1),d=0;d<n.length;d++)for(var h=0;h<a.length;h++){s=0;for(var g=0;g<n.length;g++)l=Yu(i.distance,a[h],n[d],i.attributes,"cmeans"),u=Yu(i.distance,a[h],n[g],i.attributes,"cmeans"),s+=Math.pow(l/u,c);e[h][d]=1/s}},IF=function(e,t,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var s,l,u=0;u<t.length;u++){s=-1/0,l=-1;for(var c=0;c<t[0].length;c++)t[u][c]>s&&(s=t[u][c],l=c);i[l].push(e[u])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i},gw=function(e){var t=this.cy(),n=this.nodes(),a=Lm(e),i,o,s,l,u;l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=new Array(a.k);s=new Array(n.length);for(var d=0;d<n.length;d++)s[d]=new Array(a.k);for(var h=0;h<n.length;h++){for(var g=0,p=0;p<a.k;p++)s[h][p]=Math.random(),g+=s[h][p];for(var E=0;E<a.k;E++)s[h][E]=s[h][E]/g}o=new Array(a.k);for(var y=0;y<a.k;y++)o[y]=new Array(a.attributes.length);u=new Array(n.length);for(var b=0;b<n.length;b++)u[b]=new Array(a.k);for(var w=!0,x=0;w&&x<a.maxIterations;)w=!1,AF(o,n,s,u,a),PF(s,l,o,n,a),_F(s,l,a.sensitivityThreshold)||(w=!0),x++;return i=IF(n,s,a,t),{clusters:i,degreeOfMembership:s}},DF={kMeans:TF,kMedoids:RF,fuzzyCMeans:gw,fcm:gw},BF=yt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),MF={single:"min",complete:"max"},kF=function(e){var t=BF(e),n=MF[t.linkage];return n!=null&&(t.linkage=n),t},pw=function(e,t,n,a,i){for(var o=0,s=1/0,l,u=i.attributes,c=function(P,I){return ll(i.distance,u.length,function(D){return u[D](P)},function(D){return u[D](I)},P,I)},d=0;d<e.length;d++){var h=e[d].key,g=n[h][a[h]];g<s&&(o=h,s=g)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=t[o],E=t[a[o]],y;i.mode==="dendrogram"?y={left:p,right:E,key:p.key}:y={value:p.value.concat(E.value),key:p.key},e[p.index]=y,e.splice(E.index,1),t[p.key]=y;for(var b=0;b<e.length;b++){var w=e[b];p.key===w.key?l=1/0:i.linkage==="min"?(l=n[p.key][w.key],n[p.key][w.key]>n[E.key][w.key]&&(l=n[E.key][w.key])):i.linkage==="max"?(l=n[p.key][w.key],n[p.key][w.key]<n[E.key][w.key]&&(l=n[E.key][w.key])):i.linkage==="mean"?l=(n[p.key][w.key]*p.size+n[E.key][w.key]*E.size)/(p.size+E.size):i.mode==="dendrogram"?l=c(w.value,p.value):l=c(w.value[0],p.value[0]),n[p.key][w.key]=n[w.key][p.key]=l}for(var x=0;x<e.length;x++){var C=e[x].key;if(a[C]===p.key||a[C]===E.key){for(var T=C,S=0;S<e.length;S++){var _=e[S].key;n[C][_]<n[C][T]&&(T=_)}a[C]=T}e[x].index=x}return p.key=E.key=p.index=E.index=null,!0},Ui=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Ui(e.left,t),e.right&&Ui(e.right,t)))},um=function(e,t){if(!e)return"";if(e.left&&e.right){var n=um(e.left,t),a=um(e.right,t),i=t.add({group:"nodes",data:{id:n+","+a}});return t.add({group:"edges",data:{source:n,target:i.id()}}),t.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},lm=function(e,t,n){if(!e)return[];var a=[],i=[],o=[];return t===0?(e.left&&Ui(e.left,a),e.right&&Ui(e.right,i),o=a.concat(i),[n.collection(o)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Ui(e.left,a),e.right&&Ui(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=lm(e.left,t-1,n)),e.right&&(i=lm(e.right,t-1,n)),a.concat(i))},yw=function(e){for(var t=this.cy(),n=this.nodes(),a=kF(e),i=a.attributes,o=function(x,C){return ll(a.distance,i.length,function(T){return i[T](x)},function(T){return i[T](C)},x,C)},s=[],l=[],u=[],c=[],d=0;d<n.length;d++){var h={value:a.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};s[d]=h,c[d]=h,l[d]=[],u[d]=0}for(var g=0;g<s.length;g++)for(var p=0;p<=g;p++){var E=void 0;a.mode==="dendrogram"?E=g===p?1/0:o(s[g].value,s[p].value):E=g===p?1/0:o(s[g].value[0],s[p].value[0]),l[g][p]=E,l[p][g]=E,E<l[g][u[g]]&&(u[g]=p)}for(var y=pw(s,c,l,u,a);y;)y=pw(s,c,l,u,a);var b;return a.mode==="dendrogram"?(b=lm(s[0],a.dendrogramDepth,t),a.addDendrogram&&um(s[0],t)):(b=new Array(s.length),s.forEach(function(w,x){w.key=w.index=null,b[x]=t.collection(w.value)})),b},OF={hierarchicalClustering:yw,hca:yw},LF=yt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),qF=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Lr("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||Me(n)||Lr("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),LF(e)},NF=function(e,t,n,a){var i=function(s,l){return a[l](s)};return-ll(e,a.length,function(o){return i(t,o)},function(o){return i(n,o)},t,n)},FF=function(e,t){var n=null;return t==="median"?n=qN(e):t==="mean"?n=LN(e):t==="min"?n=kN(e):t==="max"?n=ON(e):n=t,n},zF=function(e,t,n){for(var a=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&a.push(i);return a},mw=function(e,t,n){for(var a=[],i=0;i<e;i++){for(var o=-1,s=-1/0,l=0;l<n.length;l++){var u=n[l];t[i*e+u]>s&&(o=u,s=t[i*e+u])}o>0&&a.push(o)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},$F=function(e,t,n){for(var a=mw(e,t,n),i=0;i<n.length;i++){for(var o=[],s=0;s<a.length;s++)a[s]===n[i]&&o.push(s);for(var l=-1,u=-1/0,c=0;c<o.length;c++){for(var d=0,h=0;h<o.length;h++)d+=t[o[h]*e+o[c]];d>u&&(l=c,u=d)}n[i]=o[l]}return a=mw(e,t,n),a},bw=function(e){for(var t=this.cy(),n=this.nodes(),a=qF(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var s,l,u,c,d,h;s=n.length,l=s*s,u=new Array(l);for(var g=0;g<l;g++)u[g]=-1/0;for(var p=0;p<s;p++)for(var E=0;E<s;E++)p!==E&&(u[p*s+E]=NF(a.distance,n[p],n[E],a.attributes));c=FF(u,a.preference);for(var y=0;y<s;y++)u[y*s+y]=c;d=new Array(l);for(var b=0;b<l;b++)d[b]=0;h=new Array(l);for(var w=0;w<l;w++)h[w]=0;for(var x=new Array(s),C=new Array(s),T=new Array(s),S=0;S<s;S++)x[S]=0,C[S]=0,T[S]=0;for(var _=new Array(s*a.minIterations),A=0;A<_.length;A++)_[A]=0;var P;for(P=0;P<a.maxIterations;P++){for(var I=0;I<s;I++){for(var D=-1/0,k=-1/0,M=-1,N=0,z=0;z<s;z++)x[z]=d[I*s+z],N=h[I*s+z]+u[I*s+z],N>=D?(k=D,D=N,M=z):N>k&&(k=N);for(var $=0;$<s;$++)d[I*s+$]=(1-a.damping)*(u[I*s+$]-D)+a.damping*x[$];d[I*s+M]=(1-a.damping)*(u[I*s+M]-k)+a.damping*x[M]}for(var q=0;q<s;q++){for(var V=0,Z=0;Z<s;Z++)x[Z]=h[Z*s+q],C[Z]=Math.max(0,d[Z*s+q]),V+=C[Z];V-=C[q],C[q]=d[q*s+q],V+=C[q];for(var K=0;K<s;K++)h[K*s+q]=(1-a.damping)*Math.min(0,V-C[K])+a.damping*x[K];h[q*s+q]=(1-a.damping)*(V-C[q])+a.damping*x[q]}for(var j=0,ee=0;ee<s;ee++){var le=h[ee*s+ee]+d[ee*s+ee]>0?1:0;_[P%a.minIterations*s+ee]=le,j+=le}if(j>0&&(P>=a.minIterations-1||P==a.maxIterations-1)){for(var W=0,G=0;G<s;G++){T[G]=0;for(var Y=0;Y<a.minIterations;Y++)T[G]+=_[Y*s+G];(T[G]===0||T[G]===a.minIterations)&&W++}if(W===s)break}}for(var re=zF(s,d,h),de=$F(s,u,re),se={},X=0;X<re.length;X++)se[re[X]]=[];for(var Q=0;Q<n.length;Q++){var ae=i[n[Q].id()],te=de[ae];te!=null&&se[te].push(n[Q])}for(var ce=new Array(re.length),_e=0;_e<re.length;_e++)ce[_e]=t.collection(se[re[_e]]);return ce},VF={affinityPropagation:bw,ap:bw},GF=yt({root:void 0,directed:!1}),WF={hierholzer:function(e){if(!pr(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=GF(e),a=n.root,i=n.directed,o=this,s=!1,l,u,c;a&&(c=Ke(a)?this.filter(a)[0].id():a[0].id());var d={},h={};i?o.forEach(function(w){var x=w.id();if(w.isNode()){var C=w.indegree(!0),T=w.outdegree(!0),S=C-T,_=T-C;S==1?l?s=!0:l=x:_==1?u?s=!0:u=x:(_>1||S>1)&&(s=!0),d[x]=[],w.outgoers().forEach(function(A){A.isEdge()&&d[x].push(A.id())})}else h[x]=[void 0,w.target().id()]}):o.forEach(function(w){var x=w.id();if(w.isNode()){var C=w.degree(!0);C%2&&(l?u?s=!0:u=x:l=x),d[x]=[],w.connectedEdges().forEach(function(T){return d[x].push(T.id())})}else h[x]=[w.source().id(),w.target().id()]});var g={found:!1,trail:void 0};if(s)return g;if(u&&l)if(i){if(c&&u!=c)return g;c=u}else{if(c&&u!=c&&l!=c)return g;c||(c=u)}else c||(c=o[0].id());var p=function(x){for(var C=x,T=[x],S,_,A;d[C].length;)S=d[C].shift(),_=h[S][0],A=h[S][1],C!=A?(d[A]=d[A].filter(function(P){return P!=S}),C=A):!i&&C!=_&&(d[_]=d[_].filter(function(P){return P!=S}),C=_),T.unshift(S),T.unshift(C);return T},E=[],y=[];for(y=p(c);y.length!=1;)d[y[0]].length==0?(E.unshift(o.getElementById(y.shift())),E.unshift(o.getElementById(y.shift()))):y=p(y.shift()).concat(y);E.unshift(o.getElementById(y.shift()));for(var b in d)if(d[b].length)return g;return g.found=!0,g.trail=this.spawn(E,!0),g}},bu=function(){var e=this,t={},n=0,a=0,i=[],o=[],s={},l=function(h,g){for(var p=o.length-1,E=[],y=e.spawn();o[p].x!=h||o[p].y!=g;)E.push(o.pop().edge),p--;E.push(o.pop().edge),E.forEach(function(b){var w=b.connectedNodes().intersection(e);y.merge(b),w.forEach(function(x){var C=x.id(),T=x.connectedEdges().intersection(e);y.merge(x),t[C].cutVertex?y.merge(T.filter(function(S){return S.isLoop()})):y.merge(T)})}),i.push(y)},u=function(h,g,p){h===p&&(a+=1),t[g]={id:n,low:n++,cutVertex:!1};var E=e.getElementById(g).connectedEdges().intersection(e);if(E.size()===0)i.push(e.spawn(e.getElementById(g)));else{var y,b,w,x;E.forEach(function(C){y=C.source().id(),b=C.target().id(),w=y===g?b:y,w!==p&&(x=C.id(),s[x]||(s[x]=!0,o.push({x:g,y:w,edge:C})),w in t?t[g].low=Math.min(t[g].low,t[w].id):(u(h,w,g),t[g].low=Math.min(t[g].low,t[w].low),t[g].id<=t[w].low&&(t[g].cutVertex=!0,l(g,w))))})}};e.forEach(function(d){if(d.isNode()){var h=d.id();h in t||(a=0,u(h,h),t[h].cutVertex=a>1)}});var c=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(c),components:i}},UF={hopcroftTarjanBiconnected:bu,htbc:bu,htb:bu,hopcroftTarjanBiconnectedComponents:bu},wu=function(){var e=this,t={},n=0,a=[],i=[],o=e.spawn(e),s=function(u){i.push(u),t[u]={index:n,low:n++,explored:!1};var c=e.getElementById(u).connectedEdges().intersection(e);if(c.forEach(function(E){var y=E.target().id();y!==u&&(y in t||s(y),t[y].explored||(t[u].low=Math.min(t[u].low,t[y].low)))}),t[u].index===t[u].low){for(var d=e.spawn();;){var h=i.pop();if(d.merge(e.getElementById(h)),t[h].low=t[u].index,t[h].explored=!0,h===u)break}var g=d.edgesWith(d),p=d.merge(g);a.push(p),o=o.difference(p)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||s(u)}}),{cut:o,components:a}},HF={tarjanStronglyConnected:wu,tsc:wu,tscc:wu,tarjanStronglyConnectedComponents:wu},AR={};[Qo,EN,CN,SN,RN,PN,BN,iF,Yi,Zi,sm,mF,DF,OF,VF,WF,UF,HF].forEach(function(r){Ye(AR,r)});/*!
|
|
5
5
|
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
6
6
|
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
7
7
|
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
8
|
-
*/var _2=0,C2=1,S2=2,bn=function(e){if(!(this instanceof bn))return new bn(e);this.id="Thenable/1.0.7",this.state=_2,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};bn.prototype={fulfill:function(e){return pw(this,C2,"fulfillValue",e)},reject:function(e){return pw(this,S2,"rejectReason",e)},then:function(e,t){var n=this,a=new bn;return n.onFulfilled.push(mw(e,a,"fulfill")),n.onRejected.push(mw(t,a,"reject")),T2(n),a.proxy}};var pw=function(e,t,n,a){return e.state===_2&&(e.state=t,e[n]=a,T2(e)),e},T2=function(e){e.state===C2?yw(e,"onFulfilled",e.fulfillValue):e.state===S2&&yw(e,"onRejected",e.rejectReason)},yw=function(e,t,n){if(e[t].length!==0){var a=e[t];e[t]=[];var i=function(){for(var s=0;s<a.length;s++)a[s](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},mw=function(e,t,n){return function(a){if(typeof e!="function")t[n].call(t,a);else{var i;try{i=e(a)}catch(o){t.reject(o);return}R2(t,i)}}},R2=function(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(et(t)==="object"&&t!==null||typeof t=="function")try{n=t.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(t,function(i){a||(a=!0,i===t?e.reject(new TypeError("circular thenable chain")):R2(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(t)};bn.all=function(r){return new bn(function(e,t){for(var n=new Array(r.length),a=0,i=function(u,l){n[u]=l,a++,a===r.length&&e(n)},o=0;o<r.length;o++)(function(s){var u=r[s],l=u!=null&&u.then!=null;if(l)u.then(function(v){i(s,v)},function(v){t(v)});else{var c=u;i(s,c)}})(o)})};bn.resolve=function(r){return new bn(function(e,t){e(r)})};bn.reject=function(r){return new bn(function(e,t){t(r)})};var to=typeof Promise<"u"?Promise:bn,fm=function(e,t,n){var a=Sm(e),i=!a,o=this._private=He({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Nr(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},ai=fm.prototype;He(ai,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;e.queue?t=n.queue:t=n.current,t.push(this),jt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(l,c){var v=e[l];v!=null&&(e[l]=e[c],e[c]=v)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[a]=s}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case"frame":n=t.frames;break;default:case"complete":case"completed":n=t.completes}return new to(function(a,i){n.push(function(){a()})})}});ai.complete=ai.completed;ai.run=ai.play;ai.running=ai.playing;var BF={animated:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=a[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<a.length;o++){var s=a[o];s._private.animation.queue=[]}return this}},delay:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var c=s.style();t=He({},t,n);var v=Object.keys(t).length===0;if(v)return new fm(o[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(l&&(t.style=c.getPropsList(t.style||t.css),t.css=void 0),l&&t.renderedPosition!=null){var h=t.renderedPosition,g=s.pan(),p=s.zoom();t.position=d2(h,p,g)}if(u&&t.panBy!=null){var E=t.panBy,m=s.pan();t.pan={x:m.x+E.x,y:m.y+E.y}}var b=t.center||t.centre;if(u&&b!=null){var w=s.getCenterPan(b.eles,t.zoom);w!=null&&(t.pan=w)}if(u&&t.fit!=null){var x=t.fit,_=s.getFitViewport(x.eles||x.boundingBox,x.padding);_!=null&&(t.pan=_.pan,t.zoom=_.zoom)}if(u&&pr(t.zoom)){var C=s.getZoomedViewport(t.zoom);C!=null?(C.zoomed&&(t.zoom=C.zoom),C.panned&&(t.pan=C.pan)):t.zoom=null}return new fm(o[0],t)}},animate:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;n&&(t=He({},t,n));for(var u=0;u<o.length;u++){var l=o[u],c=l.animated()&&(t.queue===void 0||t.queue),v=l.animation(t,c?{queue:!0}:void 0);v.play()}return this}},stop:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var l=o[u],c=l._private,v=c.animation.current,h=0;h<v.length;h++){var g=v[h],p=g._private;n&&(p.duration=0)}t&&(c.animation.queue=[]),n||(c.animation.current=[])}return s.notify("draw"),this}}},Ac,bw;function ll(){if(bw)return Ac;bw=1;var r=Array.isArray;return Ac=r,Ac}var Pc,ww;function OF(){if(ww)return Pc;ww=1;var r=ll(),e=ds(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return Pc=a,Pc}var Dc,xw;function MF(){if(xw)return Dc;xw=1;var r=n2(),e=cs(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=r(s);return u==n||u==a||u==t||u==i}return Dc=o,Dc}var Ic,Ew;function kF(){if(Ew)return Ic;Ew=1;var r=il(),e=r["__core-js_shared__"];return Ic=e,Ic}var Bc,_w;function LF(){if(_w)return Bc;_w=1;var r=kF(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return Bc=t,Bc}var Oc,Cw;function qF(){if(Cw)return Oc;Cw=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Oc=t,Oc}var Mc,Sw;function NF(){if(Sw)return Mc;Sw=1;var r=MF(),e=LF(),t=cs(),n=qF(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,c=RegExp("^"+u.call(l).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return Mc=v,Mc}var kc,Tw;function FF(){if(Tw)return kc;Tw=1;function r(e,t){return e==null?void 0:e[t]}return kc=r,kc}var Lc,Rw;function Lm(){if(Rw)return Lc;Rw=1;var r=NF(),e=FF();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return Lc=t,Lc}var qc,Aw;function fl(){if(Aw)return qc;Aw=1;var r=Lm(),e=r(Object,"create");return qc=e,qc}var Nc,Pw;function zF(){if(Pw)return Nc;Pw=1;var r=fl();function e(){this.__data__=r?r(null):{},this.size=0}return Nc=e,Nc}var Fc,Dw;function $F(){if(Dw)return Fc;Dw=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Fc=r,Fc}var zc,Iw;function VF(){if(Iw)return zc;Iw=1;var r=fl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return zc=a,zc}var $c,Bw;function GF(){if(Bw)return $c;Bw=1;var r=fl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return $c=n,$c}var Vc,Ow;function WF(){if(Ow)return Vc;Ow=1;var r=fl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return Vc=t,Vc}var Gc,Mw;function UF(){if(Mw)return Gc;Mw=1;var r=zF(),e=$F(),t=VF(),n=GF(),a=WF();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Gc=i,Gc}var Wc,kw;function HF(){if(kw)return Wc;kw=1;function r(){this.__data__=[],this.size=0}return Wc=r,Wc}var Uc,Lw;function A2(){if(Lw)return Uc;Lw=1;function r(e,t){return e===t||e!==e&&t!==t}return Uc=r,Uc}var Hc,qw;function cl(){if(qw)return Hc;qw=1;var r=A2();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Hc=e,Hc}var Kc,Nw;function KF(){if(Nw)return Kc;Nw=1;var r=cl(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return Kc=n,Kc}var jc,Fw;function jF(){if(Fw)return jc;Fw=1;var r=cl();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return jc=e,jc}var Yc,zw;function YF(){if(zw)return Yc;zw=1;var r=cl();function e(t){return r(this.__data__,t)>-1}return Yc=e,Yc}var Zc,$w;function ZF(){if($w)return Zc;$w=1;var r=cl();function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}return Zc=e,Zc}var Xc,Vw;function XF(){if(Vw)return Xc;Vw=1;var r=HF(),e=KF(),t=jF(),n=YF(),a=ZF();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Xc=i,Xc}var Qc,Gw;function QF(){if(Gw)return Qc;Gw=1;var r=Lm(),e=il(),t=r(e,"Map");return Qc=t,Qc}var Jc,Ww;function JF(){if(Ww)return Jc;Ww=1;var r=UF(),e=XF(),t=QF();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Jc=n,Jc}var ed,Uw;function ez(){if(Uw)return ed;Uw=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return ed=r,ed}var rd,Hw;function dl(){if(Hw)return rd;Hw=1;var r=ez();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return rd=e,rd}var td,Kw;function rz(){if(Kw)return td;Kw=1;var r=dl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return td=e,td}var nd,jw;function tz(){if(jw)return nd;jw=1;var r=dl();function e(t){return r(this,t).get(t)}return nd=e,nd}var ad,Yw;function nz(){if(Yw)return ad;Yw=1;var r=dl();function e(t){return r(this,t).has(t)}return ad=e,ad}var id,Zw;function az(){if(Zw)return id;Zw=1;var r=dl();function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}return id=e,id}var od,Xw;function iz(){if(Xw)return od;Xw=1;var r=JF(),e=rz(),t=tz(),n=nz(),a=az();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,od=i,od}var sd,Qw;function oz(){if(Qw)return sd;Qw=1;var r=iz(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=n.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(t.Cache||r),i}return t.Cache=r,sd=t,sd}var ud,Jw;function sz(){if(Jw)return ud;Jw=1;var r=oz(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return ud=t,ud}var ld,ex;function P2(){if(ex)return ld;ex=1;var r=sz(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,u,l){i.push(u?l.replace(t,"$1"):s||o)}),i});return ld=n,ld}var fd,rx;function D2(){if(rx)return fd;rx=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return fd=r,fd}var cd,tx;function uz(){if(tx)return cd;tx=1;var r=Rm(),e=D2(),t=ll(),n=ds(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return cd=o,cd}var dd,nx;function I2(){if(nx)return dd;nx=1;var r=uz();function e(t){return t==null?"":r(t)}return dd=e,dd}var vd,ax;function B2(){if(ax)return vd;ax=1;var r=ll(),e=OF(),t=P2(),n=I2();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return vd=a,vd}var hd,ix;function qm(){if(ix)return hd;ix=1;var r=ds();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return hd=e,hd}var gd,ox;function lz(){if(ox)return gd;ox=1;var r=B2(),e=qm();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return gd=t,gd}var pd,sx;function fz(){if(sx)return pd;sx=1;var r=lz();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return pd=e,pd}var cz=fz(),dz=fs(cz),yd,ux;function vz(){if(ux)return yd;ux=1;var r=Lm(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return yd=e,yd}var md,lx;function hz(){if(lx)return md;lx=1;var r=vz();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return md=e,md}var bd,fx;function gz(){if(fx)return bd;fx=1;var r=hz(),e=A2(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var u=i[o];(!(n.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&r(i,o,s)}return bd=a,bd}var wd,cx;function pz(){if(cx)return wd;cx=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return wd=t,wd}var xd,dx;function yz(){if(dx)return xd;dx=1;var r=gz(),e=B2(),t=pz(),n=cs(),a=qm();function i(o,s,u,l){if(!n(o))return o;s=e(s,o);for(var c=-1,v=s.length,h=v-1,g=o;g!=null&&++c<v;){var p=a(s[c]),E=u;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var m=g[p];E=l?l(m,p,g):void 0,E===void 0&&(E=n(m)?m:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return xd=i,xd}var Ed,vx;function mz(){if(vx)return Ed;vx=1;var r=yz();function e(t,n,a){return t==null?t:r(t,n,a)}return Ed=e,Ed}var bz=mz(),wz=fs(bz),_d,hx;function xz(){if(hx)return _d;hx=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return _d=r,_d}var Cd,gx;function Ez(){if(gx)return Cd;gx=1;var r=D2(),e=xz(),t=ll(),n=ds(),a=P2(),i=qm(),o=I2();function s(u){return t(u)?r(u,i):n(u)?[u]:e(a(o(u)))}return Cd=s,Cd}var _z=Ez(),Cz=fs(_z),Sz={data:function(e){var t={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=He({},t,e),function(a,i){var o=e,s=this,u=s.length!==void 0,l=u?s:[s],c=u?s[0]:s;if(Ge(a)){var v=a.indexOf(".")!==-1,h=v&&Cz(a);if(o.allowGetting&&i===void 0){var g;return c&&(o.beforeGet(c),h&&c._private[o.field][a]===void 0?g=dz(c._private[o.field],h):g=c._private[o.field][a]),g}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var E=KR({},a,i);o.beforeSet(s,E);for(var m=0,b=l.length;m<b;m++){var w=l[m];o.canSet(w)&&(h&&c._private[o.field][a]===void 0?wz(w._private[o.field],h,i):w._private[o.field][a]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&pr(a)){var x=a,_,C,R=Object.keys(x);o.beforeSet(s,x);for(var S=0;S<R.length;S++){_=R[S],C=x[_];var A=!o.immutableKeys[_];if(A)for(var P=0;P<l.length;P++){var I=l[P];o.canSet(I)&&(I._private[o.field][_]=C)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Nr(a)){var D=a;s.on(o.bindingEvent,D)}else if(o.allowGetting&&a===void 0){var M;return c&&(o.beforeGet(c),M=c._private[o.field]),M}return s}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=He({},t,e),function(a){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(Ge(a)){for(var l=a.split(/\s+/),c=l.length,v=0;v<c;v++){var h=l[v];if(!xa(h)){var g=!i.immutableKeys[h];if(g)for(var p=0,E=u.length;p<E;p++)u[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var m=0,b=u.length;m<b;m++)for(var w=u[m]._private[i.field],x=Object.keys(w),_=0;_<x.length;_++){var C=x[_],R=!i.immutableKeys[C];R&&(w[C]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},Tz={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(n,a){var i=this,o=Array.prototype.slice.call(arguments,0);return new to(function(s,u){var l=function(g){i.off.apply(i,v),s(g)},c=o.concat([l]),v=c.concat([]);i.on.apply(i,c)})}}},xr={};[BF,Sz,Tz].forEach(function(r){He(xr,r)});var Rz={animate:xr.animate(),animation:xr.animation(),animated:xr.animated(),clearQueue:xr.clearQueue(),delay:xr.delay(),delayAnimation:xr.delayAnimation(),stop:xr.stop()},Iu={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Sr(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new ro(e),o=0;o<t.length;o++){for(var s=t[o],u=s._private,l=u.classes,c=!1,v=0;v<e.length;v++){var h=e[v],g=l.has(h);if(!g){c=!0;break}}c||(c=l.size!==e.length),c&&(u.classes=i,a.push(s))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Sr(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=t===void 0,i=[],o=0,s=n.length;o<s;o++)for(var u=n[o],l=u._private.classes,c=!1,v=0;v<e.length;v++){var h=e[v],g=l.has(h),p=!1;t||a&&!g?(l.add(h),p=!0):(!t||a&&g)&&(l.delete(h),p=!0),!c&&p&&(i.push(u),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};Iu.className=Iu.classNames=Iu.classes;var hr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Jr,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};hr.variable="(?:[\\w-.]|(?:\\\\"+hr.metaChar+"))+";hr.className="(?:[\\w-]|(?:\\\\"+hr.metaChar+"))+";hr.value=hr.string+"|"+hr.number;hr.id=hr.variable;(function(){var r,e,t;for(r=hr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],hr.comparatorOp+="|@"+e;for(r=hr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(hr.comparatorOp+="|\\!"+e)})();var _r=function(){return{checks:[]}},Ne={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},cm=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return Sq(r.selector,e.selector)}),Az=(function(){for(var r={},e,t=0;t<cm.length;t++)e=cm[t],r[e.selector]=e.matches;return r})(),Pz=function(e,t){return Az[e](t)},Dz="("+cm.map(function(r){return r.selector}).join("|")+")",Mi=function(e){return e.replace(new RegExp("\\\\("+hr.metaChar+")","g"),function(t,n){return n})},va=function(e,t,n){e[e.length-1]=n},dm=[{name:"group",query:!0,regex:"("+hr.group+")",populate:function(e,t,n){var a=Kr(n,1),i=a[0];t.checks.push({type:Ne.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Dz,populate:function(e,t,n){var a=Kr(n,1),i=a[0];t.checks.push({type:Ne.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+hr.id+")",populate:function(e,t,n){var a=Kr(n,1),i=a[0];t.checks.push({type:Ne.ID,value:Mi(i)})}},{name:"className",query:!0,regex:"\\.("+hr.className+")",populate:function(e,t,n){var a=Kr(n,1),i=a[0];t.checks.push({type:Ne.CLASS,value:Mi(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+hr.variable+")\\s*\\]",populate:function(e,t,n){var a=Kr(n,1),i=a[0];t.checks.push({type:Ne.DATA_EXIST,field:Mi(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+hr.variable+")\\s*("+hr.comparatorOp+")\\s*("+hr.value+")\\s*\\]",populate:function(e,t,n){var a=Kr(n,3),i=a[0],o=a[1],s=a[2],u=new RegExp("^"+hr.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),t.checks.push({type:Ne.DATA_COMPARE,field:Mi(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+hr.boolOp+")\\s*("+hr.variable+")\\s*\\]",populate:function(e,t,n){var a=Kr(n,2),i=a[0],o=a[1];t.checks.push({type:Ne.DATA_BOOL,field:Mi(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+hr.meta+")\\s*("+hr.comparatorOp+")\\s*("+hr.number+")\\s*\\]\\]",populate:function(e,t,n){var a=Kr(n,3),i=a[0],o=a[1],s=a[2];t.checks.push({type:Ne.META_COMPARE,field:Mi(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:hr.separator,populate:function(e,t){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=_r();return s}},{name:"directedEdge",separator:!0,regex:hr.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=t,i=_r();return n.checks.push({type:Ne.DIRECTED_EDGE,source:a,target:i}),va(e,t,n),e.edgeCount++,i}else{var o=_r(),s=t,u=_r();return o.checks.push({type:Ne.NODE_SOURCE,source:s,target:u}),va(e,t,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:hr.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=t,i=_r();return n.checks.push({type:Ne.UNDIRECTED_EDGE,nodes:[a,i]}),va(e,t,n),e.edgeCount++,i}else{var o=_r(),s=t,u=_r();return o.checks.push({type:Ne.NODE_NEIGHBOR,node:s,neighbor:u}),va(e,t,o),u}}},{name:"child",separator:!0,regex:hr.child,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=_r(),i=e[e.length-1];return n.checks.push({type:Ne.CHILD,parent:i,child:a}),va(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=_r(),s=e[e.length-1],u=_r(),l=_r(),c=_r(),v=_r();return o.checks.push({type:Ne.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:Ne.TRUE}],v.checks.push({type:Ne.TRUE}),u.checks.push({type:Ne.PARENT,parent:v,child:c}),va(e,s,o),e.currentSubject=l,e.compoundCount++,c}else{var h=_r(),g=_r(),p=[{type:Ne.PARENT,parent:h,child:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"descendant",separator:!0,regex:hr.descendant,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=_r(),i=e[e.length-1];return n.checks.push({type:Ne.DESCENDANT,ancestor:i,descendant:a}),va(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=_r(),s=e[e.length-1],u=_r(),l=_r(),c=_r(),v=_r();return o.checks.push({type:Ne.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:Ne.TRUE}],v.checks.push({type:Ne.TRUE}),u.checks.push({type:Ne.ANCESTOR,ancestor:v,descendant:c}),va(e,s,o),e.currentSubject=l,e.compoundCount++,c}else{var h=_r(),g=_r(),p=[{type:Ne.ANCESTOR,ancestor:h,descendant:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"subject",modifier:!0,regex:hr.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Er("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===Ne.DIRECTED_EDGE?a.type=Ne.NODE_TARGET:i===Ne.UNDIRECTED_EDGE&&(a.type=Ne.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];dm.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var Iz=function(e){for(var t,n,a,i=0;i<dm.length;i++){var o=dm[i],s=o.name,u=e.match(o.regexObj);if(u!=null){n=u,t=o,a=s;var l=u[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:a,remaining:e}},Bz=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},Oz=function(e){var t=this,n=t.inputText=e,a=t[0]=_r();for(t.length=1,n=Bz(n);;){var i=Iz(n);if(i.expr==null)return Er("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(t,a,o);if(s===!1)return!1;if(s!=null&&(a=s),n=i.remaining,n.match(/^\s*$/))break}var u=t[t.length-1];t.currentSubject!=null&&(u.subject=t.currentSubject),u.edgeCount=t.edgeCount,u.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var c=t[l];if(c.compoundCount>0&&c.edgeCount>0)return Er("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Er("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;c.edgeCount===1&&Er("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Mz=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(c){return c??""},t=function(c){return Ge(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},a=function(c,v){var h=c.type,g=c.value;switch(h){case Ne.GROUP:{var p=e(g);return p.substring(0,p.length-1)}case Ne.DATA_COMPARE:{var E=c.field,m=c.operator;return"["+E+n(e(m))+t(g)+"]"}case Ne.DATA_BOOL:{var b=c.operator,w=c.field;return"["+e(b)+w+"]"}case Ne.DATA_EXIST:{var x=c.field;return"["+x+"]"}case Ne.META_COMPARE:{var _=c.operator,C=c.field;return"[["+C+n(e(_))+t(g)+"]]"}case Ne.STATE:return g;case Ne.ID:return"#"+g;case Ne.CLASS:return"."+g;case Ne.PARENT:case Ne.CHILD:return i(c.parent,v)+n(">")+i(c.child,v);case Ne.ANCESTOR:case Ne.DESCENDANT:return i(c.ancestor,v)+" "+i(c.descendant,v);case Ne.COMPOUND_SPLIT:{var R=i(c.left,v),S=i(c.subject,v),A=i(c.right,v);return R+(R.length>0?" ":"")+S+A}case Ne.TRUE:return""}},i=function(c,v){return c.checks.reduce(function(h,g,p){return h+(v===c&&p===0?"$":"")+a(g,v)},"")},o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},kz={parse:Oz,toString:Mz},O2=function(e,t,n){var a,i=Ge(e),o=De(e),s=Ge(n),u,l,c=!1,v=!1,h=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),v=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(i||s||c)&&(u=!i&&!o?"":""+e,l=""+n),c&&(e=u=u.toLowerCase(),n=l=l.toLowerCase()),t){case"*=":a=u.indexOf(l)>=0;break;case"$=":a=u.indexOf(l,u.length-l.length)>=0;break;case"^=":a=u.indexOf(l)===0;break;case"=":a=e===n;break;case">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return v&&(e!=null||!h)&&(a=!a),a},Lz=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},qz=function(e){return e!==void 0},Nm=function(e,t){return e.data(t)},Nz=function(e,t){return e[t]()},$r=[],Dr=function(e,t){return e.checks.every(function(n){return $r[n.type](n,t)})};$r[Ne.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};$r[Ne.STATE]=function(r,e){var t=r.value;return Pz(t,e)};$r[Ne.ID]=function(r,e){var t=r.value;return e.id()===t};$r[Ne.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};$r[Ne.META_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return O2(Nz(e,t),n,a)};$r[Ne.DATA_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return O2(Nm(e,t),n,a)};$r[Ne.DATA_BOOL]=function(r,e){var t=r.field,n=r.operator;return Lz(Nm(e,t),n)};$r[Ne.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,qz(Nm(e,t))};$r[Ne.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],n=r.nodes[1],a=e.source(),i=e.target();return Dr(t,a)&&Dr(n,i)||Dr(n,a)&&Dr(t,i)};$r[Ne.NODE_NEIGHBOR]=function(r,e){return Dr(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Dr(r.neighbor,t)})};$r[Ne.DIRECTED_EDGE]=function(r,e){return Dr(r.source,e.source())&&Dr(r.target,e.target())};$r[Ne.NODE_SOURCE]=function(r,e){return Dr(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Dr(r.target,t)})};$r[Ne.NODE_TARGET]=function(r,e){return Dr(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Dr(r.source,t)})};$r[Ne.CHILD]=function(r,e){return Dr(r.child,e)&&Dr(r.parent,e.parent())};$r[Ne.PARENT]=function(r,e){return Dr(r.parent,e)&&e.children().some(function(t){return Dr(r.child,t)})};$r[Ne.DESCENDANT]=function(r,e){return Dr(r.descendant,e)&&e.ancestors().some(function(t){return Dr(r.ancestor,t)})};$r[Ne.ANCESTOR]=function(r,e){return Dr(r.ancestor,e)&&e.descendants().some(function(t){return Dr(r.descendant,t)})};$r[Ne.COMPOUND_SPLIT]=function(r,e){return Dr(r.subject,e)&&Dr(r.left,e)&&Dr(r.right,e)};$r[Ne.TRUE]=function(){return!0};$r[Ne.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};$r[Ne.FILTER]=function(r,e){var t=r.value;return t(e)};var Fz=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===Ne.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(i){for(var o=0;o<t.length;o++){var s=t[o];if(Dr(s,i))return!0}return!1};return t.text()==null&&(n=function(){return!0}),e.filter(n)},zz=function(e){for(var t=this,n=0;n<t.length;n++){var a=t[n];if(Dr(a,e))return!0}return!1},$z={matches:zz,filter:Fz},Ca=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ge(e)&&e.match(/^\s*$/)||(jt(e)?this.addQuery({checks:[{type:Ne.COLLECTION,value:e.collection()}]}):Nr(e)?this.addQuery({checks:[{type:Ne.FILTER,value:e}]}):Ge(e)?this.parse(e)||(this.invalid=!0):Mr("A selector must be created from a string; found "))},Sa=Ca.prototype;[kz,$z].forEach(function(r){return He(Sa,r)});Sa.text=function(){return this.inputText};Sa.size=function(){return this.length};Sa.eq=function(r){return this[r]};Sa.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};Sa.addQuery=function(r){this[this.length++]=r};Sa.selector=Sa.toString;var ba={allAre:function(e){var t=new Ca(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new Ca(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length,n=e.length;return t!==n?!1:t===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(n){return t.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(n){return t.hasElementWithId(n.id())})}};ba.allAreNeighbours=ba.allAreNeighbors;ba.has=ba.contains;ba.equal=ba.equals=ba.same;var un=function(e,t){return function(a,i,o,s){var u=a,l=this,c;if(u==null?c="":jt(u)&&u.length===1&&(c=u.id()),l.length===1&&c){var v=l[0]._private,h=v.traversalCache=v.traversalCache||{},g=h[t]=h[t]||[],p=ti(c),E=g[p];return E||(g[p]=e.call(l,a,i,o,s))}else return e.call(l,a,i,o,s)}},eo={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],o=i._private.parent;o&&t.push(o)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var a=this[n],i=a.parents();t=t||i,t=t.intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:un(function(r){for(var e=[],t=0;t<this.length;t++)for(var n=this[t],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(r)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(a){for(var i=0;i<a.length;i++){var o=a[i];t.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function Fm(r,e,t,n){for(var a=[],i=new ro,o=r.cy(),s=o.hasCompoundNodes(),u=0;u<r.length;u++){var l=r[u];t?a.push(l):s&&n(a,i,l)}for(;a.length>0;){var c=a.shift();e(c),i.add(c.id()),s&&n(a,i,c)}return r}function M2(r,e,t){if(t.isParent())for(var n=t._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||r.push(i)}}eo.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Fm(this,r,e,M2)};function k2(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}eo.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Fm(this,r,e,k2)};function Vz(r,e,t){k2(r,e,t),M2(r,e,t)}eo.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Fm(this,r,e,Vz)};eo.ancestors=eo.parents;var es,L2;es=L2={data:xr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:xr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:xr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:xr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:xr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};es.attr=es.data;es.removeAttr=es.removeData;var Gz=L2,vl={};function Sd(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var n=0,a=t[0],i=a._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(n+=r(a,s))}return n}else return}}He(vl,{degree:Sd(function(r,e){return e.source().same(e.target())?2:1}),indegree:Sd(function(r,e){return e.target().same(r)?1:0}),outdegree:Sd(function(r,e){return e.source().same(r)?1:0})});function ki(r,e){return function(t){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],s=o[r](t);s!==void 0&&(n===void 0||e(s,n))&&(n=s)}return n}}He(vl,{minDegree:ki("degree",function(r,e){return r<e}),maxDegree:ki("degree",function(r,e){return r>e}),minIndegree:ki("indegree",function(r,e){return r<e}),maxIndegree:ki("indegree",function(r,e){return r>e}),minOutdegree:ki("outdegree",function(r,e){return r<e}),maxOutdegree:ki("outdegree",function(r,e){return r>e})});He(vl,{totalDegree:function(e){for(var t=0,n=this.nodes(),a=0;a<n.length;a++)t+=n[a].degree(e);return t}});var mn,q2,N2=function(e,t,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,s={x:t.x!=null?t.x-o.x:0,y:t.y!=null?t.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,n),i.dirtyBoundingBoxCache()}}},px={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){N2(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mn=q2={position:xr.data(px),silentPosition:xr.data(He({},px,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){N2(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(pr(e))t?this.silentPosition(e):this.position(e);else if(Nr(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=n(o,i))&&(t?o.silentPosition(s):o.position(s))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var a;if(pr(e)?(a={x:De(e.x)?e.x:0,y:De(e.y)?e.y:0},n=t):Ge(e)&&De(t)&&(a={x:0,y:0},a[e]=t),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+a.x,y:u.y+a.y};n?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return pr(e)?this.shift(e,!0):Ge(e)&&De(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),s=pr(e)?e:void 0,u=s!==void 0||t!==void 0&&Ge(e);if(n&&n.isNode())if(u)for(var l=0;l<this.length;l++){var c=this[l];t!==void 0?c.position(e,(t-o[e])/i):s!==void 0&&c.position(d2(s,i,o))}else{var v=n.position();return s=sl(v,i,o),e===void 0?s:s[e]}else if(!u)return;return this},relativePosition:function(e,t){var n=this[0],a=this.cy(),i=pr(e)?e:void 0,o=i!==void 0||t!==void 0&&Ge(e),s=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],c=s?l.parent():null,v=c&&c.length>0,h=v;v&&(c=c[0]);var g=h?c.position():{x:0,y:0};t!==void 0?l.position(e,t+g[e]):i!==void 0&&l.position({x:i.x+g.x,y:i.y+g.y})}else{var p=n.position(),E=s?n.parent():null,m=E&&E.length>0,b=m;m&&(E=E[0]);var w=b?E.position():{x:0,y:0};return i={x:p.x-w.x,y:p.y-w.y},e===void 0?i:i[e]}else if(!o)return;return this}};mn.modelPosition=mn.point=mn.position;mn.modelPositions=mn.points=mn.positions;mn.renderedPoint=mn.renderedPosition;mn.relativePoint=mn.relativePosition;var Wz=q2,Zi,Ba;Zi=Ba={};Ba.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),a=t.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,s=e.y1*n+a.y,u=e.y2*n+a.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};Ba.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};Ba.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",c={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},v=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),h=s.position;(v.w===0||v.h===0)&&(v={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},v.x1=h.x-v.w/2,v.x2=h.x+v.w/2,v.y1=h.y-v.h/2,v.y2=h.y+v.h/2);function g(P,I,D){var M=0,O=0,N=I+D;return P>0&&N>0&&(M=I/N*P,O=D/N*P),{biasDiff:M,biasComplementDiff:O}}function p(P,I,D,M){if(D.units==="%")switch(M){case"width":return P>0?D.pfValue*P:0;case"height":return I>0?D.pfValue*I:0;case"average":return P>0&&I>0?D.pfValue*(P+I)/2:0;case"min":return P>0&&I>0?P>I?D.pfValue*I:D.pfValue*P:0;case"max":return P>0&&I>0?P>I?D.pfValue*P:D.pfValue*I:0;default:return 0}else return D.units==="px"?D.pfValue:0}var E=c.width.left.value;c.width.left.units==="px"&&c.width.val>0&&(E=E*100/c.width.val);var m=c.width.right.value;c.width.right.units==="px"&&c.width.val>0&&(m=m*100/c.width.val);var b=c.height.top.value;c.height.top.units==="px"&&c.height.val>0&&(b=b*100/c.height.val);var w=c.height.bottom.value;c.height.bottom.units==="px"&&c.height.val>0&&(w=w*100/c.height.val);var x=g(c.width.val-v.w,E,m),_=x.biasDiff,C=x.biasComplementDiff,R=g(c.height.val-v.h,b,w),S=R.biasDiff,A=R.biasComplementDiff;s.autoPadding=p(v.w,v.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(v.w,c.width.val),h.x=(-_+v.x1+v.x2+C)/2,s.autoHeight=Math.max(v.h,c.height.val),h.y=(-S+v.y1+v.y2+A)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||r)&&(t(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var on=function(e){return e===1/0||e===-1/0?0:e},yn=function(e,t,n,a,i){a-t===0||i-n===0||t==null||n==null||a==null||i==null||(e.x1=t<e.x1?t:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ha=function(e,t){return t==null?e:yn(e,t.x1,t.y1,t.x2,t.y2)},Do=function(e,t,n){return qt(e,t,n)},wu=function(e,t,n){if(!t.cy().headless()){var a=t._private,i=a.rstyle,o=i.arrowWidth/2,s=t.pstyle(n+"-arrow-shape").value,u,l;if(s!=="none"){n==="source"?(u=i.srcX,l=i.srcY):n==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var c=a.arrowBounds=a.arrowBounds||{},v=c[n]=c[n]||{};v.x1=u-o,v.y1=l-o,v.x2=u+o,v.y2=l+o,v.w=v.x2-v.x1,v.h=v.y2-v.y1,Pu(v,1),yn(e,v.x1,v.y1,v.x2,v.y2)}}},Td=function(e,t,n){if(!t.cy().headless()){var a;n?a=n+"-":a="";var i=t._private,o=i.rstyle,s=t.pstyle(a+"label").strValue;if(s){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),c=Do(o,"labelWidth",n),v=Do(o,"labelHeight",n),h=Do(o,"labelX",n),g=Do(o,"labelY",n),p=t.pstyle(a+"text-margin-x").pfValue,E=t.pstyle(a+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(a+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,x=t.pstyle("text-border-width").pfValue,_=x/2,C=t.pstyle("text-background-padding").pfValue,R=2,S=v,A=c,P=A/2,I=S/2,D,M,O,N;if(m)D=h-P,M=h+P,O=g-I,N=g+I;else{switch(u.value){case"left":D=h-A,M=h;break;case"center":D=h-P,M=h+P;break;case"right":D=h,M=h+A;break}switch(l.value){case"top":O=g-S,N=g;break;case"center":O=g-I,N=g+I;break;case"bottom":O=g,N=g+S;break}}var V=p-Math.max(w,_)-C-R,$=p+Math.max(w,_)+C+R,G=E-Math.max(w,_)-C-R,U=E+Math.max(w,_)+C+R;D+=V,M+=$,O+=G,N+=U;var J=n||"main",W=i.labelBounds,H=W[J]=W[J]||{};H.x1=D,H.y1=O,H.x2=M,H.y2=N,H.w=M-D,H.h=N-O,H.leftPad=V,H.rightPad=$,H.topPad=G,H.botPad=U;var Z=m&&b.strValue==="autorotate",ne=b.pfValue!=null&&b.pfValue!==0;if(Z||ne){var F=Z?Do(i.rstyle,"labelAngle",n):b.pfValue,z=Math.cos(F),j=Math.sin(F),ee=(D+M)/2,ie=(O+N)/2;if(!m){switch(u.value){case"left":ee=M;break;case"right":ee=D;break}switch(l.value){case"top":ie=N;break;case"bottom":ie=O;break}}var oe=function(ue,Se){return ue=ue-ee,Se=Se-ie,{x:ue*z-Se*j+ee,y:ue*j+Se*z+ie}},Y=oe(D,O),X=oe(D,N),re=oe(M,O),le=oe(M,N);D=Math.min(Y.x,X.x,re.x,le.x),M=Math.max(Y.x,X.x,re.x,le.x),O=Math.min(Y.y,X.y,re.y,le.y),N=Math.max(Y.y,X.y,re.y,le.y)}var he=J+"Rot",be=W[he]=W[he]||{};be.x1=D,be.y1=O,be.x2=M,be.y2=N,be.w=M-D,be.h=N-O,yn(e,D,O,M,N),yn(i.labelBounds.all,D,O,M,N)}return e}},yx=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,a=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,o=a+i;F2(e,t,n,o,"outside",o/2)}},F2=function(e,t,n,a,i,o){if(!(n===0||a<=0||i==="inside")){var s=t.cy(),u=t.pstyle("shape").value,l=s.renderer().nodeShapes[u],c=t.position(),v=c.x,h=c.y,g=t.width(),p=t.height();if(l.hasMiterBounds){i==="center"&&(a/=2);var E=l.miterBounds(v,h,g,p,a);ha(e,E)}else o!=null&&o>0&&Du(e,[o,o,o,o])}},Uz=function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,a=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;F2(e,t,n,a,i)}},Hz=function(e,t){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Dt(),s=e._private,u=e.isNode(),l=e.isEdge(),c,v,h,g,p,E,m=s.rstyle,b=u&&a?e.pstyle("bounds-expansion").pfValue:[0],w=function(fe){return fe.pstyle("display").value!=="none"},x=!a||w(e)&&(!l||w(e.source())&&w(e.target()));if(x){var _=0,C=0;a&&t.includeOverlays&&(_=e.pstyle("overlay-opacity").value,_!==0&&(C=e.pstyle("overlay-padding").value));var R=0,S=0;a&&t.includeUnderlays&&(R=e.pstyle("underlay-opacity").value,R!==0&&(S=e.pstyle("underlay-padding").value));var A=Math.max(C,S),P=0,I=0;if(a&&(P=e.pstyle("width").pfValue,I=P/2),u&&t.includeNodes){var D=e.position();p=D.x,E=D.y;var M=e.outerWidth(),O=M/2,N=e.outerHeight(),V=N/2;c=p-O,v=p+O,h=E-V,g=E+V,yn(o,c,h,v,g),a&&yx(o,e),a&&t.includeOutlines&&!i&&yx(o,e),a&&Uz(o,e)}else if(l&&t.includeEdges)if(a&&!i){var $=e.pstyle("curve-style").strValue;if(c=Math.min(m.srcX,m.midX,m.tgtX),v=Math.max(m.srcX,m.midX,m.tgtX),h=Math.min(m.srcY,m.midY,m.tgtY),g=Math.max(m.srcY,m.midY,m.tgtY),c-=I,v+=I,h-=I,g+=I,yn(o,c,h,v,g),$==="haystack"){var G=m.haystackPts;if(G&&G.length===2){if(c=G[0].x,h=G[0].y,v=G[1].x,g=G[1].y,c>v){var U=c;c=v,v=U}if(h>g){var J=h;h=g,g=J}yn(o,c-I,h-I,v+I,g+I)}}else if($==="bezier"||$==="unbundled-bezier"||ga($,"segments")||ga($,"taxi")){var W;switch($){case"bezier":case"unbundled-bezier":W=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":W=m.linePts;break}if(W!=null)for(var H=0;H<W.length;H++){var Z=W[H];c=Z.x-I,v=Z.x+I,h=Z.y-I,g=Z.y+I,yn(o,c,h,v,g)}}}else{var ne=e.source(),F=ne.position(),z=e.target(),j=z.position();if(c=F.x,v=j.x,h=F.y,g=j.y,c>v){var ee=c;c=v,v=ee}if(h>g){var ie=h;h=g,g=ie}c-=I,v+=I,h-=I,g+=I,yn(o,c,h,v,g)}if(a&&t.includeEdges&&l&&(wu(o,e,"mid-source"),wu(o,e,"mid-target"),wu(o,e,"source"),wu(o,e,"target")),a){var oe=e.pstyle("ghost").value==="yes";if(oe){var Y=e.pstyle("ghost-offset-x").pfValue,X=e.pstyle("ghost-offset-y").pfValue;yn(o,o.x1+Y,o.y1+X,o.x2+Y,o.y2+X)}}var re=s.bodyBounds=s.bodyBounds||{};tw(re,o),Du(re,b),Pu(re,1),a&&(c=o.x1,v=o.x2,h=o.y1,g=o.y2,yn(o,c-A,h-A,v+A,g+A));var le=s.overlayBounds=s.overlayBounds||{};tw(le,o),Du(le,b),Pu(le,1);var he=s.labelBounds=s.labelBounds||{};he.all!=null?RN(he.all):he.all=Dt(),a&&t.includeLabels&&(t.includeMainLabels&&Td(o,e,null),l&&(t.includeSourceLabels&&Td(o,e,"source"),t.includeTargetLabels&&Td(o,e,"target")))}return o.x1=on(o.x1),o.y1=on(o.y1),o.x2=on(o.x2),o.y2=on(o.y2),o.w=on(o.x2-o.x1),o.h=on(o.y2-o.y1),o.w>0&&o.h>0&&x&&(Du(o,b),Pu(o,1)),o},z2=function(e){var t=0,n=function(o){return(o?1:0)<<t++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},$2=function(e){var t=function(s){return Math.round(s)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return Z1([t(n.x),t(n.y),t(a.x),t(a.y)])}else{var i=e.position();return Z1([t(i.x),t(i.y)])}},mx=function(e,t){var n=e._private,a,i=e.isEdge(),o=t==null?bx:z2(t),s=o===bx;if(n.bbCache==null?(a=Hz(e,rs),n.bbCache=a,n.bbCachePosKey=$2(e)):a=n.bbCache,!s){var u=e.isNode();a=Dt(),(t.includeNodes&&u||t.includeEdges&&!u)&&(t.includeOverlays?ha(a,n.overlayBounds):ha(a,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ha(a,n.labelBounds.all):(t.includeMainLabels&&ha(a,n.labelBounds.mainRot),t.includeSourceLabels&&ha(a,n.labelBounds.sourceRot),t.includeTargetLabels&&ha(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},rs={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},bx=z2(rs),wx=ht(rs);Ba.boundingBox=function(r){var e,t=r===void 0||r.useCache===void 0||r.useCache===!0,n=Qi(function(c){var v=c._private;return v.bbCache==null||v.styleDirty||v.bbCachePosKey!==$2(c)},function(c){return c.id()});if(t&&this.length===1&&!n(this[0]))r===void 0?r=rs:r=wx(r),e=mx(this[0],r);else{e=Dt(),r=r||rs;var a=wx(r),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),s&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var u=0;u<i.length;u++){var l=i[u];n(l)&&l.dirtyBoundingBoxCache(),ha(e,mx(l,a))}}return e.x1=on(e.x1),e.y1=on(e.y1),e.x2=on(e.x2),e.y2=on(e.y2),e.w=on(e.x2-e.x1),e.h=on(e.y2-e.y1),e};Ba.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Ba.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),n=t.hasCompoundNodes(),a=t.collection();if(n&&(a=e.filter(function(l){return l.isParent()}),e=e.not(a)),pr(r)){var i=r;r=function(){return i}}var o=function(c,v){return c._private.bbAtOldPos=r(c,v)},s=function(c){return c._private.bbAtOldPos};t.startBatch(),e.forEach(o).silentPositions(r),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var u=TN(this.boundingBox({useCache:!1}));return e.silentPositions(s),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),t.endBatch(),u};Zi.boundingbox=Zi.bb=Zi.boundingBox;Zi.renderedBoundingbox=Zi.renderedBoundingBox;var Kz=Ba,qo,gs;qo=gs={};var V2=function(e){e.uppercaseName=k1(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=k1(e.outerName),qo[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var s=n.pstyle(e.name);switch(s.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},qo["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var s=n[e.name](),u=n.pstyle("border-position").value,l;u==="center"?l=n.pstyle("border-width").pfValue:u==="outside"?l=2*n.pstyle("border-width").pfValue:l=0;var c=2*n.padding();return s+l+c}else return 1},qo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},qo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};V2({name:"width"});V2({name:"height"});gs.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue};gs.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};gs.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var jz=gs,Yz=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},Zz=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return sl(t(e),n.zoom(),n.pan())}},Xz=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return t(e).map(function(o){return sl(o,i,a)})}},Qz=function(e){return e.renderer().getControlPoints(e)},Jz=function(e){return e.renderer().getSegmentPoints(e)},e5=function(e){return e.renderer().getSourceEndpoint(e)},r5=function(e){return e.renderer().getTargetEndpoint(e)},t5=function(e){return e.renderer().getEdgeMidpoint(e)},xx={controlPoints:{get:Qz,mult:!0},segmentPoints:{get:Jz,mult:!0},sourceEndpoint:{get:e5},targetEndpoint:{get:r5},midpoint:{get:t5}},n5=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},a5=Object.keys(xx).reduce(function(r,e){var t=xx[e],n=n5(e);return r[e]=function(){return Yz(this,t.get)},t.mult?r[n]=function(){return Xz(this,t.get)}:r[n]=function(){return Zz(this,t.get)},r},{}),i5=He({},Wz,Kz,jz,a5);/*!
|
|
8
|
+
*/var PR=0,IR=1,DR=2,wn=function(e){if(!(this instanceof wn))return new wn(e);this.id="Thenable/1.0.7",this.state=PR,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};wn.prototype={fulfill:function(e){return ww(this,IR,"fulfillValue",e)},reject:function(e){return ww(this,DR,"rejectReason",e)},then:function(e,t){var n=this,a=new wn;return n.onFulfilled.push(Ew(e,a,"fulfill")),n.onRejected.push(Ew(t,a,"reject")),BR(n),a.proxy}};var ww=function(e,t,n,a){return e.state===PR&&(e.state=t,e[n]=a,BR(e)),e},BR=function(e){e.state===IR?xw(e,"onFulfilled",e.fulfillValue):e.state===DR&&xw(e,"onRejected",e.rejectReason)},xw=function(e,t,n){if(e[t].length!==0){var a=e[t];e[t]=[];var i=function(){for(var s=0;s<a.length;s++)a[s](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Ew=function(e,t,n){return function(a){if(typeof e!="function")t[n].call(t,a);else{var i;try{i=e(a)}catch(o){t.reject(o);return}MR(t,i)}}},MR=function(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(tt(t)==="object"&&t!==null||typeof t=="function")try{n=t.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(t,function(i){a||(a=!0,i===t?e.reject(new TypeError("circular thenable chain")):MR(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(t)};wn.all=function(r){return new wn(function(e,t){for(var n=new Array(r.length),a=0,i=function(l,u){n[l]=u,a++,a===r.length&&e(n)},o=0;o<r.length;o++)(function(s){var l=r[s],u=l!=null&&l.then!=null;if(u)l.then(function(d){i(s,d)},function(d){t(d)});else{var c=l;i(s,c)}})(o)})};wn.resolve=function(r){return new wn(function(e,t){e(r)})};wn.reject=function(r){return new wn(function(e,t){t(r)})};var no=typeof Promise<"u"?Promise:wn,fm=function(e,t,n){var a=Tm(e),i=!a,o=this._private=Ye({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&zr(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var l=e.pan();o.startPan={x:l.x,y:l.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},oi=fm.prototype;Ye(oi,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;e.queue?t=n.queue:t=n.current,t.push(this),Yt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,c){var d=e[u];d!=null&&(e[u]=e[c],e[c]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[a]=s}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case"frame":n=t.frames;break;default:case"complete":case"completed":n=t.completes}return new no(function(a,i){n.push(function(){a()})})}});oi.complete=oi.completed;oi.run=oi.play;oi.running=oi.playing;var KF={animated:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=a[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<a.length;o++){var s=a[o];s._private.animation.queue=[]}return this}},delay:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this,l=!i,u=!l;if(!s.styleEnabled())return this;var c=s.style();t=Ye({},t,n);var d=Object.keys(t).length===0;if(d)return new fm(o[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(u&&(t.style=c.getPropsList(t.style||t.css),t.css=void 0),u&&t.renderedPosition!=null){var h=t.renderedPosition,g=s.pan(),p=s.zoom();t.position=mR(h,p,g)}if(l&&t.panBy!=null){var E=t.panBy,y=s.pan();t.pan={x:y.x+E.x,y:y.y+E.y}}var b=t.center||t.centre;if(l&&b!=null){var w=s.getCenterPan(b.eles,t.zoom);w!=null&&(t.pan=w)}if(l&&t.fit!=null){var x=t.fit,C=s.getFitViewport(x.eles||x.boundingBox,x.padding);C!=null&&(t.pan=C.pan,t.zoom=C.zoom)}if(l&&pr(t.zoom)){var T=s.getZoomedViewport(t.zoom);T!=null?(T.zoomed&&(t.zoom=T.zoom),T.panned&&(t.pan=T.pan)):t.zoom=null}return new fm(o[0],t)}},animate:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;n&&(t=Ye({},t,n));for(var l=0;l<o.length;l++){var u=o[l],c=u.animated()&&(t.queue===void 0||t.queue),d=u.animation(t,c?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var l=0;l<o.length;l++){for(var u=o[l],c=u._private,d=c.animation.current,h=0;h<d.length;h++){var g=d[h],p=g._private;n&&(p.duration=0)}t&&(c.animation.queue=[]),n||(c.animation.current=[])}return s.notify("draw"),this}}},Ac,Cw;function fl(){if(Cw)return Ac;Cw=1;var r=Array.isArray;return Ac=r,Ac}var Pc,_w;function jF(){if(_w)return Pc;_w=1;var r=fl(),e=vs(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return Pc=a,Pc}var Ic,Sw;function YF(){if(Sw)return Ic;Sw=1;var r=lR(),e=ds(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var l=r(s);return l==n||l==a||l==t||l==i}return Ic=o,Ic}var Dc,Tw;function ZF(){if(Tw)return Dc;Tw=1;var r=ol(),e=r["__core-js_shared__"];return Dc=e,Dc}var Bc,Rw;function XF(){if(Rw)return Bc;Rw=1;var r=ZF(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return Bc=t,Bc}var Mc,Aw;function QF(){if(Aw)return Mc;Aw=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Mc=t,Mc}var kc,Pw;function JF(){if(Pw)return kc;Pw=1;var r=YF(),e=XF(),t=ds(),n=QF(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return kc=d,kc}var Oc,Iw;function ez(){if(Iw)return Oc;Iw=1;function r(e,t){return e==null?void 0:e[t]}return Oc=r,Oc}var Lc,Dw;function qm(){if(Dw)return Lc;Dw=1;var r=JF(),e=ez();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return Lc=t,Lc}var qc,Bw;function cl(){if(Bw)return qc;Bw=1;var r=qm(),e=r(Object,"create");return qc=e,qc}var Nc,Mw;function rz(){if(Mw)return Nc;Mw=1;var r=cl();function e(){this.__data__=r?r(null):{},this.size=0}return Nc=e,Nc}var Fc,kw;function tz(){if(kw)return Fc;kw=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Fc=r,Fc}var zc,Ow;function nz(){if(Ow)return zc;Ow=1;var r=cl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return zc=a,zc}var $c,Lw;function az(){if(Lw)return $c;Lw=1;var r=cl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return $c=n,$c}var Vc,qw;function iz(){if(qw)return Vc;qw=1;var r=cl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return Vc=t,Vc}var Gc,Nw;function oz(){if(Nw)return Gc;Nw=1;var r=rz(),e=tz(),t=nz(),n=az(),a=iz();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Gc=i,Gc}var Wc,Fw;function sz(){if(Fw)return Wc;Fw=1;function r(){this.__data__=[],this.size=0}return Wc=r,Wc}var Uc,zw;function kR(){if(zw)return Uc;zw=1;function r(e,t){return e===t||e!==e&&t!==t}return Uc=r,Uc}var Hc,$w;function dl(){if($w)return Hc;$w=1;var r=kR();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Hc=e,Hc}var Kc,Vw;function uz(){if(Vw)return Kc;Vw=1;var r=dl(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return Kc=n,Kc}var jc,Gw;function lz(){if(Gw)return jc;Gw=1;var r=dl();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return jc=e,jc}var Yc,Ww;function fz(){if(Ww)return Yc;Ww=1;var r=dl();function e(t){return r(this.__data__,t)>-1}return Yc=e,Yc}var Zc,Uw;function cz(){if(Uw)return Zc;Uw=1;var r=dl();function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}return Zc=e,Zc}var Xc,Hw;function dz(){if(Hw)return Xc;Hw=1;var r=sz(),e=uz(),t=lz(),n=fz(),a=cz();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Xc=i,Xc}var Qc,Kw;function vz(){if(Kw)return Qc;Kw=1;var r=qm(),e=ol(),t=r(e,"Map");return Qc=t,Qc}var Jc,jw;function hz(){if(jw)return Jc;jw=1;var r=oz(),e=dz(),t=vz();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Jc=n,Jc}var ed,Yw;function gz(){if(Yw)return ed;Yw=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return ed=r,ed}var rd,Zw;function vl(){if(Zw)return rd;Zw=1;var r=gz();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return rd=e,rd}var td,Xw;function pz(){if(Xw)return td;Xw=1;var r=vl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return td=e,td}var nd,Qw;function yz(){if(Qw)return nd;Qw=1;var r=vl();function e(t){return r(this,t).get(t)}return nd=e,nd}var ad,Jw;function mz(){if(Jw)return ad;Jw=1;var r=vl();function e(t){return r(this,t).has(t)}return ad=e,ad}var id,ex;function bz(){if(ex)return id;ex=1;var r=vl();function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}return id=e,id}var od,rx;function wz(){if(rx)return od;rx=1;var r=hz(),e=pz(),t=yz(),n=mz(),a=bz();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,od=i,od}var sd,tx;function xz(){if(tx)return sd;tx=1;var r=wz(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],l=i.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return i.cache=l.set(s,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,sd=t,sd}var ud,nx;function Ez(){if(nx)return ud;nx=1;var r=xz(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return ud=t,ud}var ld,ax;function OR(){if(ax)return ld;ax=1;var r=Ez(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,l,u){i.push(l?u.replace(t,"$1"):s||o)}),i});return ld=n,ld}var fd,ix;function LR(){if(ix)return fd;ix=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return fd=r,fd}var cd,ox;function Cz(){if(ox)return cd;ox=1;var r=Am(),e=LR(),t=fl(),n=vs(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return cd=o,cd}var dd,sx;function qR(){if(sx)return dd;sx=1;var r=Cz();function e(t){return t==null?"":r(t)}return dd=e,dd}var vd,ux;function NR(){if(ux)return vd;ux=1;var r=fl(),e=jF(),t=OR(),n=qR();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return vd=a,vd}var hd,lx;function Nm(){if(lx)return hd;lx=1;var r=vs();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return hd=e,hd}var gd,fx;function _z(){if(fx)return gd;fx=1;var r=NR(),e=Nm();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return gd=t,gd}var pd,cx;function Sz(){if(cx)return pd;cx=1;var r=_z();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return pd=e,pd}var Tz=Sz(),Rz=cs(Tz),yd,dx;function Az(){if(dx)return yd;dx=1;var r=qm(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return yd=e,yd}var md,vx;function Pz(){if(vx)return md;vx=1;var r=Az();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return md=e,md}var bd,hx;function Iz(){if(hx)return bd;hx=1;var r=Pz(),e=kR(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var l=i[o];(!(n.call(i,o)&&e(l,s))||s===void 0&&!(o in i))&&r(i,o,s)}return bd=a,bd}var wd,gx;function Dz(){if(gx)return wd;gx=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return wd=t,wd}var xd,px;function Bz(){if(px)return xd;px=1;var r=Iz(),e=NR(),t=Dz(),n=ds(),a=Nm();function i(o,s,l,u){if(!n(o))return o;s=e(s,o);for(var c=-1,d=s.length,h=d-1,g=o;g!=null&&++c<d;){var p=a(s[c]),E=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var y=g[p];E=u?u(y,p,g):void 0,E===void 0&&(E=n(y)?y:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return xd=i,xd}var Ed,yx;function Mz(){if(yx)return Ed;yx=1;var r=Bz();function e(t,n,a){return t==null?t:r(t,n,a)}return Ed=e,Ed}var kz=Mz(),Oz=cs(kz),Cd,mx;function Lz(){if(mx)return Cd;mx=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return Cd=r,Cd}var _d,bx;function qz(){if(bx)return _d;bx=1;var r=LR(),e=Lz(),t=fl(),n=vs(),a=OR(),i=Nm(),o=qR();function s(l){return t(l)?r(l,i):n(l)?[l]:e(a(o(l)))}return _d=s,_d}var Nz=qz(),Fz=cs(Nz),zz={data:function(e){var t={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=Ye({},t,e),function(a,i){var o=e,s=this,l=s.length!==void 0,u=l?s:[s],c=l?s[0]:s;if(Ke(a)){var d=a.indexOf(".")!==-1,h=d&&Fz(a);if(o.allowGetting&&i===void 0){var g;return c&&(o.beforeGet(c),h&&c._private[o.field][a]===void 0?g=Rz(c._private[o.field],h):g=c._private[o.field][a]),g}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var E=J2({},a,i);o.beforeSet(s,E);for(var y=0,b=u.length;y<b;y++){var w=u[y];o.canSet(w)&&(h&&c._private[o.field][a]===void 0?Oz(w._private[o.field],h,i):w._private[o.field][a]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&pr(a)){var x=a,C,T,S=Object.keys(x);o.beforeSet(s,x);for(var _=0;_<S.length;_++){C=S[_],T=x[C];var A=!o.immutableKeys[C];if(A)for(var P=0;P<u.length;P++){var I=u[P];o.canSet(I)&&(I._private[o.field][C]=T)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&zr(a)){var D=a;s.on(o.bindingEvent,D)}else if(o.allowGetting&&a===void 0){var k;return c&&(o.beforeGet(c),k=c._private[o.field]),k}return s}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ye({},t,e),function(a){var i=e,o=this,s=o.length!==void 0,l=s?o:[o];if(Ke(a)){for(var u=a.split(/\s+/),c=u.length,d=0;d<c;d++){var h=u[d];if(!Ca(h)){var g=!i.immutableKeys[h];if(g)for(var p=0,E=l.length;p<E;p++)l[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,b=l.length;y<b;y++)for(var w=l[y]._private[i.field],x=Object.keys(w),C=0;C<x.length;C++){var T=x[C],S=!i.immutableKeys[T];S&&(w[T]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},$z={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(n,a){var i=this,o=Array.prototype.slice.call(arguments,0);return new no(function(s,l){var u=function(g){i.off.apply(i,d),s(g)},c=o.concat([u]),d=c.concat([]);i.on.apply(i,c)})}}},xr={};[KF,zz,$z].forEach(function(r){Ye(xr,r)});var Vz={animate:xr.animate(),animation:xr.animation(),animated:xr.animated(),clearQueue:xr.clearQueue(),delay:xr.delay(),delayAnimation:xr.delayAnimation(),stop:xr.stop()},Bu={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Sr(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new to(e),o=0;o<t.length;o++){for(var s=t[o],l=s._private,u=l.classes,c=!1,d=0;d<e.length;d++){var h=e[d],g=u.has(h);if(!g){c=!0;break}}c||(c=u.size!==e.length),c&&(l.classes=i,a.push(s))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Sr(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=t===void 0,i=[],o=0,s=n.length;o<s;o++)for(var l=n[o],u=l._private.classes,c=!1,d=0;d<e.length;d++){var h=e[d],g=u.has(h),p=!1;t||a&&!g?(u.add(h),p=!0):(!t||a&&g)&&(u.delete(h),p=!0),!c&&p&&(i.push(l),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};Bu.className=Bu.classNames=Bu.classes;var gr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:rt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};gr.variable="(?:[\\w-.]|(?:\\\\"+gr.metaChar+"))+";gr.className="(?:[\\w-]|(?:\\\\"+gr.metaChar+"))+";gr.value=gr.string+"|"+gr.number;gr.id=gr.variable;(function(){var r,e,t;for(r=gr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],gr.comparatorOp+="|@"+e;for(r=gr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(gr.comparatorOp+="|\\!"+e)})();var Cr=function(){return{checks:[]}},ze={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},cm=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return zq(r.selector,e.selector)}),Gz=(function(){for(var r={},e,t=0;t<cm.length;t++)e=cm[t],r[e.selector]=e.matches;return r})(),Wz=function(e,t){return Gz[e](t)},Uz="("+cm.map(function(r){return r.selector}).join("|")+")",Oi=function(e){return e.replace(new RegExp("\\\\("+gr.metaChar+")","g"),function(t,n){return n})},ga=function(e,t,n){e[e.length-1]=n},dm=[{name:"group",query:!0,regex:"("+gr.group+")",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Uz,populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+gr.id+")",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.ID,value:Oi(i)})}},{name:"className",query:!0,regex:"\\.("+gr.className+")",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.CLASS,value:Oi(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+gr.variable+")\\s*\\]",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.DATA_EXIST,field:Oi(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+gr.variable+")\\s*("+gr.comparatorOp+")\\s*("+gr.value+")\\s*\\]",populate:function(e,t,n){var a=Yr(n,3),i=a[0],o=a[1],s=a[2],l=new RegExp("^"+gr.string+"$").exec(s)!=null;l?s=s.substring(1,s.length-1):s=parseFloat(s),t.checks.push({type:ze.DATA_COMPARE,field:Oi(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+gr.boolOp+")\\s*("+gr.variable+")\\s*\\]",populate:function(e,t,n){var a=Yr(n,2),i=a[0],o=a[1];t.checks.push({type:ze.DATA_BOOL,field:Oi(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+gr.meta+")\\s*("+gr.comparatorOp+")\\s*("+gr.number+")\\s*\\]\\]",populate:function(e,t,n){var a=Yr(n,3),i=a[0],o=a[1],s=a[2];t.checks.push({type:ze.META_COMPARE,field:Oi(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:gr.separator,populate:function(e,t){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Cr();return s}},{name:"directedEdge",separator:!0,regex:gr.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=t,i=Cr();return n.checks.push({type:ze.DIRECTED_EDGE,source:a,target:i}),ga(e,t,n),e.edgeCount++,i}else{var o=Cr(),s=t,l=Cr();return o.checks.push({type:ze.NODE_SOURCE,source:s,target:l}),ga(e,t,o),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:gr.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=t,i=Cr();return n.checks.push({type:ze.UNDIRECTED_EDGE,nodes:[a,i]}),ga(e,t,n),e.edgeCount++,i}else{var o=Cr(),s=t,l=Cr();return o.checks.push({type:ze.NODE_NEIGHBOR,node:s,neighbor:l}),ga(e,t,o),l}}},{name:"child",separator:!0,regex:gr.child,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=Cr(),i=e[e.length-1];return n.checks.push({type:ze.CHILD,parent:i,child:a}),ga(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=Cr(),s=e[e.length-1],l=Cr(),u=Cr(),c=Cr(),d=Cr();return o.checks.push({type:ze.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=t.checks,t.checks=[{type:ze.TRUE}],d.checks.push({type:ze.TRUE}),l.checks.push({type:ze.PARENT,parent:d,child:c}),ga(e,s,o),e.currentSubject=u,e.compoundCount++,c}else{var h=Cr(),g=Cr(),p=[{type:ze.PARENT,parent:h,child:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"descendant",separator:!0,regex:gr.descendant,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=Cr(),i=e[e.length-1];return n.checks.push({type:ze.DESCENDANT,ancestor:i,descendant:a}),ga(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=Cr(),s=e[e.length-1],l=Cr(),u=Cr(),c=Cr(),d=Cr();return o.checks.push({type:ze.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=t.checks,t.checks=[{type:ze.TRUE}],d.checks.push({type:ze.TRUE}),l.checks.push({type:ze.ANCESTOR,ancestor:d,descendant:c}),ga(e,s,o),e.currentSubject=u,e.compoundCount++,c}else{var h=Cr(),g=Cr(),p=[{type:ze.ANCESTOR,ancestor:h,descendant:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"subject",modifier:!0,regex:gr.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Er("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===ze.DIRECTED_EDGE?a.type=ze.NODE_TARGET:i===ze.UNDIRECTED_EDGE&&(a.type=ze.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];dm.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var Hz=function(e){for(var t,n,a,i=0;i<dm.length;i++){var o=dm[i],s=o.name,l=e.match(o.regexObj);if(l!=null){n=l,t=o,a=s;var u=l[0];e=e.substring(u.length);break}}return{expr:t,match:n,name:a,remaining:e}},Kz=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},jz=function(e){var t=this,n=t.inputText=e,a=t[0]=Cr();for(t.length=1,n=Kz(n);;){var i=Hz(n);if(i.expr==null)return Er("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(t,a,o);if(s===!1)return!1;if(s!=null&&(a=s),n=i.remaining,n.match(/^\s*$/))break}var l=t[t.length-1];t.currentSubject!=null&&(l.subject=t.currentSubject),l.edgeCount=t.edgeCount,l.compoundCount=t.compoundCount;for(var u=0;u<t.length;u++){var c=t[u];if(c.compoundCount>0&&c.edgeCount>0)return Er("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Er("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;c.edgeCount===1&&Er("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Yz=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(c){return c??""},t=function(c){return Ke(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},a=function(c,d){var h=c.type,g=c.value;switch(h){case ze.GROUP:{var p=e(g);return p.substring(0,p.length-1)}case ze.DATA_COMPARE:{var E=c.field,y=c.operator;return"["+E+n(e(y))+t(g)+"]"}case ze.DATA_BOOL:{var b=c.operator,w=c.field;return"["+e(b)+w+"]"}case ze.DATA_EXIST:{var x=c.field;return"["+x+"]"}case ze.META_COMPARE:{var C=c.operator,T=c.field;return"[["+T+n(e(C))+t(g)+"]]"}case ze.STATE:return g;case ze.ID:return"#"+g;case ze.CLASS:return"."+g;case ze.PARENT:case ze.CHILD:return i(c.parent,d)+n(">")+i(c.child,d);case ze.ANCESTOR:case ze.DESCENDANT:return i(c.ancestor,d)+" "+i(c.descendant,d);case ze.COMPOUND_SPLIT:{var S=i(c.left,d),_=i(c.subject,d),A=i(c.right,d);return S+(S.length>0?" ":"")+_+A}case ze.TRUE:return""}},i=function(c,d){return c.checks.reduce(function(h,g,p){return h+(d===c&&p===0?"$":"")+a(g,d)},"")},o="",s=0;s<this.length;s++){var l=this[s];o+=i(l,l.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},Zz={parse:jz,toString:Yz},FR=function(e,t,n){var a,i=Ke(e),o=Me(e),s=Ke(n),l,u,c=!1,d=!1,h=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(i||s||c)&&(l=!i&&!o?"":""+e,u=""+n),c&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),t){case"*=":a=l.indexOf(u)>=0;break;case"$=":a=l.indexOf(u,l.length-u.length)>=0;break;case"^=":a=l.indexOf(u)===0;break;case"=":a=e===n;break;case">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return d&&(e!=null||!h)&&(a=!a),a},Xz=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Qz=function(e){return e!==void 0},Fm=function(e,t){return e.data(t)},Jz=function(e,t){return e[t]()},Gr=[],Br=function(e,t){return e.checks.every(function(n){return Gr[n.type](n,t)})};Gr[ze.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};Gr[ze.STATE]=function(r,e){var t=r.value;return Wz(t,e)};Gr[ze.ID]=function(r,e){var t=r.value;return e.id()===t};Gr[ze.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};Gr[ze.META_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return FR(Jz(e,t),n,a)};Gr[ze.DATA_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return FR(Fm(e,t),n,a)};Gr[ze.DATA_BOOL]=function(r,e){var t=r.field,n=r.operator;return Xz(Fm(e,t),n)};Gr[ze.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,Qz(Fm(e,t))};Gr[ze.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],n=r.nodes[1],a=e.source(),i=e.target();return Br(t,a)&&Br(n,i)||Br(n,a)&&Br(t,i)};Gr[ze.NODE_NEIGHBOR]=function(r,e){return Br(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Br(r.neighbor,t)})};Gr[ze.DIRECTED_EDGE]=function(r,e){return Br(r.source,e.source())&&Br(r.target,e.target())};Gr[ze.NODE_SOURCE]=function(r,e){return Br(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Br(r.target,t)})};Gr[ze.NODE_TARGET]=function(r,e){return Br(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Br(r.source,t)})};Gr[ze.CHILD]=function(r,e){return Br(r.child,e)&&Br(r.parent,e.parent())};Gr[ze.PARENT]=function(r,e){return Br(r.parent,e)&&e.children().some(function(t){return Br(r.child,t)})};Gr[ze.DESCENDANT]=function(r,e){return Br(r.descendant,e)&&e.ancestors().some(function(t){return Br(r.ancestor,t)})};Gr[ze.ANCESTOR]=function(r,e){return Br(r.ancestor,e)&&e.descendants().some(function(t){return Br(r.descendant,t)})};Gr[ze.COMPOUND_SPLIT]=function(r,e){return Br(r.subject,e)&&Br(r.left,e)&&Br(r.right,e)};Gr[ze.TRUE]=function(){return!0};Gr[ze.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};Gr[ze.FILTER]=function(r,e){var t=r.value;return t(e)};var e5=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===ze.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(i){for(var o=0;o<t.length;o++){var s=t[o];if(Br(s,i))return!0}return!1};return t.text()==null&&(n=function(){return!0}),e.filter(n)},r5=function(e){for(var t=this,n=0;n<t.length;n++){var a=t[n];if(Br(a,e))return!0}return!1},t5={matches:r5,filter:e5},Ta=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ke(e)&&e.match(/^\s*$/)||(Yt(e)?this.addQuery({checks:[{type:ze.COLLECTION,value:e.collection()}]}):zr(e)?this.addQuery({checks:[{type:ze.FILTER,value:e}]}):Ke(e)?this.parse(e)||(this.invalid=!0):Lr("A selector must be created from a string; found "))},Ra=Ta.prototype;[Zz,t5].forEach(function(r){return Ye(Ra,r)});Ra.text=function(){return this.inputText};Ra.size=function(){return this.length};Ra.eq=function(r){return this[r]};Ra.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};Ra.addQuery=function(r){this[this.length++]=r};Ra.selector=Ra.toString;var xa={allAre:function(e){var t=new Ta(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new Ta(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length,n=e.length;return t!==n?!1:t===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(n){return t.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(n){return t.hasElementWithId(n.id())})}};xa.allAreNeighbours=xa.allAreNeighbors;xa.has=xa.contains;xa.equal=xa.equals=xa.same;var ln=function(e,t){return function(a,i,o,s){var l=a,u=this,c;if(l==null?c="":Yt(l)&&l.length===1&&(c=l.id()),u.length===1&&c){var d=u[0]._private,h=d.traversalCache=d.traversalCache||{},g=h[t]=h[t]||[],p=ai(c),E=g[p];return E||(g[p]=e.call(u,a,i,o,s))}else return e.call(u,a,i,o,s)}},ro={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],o=i._private.parent;o&&t.push(o)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var a=this[n],i=a.parents();t=t||i,t=t.intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:ln(function(r){for(var e=[],t=0;t<this.length;t++)for(var n=this[t],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(r)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(a){for(var i=0;i<a.length;i++){var o=a[i];t.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function zm(r,e,t,n){for(var a=[],i=new to,o=r.cy(),s=o.hasCompoundNodes(),l=0;l<r.length;l++){var u=r[l];t?a.push(u):s&&n(a,i,u)}for(;a.length>0;){var c=a.shift();e(c),i.add(c.id()),s&&n(a,i,c)}return r}function zR(r,e,t){if(t.isParent())for(var n=t._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||r.push(i)}}ro.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zm(this,r,e,zR)};function $R(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}ro.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zm(this,r,e,$R)};function n5(r,e,t){$R(r,e,t),zR(r,e,t)}ro.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zm(this,r,e,n5)};ro.ancestors=ro.parents;var rs,VR;rs=VR={data:xr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:xr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:xr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:xr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:xr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};rs.attr=rs.data;rs.removeAttr=rs.removeData;var a5=VR,hl={};function Sd(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var n=0,a=t[0],i=a._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(n+=r(a,s))}return n}else return}}Ye(hl,{degree:Sd(function(r,e){return e.source().same(e.target())?2:1}),indegree:Sd(function(r,e){return e.target().same(r)?1:0}),outdegree:Sd(function(r,e){return e.source().same(r)?1:0})});function Li(r,e){return function(t){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],s=o[r](t);s!==void 0&&(n===void 0||e(s,n))&&(n=s)}return n}}Ye(hl,{minDegree:Li("degree",function(r,e){return r<e}),maxDegree:Li("degree",function(r,e){return r>e}),minIndegree:Li("indegree",function(r,e){return r<e}),maxIndegree:Li("indegree",function(r,e){return r>e}),minOutdegree:Li("outdegree",function(r,e){return r<e}),maxOutdegree:Li("outdegree",function(r,e){return r>e})});Ye(hl,{totalDegree:function(e){for(var t=0,n=this.nodes(),a=0;a<n.length;a++)t+=n[a].degree(e);return t}});var bn,GR,WR=function(e,t,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,s={x:t.x!=null?t.x-o.x:0,y:t.y!=null?t.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,n),i.dirtyBoundingBoxCache()}}},wx={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){WR(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};bn=GR={position:xr.data(wx),silentPosition:xr.data(Ye({},wx,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){WR(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(pr(e))t?this.silentPosition(e):this.position(e);else if(zr(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=n(o,i))&&(t?o.silentPosition(s):o.position(s))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var a;if(pr(e)?(a={x:Me(e.x)?e.x:0,y:Me(e.y)?e.y:0},n=t):Ke(e)&&Me(t)&&(a={x:0,y:0},a[e]=t),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var l=s.position(),u={x:l.x+a.x,y:l.y+a.y};n?s.silentPosition(u):s.position(u)}}i.endBatch()}return this},silentShift:function(e,t){return pr(e)?this.shift(e,!0):Ke(e)&&Me(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),s=pr(e)?e:void 0,l=s!==void 0||t!==void 0&&Ke(e);if(n&&n.isNode())if(l)for(var u=0;u<this.length;u++){var c=this[u];t!==void 0?c.position(e,(t-o[e])/i):s!==void 0&&c.position(mR(s,i,o))}else{var d=n.position();return s=ul(d,i,o),e===void 0?s:s[e]}else if(!l)return;return this},relativePosition:function(e,t){var n=this[0],a=this.cy(),i=pr(e)?e:void 0,o=i!==void 0||t!==void 0&&Ke(e),s=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var l=0;l<this.length;l++){var u=this[l],c=s?u.parent():null,d=c&&c.length>0,h=d;d&&(c=c[0]);var g=h?c.position():{x:0,y:0};t!==void 0?u.position(e,t+g[e]):i!==void 0&&u.position({x:i.x+g.x,y:i.y+g.y})}else{var p=n.position(),E=s?n.parent():null,y=E&&E.length>0,b=y;y&&(E=E[0]);var w=b?E.position():{x:0,y:0};return i={x:p.x-w.x,y:p.y-w.y},e===void 0?i:i[e]}else if(!o)return;return this}};bn.modelPosition=bn.point=bn.position;bn.modelPositions=bn.points=bn.positions;bn.renderedPoint=bn.renderedPosition;bn.relativePoint=bn.relativePosition;var i5=GR,Xi,ka;Xi=ka={};ka.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),a=t.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,s=e.y1*n+a.y,l=e.y2*n+a.y;return{x1:i,x2:o,y1:s,y2:l,w:o-i,h:l-s}};ka.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};ka.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(o){if(!o.isParent())return;var s=o._private,l=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",c={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=s.position;(d.w===0||d.h===0)&&(d={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},d.x1=h.x-d.w/2,d.x2=h.x+d.w/2,d.y1=h.y-d.h/2,d.y2=h.y+d.h/2);function g(P,I,D){var k=0,M=0,N=I+D;return P>0&&N>0&&(k=I/N*P,M=D/N*P),{biasDiff:k,biasComplementDiff:M}}function p(P,I,D,k){if(D.units==="%")switch(k){case"width":return P>0?D.pfValue*P:0;case"height":return I>0?D.pfValue*I:0;case"average":return P>0&&I>0?D.pfValue*(P+I)/2:0;case"min":return P>0&&I>0?P>I?D.pfValue*I:D.pfValue*P:0;case"max":return P>0&&I>0?P>I?D.pfValue*P:D.pfValue*I:0;default:return 0}else return D.units==="px"?D.pfValue:0}var E=c.width.left.value;c.width.left.units==="px"&&c.width.val>0&&(E=E*100/c.width.val);var y=c.width.right.value;c.width.right.units==="px"&&c.width.val>0&&(y=y*100/c.width.val);var b=c.height.top.value;c.height.top.units==="px"&&c.height.val>0&&(b=b*100/c.height.val);var w=c.height.bottom.value;c.height.bottom.units==="px"&&c.height.val>0&&(w=w*100/c.height.val);var x=g(c.width.val-d.w,E,y),C=x.biasDiff,T=x.biasComplementDiff,S=g(c.height.val-d.h,b,w),_=S.biasDiff,A=S.biasComplementDiff;s.autoPadding=p(d.w,d.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(d.w,c.width.val),h.x=(-C+d.x1+d.x2+T)/2,s.autoHeight=Math.max(d.h,c.height.val),h.y=(-_+d.y1+d.y2+A)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||r)&&(t(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var sn=function(e){return e===1/0||e===-1/0?0:e},mn=function(e,t,n,a,i){a-t===0||i-n===0||t==null||n==null||a==null||i==null||(e.x1=t<e.x1?t:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},pa=function(e,t){return t==null?e:mn(e,t.x1,t.y1,t.x2,t.y2)},Do=function(e,t,n){return Nt(e,t,n)},xu=function(e,t,n){if(!t.cy().headless()){var a=t._private,i=a.rstyle,o=i.arrowWidth/2,s=t.pstyle(n+"-arrow-shape").value,l,u;if(s!=="none"){n==="source"?(l=i.srcX,u=i.srcY):n==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var c=a.arrowBounds=a.arrowBounds||{},d=c[n]=c[n]||{};d.x1=l-o,d.y1=u-o,d.x2=l+o,d.y2=u+o,d.w=d.x2-d.x1,d.h=d.y2-d.y1,Iu(d,1),mn(e,d.x1,d.y1,d.x2,d.y2)}}},Td=function(e,t,n){if(!t.cy().headless()){var a;n?a=n+"-":a="";var i=t._private,o=i.rstyle,s=t.pstyle(a+"label").strValue;if(s){var l=t.pstyle("text-halign"),u=t.pstyle("text-valign"),c=Do(o,"labelWidth",n),d=Do(o,"labelHeight",n),h=Do(o,"labelX",n),g=Do(o,"labelY",n),p=t.pstyle(a+"text-margin-x").pfValue,E=t.pstyle(a+"text-margin-y").pfValue,y=t.isEdge(),b=t.pstyle(a+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,x=t.pstyle("text-border-width").pfValue,C=x/2,T=t.pstyle("text-background-padding").pfValue,S=2,_=d,A=c,P=A/2,I=_/2,D,k,M,N;if(y)D=h-P,k=h+P,M=g-I,N=g+I;else{switch(l.value){case"left":D=h-A,k=h;break;case"center":D=h-P,k=h+P;break;case"right":D=h,k=h+A;break}switch(u.value){case"top":M=g-_,N=g;break;case"center":M=g-I,N=g+I;break;case"bottom":M=g,N=g+_;break}}var z=p-Math.max(w,C)-T-S,$=p+Math.max(w,C)+T+S,q=E-Math.max(w,C)-T-S,V=E+Math.max(w,C)+T+S;D+=z,k+=$,M+=q,N+=V;var Z=n||"main",K=i.labelBounds,j=K[Z]=K[Z]||{};j.x1=D,j.y1=M,j.x2=k,j.y2=N,j.w=k-D,j.h=N-M,j.leftPad=z,j.rightPad=$,j.topPad=q,j.botPad=V;var ee=y&&b.strValue==="autorotate",le=b.pfValue!=null&&b.pfValue!==0;if(ee||le){var W=ee?Do(i.rstyle,"labelAngle",n):b.pfValue,G=Math.cos(W),Y=Math.sin(W),re=(D+k)/2,de=(M+N)/2;if(!y){switch(l.value){case"left":re=k;break;case"right":re=D;break}switch(u.value){case"top":de=N;break;case"bottom":de=M;break}}var se=function(U,fe){return U=U-re,fe=fe-de,{x:U*G-fe*Y+re,y:U*Y+fe*G+de}},X=se(D,M),Q=se(D,N),ae=se(k,M),te=se(k,N);D=Math.min(X.x,Q.x,ae.x,te.x),k=Math.max(X.x,Q.x,ae.x,te.x),M=Math.min(X.y,Q.y,ae.y,te.y),N=Math.max(X.y,Q.y,ae.y,te.y)}var ce=Z+"Rot",_e=K[ce]=K[ce]||{};_e.x1=D,_e.y1=M,_e.x2=k,_e.y2=N,_e.w=k-D,_e.h=N-M,mn(e,D,M,k,N),mn(i.labelBounds.all,D,M,k,N)}return e}},xx=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,a=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,o=a+i;UR(e,t,n,o,"outside",o/2)}},UR=function(e,t,n,a,i,o){if(!(n===0||a<=0||i==="inside")){var s=t.cy(),l=t.pstyle("shape").value,u=s.renderer().nodeShapes[l],c=t.position(),d=c.x,h=c.y,g=t.width(),p=t.height();if(u.hasMiterBounds){i==="center"&&(a/=2);var E=u.miterBounds(d,h,g,p,a);pa(e,E)}else o!=null&&o>0&&Du(e,[o,o,o,o])}},o5=function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,a=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;UR(e,t,n,a,i)}},s5=function(e,t){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Dt(),s=e._private,l=e.isNode(),u=e.isEdge(),c,d,h,g,p,E,y=s.rstyle,b=l&&a?e.pstyle("bounds-expansion").pfValue:[0],w=function(ve){return ve.pstyle("display").value!=="none"},x=!a||w(e)&&(!u||w(e.source())&&w(e.target()));if(x){var C=0,T=0;a&&t.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(T=e.pstyle("overlay-padding").value));var S=0,_=0;a&&t.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(_=e.pstyle("underlay-padding").value));var A=Math.max(T,_),P=0,I=0;if(a&&(P=e.pstyle("width").pfValue,I=P/2),l&&t.includeNodes){var D=e.position();p=D.x,E=D.y;var k=e.outerWidth(),M=k/2,N=e.outerHeight(),z=N/2;c=p-M,d=p+M,h=E-z,g=E+z,mn(o,c,h,d,g),a&&xx(o,e),a&&t.includeOutlines&&!i&&xx(o,e),a&&o5(o,e)}else if(u&&t.includeEdges)if(a&&!i){var $=e.pstyle("curve-style").strValue;if(c=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),g=Math.max(y.srcY,y.midY,y.tgtY),c-=I,d+=I,h-=I,g+=I,mn(o,c,h,d,g),$==="haystack"){var q=y.haystackPts;if(q&&q.length===2){if(c=q[0].x,h=q[0].y,d=q[1].x,g=q[1].y,c>d){var V=c;c=d,d=V}if(h>g){var Z=h;h=g,g=Z}mn(o,c-I,h-I,d+I,g+I)}}else if($==="bezier"||$==="unbundled-bezier"||ya($,"segments")||ya($,"taxi")){var K;switch($){case"bezier":case"unbundled-bezier":K=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":K=y.linePts;break}if(K!=null)for(var j=0;j<K.length;j++){var ee=K[j];c=ee.x-I,d=ee.x+I,h=ee.y-I,g=ee.y+I,mn(o,c,h,d,g)}}}else{var le=e.source(),W=le.position(),G=e.target(),Y=G.position();if(c=W.x,d=Y.x,h=W.y,g=Y.y,c>d){var re=c;c=d,d=re}if(h>g){var de=h;h=g,g=de}c-=I,d+=I,h-=I,g+=I,mn(o,c,h,d,g)}if(a&&t.includeEdges&&u&&(xu(o,e,"mid-source"),xu(o,e,"mid-target"),xu(o,e,"source"),xu(o,e,"target")),a){var se=e.pstyle("ghost").value==="yes";if(se){var X=e.pstyle("ghost-offset-x").pfValue,Q=e.pstyle("ghost-offset-y").pfValue;mn(o,o.x1+X,o.y1+Q,o.x2+X,o.y2+Q)}}var ae=s.bodyBounds=s.bodyBounds||{};ow(ae,o),Du(ae,b),Iu(ae,1),a&&(c=o.x1,d=o.x2,h=o.y1,g=o.y2,mn(o,c-A,h-A,d+A,g+A));var te=s.overlayBounds=s.overlayBounds||{};ow(te,o),Du(te,b),Iu(te,1);var ce=s.labelBounds=s.labelBounds||{};ce.all!=null?VN(ce.all):ce.all=Dt(),a&&t.includeLabels&&(t.includeMainLabels&&Td(o,e,null),u&&(t.includeSourceLabels&&Td(o,e,"source"),t.includeTargetLabels&&Td(o,e,"target")))}return o.x1=sn(o.x1),o.y1=sn(o.y1),o.x2=sn(o.x2),o.y2=sn(o.y2),o.w=sn(o.x2-o.x1),o.h=sn(o.y2-o.y1),o.w>0&&o.h>0&&x&&(Du(o,b),Iu(o,1)),o},HR=function(e){var t=0,n=function(o){return(o?1:0)<<t++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},KR=function(e){var t=function(s){return Math.round(s)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return ew([t(n.x),t(n.y),t(a.x),t(a.y)])}else{var i=e.position();return ew([t(i.x),t(i.y)])}},Ex=function(e,t){var n=e._private,a,i=e.isEdge(),o=t==null?Cx:HR(t),s=o===Cx;if(n.bbCache==null?(a=s5(e,ts),n.bbCache=a,n.bbCachePosKey=KR(e)):a=n.bbCache,!s){var l=e.isNode();a=Dt(),(t.includeNodes&&l||t.includeEdges&&!l)&&(t.includeOverlays?pa(a,n.overlayBounds):pa(a,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?pa(a,n.labelBounds.all):(t.includeMainLabels&&pa(a,n.labelBounds.mainRot),t.includeSourceLabels&&pa(a,n.labelBounds.sourceRot),t.includeTargetLabels&&pa(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},ts={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Cx=HR(ts),_x=yt(ts);ka.boundingBox=function(r){var e,t=r===void 0||r.useCache===void 0||r.useCache===!0,n=Ji(function(c){var d=c._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==KR(c)},function(c){return c.id()});if(t&&this.length===1&&!n(this[0]))r===void 0?r=ts:r=_x(r),e=Ex(this[0],r);else{e=Dt(),r=r||ts;var a=_x(r),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),s&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var l=0;l<i.length;l++){var u=i[l];n(u)&&u.dirtyBoundingBoxCache(),pa(e,Ex(u,a))}}return e.x1=sn(e.x1),e.y1=sn(e.y1),e.x2=sn(e.x2),e.y2=sn(e.y2),e.w=sn(e.x2-e.x1),e.h=sn(e.y2-e.y1),e};ka.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};ka.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),n=t.hasCompoundNodes(),a=t.collection();if(n&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),pr(r)){var i=r;r=function(){return i}}var o=function(c,d){return c._private.bbAtOldPos=r(c,d)},s=function(c){return c._private.bbAtOldPos};t.startBatch(),e.forEach(o).silentPositions(r),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var l=$N(this.boundingBox({useCache:!1}));return e.silentPositions(s),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),t.endBatch(),l};Xi.boundingbox=Xi.bb=Xi.boundingBox;Xi.renderedBoundingbox=Xi.renderedBoundingBox;var u5=ka,No,ps;No=ps={};var jR=function(e){e.uppercaseName=F1(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=F1(e.outerName),No[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var s=n.pstyle(e.name);switch(s.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},No["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var s=n[e.name](),l=n.pstyle("border-position").value,u;l==="center"?u=n.pstyle("border-width").pfValue:l==="outside"?u=2*n.pstyle("border-width").pfValue:u=0;var c=2*n.padding();return s+u+c}else return 1},No["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},No["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};jR({name:"width"});jR({name:"height"});ps.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue};ps.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};ps.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var l5=ps,f5=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},c5=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return ul(t(e),n.zoom(),n.pan())}},d5=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return t(e).map(function(o){return ul(o,i,a)})}},v5=function(e){return e.renderer().getControlPoints(e)},h5=function(e){return e.renderer().getSegmentPoints(e)},g5=function(e){return e.renderer().getSourceEndpoint(e)},p5=function(e){return e.renderer().getTargetEndpoint(e)},y5=function(e){return e.renderer().getEdgeMidpoint(e)},Sx={controlPoints:{get:v5,mult:!0},segmentPoints:{get:h5,mult:!0},sourceEndpoint:{get:g5},targetEndpoint:{get:p5},midpoint:{get:y5}},m5=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},b5=Object.keys(Sx).reduce(function(r,e){var t=Sx[e],n=m5(e);return r[e]=function(){return f5(this,t.get)},t.mult?r[n]=function(){return d5(this,t.get)}:r[n]=function(){return c5(this,t.get)},r},{}),w5=Ye({},i5,u5,l5,b5);/*!
|
|
9
9
|
Event object based on jQuery events, MIT license
|
|
10
10
|
|
|
11
11
|
https://jquery.org/license/
|
|
12
12
|
https://tldrlegal.com/license/mit-license
|
|
13
13
|
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
14
|
-
*/var G2=function(e,t){this.recycle(e,t)};function Io(){return!1}function xu(){return!0}G2.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Io,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?xu:Io):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=xu;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=xu;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=xu,this.stopPropagation()},isDefaultPrevented:Io,isPropagationStopped:Io,isImmediatePropagationStopped:Io};var W2=/^([^.]+)(\.(?:[^.]+))?$/,o5=".*",U2={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ex=Object.keys(U2),s5={};function hl(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s5,e=arguments.length>1?arguments[1]:void 0,t=0;t<Ex.length;t++){var n=Ex[t];this[n]=r[n]||U2[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ta=hl.prototype,H2=function(e,t,n,a,i,o,s){Nr(a)&&(i=a,a=null),s&&(o==null?o=s:o=He({},o,s));for(var u=Sr(n)?n:n.split(/\s+/),l=0;l<u.length;l++){var c=u[l];if(!xa(c)){var v=c.match(W2);if(v){var h=v[1],g=v[2]?v[2]:null,p=t(e,c,h,g,a,i,o);if(p===!1)break}}}},_x=function(e,t){return e.addEventFields(e.context,t),new G2(t.type,t)},u5=function(e,t,n){if(hq(n)){t(e,n);return}else if(pr(n)){t(e,_x(e,n));return}for(var a=Sr(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!xa(o)){var s=o.match(W2);if(s){var u=s[1],l=s[2]?s[2]:null,c=_x(e,{type:u,namespace:l,target:e.context});t(e,c)}}}};Ta.on=Ta.addListener=function(r,e,t,n,a){return H2(this,function(i,o,s,u,l,c,v){Nr(c)&&i.listeners.push({event:o,callback:c,type:s,namespace:u,qualifier:l,conf:v})},r,e,t,n,a),this};Ta.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})};Ta.removeListener=Ta.off=function(r,e,t,n){var a=this;this.emitting!==0&&(this.listeners=Zq(this.listeners));for(var i=this.listeners,o=function(l){var c=i[l];H2(a,function(v,h,g,p,E,m){if((c.type===g||r==="*")&&(!p&&c.namespace!==".*"||c.namespace===p)&&(!E||v.qualifierCompare(c.qualifier,E))&&(!m||c.callback===m))return i.splice(l,1),!1},r,e,t,n)},s=i.length-1;s>=0;s--)o(s);return this};Ta.removeAllListeners=function(){return this.removeListener("*")};Ta.emit=Ta.trigger=function(r,e,t){var n=this.listeners,a=n.length;return this.emitting++,Sr(e)||(e=[e]),u5(this,function(i,o){t!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:t}],a=n.length);for(var s=function(){var c=n[u];if(c.type===o.type&&(!c.namespace||c.namespace===o.namespace||c.namespace===o5)&&i.eventMatches(i.context,c,o)){var v=[o];e!=null&&Qq(v,e),i.beforeEmit(i.context,c,o),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==c}));var h=i.callbackContext(i.context,c,o),g=c.callback.apply(h,v);i.afterEmit(i.context,c,o),g===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<a;u++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},r),this.emitting--,this};var l5={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&ls(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Eu=function(e){return Ge(e)?new Ca(e):e},K2={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new hl(l5,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var a=Eu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,t,n){for(var a=Eu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,n){for(var a=Eu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,t,n){for(var a=Eu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};xr.eventAliasesOn(K2);var j2={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):t.push(a)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(Ge(e)||jt(e))return new Ca(e).filter(this);if(Nr(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);s&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ge(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||t.push(a)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ge(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,s=o?a:i,u=o?i:a,l=0;l<s.length;l++){var c=s[l];u.has(c)&&n.push(c)}return n},xor:function(e){var t=this._private.cy;Ge(e)&&(e=t.$(e));var n=this.spawn(),a=this,i=e,o=function(u,l){for(var c=0;c<u.length;c++){var v=u[c],h=v._private.data.id,g=l.hasElementWithId(h);g||n.push(v)}};return o(a,i),o(i,a),n},diff:function(e){var t=this._private.cy;Ge(e)&&(e=t.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,s=e,u=function(c,v,h){for(var g=0;g<c.length;g++){var p=c[g],E=p._private.data.id,m=v.hasElementWithId(E);m?i.merge(p):h.push(p)}};return u(o,s,n),u(s,o,a),{left:n,right:a,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(Ge(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&a.push(o)}return a},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&Ge(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=t.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id,l=!i.has(u);if(l){var c=this.length++;this[c]=s,i.set(u,{ele:s,index:c})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,u=this[s],l=u._private.data.id;this[s]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,a=t.map,i=a.get(n);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&Ge(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);n.push(s)}return n},reduce:function(e,t){for(var n=t,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,t){for(var n=-1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],u=t?e.apply(t,[s,o,i]):e(s,o,i);u>n&&(n=u,a=s)}return{value:n,ele:a}},min:function(e,t){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],u=t?e.apply(t,[s,o,i]):e(s,o,i);u<n&&(n=u,a=s)}return{value:n,ele:a}}},yr=j2;yr.u=yr["|"]=yr["+"]=yr.union=yr.or=yr.add;yr["\\"]=yr["!"]=yr["-"]=yr.difference=yr.relativeComplement=yr.subtract=yr.not;yr.n=yr["&"]=yr["."]=yr.and=yr.intersection=yr.intersect;yr["^"]=yr["(+)"]=yr["(-)"]=yr.symmetricDifference=yr.symdiff=yr.xor;yr.fnFilter=yr.filterFn=yr.stdFilter=yr.filter;yr.complement=yr.abscomp=yr.absoluteComplement;var f5={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Y2=function(e,t){var n=e.cy(),a=n.hasCompoundNodes();function i(c){var v=c.pstyle("z-compound-depth");return v.value==="auto"?a?c.zDepth():0:v.value==="bottom"?-1:v.value==="top"?Am:0}var o=i(e)-i(t);if(o!==0)return o;function s(c){var v=c.pstyle("z-index-compare");return v.value==="auto"&&c.isNode()?1:0}var u=s(e)-s(t);if(u!==0)return u;var l=e.pstyle("z-index").value-t.pstyle("z-index").value;return l!==0?l:e.poolIndex()-t.poolIndex()},Yu={forEach:function(e,t){if(Nr(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=t?e.apply(t,[i,a,this]):e(i,a,this);if(o===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],a=this.length;t==null&&(t=a),e==null&&(e=0),e<0&&(e=a+e),t<0&&(t=a+t);for(var i=e;i>=0&&i<t&&i<a;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Nr(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Y2)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var a=t.data.parent?e.parents().size():0;return e.isParent()?a:Am-1}else{var i=t.source,o=t.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};Yu.each=Yu.forEach;var c5=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":et(Symbol))!=e&&et(Symbol.iterator)!=e;t&&(Yu[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return KR({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};c5();var d5=ht({nodeDimensionsIncludeLabels:!1}),Bu={layoutDimensions:function(e){e=d5(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var a=this.nodes().filter(function(C){return!C.isParent()}),i=this.cy(),o=t.eles,s=function(R){return R.id()},u=Qi(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(R,S,A){var P={x:S.x1+S.w/2,y:S.y1+S.h/2},I={x:(A.x-P.x)*R,y:(A.y-P.y)*R};return{x:P.x+I.x,y:P.y+I.y}},c=t.spacingFactor&&t.spacingFactor!==1,v=function(){if(!c)return null;for(var R=Dt(),S=0;S<a.length;S++){var A=a[S],P=u(A,S);v2(R,P.x,P.y)}return R},h=v(),g=Qi(function(C,R){var S=u(C,R);if(c){var A=Math.abs(t.spacingFactor);S=l(A,h,S)}return t.transform!=null&&(S=t.transform(C,S)),S},s);if(t.animate){for(var p=0;p<a.length;p++){var E=a[p],m=g(E,p),b=t.animateFilter==null||t.animateFilter(E,p);if(b){var w=E.animation({position:m,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}else E.position(m)}if(t.fit){var x=i.animation({fit:{boundingBox:o.boundingBoxAt(g),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(x)}else if(t.zoom!==void 0&&t.pan!==void 0){var _=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(_)}e.animations.forEach(function(C){return C.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),to.all(e.animations.map(function(C){return C.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(g),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(He({},e,{eles:this}))}};Bu.createLayout=Bu.makeLayout=Bu.layout;function Z2(r,e,t){var n=t._private,a=n.styleCache=n.styleCache||[],i;return(i=a[r])!=null||(i=a[r]=e(t)),i}function gl(r,e){return r=ti(r),function(n){return Z2(r,e,n)}}function pl(r,e){r=ti(r);var t=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Z2(r,t,a)}}var dt={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),a=t.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(a){t(a),a.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var n=t._private.batchStyleEles;return n.merge(this),this}var a=t.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var i=n._private.style[e];return i??(t?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(pr(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ge(e))if(t===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,t,a),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,a=t.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];a.removeAllBypasses(s,n)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];a.removeBypasses(l,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=a.data.parent?n.parents():null;if(o)for(var s=0;s<o.length;s++){var u=o[s],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();if(t)return n?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function Rd(r,e){var t=r._private,n=t.data.parent?r.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function zm(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,n=r.parentOk||r.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],o=a.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||Rd(i,n);var u=s.source,l=s.target;return t(u)&&(!o||Rd(u,t))&&(u===l||t(l)&&(!o||Rd(l,t)))}}}var no=gl("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});dt.takesUpSpace=pl("takesUpSpace",zm({ok:no}));var v5=gl("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&no(r)}),h5=gl("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&no(r)});dt.interactive=pl("interactive",zm({ok:v5,parentOk:h5,edgeOkViaNode:no}));dt.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var g5=gl("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&no(r)}),p5=no;dt.visible=pl("visible",zm({ok:g5,edgeOkViaNode:p5}));dt.hidden=function(){var r=this[0];if(r)return!r.visible()};dt.isBundledBezier=pl("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});dt.bypass=dt.css=dt.style;dt.renderedCss=dt.renderedStyle;dt.removeBypass=dt.removeCss=dt.removeStyle;dt.pstyle=dt.parsedStyle;var wa={};function Cx(r){return function(){var e=arguments,t=[];if(e.length===2){var n=e[0],a=e[1];this.on(r.event,n,a)}else if(e.length===1&&Nr(e[0])){var i=e[0];this.on(r.event,i)}else if(e.length===0||e.length===1&&Sr(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!r.ableField||u._private[r.ableField],c=u._private[r.field]!=r.value;if(r.overrideAble){var v=r.overrideAble(u);if(v!==void 0&&(l=v,!v))return this}l&&(u._private[r.field]=r.value,c&&t.push(u))}var h=this.spawn(t);h.updateStyle(),h.emit(r.event),o&&h.emit(o)}return this}}function ao(r){wa[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},wa[r.on]=Cx({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),wa[r.off]=Cx({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}ao({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});ao({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});ao({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});ao({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});wa.deselect=wa.unselect;wa.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};ao({field:"active",on:"activate",off:"unactivate"});ao({field:"pannable",on:"panify",off:"unpanify"});wa.inactive=function(){var r=this[0];if(r)return!r._private.active};var xt={},Sx=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var s=a[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),c=0;c<l.length;c++){var v=l[c],h=v.source(),g=v.target();if(e.noIncomingEdges&&g===s&&h!==s||e.noOutgoingEdges&&h===s&&g!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(n)}},Tx=function(e){return function(t){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],c=l.source(),v=l.target();e.outgoing&&c===o?(a.push(l),a.push(v)):e.incoming&&v===o&&(a.push(l),a.push(c))}}return this.spawn(a,!0).filter(t)}},Rx=function(e){return function(t){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],c=l.id();i[c]||(i[c]=!0,a.push(l),s=!0)}if(!s)break;n=o}return this.spawn(a,!0).filter(t)}};xt.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};He(xt,{roots:Sx({noIncomingEdges:!0}),leaves:Sx({noOutgoingEdges:!0}),outgoers:un(Tx({outgoing:!0}),"outgoers"),successors:Rx({outgoing:!0}),incomers:un(Tx({incoming:!0}),"incomers"),predecessors:Rx({})});He(xt,{neighborhood:un(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var a=t[n],i=a.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),c=a===u?l:u;c.length>0&&e.push(c[0]),e.push(s[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});xt.neighbourhood=xt.neighborhood;xt.closedNeighbourhood=xt.closedNeighborhood;xt.openNeighbourhood=xt.openNeighborhood;He(xt,{source:un(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:un(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Ax({attr:"source"}),targets:Ax({attr:"target"})});function Ax(r){return function(t){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[r.attr];o&&n.push(o)}return this.spawn(n,!0).filter(t)}}He(xt,{edgesWith:un(Px(),"edgesWith"),edgesTo:un(Px({thisIsSrc:!0}),"edgesTo")});function Px(r){return function(t){var n=[],a=this._private.cy,i=r||{};Ge(t)&&(t=a.$(t));for(var o=0;o<t.length;o++)for(var s=t[o]._private.edges,u=0;u<s.length;u++){var l=s[u],c=l._private.data,v=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),h=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target),g=v||h;g&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!v||i.thisIsTgt&&!h)||n.push(l))}return this.spawn(n,!0)}}He(xt,{connectedEdges:un(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];if(a.isNode())for(var i=a._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:un(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:un(Dx(),"parallelEdges"),codirectedEdges:un(Dx({codirected:!0}),"codirectedEdges")});function Dx(r){var e={codirected:!1};return r=He({},e,r),function(n){for(var a=[],i=this.edges(),o=r,s=0;s<i.length;s++)for(var u=i[s],l=u._private,c=l.source,v=c._private.data.id,h=l.data.target,g=c._private.edges,p=0;p<g.length;p++){var E=g[p],m=E._private.data,b=m.target,w=m.source,x=b===h&&w===v,_=v===b&&h===w;(o.codirected&&x||!o.codirected&&(x||_))&&a.push(E)}return this.spawn(a,!0).filter(n)}}He(xt,{components:function(e){var t=this,n=t.cy(),a=n.collection(),i=e==null?t.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(c,v){a.merge(c),i.unmerge(c),v.merge(c)};if(i.empty())return t.spawn();var u=function(){var c=n.collection();o.push(c);var v=i[0];s(v,c),t.bfs({directed:!1,roots:v,visit:function(g){return s(g,c)}}),c.forEach(function(h){h.connectedEdges().forEach(function(g){t.has(g)&&c.has(g.source())&&c.has(g.target())&&c.merge(g)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});xt.componentsOf=xt.components;var vt=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Mr("A collection must have a reference to the core");return}var i=new Kn,o=!1;if(!t)t=[];else if(t.length>0&&pr(t[0])&&!ls(t[0])){o=!0;for(var s=[],u=new ro,l=0,c=t.length;l<c;l++){var v=t[l];v.data==null&&(v.data={});var h=v.data;if(h.id==null)h.id=f2();else if(e.hasElementWithId(h.id)||u.has(h.id))continue;var g=new ol(e,v,!1);s.push(g),u.add(h.id)}t=s}this.length=0;for(var p=0,E=t.length;p<E;p++){var m=t[p][0];if(m!=null){var b=m._private.data.id;(!n||!i.has(b))&&(n&&i.set(b,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(w){this.lazyMap=w},rebuildMap:function(){for(var x=this.lazyMap=new Kn,_=this.eles,C=0;C<_.length;C++){var R=_[C];x.set(R.id(),{index:C,ele:R})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Ar=ol.prototype=vt.prototype=Object.create(Array.prototype);Ar.instanceString=function(){return"collection"};Ar.spawn=function(r,e){return new vt(this.cy(),r,e)};Ar.spawnSelf=function(){return this.spawn(this)};Ar.cy=function(){return this._private.cy};Ar.renderer=function(){return this._private.cy.renderer()};Ar.element=function(){return this[0]};Ar.collection=function(){return ZR(this)?this:new vt(this._private.cy,[this])};Ar.unique=function(){return new vt(this._private.cy,this,!0)};Ar.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)};Ar.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new vt(e)};Ar.$id=Ar.getElementById;Ar.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index};Ar.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index};Ar.indexOfId=function(r){return r=""+r,this._private.map.get(r).index};Ar.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var n=e._private;if(pr(r)){if(t.startBatch(),r.data){e.data(r.data);var a=n.data;if(e.isEdge()){var i=!1,o={},s=r.data.source,u=r.data.target;s!=null&&s!=a.source&&(o.source=""+s,i=!0),u!=null&&u!=a.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in r.data,c=r.data.parent;l&&(c!=null||a.parent!=null)&&c!=a.parent&&(c===void 0&&(c=null),c!=null&&(c=""+c),e=e.move({parent:c}))}}r.position&&e.position(r.position);var v=function(E,m,b){var w=r[E];w!=null&&w!==n[E]&&(w?e[m]():e[b]())};return v("removed","remove","restore"),v("selected","select","unselect"),v("selectable","selectify","unselectify"),v("locked","lock","unlock"),v("grabbable","grabify","ungrabify"),v("pannable","panify","unpanify"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var h={data:Dn(n.data),position:Dn(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};h.classes="";var g=0;return n.classes.forEach(function(p){return h.classes+=g++===0?p:" "+p}),h}}};Ar.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],n=t.json();r.push(n)}return r};Ar.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var n=this[t],a=n.json(),i=new ol(r,a,!1);e.push(i)}return new vt(r,e)};Ar.copy=Ar.clone;Ar.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=t.cy(),a=n._private,i=[],o=[],s,u=0,l=t.length;u<l;u++){var c=t[u];e&&!c.removed()||(c.isNode()?i.push(c):o.push(c))}s=i.concat(o);var v,h=function(){s.splice(v,1),v--};for(v=0;v<s.length;v++){var g=s[v],p=g._private,E=p.data;if(g.clearTraversalCache(),!(!e&&!p.removed)){if(E.id===void 0)E.id=f2();else if(De(E.id))E.id=""+E.id;else if(xa(E.id)||!Ge(E.id)){Mr("Can not create element with invalid string ID `"+E.id+"`"),h();continue}else if(n.hasElementWithId(E.id)){Mr("Can not create second element with ID `"+E.id+"`"),h();continue}}var m=E.id;if(g.isNode()){var b=p.position;b.x==null&&(b.x=0),b.y==null&&(b.y=0)}if(g.isEdge()){for(var w=g,x=["source","target"],_=x.length,C=!1,R=0;R<_;R++){var S=x[R],A=E[S];De(A)&&(A=E[S]=""+E[S]),A==null||A===""?(Mr("Can not create edge `"+m+"` with unspecified "+S),C=!0):n.hasElementWithId(A)||(Mr("Can not create edge `"+m+"` with nonexistant "+S+" `"+A+"`"),C=!0)}if(C){h();continue}var P=n.getElementById(E.source),I=n.getElementById(E.target);P.same(I)?P._private.edges.push(w):(P._private.edges.push(w),I._private.edges.push(w)),w._private.source=P,w._private.target=I}p.map=new Kn,p.map.set(m,{ele:g,index:0}),p.removed=!1,e&&n.addToPool(g)}for(var D=0;D<i.length;D++){var M=i[D],O=M._private.data;De(O.parent)&&(O.parent=""+O.parent);var N=O.parent,V=N!=null;if(V||M._private.parent){var $=M._private.parent?n.collection().merge(M._private.parent):n.getElementById(N);if($.empty())O.parent=void 0;else if($[0].removed())Er("Node added with missing parent, reference to parent removed"),O.parent=void 0,M._private.parent=null;else{for(var G=!1,U=$;!U.empty();){if(M.same(U)){G=!0,O.parent=void 0;break}U=U.parent()}G||($[0]._private.children.push(M),M._private.parent=$[0],a.hasCompoundNodes=!0)}}}if(s.length>0){for(var J=s.length===t.length?t:new vt(n,s),W=0;W<J.length;W++){var H=J[W];H.isNode()||(H.parallelEdges().clearTraversalCache(),H.source().clearTraversalCache(),H.target().clearTraversalCache())}var Z;a.hasCompoundNodes?Z=n.collection().merge(J).merge(J.connectedNodes()).merge(J.parent()):Z=J,Z.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?J.emitAndNotify("add"):e&&J.emit("add")}return t};Ar.removed=function(){var r=this[0];return r&&r._private.removed};Ar.inside=function(){var r=this[0];return r&&!r._private.removed};Ar.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=[],a={},i=t._private.cy;function o(N){for(var V=N._private.edges,$=0;$<V.length;$++)u(V[$])}function s(N){for(var V=N._private.children,$=0;$<V.length;$++)u(V[$])}function u(N){var V=a[N.id()];e&&N.removed()||V||(a[N.id()]=!0,N.isNode()?(n.push(N),o(N),s(N)):n.unshift(N))}for(var l=0,c=t.length;l<c;l++){var v=t[l];u(v)}function h(N,V){var $=N._private.edges;Ea($,V),N.clearTraversalCache()}function g(N){N.clearTraversalCache()}var p=[];p.ids={};function E(N,V){V=V[0],N=N[0];var $=N._private.children,G=N.id();Ea($,V),V._private.parent=null,p.ids[G]||(p.ids[G]=!0,p.push(N))}t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var m=0;m<n.length;m++){var b=n[m];if(b.isEdge()){var w=b.source()[0],x=b.target()[0];h(w,b),h(x,b);for(var _=b.parallelEdges(),C=0;C<_.length;C++){var R=_[C];g(R),R.isBundledBezier()&&R.dirtyBoundingBoxCache()}}else{var S=b.parent();S.length!==0&&E(S,b)}e&&(b._private.removed=!0)}var A=i._private.elements;i._private.hasCompoundNodes=!1;for(var P=0;P<A.length;P++){var I=A[P];if(I.isParent()){i._private.hasCompoundNodes=!0;break}}var D=new vt(this.cy(),n);D.size()>0&&(r?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var M=0;M<p.length;M++){var O=p[M];(!e||!O.removed())&&O.updateStyle()}return D};Ar.move=function(r){var e=this._private.cy,t=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(r.source!==void 0||r.target!==void 0){var o=i(r.source),s=i(r.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(e.batch(function(){t.remove(n,a),t.emitAndNotify("moveout");for(var g=0;g<t.length;g++){var p=t[g],E=p._private.data;p.isEdge()&&(u&&(E.source=o),l&&(E.target=s))}t.restore(n,a)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var c=i(r.parent),v=c===null||e.hasElementWithId(c);if(v){var h=c===null?void 0:c;e.batch(function(){var g=t.remove(n,a);g.emitAndNotify("moveout");for(var p=0;p<t.length;p++){var E=t[p],m=E._private.data;E.isNode()&&(m.parent=h)}g.restore(n,a)}),t.emitAndNotify("move")}}return this};[E2,Rz,Iu,ba,eo,Gz,vl,i5,K2,j2,f5,Yu,Bu,dt,wa,xt].forEach(function(r){He(Ar,r)});var y5={add:function(e){var t,n=this;if(jt(e)){var a=e;if(a._private.cy===n)t=a.restore();else{for(var i=[],o=0;o<a.length;o++){var s=a[o];i.push(s.json())}t=new vt(n,i)}}else if(Sr(e)){var u=e;t=new vt(n,u)}else if(pr(e)&&(Sr(e.nodes)||Sr(e.edges))){for(var l=e,c=[],v=["nodes","edges"],h=0,g=v.length;h<g;h++){var p=v[h],E=l[p];if(Sr(E))for(var m=0,b=E.length;m<b;m++){var w=He({group:p},E[m]);c.push(w)}}t=new vt(n,c)}else{var x=e;t=new ol(n,x).collection()}return t},remove:function(e){if(!jt(e)){if(Ge(e)){var t=e;e=this.$(t)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function m5(r,e,t,n){var a=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),c=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var v=0;v<4;++v)if(typeof arguments[v]!="number"||isNaN(arguments[v])||!isFinite(arguments[v]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var h=c?new Float32Array(u):new Array(u);function g(I,D){return 1-3*D+3*I}function p(I,D){return 3*D-6*I}function E(I){return 3*I}function m(I,D,M){return((g(D,M)*I+p(D,M))*I+E(D))*I}function b(I,D,M){return 3*g(D,M)*I*I+2*p(D,M)*I+E(D)}function w(I,D){for(var M=0;M<a;++M){var O=b(D,r,t);if(O===0)return D;var N=m(D,r,t)-I;D-=N/O}return D}function x(){for(var I=0;I<u;++I)h[I]=m(I*l,r,t)}function _(I,D,M){var O,N,V=0;do N=D+(M-D)/2,O=m(N,r,t)-I,O>0?M=N:D=N;while(Math.abs(O)>o&&++V<s);return N}function C(I){for(var D=0,M=1,O=u-1;M!==O&&h[M]<=I;++M)D+=l;--M;var N=(I-h[M])/(h[M+1]-h[M]),V=D+N*l,$=b(V,r,t);return $>=i?w(I,V):$===0?V:_(I,D,D+l)}var R=!1;function S(){R=!0,(r!==e||t!==n)&&x()}var A=function(D){return R||S(),r===e&&t===n?D:D===0?0:D===1?1:m(C(D),e,n)};A.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var P="generateBezier("+[r,e,t,n]+")";return A.toString=function(){return P},A}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var b5=(function(){function r(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:r(o)}}function t(n,a){var i={dx:n.v,dv:r(n)},o=e(n,a*.5,i),s=e(n,a*.5,o),u=e(n,a,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),c=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return n.x=n.x+l*a,n.v=n.v+c*a,n}return function n(a,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,c=1/1e4,v=16/1e3,h,g,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,s.tension=a,s.friction=i,h=o!==null,h?(l=n(a,i),g=l/o*v):g=v;p=t(p||s,g),u.push(1+p.x),l+=16,Math.abs(p.x)>c&&Math.abs(p.v)>c;);return h?function(E){return u[E*(u.length-1)|0]}:l}})(),Rr=function(e,t,n,a){var i=m5(e,t,n,a);return function(o,s,u){return o+(s-o)*i(u)}},Ou={linear:function(e,t,n){return e+(t-e)*n},ease:Rr(.25,.1,.25,1),"ease-in":Rr(.42,0,1,1),"ease-out":Rr(0,0,.58,1),"ease-in-out":Rr(.42,0,.58,1),"ease-in-sine":Rr(.47,0,.745,.715),"ease-out-sine":Rr(.39,.575,.565,1),"ease-in-out-sine":Rr(.445,.05,.55,.95),"ease-in-quad":Rr(.55,.085,.68,.53),"ease-out-quad":Rr(.25,.46,.45,.94),"ease-in-out-quad":Rr(.455,.03,.515,.955),"ease-in-cubic":Rr(.55,.055,.675,.19),"ease-out-cubic":Rr(.215,.61,.355,1),"ease-in-out-cubic":Rr(.645,.045,.355,1),"ease-in-quart":Rr(.895,.03,.685,.22),"ease-out-quart":Rr(.165,.84,.44,1),"ease-in-out-quart":Rr(.77,0,.175,1),"ease-in-quint":Rr(.755,.05,.855,.06),"ease-out-quint":Rr(.23,1,.32,1),"ease-in-out-quint":Rr(.86,0,.07,1),"ease-in-expo":Rr(.95,.05,.795,.035),"ease-out-expo":Rr(.19,1,.22,1),"ease-in-out-expo":Rr(1,0,0,1),"ease-in-circ":Rr(.6,.04,.98,.335),"ease-out-circ":Rr(.075,.82,.165,1),"ease-in-out-circ":Rr(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return Ou.linear;var a=b5(e,t,n);return function(i,o,s){return i+(o-i)*a(s)}},"cubic-bezier":Rr};function Ix(r,e,t,n,a){if(n===1||e===t)return t;var i=a(e,t,n);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function Bx(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Li(r,e,t,n,a){var i=a!=null?a.type:null;t<0?t=0:t>1&&(t=1);var o=Bx(r,a),s=Bx(e,a);if(De(o)&&De(s))return Ix(i,o,s,t,n);if(Sr(o)&&Sr(s)){for(var u=[],l=0;l<s.length;l++){var c=o[l],v=s[l];if(c!=null&&v!=null){var h=Ix(i,c,v,t,n);u.push(h)}else u.push(v)}return u}}function w5(r,e,t,n){var a=!n,i=r._private,o=e._private,s=o.easing,u=o.startTime,l=n?r:r.cy(),c=l.style();if(!o.easingImpl)if(s==null)o.easingImpl=Ou.linear;else{var v;if(Ge(s)){var h=c.parse("transition-timing-function",s);v=h.value}else v=s;var g,p;Ge(v)?(g=v,p=[]):(g=v[1],p=v.slice(2).map(function(J){return+J})),p.length>0?(g==="spring"&&p.push(o.duration),o.easingImpl=Ou[g].apply(null,p)):o.easingImpl=Ou[g]}var E=o.easingImpl,m;if(o.duration===0?m=1:m=(t-u)/o.duration,o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var b=o.startPosition,w=o.position;if(w&&a&&!r.locked()){var x={};Bo(b.x,w.x)&&(x.x=Li(b.x,w.x,m,E)),Bo(b.y,w.y)&&(x.y=Li(b.y,w.y,m,E)),r.position(x)}var _=o.startPan,C=o.pan,R=i.pan,S=C!=null&&n;S&&(Bo(_.x,C.x)&&(R.x=Li(_.x,C.x,m,E)),Bo(_.y,C.y)&&(R.y=Li(_.y,C.y,m,E)),r.emit("pan"));var A=o.startZoom,P=o.zoom,I=P!=null&&n;I&&(Bo(A,P)&&(i.zoom=Qo(i.minZoom,Li(A,P,m,E),i.maxZoom)),r.emit("zoom")),(S||I)&&r.emit("viewport");var D=o.style;if(D&&D.length>0&&a){for(var M=0;M<D.length;M++){var O=D[M],N=O.name,V=O,$=o.startStyle[N],G=c.properties[$.name],U=Li($,V,m,E,G);c.overrideBypass(r,N,U)}r.emit("style")}}return o.progress=m,m}function Bo(r,e){return r==null||e==null?!1:De(r)&&De(e)?!0:!!(r&&e)}function x5(r,e,t,n){var a=e._private;a.started=!0,a.startTime=t-a.progress*a.duration}function Ox(r,e){var t=e._private.aniEles,n=[];function a(c,v){var h=c._private,g=h.animation.current,p=h.animation.queue,E=!1;if(g.length===0){var m=p.shift();m&&g.push(m)}for(var b=function(R){for(var S=R.length-1;S>=0;S--){var A=R[S];A()}R.splice(0,R.length)},w=g.length-1;w>=0;w--){var x=g[w],_=x._private;if(_.stopped){g.splice(w,1),_.hooked=!1,_.playing=!1,_.started=!1,b(_.frames);continue}!_.playing&&!_.applying||(_.playing&&_.applying&&(_.applying=!1),_.started||x5(c,x,r),w5(c,x,r,v),_.applying&&(_.applying=!1),b(_.frames),_.step!=null&&_.step(r),x.completed()&&(g.splice(w,1),_.hooked=!1,_.playing=!1,_.started=!1,b(_.completes)),E=!0)}return!v&&g.length===0&&p.length===0&&n.push(c),E}for(var i=!1,o=0;o<t.length;o++){var s=t[o],u=a(s);i=i||u}var l=a(e,!0);(i||l)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var E5={animate:xr.animate(),animation:xr.animation(),animated:xr.animated(),clearQueue:xr.clearQueue(),delay:xr.delay(),delayAnimation:xr.delayAnimation(),stop:xr.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&Wu(function(i){Ox(i,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){Ox(o,e)},n.beforeRenderPriorities.animations):t()}},_5={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&ls(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},_u=function(e){return Ge(e)?new Ca(e):e},X2={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new hl(_5,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,_u(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,_u(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,_u(t),n),this},once:function(e,t,n){return this.emitter().one(e,_u(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};xr.eventAliasesOn(X2);var vm={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};vm.jpeg=vm.jpg;var Mu={layout:function(e){var t=this;if(e==null){Mr("Layout options must be specified to make a layout");return}if(e.name==null){Mr("A `name` must be specified to make a layout");return}var n=e.name,a=t.extension("layout",n);if(a==null){Mr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ge(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var o=new a(He({},e,{cy:t,eles:i}));return o}};Mu.createLayout=Mu.makeLayout=Mu.layout;var C5={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&a.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?t.notify(n):t.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],o=e[i],s=t.getElementById(i);s.data(o)}})}},S5=ht({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),hm={renderTo:function(e,t,n,a){var i=this._private.renderer;return i.renderTo(e,t,n,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(n==null){Mr("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Er("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=S5(e);a.cy=t,t._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};hm.invalidateDimensions=hm.resize;var ku={collection:function(e,t){return Ge(e)?this.$(e):jt(e)?e.collection():Sr(e)?(t||(t={}),new vt(this,e,t.unique,t.removed)):new vt(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};ku.elements=ku.filter=ku.$;var ot={},Wo="t",T5="f";ot.apply=function(r){for(var e=this,t=e._private,n=t.cy,a=n.collection(),i=0;i<r.length;i++){var o=r[i],s=e.getContextMeta(o);if(!s.empty){var u=e.getContextStyle(s),l=e.applyContextStyle(s,u,o);o._private.appliedInitStyle?e.updateTransitions(o,l.diffProps):o._private.appliedInitStyle=!0;var c=e.updateStyleHints(o);c&&a.push(o)}}return a};ot.getPropertiesDiff=function(r,e){var t=this,n=t._private.propDiffs=t._private.propDiffs||{},a=r+"-"+e,i=n[a];if(i)return i;for(var o=[],s={},u=0;u<t.length;u++){var l=t[u],c=r[u]===Wo,v=e[u]===Wo,h=c!==v,g=l.mappedProperties.length>0;if(h||v&&g){var p=void 0;h&&g||h?p=l.properties:g&&(p=l.mappedProperties);for(var E=0;E<p.length;E++){for(var m=p[E],b=m.name,w=!1,x=u+1;x<t.length;x++){var _=t[x],C=e[x]===Wo;if(C&&(w=_.properties[m.name]!=null,w))break}!s[b]&&!w&&(s[b]=!0,o.push(b))}}}return n[a]=o,o};ot.getContextMeta=function(r){for(var e=this,t="",n,a=r._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(r);s?t+=Wo:t+=T5}return n=e.getPropertiesDiff(a,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:n.length===0}};ot.getContextStyle=function(r){var e=r.key,t=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<t.length;i++){var o=t[i],s=e[i]===Wo;if(s)for(var u=0;u<o.properties.length;u++){var l=o.properties[u];a[l.name]=l}}return n[e]=a,a};ot.applyContextStyle=function(r,e,t){for(var n=this,a=r.diffPropNames,i={},o=n.types,s=0;s<a.length;s++){var u=a[s],l=e[u],c=t.pstyle(u);if(!l)if(c)c.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(c!==l){if(l.mapped===o.fn&&c!=null&&c.mapping!=null&&c.mapping.value===l.value){var v=c.mapping,h=v.fnValue=l.value(t);if(h===v.prevFnValue)continue}var g=i[u]={prev:c};n.applyParsedProperty(t,l),g.next=t.pstyle(u),g.next&&g.next.bypass&&(g.next=g.next.bypassed)}}return{diffProps:i}};ot.updateStyleHints=function(r){var e=r._private,t=this,n=t.propertyGroupNames,a=t.propertyGroupKeys,i=function(re,le,he){return t.getPropertiesHash(re,le,he)},o=e.styleKey;if(r.removed())return!1;var s=e.group==="nodes",u=r._private.style;n=Object.keys(u);for(var l=0;l<a.length;l++){var c=a[l];e.styleKeys[c]=[Xa,Vi]}for(var v=function(re,le){return e.styleKeys[le][0]=Yo(re,e.styleKeys[le][0])},h=function(re,le){return e.styleKeys[le][1]=Zo(re,e.styleKeys[le][1])},g=function(re,le){v(re,le),h(re,le)},p=function(re,le){for(var he=0;he<re.length;he++){var be=re.charCodeAt(he);v(be,le),h(be,le)}},E=2e9,m=function(re){return-128<re&&re<128&&Math.floor(re)!==re?E-(re*1024|0):re},b=0;b<n.length;b++){var w=n[b],x=u[w];if(x!=null){var _=this.properties[w],C=_.type,R=_.groupKey,S=void 0;_.hashOverride!=null?S=_.hashOverride(r,x):x.pfValue!=null&&(S=x.pfValue);var A=_.enums==null?x.value:null,P=S!=null,I=A!=null,D=P||I,M=x.units;if(C.number&&D&&!C.multiple){var O=P?S:A;g(m(O),R),!P&&M!=null&&p(M,R)}else p(x.strValue,R)}}for(var N=[Xa,Vi],V=0;V<a.length;V++){var $=a[V],G=e.styleKeys[$];N[0]=Yo(G[0],N[0]),N[1]=Zo(G[1],N[1])}e.styleKey=Vq(N[0],N[1]);var U=e.styleKeys;e.labelDimsKey=da(U.labelDimensions);var J=i(r,["label"],U.labelDimensions);if(e.labelKey=da(J),e.labelStyleKey=da(gu(U.commonLabel,J)),!s){var W=i(r,["source-label"],U.labelDimensions);e.sourceLabelKey=da(W),e.sourceLabelStyleKey=da(gu(U.commonLabel,W));var H=i(r,["target-label"],U.labelDimensions);e.targetLabelKey=da(H),e.targetLabelStyleKey=da(gu(U.commonLabel,H))}if(s){var Z=e.styleKeys,ne=Z.nodeBody,F=Z.nodeBorder,z=Z.nodeOutline,j=Z.backgroundImage,ee=Z.compound,ie=Z.pie,oe=Z.stripe,Y=[ne,F,z,j,ee,ie,oe].filter(function(X){return X!=null}).reduce(gu,[Xa,Vi]);e.nodeKey=da(Y),e.hasPie=ie!=null&&ie[0]!==Xa&&ie[1]!==Vi,e.hasStripe=oe!=null&&oe[0]!==Xa&&oe[1]!==Vi}return o!==e.styleKey};ot.clearStyleHints=function(r){var e=r._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};ot.applyParsedProperty=function(r,e){var t=this,n=e,a=r._private.style,i,o=t.types,s=t.properties[n.name].type,u=n.bypass,l=a[n.name],c=l&&l.bypass,v=r._private,h="mapping",g=function(ne){return ne==null?null:ne.pfValue!=null?ne.pfValue:ne.value},p=function(){var ne=g(l),F=g(n);t.checkTriggers(r,n.name,ne,F)};if(e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",u)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return l?l.bypass?(a[n.name]=l.bypassed,p(),!0):!1:(p(),!0);var E=function(){Er("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{for(var m=n.field.split("."),b=v.data,w=0;w<m.length&&b;w++){var x=m[w];b=b[x]}if(b==null)return E(),!1;var _;if(De(b)){var C=n.fieldMax-n.fieldMin;C===0?_=0:_=(b-n.fieldMin)/C}else return Er("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+b+"` for `"+r.id()+"` is non-numeric)"),!1;if(_<0?_=0:_>1&&(_=1),s.color){var R=n.valueMin[0],S=n.valueMax[0],A=n.valueMin[1],P=n.valueMax[1],I=n.valueMin[2],D=n.valueMax[2],M=n.valueMin[3]==null?1:n.valueMin[3],O=n.valueMax[3]==null?1:n.valueMax[3],N=[Math.round(R+(S-R)*_),Math.round(A+(P-A)*_),Math.round(I+(D-I)*_),Math.round(M+(O-M)*_)];i={bypass:n.bypass,name:n.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else if(s.number){var V=n.valueMin+(n.valueMax-n.valueMin)*_;i=this.parse(n.name,V,n.bypass,h)}else return!1;if(!i)return E(),!1;i.mapping=n,n=i;break}case o.data:{for(var $=n.field.split("."),G=v.data,U=0;U<$.length&&G;U++){var J=$[U];G=G[J]}if(G!=null&&(i=this.parse(n.name,G,n.bypass,h)),!i)return E(),!1;i.mapping=n,n=i;break}case o.fn:{var W=n.value,H=n.fnValue!=null?n.fnValue:W(r);if(n.prevFnValue=H,H==null)return Er("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(i=this.parse(n.name,H,n.bypass,h),!i)return Er("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+r.id()+"` is invalid)"),!1;i.mapping=Dn(n),n=i;break}case void 0:break;default:return!1}return u?(c?n.bypassed=l.bypassed:n.bypassed=l,a[n.name]=n):c?l.bypassed=n:a[n.name]=n,p(),!0};ot.cleanElements=function(r,e){for(var t=0;t<r.length;t++){var n=r[t];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s];u!=null&&(u.bypass?u.bypassed=null:a[s]=null)}}};ot.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()};ot.updateTransitions=function(r,e){var t=this,n=r._private,a=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,o=r.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var s={},u=!1,l=0;l<a.length;l++){var c=a[l],v=r.pstyle(c),h=e[c];if(h){var g=h.prev,p=g,E=h.next!=null?h.next:v,m=!1,b=void 0,w=1e-6;p&&(De(p.pfValue)&&De(E.pfValue)?(m=E.pfValue-p.pfValue,b=p.pfValue+w*m):De(p.value)&&De(E.value)?(m=E.value-p.value,b=p.value+w*m):Sr(p.value)&&Sr(E.value)&&(m=p.value[0]!==E.value[0]||p.value[1]!==E.value[1]||p.value[2]!==E.value[2],b=p.strValue),m&&(s[c]=E.strValue,this.applyBypass(r,c,b),u=!0))}}if(!u)return;n.transitioning=!0,new to(function(x){o>0?r.delayAnimation(o).play().promise().then(x):x()}).then(function(){return r.animation({style:s,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1)};ot.checkTrigger=function(r,e,t,n,a,i){var o=this.properties[e],s=a(o);r.removed()||s!=null&&s(t,n,r)&&i(o)};ot.checkZOrderTrigger=function(r,e,t,n){var a=this;this.checkTrigger(r,e,t,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",r)})};ot.checkBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBounds},function(a){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};ot.checkConnectedEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfConnectedEdges},function(a){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ot.checkParallelEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfParallelEdges},function(a){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ot.checkTriggers=function(r,e,t,n){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,n),this.checkBoundsTrigger(r,e,t,n),this.checkConnectedEdgesBoundsTrigger(r,e,t,n),this.checkParallelEdgesBoundsTrigger(r,e,t,n)};var ps={};ps.applyBypass=function(r,e,t,n){var a=this,i=[],o=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var s=0;s<a.properties.length;s++){var u=a.properties[s],l=u.name,c=this.parse(l,t,!0);c&&i.push(c)}}else if(Ge(e)){var v=this.parse(e,t,!0);v&&i.push(v)}else if(pr(e)){var h=e;n=t;for(var g=Object.keys(h),p=0;p<g.length;p++){var E=g[p],m=h[E];if(m===void 0&&(m=h[al(E)]),m!==void 0){var b=this.parse(E,m,!0);b&&i.push(b)}}}else return!1;if(i.length===0)return!1;for(var w=!1,x=0;x<r.length;x++){for(var _=r[x],C={},R=void 0,S=0;S<i.length;S++){var A=i[S];if(n){var P=_.pstyle(A.name);R=C[A.name]={prev:P}}w=this.applyParsedProperty(_,Dn(A))||w,n&&(R.next=_.pstyle(A.name))}w&&this.updateStyleHints(_),n&&this.updateTransitions(_,C,o)}return w};ps.overrideBypass=function(r,e,t){e=Tm(e);for(var n=0;n<r.length;n++){var a=r[n],i=a._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,t):(i.value=t,i.pfValue!=null&&(i.pfValue=t),s?i.strValue="rgb("+t.join(",")+")":u?i.strValue=t.join(" "):i.strValue=""+t,this.updateStyleHints(a)),this.checkTriggers(a,e,l,t)}};ps.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};ps.removeBypasses=function(r,e,t){for(var n=!0,a=0;a<r.length;a++){for(var i=r[a],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],c=i.pstyle(l.name);if(!(!c||!c.bypass)){var v="",h=this.parse(u,v,!0),g=o[l.name]={prev:c};this.applyParsedProperty(i,h),g.next=i.pstyle(l.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,o,n)}};var $m={};$m.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};$m.containerCss=function(r){var e=this._private.cy,t=e.container(),n=e.window();if(n&&t&&n.getComputedStyle)return n.getComputedStyle(t).getPropertyValue(r)};var In={};In.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};In.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var n={},a=0;a<t.properties.length;a++){var i=t.properties[a],o=t.getStylePropertyValue(r,i.name,e);o!=null&&(n[i.name]=o,n[al(i.name)]=o)}return n}};In.getIndexedStyle=function(r,e,t,n){var a=r.pstyle(e)[t][n];return a??r.cy().style().getDefaultProperty(e)[t][0]};In.getStylePropertyValue=function(r,e,t){var n=this;if(r=r[0],r){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,o=r.pstyle(a.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(t&&i.number&&s!=null&&De(s)){var c=r.cy().zoom(),v=function(m){return m*c},h=function(m,b){return v(m)+b},g=Sr(s),p=g?u.every(function(E){return E!=null}):u!=null;return p?g?s.map(function(E,m){return h(E,u[m])}).join(" "):h(s,u):g?s.map(function(E){return Ge(E)?E:""+v(E)}).join(" "):""+v(s)}else if(l!=null)return l}return null}};In.getAnimationStartStyle=function(r,e){for(var t={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=r.pstyle(i);o!==void 0&&(pr(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(t[i]=o)}return t};In.getPropsList=function(r){var e=this,t=[],n=r,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s],l=a[s]||a[Tm(s)],c=this.parse(l.name,u);c&&t.push(c)}return t};In.getNonDefaultPropertiesHash=function(r,e,t){var n=t.slice(),a,i,o,s,u,l;for(u=0;u<e.length;u++)if(a=e[u],i=r.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=Yo(s,n[0]),n[1]=Zo(s,n[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),n[0]=Yo(s,n[0]),n[1]=Zo(s,n[1]);return n};In.getPropertiesHash=In.getNonDefaultPropertiesHash;var yl={};yl.appendFromJson=function(r){for(var e=this,t=0;t<r.length;t++){var n=r[t],a=n.selector,i=n.style||n.css,o=Object.keys(i);e.selector(a);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};yl.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};yl.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,a=t.properties,i={},o=0;o<a.length;o++){var s=a[o];i[s.name]=s.strValue}r.push({selector:n?n.toString():"core",style:i})}return r};var Vm={};Vm.appendFromString=function(r){var e=this,t=this,n=""+r,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){n.length>a.length?n=n.substr(a.length):n=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var l=n.match(/^\s*$/);if(l)break;var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Er("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=c[0];var v=c[1];if(v!=="core"){var h=new Ca(v);if(h.invalid){Er("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),s();continue}}var g=c[2],p=!1;i=g;for(var E=[];;){var m=i.match(/^\s*$/);if(m)break;var b=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!b){Er("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+g),p=!0;break}o=b[0];var w=b[1],x=b[2],_=e.properties[w];if(!_){Er("Skipping property: Invalid property name in: "+o),u();continue}var C=t.parse(w,x);if(!C){Er("Skipping property: Invalid property definition in: "+o),u();continue}E.push({name:w,val:x}),u()}if(p){s();break}t.selector(v);for(var R=0;R<E.length;R++){var S=E[R];t.css(S.name,S.val)}s()}return t};Vm.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var Hr={};(function(){var r=Jr,e=wq,t=Eq,n=_q,a=Cq,i=function(X){return"^"+X+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(X){var re=r+"|\\w+|"+e+"|"+t+"|"+n+"|"+a;return"^"+X+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+re+")\\s*\\,\\s*("+re+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Hr.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(X,re){switch(X.length){case 2:return re[0]!=="deg"&&re[0]!=="rad"&&re[1]!=="deg"&&re[1]!=="rad";case 1:return Ge(X[0])||re[0]==="deg"||re[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(X){var re=X.length;return re===1||re===2||re===4}}};var u={zeroNonZero:function(X,re){return(X==null||re==null)&&X!==re||X==0&&re!=0?!0:X!=0&&re==0},any:function(X,re){return X!=re},emptyNonEmpty:function(X,re){var le=xa(X),he=xa(re);return le&&!he||!le&&he}},l=Hr.types,c=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],v=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],h=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],g=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],p=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification},{name:"box-select-labels",type:l.bool,triggersBounds:u.any}],E=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any},{name:"box-selection",type:l.boxSelection,triggersZOrder:u.any}],m=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:function(X,re,le){return X===re?!1:le.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],b=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],w=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],x=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],_=function(X,re){return re.value==="label"?-X.poolIndex():re.pfValue},C=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:_},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:_},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],R=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],S=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],A=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],P=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],I=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:function(X,re){return X===re?!1:X==="bezier"||re==="bezier"}},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],D=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],M=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],O=[];Hr.pieBackgroundN=16,O.push({name:"pie-size",type:l.sizeMaybePercent}),O.push({name:"pie-hole",type:l.sizeMaybePercent}),O.push({name:"pie-start-angle",type:l.angle});for(var N=1;N<=Hr.pieBackgroundN;N++)O.push({name:"pie-"+N+"-background-color",type:l.color}),O.push({name:"pie-"+N+"-background-size",type:l.percent}),O.push({name:"pie-"+N+"-background-opacity",type:l.zeroOneNumber});var V=[];Hr.stripeBackgroundN=16,V.push({name:"stripe-size",type:l.sizeMaybePercent}),V.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var $=1;$<=Hr.stripeBackgroundN;$++)V.push({name:"stripe-"+$+"-background-color",type:l.color}),V.push({name:"stripe-"+$+"-background-size",type:l.percent}),V.push({name:"stripe-"+$+"-background-opacity",type:l.zeroOneNumber});var G=[],U=Hr.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(Y){U.forEach(function(X){var re=X+"-"+Y.name,le=Y.type,he=Y.triggersBounds;G.push({name:re,type:le,triggersBounds:he})})},{});var J=Hr.properties=[].concat(E,x,m,b,w,D,p,g,c,v,h,C,R,S,A,O,V,P,I,G,M),W=Hr.propertyGroups={behavior:E,transition:x,visibility:m,overlay:b,underlay:w,ghost:D,commonLabel:p,labelDimensions:g,mainLabel:c,sourceLabel:v,targetLabel:h,nodeBody:C,nodeBorder:R,nodeOutline:S,backgroundImage:A,pie:O,stripe:V,compound:P,edgeLine:I,edgeArrow:G,core:M},H=Hr.propertyGroupNames={},Z=Hr.propertyGroupKeys=Object.keys(W);Z.forEach(function(Y){H[Y]=W[Y].map(function(X){return X.name}),W[Y].forEach(function(X){return X.groupKey=Y})});var ne=Hr.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Hr.propertyNames=J.map(function(Y){return Y.name});for(var F=0;F<J.length;F++){var z=J[F];J[z.name]=z}for(var j=0;j<ne.length;j++){var ee=ne[j],ie=J[ee.pointsTo],oe={name:ee.name,alias:!0,pointsTo:ie};J.push(oe),J[ee.name]=oe}})();Hr.getDefaultProperty=function(r){return this.getDefaultProperties()[r]};Hr.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=He({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var c=1;c<=Hr.pieBackgroundN;c++){var v=l.name.replace("{{i}}",c),h=l.value;u[v]=h}return u},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var c=1;c<=Hr.stripeBackgroundN;c++){var v=l.name.replace("{{i}}",c),h=l.value;u[v]=h}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,l){return Hr.arrowPrefixes.forEach(function(c){var v=c+"-"+l.name,h=l.value;u[v]=h}),u},{})),t={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],s=this.parse(i,o);t[i]=s}}return r.defaultProperties=t,r.defaultProperties};Hr.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var ml={};ml.parse=function(r,e,t,n){var a=this;if(Nr(e))return a.parseImplWarn(r,e,t,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=t?"t":"f",s=""+e,u=s2(r,s,o,i),l=a.propCache=a.propCache||[],c;return(c=l[u])||(c=l[u]=a.parseImplWarn(r,e,t,n)),(t||n==="mapping")&&(c=Dn(c),c&&(c.value=Dn(c.value))),c};ml.parseImplWarn=function(r,e,t,n){var a=this.parseImpl(r,e,t,n);return!a&&e!=null&&Er("The style property `".concat(r,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Er("The style value of `label` is deprecated for `"+a.name+"`"),a};ml.parseImpl=function(r,e,t,n){var a=this;r=Tm(r);var i=a.properties[r],o=e,s=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,r=i.name);var u=Ge(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(Nr(e))return{name:r,value:e,strValue:"fn",mapped:s.fn,bypass:t};var c,v;if(!(!u||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(c=new RegExp(s.data.regex).exec(e))){if(t)return!1;var h=s.data;return{name:r,value:c,strValue:""+e,mapped:h,field:c[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(v=new RegExp(s.mapData.regex).exec(e))){if(t||l.multiple)return!1;var g=s.mapData;if(!(l.color||l.number))return!1;var p=this.parse(r,v[4]);if(!p||p.mapped)return!1;var E=this.parse(r,v[5]);if(!E||E.mapped)return!1;if(p.pfValue===E.pfValue||p.strValue===E.strValue)return Er("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+p.strValue+"`"),this.parse(r,p.strValue);if(l.color){var m=p.value,b=E.value,w=m[0]===b[0]&&m[1]===b[1]&&m[2]===b[2]&&(m[3]===b[3]||(m[3]==null||m[3]===1)&&(b[3]==null||b[3]===1));if(w)return!1}return{name:r,value:v,strValue:""+e,mapped:g,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:p.value,valueMax:E.value,bypass:t}}}if(l.multiple&&n!=="multiple"){var x;if(u?x=e.split(/\s+/):Sr(e)?x=e:x=[e],l.evenMultiple&&x.length%2!==0)return null;for(var _=[],C=[],R=[],S="",A=!1,P=0;P<x.length;P++){var I=a.parse(r,x[P],t,"multiple");A=A||Ge(I.value),_.push(I.value),R.push(I.pfValue!=null?I.pfValue:I.value),C.push(I.units),S+=(P>0?" ":"")+I.strValue}return l.validate&&!l.validate(_,C)?null:l.singleEnum&&A?_.length===1&&Ge(_[0])?{name:r,value:_[0],strValue:_[0],bypass:t}:null:{name:r,value:_,pfValue:R,strValue:S,bypass:t,units:C}}var D=function(){for(var oe=0;oe<l.enums.length;oe++){var Y=l.enums[oe];if(Y===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(l.number){var M,O="px";if(l.units&&(M=l.units),l.implicitUnits&&(O=l.implicitUnits),!l.unitless)if(u){var N="px|em"+(l.allowPercent?"|\\%":"");M&&(N=M);var V=e.match("^("+Jr+")("+N+")?$");V&&(e=V[1],M=V[2]||O)}else(!M||l.implicitUnits)&&(M=O);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,D();if(l.integer&&!vq(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var $={name:r,value:e,strValue:""+e+(M||""),units:M,bypass:t};return l.unitless||M!=="px"&&M!=="em"?$.pfValue=e:$.pfValue=M==="px"||!M?e:this.getEmSizeInPixels()*e,(M==="ms"||M==="s")&&($.pfValue=M==="ms"?e:1e3*e),(M==="deg"||M==="rad")&&($.pfValue=M==="rad"?e:_N(e)),M==="%"&&($.pfValue=e/100),$}else if(l.propList){var G=[],U=""+e;if(U!=="none"){for(var J=U.split(/\s*,\s*|\s+/),W=0;W<J.length;W++){var H=J[W].trim();a.properties[H]?G.push(H):Er("`"+H+"` is not a valid property name")}if(G.length===0)return null}return{name:r,value:G,strValue:G.length===0?"none":G.join(" "),bypass:t}}else if(l.color){var Z=e2(e);return Z?{name:r,value:Z,pfValue:Z,strValue:"rgb("+Z[0]+","+Z[1]+","+Z[2]+")",bypass:t}:null}else if(l.regex||l.regexes){if(l.enums){var ne=D();if(ne)return ne}for(var F=l.regexes?l.regexes:[l.regex],z=0;z<F.length;z++){var j=new RegExp(F[z]),ee=j.exec(e);if(ee)return{name:r,value:l.singleRegexMatchValue?ee[1]:ee,strValue:""+e,bypass:t}}return null}else return l.string?{name:r,value:""+e,strValue:""+e,bypass:t}:l.enums?D():null};var it=function(e){if(!(this instanceof it))return new it(e);if(!Sm(e)){Mr("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Et=it.prototype;Et.instanceString=function(){return"style"};Et.clear=function(){for(var r=this._private,e=r.cy,t=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};Et.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Et.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};Et.selector=function(r){var e=r==="core"?null:new Ca(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};Et.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],n=0;n<r.properties.length;n++){var a=r.properties[n],i=t[a.name];i===void 0&&(i=t[al(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Et.style=Et.css;Et.cssRule=function(r,e){var t=this.parse(r,e);if(t){var n=this.length-1;this[n].properties.push(t),this[n].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.name.match(/stripe-(\d+)-background-size/)&&t.value&&(this._private.hasStripe=!0),t.mapped&&this[n].mappedProperties.push(t);var a=!this[n].selector;a&&(this._private.coreStyle[t.name]=t)}return this};Et.append=function(r){return XR(r)?r.appendToStyle(this):Sr(r)?this.appendFromJson(r):Ge(r)&&this.appendFromString(r),this};it.fromJson=function(r,e){var t=new it(r);return t.fromJson(e),t};it.fromString=function(r,e){return new it(r).fromString(e)};[ot,ps,$m,In,yl,Vm,Hr,ml].forEach(function(r){He(Et,r)});it.types=Et.types;it.properties=Et.properties;it.propertyGroups=Et.propertyGroups;it.propertyGroupNames=Et.propertyGroupNames;it.propertyGroupKeys=Et.propertyGroupKeys;var R5={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return XR(e)?t.style=e.generateStyle(this):Sr(e)?t.style=it.fromJson(this,e):Ge(e)?t.style=it.fromString(this,e):t.style=it(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},A5="single",ii={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=A5),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,a,i,o,s;switch(e.length){case 0:return t;case 1:if(Ge(e[0]))return n=e[0],t[n];if(pr(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,De(o)&&(t.x=o),De(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&De(a)&&(t[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,a=this._private.pan,i,o,s,u,l;if(!this._private.panningEnabled)return this;switch(n.length){case 1:pr(e)&&(s=n[0],u=s.x,l=s.y,De(u)&&(a.x+=u),De(l)&&(a.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=t,(i==="x"||i==="y")&&De(o)&&(a[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(De(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ge(e)){var a=e;e=this.$(a)}else if(pq(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else jt(e)||(e=this.mutableElements());if(!(jt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),s=this.height(),u;if(t=De(t)?t:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((o-2*t)/n.w,(s-2*t)/n.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(n.x1+n.x2))/2,y:(s-u*(n.y1+n.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var a=e;e=a.min,t=a.max}return De(e)&&De(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):De(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:De(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,a=t.zoom,i,o,s=!1;if(t.zoomingEnabled||(s=!0),De(e)?o=e:pr(e)&&(o=e.level,e.position!=null?i=sl(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(s=!0)),o=o>t.maxZoom?t.maxZoom:o,o=o<t.minZoom?t.minZoom:o,s||!De(o)||o===a||i!=null&&(!De(i.x)||!De(i.y)))return null;if(i!=null){var u=n,l=a,c=o,v={x:-c/l*(i.x-u.x)+i.x,y:-c/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:c,pan:v}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,n=!0,a=!0,i=[],o=!1,s=!1;if(!e)return this;if(De(e.zoom)||(n=!1),pr(e.pan)||(a=!1),!n&&!a)return this;if(n){var u=e.zoom;u<t.minZoom||u>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=u,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;De(l.x)&&(t.pan.x=l.x,s=!1),De(l.y)&&(t.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(Ge(e)){var n=e;e=this.mutableElements().filter(n)}else jt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();t=t===void 0?this._private.zoom:t;var s={x:(i-t*(a.x1+a.x2))/2,y:(o-t*(a.y1+a.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?(function(){var a=n.window().getComputedStyle(t),i=function(s){return parseFloat(a.getPropertyValue(s))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};ii.centre=ii.center;ii.autolockNodes=ii.autolock;ii.autoungrabifyNodes=ii.autoungrabify;var ts={data:xr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:xr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:xr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data;ts.removeAttr=ts.removeData;var ns=function(e){var t=this;e=He({},e);var n=e.container;n&&!Gu(n)&&Gu(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=t;var o=Qr!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=He({name:o?"grid":"null"},s.layout),s.renderer=He({name:o?"canvas":"null"},s.renderer);var u=function(p,E,m){return E!==void 0?E:m!==void 0?m:p},l=this._private={container:n,ready:!1,options:s,elements:new vt(this),listeners:[],aniEles:new vt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:De(s.zoom)?s.zoom:1,pan:{x:pr(s.pan)&&De(s.pan.x)?s.pan.x:0,y:pr(s.pan)&&De(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var c=function(p,E){var m=p.some(yq);if(m)return to.all(p).then(E);E(p)};l.styleEnabled&&t.setStyle([]);var v=He({},s,s.renderer);t.initRenderer(v);var h=function(p,E,m){t.notifications(!1);var b=t.mutableElements();b.length>0&&b.remove(),p!=null&&(pr(p)||Sr(p))&&t.add(p),t.one("layoutready",function(x){t.notifications(!0),t.emit(x),t.one("load",E),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",m),t.emit("done")});var w=He({},t._private.options.layout);w.eles=t.elements(),t.layout(w).run()};c([s.style,s.elements],function(g){var p=g[0],E=g[1];l.styleEnabled&&t.style().append(p),h(E,function(){t.startAnimationLoop(),l.ready=!0,Nr(s.ready)&&t.on("ready",s.ready);for(var m=0;m<i.length;m++){var b=i[m];t.on("ready",b)}a&&(a.readies=[]),t.emit("ready")},s.done)})},Zu=ns.prototype;He(Zu,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return Qr;var t=this._private.container.ownerDocument;return t===void 0||t==null?Qr:t.defaultView||Qr},mount:function(e){if(e!=null){var t=this,n=t._private,a=n.options;return!Gu(e)&&Gu(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(He({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),t.startAnimationLoop(),t.style(a.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Dn(this._private.options)},json:function(e){var t=this,n=t._private,a=t.mutableElements(),i=function(_){return t.getElementById(_.id())};if(pr(e)){if(t.startBatch(),e.elements){var o={},s=function(_,C){for(var R=[],S=[],A=0;A<_.length;A++){var P=_[A];if(!P.data.id){Er("cy.json() cannot handle elements without an ID attribute");continue}var I=""+P.data.id,D=t.getElementById(I);o[I]=!0,D.length!==0?S.push({ele:D,json:P}):(C&&(P.group=C),R.push(P))}t.add(R);for(var M=0;M<S.length;M++){var O=S[M],N=O.ele,V=O.json;N.json(V)}};if(Sr(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var c=u[l],v=e.elements[c];Sr(v)&&s(v,c)}var h=t.collection();a.filter(function(x){return!o[x.id()]}).forEach(function(x){x.isParent()?h.merge(x):x.remove()}),h.forEach(function(x){return x.children().move({parent:null})}),h.forEach(function(x){return i(x).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var g=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<g.length;p++){var E=g[p];e[E]!=null&&t[E](e[E])}return t.endBatch(),this}else{var m=!!e,b={};m?b.elements=this.elements().map(function(x){return x.json()}):(b.elements={},a.forEach(function(x){var _=x.group();b.elements[_]||(b.elements[_]=[]),b.elements[_].push(x.json())})),this._private.styleEnabled&&(b.style=t.style().json()),b.data=Dn(t.data());var w=n.options;return b.zoomingEnabled=n.zoomingEnabled,b.userZoomingEnabled=n.userZoomingEnabled,b.zoom=n.zoom,b.minZoom=n.minZoom,b.maxZoom=n.maxZoom,b.panningEnabled=n.panningEnabled,b.userPanningEnabled=n.userPanningEnabled,b.pan=Dn(n.pan),b.boxSelectionEnabled=n.boxSelectionEnabled,b.renderer=Dn(w.renderer),b.hideEdgesOnViewport=w.hideEdgesOnViewport,b.textureOnViewport=w.textureOnViewport,b.wheelSensitivity=w.wheelSensitivity,b.motionBlur=w.motionBlur,b.multiClickDebounceTime=w.multiClickDebounceTime,b}}});Zu.$id=Zu.getElementById;[y5,E5,X2,vm,Mu,C5,hm,ku,R5,ii,ts].forEach(function(r){He(Zu,r)});var P5={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},D5={maximal:!1,acyclic:!1},qi=function(e){return e.scratch("breadthfirst")},Mx=function(e,t){return e.scratch("breadthfirst",t)};function Q2(r){this.options=He({},P5,D5,r)}Q2.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(Ae){return Ae.isChildless()}),a=t,i=r.directed,o=r.acyclic||r.maximal||r.maximalAdjustments>0,s=!!r.boundingBox,u=Dt(s?r.boundingBox:structuredClone(e.extent())),l;if(jt(r.roots))l=r.roots;else if(Sr(r.roots)){for(var c=[],v=0;v<r.roots.length;v++){var h=r.roots[v],g=e.getElementById(h);c.push(g)}l=e.collection(c)}else if(Ge(r.roots))l=e.$(r.roots);else if(i)l=n.roots();else{var p=t.components();l=e.collection();for(var E=function(){var Te=p[m],Pe=Te.maxDegree(!1),Ie=Te.filter(function(Le){return Le.degree(!1)===Pe});l=l.add(Ie)},m=0;m<p.length;m++)E()}var b=[],w={},x=function(Te,Pe){b[Pe]==null&&(b[Pe]=[]);var Ie=b[Pe].length;b[Pe].push(Te),Mx(Te,{index:Ie,depth:Pe})},_=function(Te,Pe){var Ie=qi(Te),Le=Ie.depth,Fe=Ie.index;b[Le][Fe]=null,Te.isChildless()&&x(Te,Pe)};a.bfs({roots:l,directed:r.directed,visit:function(Te,Pe,Ie,Le,Fe){var je=Te[0],lr=je.id();je.isChildless()&&x(je,Fe),w[lr]=!0}});for(var C=[],R=0;R<n.length;R++){var S=n[R];w[S.id()]||C.push(S)}var A=function(Te){for(var Pe=b[Te],Ie=0;Ie<Pe.length;Ie++){var Le=Pe[Ie];if(Le==null){Pe.splice(Ie,1),Ie--;continue}Mx(Le,{depth:Te,index:Ie})}},P=function(Te,Pe){for(var Ie=qi(Te),Le=Te.incomers().filter(function(Ue){return Ue.isNode()&&t.has(Ue)}),Fe=-1,je=Te.id(),lr=0;lr<Le.length;lr++){var ir=Le[lr],Xe=qi(ir);Fe=Math.max(Fe,Xe.depth)}if(Ie.depth<=Fe){if(!r.acyclic&&Pe[je])return null;var fr=Fe+1;return _(Te,fr),Pe[je]=fr,!0}return!1};if(i&&o){var I=[],D={},M=function(Te){return I.push(Te)},O=function(){return I.shift()};for(n.forEach(function(Ae){return I.push(Ae)});I.length>0;){var N=O(),V=P(N,D);if(V)N.outgoers().filter(function(Ae){return Ae.isNode()&&t.has(Ae)}).forEach(M);else if(V===null){Er("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(r.avoidOverlap)for(var G=0;G<n.length;G++){var U=n[G],J=U.layoutDimensions(r),W=J.w,H=J.h;$=Math.max($,W,H)}var Z={},ne=function(Te){if(Z[Te.id()])return Z[Te.id()];for(var Pe=qi(Te).depth,Ie=Te.neighborhood(),Le=0,Fe=0,je=0;je<Ie.length;je++){var lr=Ie[je];if(!(lr.isEdge()||lr.isParent()||!n.has(lr))){var ir=qi(lr);if(ir!=null){var Xe=ir.index,fr=ir.depth;if(!(Xe==null||fr==null)){var Ue=b[fr].length;fr<Pe&&(Le+=Xe/Ue,Fe++)}}}}return Fe=Math.max(1,Fe),Le=Le/Fe,Fe===0&&(Le=0),Z[Te.id()]=Le,Le},F=function(Te,Pe){var Ie=ne(Te),Le=ne(Pe),Fe=Ie-Le;return Fe===0?JR(Te.id(),Pe.id()):Fe};r.depthSort!==void 0&&(F=r.depthSort);for(var z=b.length,j=0;j<z;j++)b[j].sort(F),A(j);for(var ee=[],ie=0;ie<C.length;ie++)ee.push(C[ie]);var oe=function(){for(var Te=0;Te<z;Te++)A(Te)};ee.length&&(b.unshift(ee),z=b.length,oe());for(var Y=0,X=0;X<z;X++)Y=Math.max(b[X].length,Y);var re={x:u.x1+u.w/2,y:u.y1+u.h/2},le=n.reduce(function(Ae,Te){return(function(Pe){return{w:Ae.w===-1?Pe.w:(Ae.w+Pe.w)/2,h:Ae.h===-1?Pe.h:(Ae.h+Pe.h)/2}})(Te.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),he=Math.max(z===1?0:s?(u.h-r.padding*2-le.h)/(z-1):(u.h-r.padding*2-le.h)/(z+1),$),be=b.reduce(function(Ae,Te){return Math.max(Ae,Te.length)},0),fe=function(Te){var Pe=qi(Te),Ie=Pe.depth,Le=Pe.index;if(r.circle){var Fe=Math.min(u.w/2/z,u.h/2/z);Fe=Math.max(Fe,$);var je=Fe*Ie+Fe-(z>0&&b[0].length<=3?Fe/2:0),lr=2*Math.PI/b[Ie].length*Le;return Ie===0&&b[0].length===1&&(je=1),{x:re.x+je*Math.cos(lr),y:re.y+je*Math.sin(lr)}}else{var ir=b[Ie].length,Xe=Math.max(ir===1?0:s?(u.w-r.padding*2-le.w)/((r.grid?be:ir)-1):(u.w-r.padding*2-le.w)/((r.grid?be:ir)+1),$),fr={x:re.x+(Le+1-(ir+1)/2)*Xe,y:re.y+(Ie+1-(z+1)/2)*he};return fr}},ue={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(ue).indexOf(r.direction)===-1&&Mr("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(ue).join(", ")));var Se=function(Te){return Hq(fe(Te),u,ue[r.direction])};return t.nodes().layoutPositions(this,r,Se),this};var I5={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function J2(r){this.options=He({},I5,r)}J2.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Dt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),c,v=0,h=0;h<i.length;h++){var g=i[h],p=g.layoutDimensions(e),E=p.w,m=p.h;v=Math.max(v,E,m)}if(De(e.radius)?c=e.radius:i.length<=1?c=0:c=Math.min(o.h,o.w)/2-v,i.length>1&&e.avoidOverlap){v*=1.75;var b=Math.cos(l)-Math.cos(0),w=Math.sin(l)-Math.sin(0),x=Math.sqrt(v*v/(b*b+w*w));c=Math.max(x,c)}var _=function(R,S){var A=e.startAngle+S*l*(a?1:-1),P=c*Math.cos(A),I=c*Math.sin(A),D={x:s.x+P,y:s.y+I};return D};return n.nodes().layoutPositions(this,e,_),this};var B5={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function eA(r){this.options=He({},B5,r)}eA.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=r.cy,a=e.eles,i=a.nodes().not(":parent"),o=Dt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,c=0;c<i.length;c++){var v=i[c],h=void 0;h=e.concentric(v),u.push({value:h,node:v}),v._private.scratch.concentric=h}i.updateStyle();for(var g=0;g<i.length;g++){var p=i[g],E=p.layoutDimensions(e);l=Math.max(l,E.w,E.h)}u.sort(function(he,be){return be.value-he.value});for(var m=e.levelWidth(i),b=[[]],w=b[0],x=0;x<u.length;x++){var _=u[x];if(w.length>0){var C=Math.abs(w[0].value-_.value);C>=m&&(w=[],b.push(w))}w.push(_)}var R=l+e.minNodeSpacing;if(!e.avoidOverlap){var S=b.length>0&&b[0].length>1,A=Math.min(o.w,o.h)/2-R,P=A/(b.length+S?1:0);R=Math.min(R,P)}for(var I=0,D=0;D<b.length;D++){var M=b[D],O=e.sweep===void 0?2*Math.PI-2*Math.PI/M.length:e.sweep,N=M.dTheta=O/Math.max(1,M.length-1);if(M.length>1&&e.avoidOverlap){var V=Math.cos(N)-Math.cos(0),$=Math.sin(N)-Math.sin(0),G=Math.sqrt(R*R/(V*V+$*$));I=Math.max(G,I)}M.r=I,I+=R}if(e.equidistant){for(var U=0,J=0,W=0;W<b.length;W++){var H=b[W],Z=H.r-J;U=Math.max(U,Z)}J=0;for(var ne=0;ne<b.length;ne++){var F=b[ne];ne===0&&(J=F.r),F.r=J,J+=U}}for(var z={},j=0;j<b.length;j++)for(var ee=b[j],ie=ee.dTheta,oe=ee.r,Y=0;Y<ee.length;Y++){var X=ee[Y],re=e.startAngle+(t?1:-1)*ie*Y,le={x:s.x+oe*Math.cos(re),y:s.y+oe*Math.sin(re)};z[X.node.id()]=le}return a.nodes().layoutPositions(this,e,function(he){var be=he.id();return z[be]}),this};var Ad,O5={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function bl(r){this.options=He({},O5,r),this.options.layout=this;var e=this.options.eles.nodes(),t=this.options.eles.edges(),n=t.filter(function(a){var i=a.source().data("id"),o=a.target().data("id"),s=e.some(function(l){return l.data("id")===i}),u=e.some(function(l){return l.data("id")===o});return!s||!u});this.options.eles=this.options.eles.not(n)}bl.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?Ad=!0:Ad=!1;var n=M5(e,t,r);Ad&&L5(n),r.randomize&&q5(n);var a=jn(),i=function(){N5(n,e,r),r.fit===!0&&e.fit(r.padding)},o=function(h){return!(t.stopped||h>=r.numIter||(F5(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},s=function(){if(r.animate===!0||r.animate===!1)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var h=r.eles.nodes(),g=tA(n,r,h);h.layoutPositions(t,r,g)}},u=0,l=!0;if(r.animate===!0){var c=function(){for(var h=0;l&&h<r.refresh;)l=o(u),u++,h++;if(!l)Lx(n,r),s();else{var g=jn();g-a>=r.animationThreshold&&i(),Wu(c)}};c()}else{for(;l;)l=o(u),u++;Lx(n,r),s()}return this};bl.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};bl.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var M5=function(e,t,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Dt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=n.eles.components(),l={},c=0;c<u.length;c++)for(var v=u[c],h=0;h<v.length;h++){var g=v[h];l[g.id()]=c}for(var c=0;c<s.nodeSize;c++){var p=i[c],E=p.layoutDimensions(n),m={};m.isLocked=p.locked(),m.id=p.data("id"),m.parentId=p.data("parent"),m.cmptId=l[p.id()],m.children=[],m.positionX=p.position("x"),m.positionY=p.position("y"),m.offsetX=0,m.offsetY=0,m.height=E.w,m.width=E.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(p.style("padding")),m.padRight=parseFloat(p.style("padding")),m.padTop=parseFloat(p.style("padding")),m.padBottom=parseFloat(p.style("padding")),m.nodeRepulsion=Nr(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,s.layoutNodes.push(m),s.idToIndex[m.id]=c}for(var b=[],w=0,x=-1,_=[],c=0;c<s.nodeSize;c++){var p=s.layoutNodes[c],C=p.parentId;C!=null?s.layoutNodes[s.idToIndex[C]].children.push(p.id):(b[++x]=p.id,_.push(p.id))}for(s.graphSet.push(_);w<=x;){var R=b[w++],S=s.idToIndex[R],g=s.layoutNodes[S],A=g.children;if(A.length>0){s.graphSet.push(A);for(var c=0;c<A.length;c++)b[++x]=A[c]}}for(var c=0;c<s.graphSet.length;c++)for(var P=s.graphSet[c],h=0;h<P.length;h++){var I=s.idToIndex[P[h]];s.indexToGraph[I]=c}for(var c=0;c<s.edgeSize;c++){var D=a[c],M={};M.id=D.data("id"),M.sourceId=D.data("source"),M.targetId=D.data("target");var O=Nr(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,N=Nr(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,V=s.idToIndex[M.sourceId],$=s.idToIndex[M.targetId],G=s.indexToGraph[V],U=s.indexToGraph[$];if(G!=U){for(var J=k5(M.sourceId,M.targetId,s),W=s.graphSet[J],H=0,m=s.layoutNodes[V];W.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],H++;for(m=s.layoutNodes[$];W.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],H++;O*=H*n.nestingFactor}M.idealLength=O,M.elasticity=N,s.layoutEdges.push(M)}return s},k5=function(e,t,n){var a=rA(e,t,0,n);return 2>a.count?0:a.graph},rA=function(e,t,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:n};for(var o=0,s=0;s<i.length;s++){var u=i[s],l=a.idToIndex[u],c=a.layoutNodes[l].children;if(c.length!==0){var v=a.indexToGraph[a.idToIndex[c[0]]],h=rA(e,t,v,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},L5,q5=function(e,t){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},tA=function(e,t,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(t.boundingBox){var l=i.w===0?.5:(u.positionX-i.x1)/i.w,c=i.h===0?.5:(u.positionY-i.y1)/i.h;return{x:a.x1+l*a.w,y:a.y1+c*a.h}}else return{x:u.positionX,y:u.positionY}}},N5=function(e,t,n){var a=n.layout,i=n.eles.nodes(),o=tA(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},F5=function(e,t,n){z5(e,t),G5(e),W5(e,t),U5(e),H5(e)},z5=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[a[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[a[u]]];$5(s,l,e,t)}},kx=function(e){return-1+2*e*Math.random()},$5=function(e,t,n,a){var i=e.cmptId,o=t.cmptId;if(!(i!==o&&!n.isCompound)){var s=t.positionX-e.positionX,u=t.positionY-e.positionY,l=1;s===0&&u===0&&(s=kx(l),u=kx(l));var c=V5(e,t,s,u);if(c>0)var v=a.nodeOverlap*c,h=Math.sqrt(s*s+u*u),g=v*s/h,p=v*u/h;else var E=Xu(e,s,u),m=Xu(t,-1*s,-1*u),b=m.x-E.x,w=m.y-E.y,x=b*b+w*w,h=Math.sqrt(x),v=(e.nodeRepulsion+t.nodeRepulsion)/x,g=v*b/h,p=v*w/h;e.isLocked||(e.offsetX-=g,e.offsetY-=p),t.isLocked||(t.offsetX+=g,t.offsetY+=p)}},V5=function(e,t,n,a){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(a>0)var o=e.maxY-t.minY;else var o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Xu=function(e,t,n){var a=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=n/t,l=o/s,c={};return t===0&&0<n||t===0&&0>n?(c.x=a,c.y=i+o/2,c):0<t&&-1*l<=u&&u<=l?(c.x=a+s/2,c.y=i+s*n/2/t,c):0>t&&-1*l<=u&&u<=l?(c.x=a-s/2,c.y=i-s*n/2/t,c):0<n&&(u<=-1*l||u>=l)?(c.x=a+o*t/2/n,c.y=i+o/2,c):(0>n&&(u<=-1*l||u>=l)&&(c.x=a-o*t/2/n,c.y=i-o/2),c)},G5=function(e,t){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],s=e.idToIndex[a.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,c=u.positionY-o.positionY;if(!(l===0&&c===0)){var v=Xu(o,l,c),h=Xu(u,-1*l,-1*c),g=h.x-v.x,p=h.y-v.y,E=Math.sqrt(g*g+p*p),m=Math.pow(a.idealLength-E,2)/a.elasticity;if(E!==0)var b=m*g/E,w=m*p/E;else var b=0,w=0;o.isLocked||(o.offsetX+=b,o.offsetY+=w),u.isLocked||(u.offsetX-=b,u.offsetY-=w)}}},W5=function(e,t){if(t.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=i.length;if(a===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],c=e.layoutNodes[e.idToIndex[l.parentId]],s=c.positionX,u=c.positionY;for(var v=0;v<o;v++){var h=e.layoutNodes[e.idToIndex[i[v]]];if(!h.isLocked){var g=s-h.positionX,p=u-h.positionY,E=Math.sqrt(g*g+p*p);if(E>n){var m=t.gravity*g/E,b=t.gravity*p/E;h.offsetX+=m,h.offsetY+=b}}}}},U5=function(e,t){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var o=n[a++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var c=u.offsetX,v=u.offsetY,h=0;h<l.length;h++){var g=e.layoutNodes[e.idToIndex[l[h]]];g.offsetX+=c,g.offsetY+=v,n[++i]=l[h]}u.offsetX=0,u.offsetY=0}}},H5=function(e,t){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=K5(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,nA(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},K5=function(e,t,n){var a=Math.sqrt(e*e+t*t);if(a>n)var i={x:n*e/a,y:n*t/a};else var i={x:e,y:t};return i},nA=function(e,t){var n=e.parentId;if(n!=null){var a=t.layoutNodes[t.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return nA(a,t)}},Lx=function(e,t){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],s=o.cmptId,u=a[s]=a[s]||[];u.push(o)}for(var l=0,i=0;i<a.length;i++){var c=a[i];if(c){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var v=0;v<c.length;v++){var h=c[v];c.x1=Math.min(c.x1,h.positionX-h.width/2),c.x2=Math.max(c.x2,h.positionX+h.width/2),c.y1=Math.min(c.y1,h.positionY-h.height/2),c.y2=Math.max(c.y2,h.positionY+h.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,l+=c.w*c.h}}a.sort(function(w,x){return x.w*x.h-w.w*w.h});for(var g=0,p=0,E=0,m=0,b=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var c=a[i];if(c){for(var v=0;v<c.length;v++){var h=c[v];h.isLocked||(h.positionX+=g-c.x1,h.positionY+=p-c.y1)}g+=c.w+t.componentSpacing,E+=c.w+t.componentSpacing,m=Math.max(m,c.h),E>b&&(p+=m+t.componentSpacing,g=0,E=0,m=0)}}},j5={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function aA(r){this.options=He({},j5,r)}aA.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=Dt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(ne){return{x:i.x1,y:i.y1}});else{var o=a.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),c=function(F){if(F==null)return Math.min(u,l);var z=Math.min(u,l);z==u?u=F:l=F},v=function(F){if(F==null)return Math.max(u,l);var z=Math.max(u,l);z==u?u=F:l=F},h=e.rows,g=e.cols!=null?e.cols:e.columns;if(h!=null&&g!=null)u=h,l=g;else if(h!=null&&g==null)u=h,l=Math.ceil(o/u);else if(h==null&&g!=null)l=g,u=Math.ceil(o/l);else if(l*u>o){var p=c(),E=v();(p-1)*E>=o?c(p-1):(E-1)*p>=o&&v(E-1)}else for(;l*u<o;){var m=c(),b=v();(b+1)*m>=o?v(b+1):c(m+1)}var w=i.w/l,x=i.h/u;if(e.condense&&(w=0,x=0),e.avoidOverlap)for(var _=0;_<a.length;_++){var C=a[_],R=C._private.position;(R.x==null||R.y==null)&&(R.x=0,R.y=0);var S=C.layoutDimensions(e),A=e.avoidOverlapPadding,P=S.w+A,I=S.h+A;w=Math.max(w,P),x=Math.max(x,I)}for(var D={},M=function(F,z){return!!D["c-"+F+"-"+z]},O=function(F,z){D["c-"+F+"-"+z]=!0},N=0,V=0,$=function(){V++,V>=l&&(V=0,N++)},G={},U=0;U<a.length;U++){var J=a[U],W=e.position(J);if(W&&(W.row!==void 0||W.col!==void 0)){var H={row:W.row,col:W.col};if(H.col===void 0)for(H.col=0;M(H.row,H.col);)H.col++;else if(H.row===void 0)for(H.row=0;M(H.row,H.col);)H.row++;G[J.id()]=H,O(H.row,H.col)}}var Z=function(F,z){var j,ee;if(F.locked()||F.isParent())return!1;var ie=G[F.id()];if(ie)j=ie.col*w+w/2+i.x1,ee=ie.row*x+x/2+i.y1;else{for(;M(N,V);)$();j=V*w+w/2+i.x1,ee=N*x+x/2+i.y1,O(N,V),$()}return{x:j,y:ee}};a.layoutPositions(this,e,Z)}return this};var Y5={ready:function(){},stop:function(){}};function Gm(r){this.options=He({},Y5,r)}Gm.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this};Gm.prototype.stop=function(){return this};var Z5={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function iA(r){this.options=He({},Z5,r)}iA.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),n=Nr(r.positions);function a(i){if(r.positions==null)return mN(i.position());if(n)return r.positions(i);var o=r.positions[i._private.data.id];return o??null}return t.layoutPositions(this,r,function(i,o){var s=a(i);return i.locked()||s==null?!1:s}),this};var X5={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function oA(r){this.options=He({},X5,r)}oA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=Dt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,s){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return t.nodes().layoutPositions(this,r,a),this};var Q5=[{name:"breadthfirst",impl:Q2},{name:"circle",impl:J2},{name:"concentric",impl:eA},{name:"cose",impl:bl},{name:"grid",impl:aA},{name:"null",impl:Gm},{name:"preset",impl:iA},{name:"random",impl:oA}];function sA(r){this.options=r,this.notifications=0}var qx=function(){},Nx=function(){throw new Error("A headless instance can not render images")};sA.prototype={recalculateRenderedStyle:qx,notify:function(){this.notifications++},init:qx,isHeadless:function(){return!0},png:Nx,jpg:Nx};var Wm={};Wm.arrowShapeWidth=.3;Wm.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(l,c,v,h,g,p,E){var m=g.x-v/2-E,b=g.x+v/2+E,w=g.y-v/2-E,x=g.y+v/2+E,_=m<=l&&l<=b&&w<=c&&c<=x;return _},n=function(l,c,v,h,g){var p=l*Math.cos(h)-c*Math.sin(h),E=l*Math.sin(h)+c*Math.cos(h),m=p*v,b=E*v,w=m+g.x,x=b+g.y;return{x:w,y:x}},a=function(l,c,v,h){for(var g=[],p=0;p<l.length;p+=2){var E=l[p],m=l[p+1];g.push(n(E,m,c,v,h))}return g},i=function(l){for(var c=[],v=0;v<l.length;v++){var h=l[v];c.push(h.x,h.y)}return c},o=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},s=function(l,c){Ge(c)&&(c=r[c]),r[l]=He({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,g,p,E,m,b){var w=i(a(this.points,p+2*b,E,m)),x=Nt(h,g,w);return x},roughCollide:t,draw:function(h,g,p,E){var m=a(this.points,g,p,E);e.arrowShapeImpl("polygon")(h,m)},spacing:function(h){return 0},gap:o},c)};s("none",{collide:Uu,roughCollide:Uu,draw:Pm,spacing:Q1,gap:Q1}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(l,c,v,h,g){var p=a(this.points,c,v,h),E=this.controlPoint,m=n(E[0],E[1],c,v,h);e.arrowShapeImpl(this.name)(l,p,m)},gap:function(l){return o(l)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,c,v,h,g,p,E){var m=i(a(this.points,v+2*E,h,g)),b=i(a(this.pointsTee,v+2*E,h,g)),w=Nt(l,c,m)||Nt(l,c,b);return w},draw:function(l,c,v,h,g){var p=a(this.points,c,v,h),E=a(this.pointsTee,c,v,h);e.arrowShapeImpl(this.name)(l,p,E)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,c,v,h,g,p,E){var m=g,b=Math.pow(m.x-l,2)+Math.pow(m.y-c,2)<=Math.pow((v+2*E)*this.radius,2),w=i(a(this.points,v+2*E,h,g));return Nt(l,c,w)||b},draw:function(l,c,v,h,g){var p=a(this.pointsTr,c,v,h);e.arrowShapeImpl(this.name)(l,p,h.x,h.y,this.radius*c)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,c){var v=this.baseCrossLinePts.slice(),h=c/l,g=3,p=5;return v[g]=v[g]-h,v[p]=v[p]-h,v},collide:function(l,c,v,h,g,p,E){var m=i(a(this.points,v+2*E,h,g)),b=i(a(this.crossLinePts(v,p),v+2*E,h,g)),w=Nt(l,c,m)||Nt(l,c,b);return w},draw:function(l,c,v,h,g){var p=a(this.points,c,v,h),E=a(this.crossLinePts(c,g),c,v,h);e.arrowShapeImpl(this.name)(l,p,E)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return o(l)*.525}}),s("circle",{radius:.15,collide:function(l,c,v,h,g,p,E){var m=g,b=Math.pow(m.x-l,2)+Math.pow(m.y-c,2)<=Math.pow((v+2*E)*this.radius,2);return b},draw:function(l,c,v,h,g){e.arrowShapeImpl(this.name)(l,h.x,h.y,this.radius*c)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})};var ui={};ui.projectIntoViewport=function(r,e){var t=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],s=t.pan(),u=t.zoom(),l=((r-a)/o-s.x)/u,c=((e-i)/o-s.y)/u;return[l,c]};ui.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(b){return parseFloat(t.getPropertyValue(b))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=r.clientWidth,s=r.clientHeight,u=a.left+a.right,l=a.top+a.bottom,c=i.left+i.right,v=e.width/(o+c),h=o-u,g=s-l,p=e.left+a.left+i.left,E=e.top+a.top+i.top;return this.containerBB=[p,E,h,g,v]};ui.invalidateContainerClientCoordsCache=function(){this.containerBB=null};ui.findNearestElement=function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]};ui.findNearestElements=function(r,e,t,n){var a=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),c=(n?24:8)/u,v=(n?8:2)/u,h=(n?8:2)/u,g=1/0,p,E;t&&(o=o.interactive);function m(S,A){if(S.isNode()){if(E)return;E=S,s.push(S)}if(S.isEdge()&&(A==null||A<g))if(p){if(p.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value){for(var P=0;P<s.length;P++)if(s[P].isEdge()){s[P]=S,p=S,g=A??g;break}}}else s.push(S),p=S,g=A??g}function b(S){var A=S.outerWidth()+2*v,P=S.outerHeight()+2*v,I=A/2,D=P/2,M=S.position(),O=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,N=S._private.rscratch;if(M.x-I<=r&&r<=M.x+I&&M.y-D<=e&&e<=M.y+D){var V=i.nodeShapes[a.getNodeShape(S)];if(V.checkPoint(r,e,0,A,P,M.x,M.y,O,N))return m(S,0),!0}}function w(S){var A=S._private,P=A.rscratch,I=S.pstyle("width").pfValue,D=S.pstyle("arrow-scale").value,M=I/2+c,O=M*M,N=M*2,U=A.source,J=A.target,V;if(P.edgeType==="segments"||P.edgeType==="straight"||P.edgeType==="haystack"){for(var $=P.allpts,G=0;G+3<$.length;G+=2)if(BN(r,e,$[G],$[G+1],$[G+2],$[G+3],N)&&O>(V=qN(r,e,$[G],$[G+1],$[G+2],$[G+3])))return m(S,V),!0}else if(P.edgeType==="bezier"||P.edgeType==="multibezier"||P.edgeType==="self"||P.edgeType==="compound"){for(var $=P.allpts,G=0;G+5<P.allpts.length;G+=4)if(ON(r,e,$[G],$[G+1],$[G+2],$[G+3],$[G+4],$[G+5],N)&&O>(V=LN(r,e,$[G],$[G+1],$[G+2],$[G+3],$[G+4],$[G+5])))return m(S,V),!0}for(var U=U||A.source,J=J||A.target,W=a.getArrowWidth(I,D),H=[{name:"source",x:P.arrowStartX,y:P.arrowStartY,angle:P.srcArrowAngle},{name:"target",x:P.arrowEndX,y:P.arrowEndY,angle:P.tgtArrowAngle},{name:"mid-source",x:P.midX,y:P.midY,angle:P.midsrcArrowAngle},{name:"mid-target",x:P.midX,y:P.midY,angle:P.midtgtArrowAngle}],G=0;G<H.length;G++){var Z=H[G],ne=i.arrowShapes[S.pstyle(Z.name+"-arrow-shape").value],F=S.pstyle("width").pfValue;if(ne.roughCollide(r,e,W,Z.angle,{x:Z.x,y:Z.y},F,c)&&ne.collide(r,e,W,Z.angle,{x:Z.x,y:Z.y},F,c))return m(S),!0}l&&s.length>0&&(b(U),b(J))}function x(S,A,P){return qt(S,A,P)}function _(S,A){var P=S._private,I=h,D;A?D=A+"-":D="",S.boundingBox();var M=P.labelBounds[A||"main"],O=S.pstyle(D+"label").value,N=S.pstyle("text-events").strValue==="yes";if(!(!N||!O)){var V=x(P.rscratch,"labelX",A),$=x(P.rscratch,"labelY",A),G=x(P.rscratch,"labelAngle",A),U=S.pstyle(D+"text-margin-x").pfValue,J=S.pstyle(D+"text-margin-y").pfValue,W=M.x1-I-U,H=M.x2+I-U,Z=M.y1-I-J,ne=M.y2+I-J;if(G){var F=Math.cos(G),z=Math.sin(G),j=function(le,he){return le=le-V,he=he-$,{x:le*F-he*z+V,y:le*z+he*F+$}},ee=j(W,Z),ie=j(W,ne),oe=j(H,Z),Y=j(H,ne),X=[ee.x+U,ee.y+J,oe.x+U,oe.y+J,Y.x+U,Y.y+J,ie.x+U,ie.y+J];if(Nt(r,e,X))return m(S),!0}else if(pa(M,r,e))return m(S),!0}}for(var C=o.length-1;C>=0;C--){var R=o[C];R.isNode()?b(R)||_(R):w(R)||_(R)||_(R,"source")||_(R,"target")}return s};ui.getAllInBox=function(r,e,t,n){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),o=2/i,s=[],u=Math.min(r,t),l=Math.max(r,t),c=Math.min(e,n),v=Math.max(e,n);r=u,t=l,e=c,n=v;var h=Dt({x1:r,y1:e,x2:t,y2:n}),g=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],p=[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]],[g[3],g[0]]];function E(le,he,be){return qt(le,he,be)}function m(le,he){var be=le._private,fe=o,ue="";le.boundingBox();var Se=be.labelBounds.main;if(!Se)return null;var Ae=E(be.rscratch,"labelX",he),Te=E(be.rscratch,"labelY",he),Pe=E(be.rscratch,"labelAngle",he),Ie=le.pstyle(ue+"text-margin-x").pfValue,Le=le.pstyle(ue+"text-margin-y").pfValue,Fe=Se.x1-fe-Ie,je=Se.x2+fe-Ie,lr=Se.y1-fe-Le,ir=Se.y2+fe-Le;if(Pe){var Xe=Math.cos(Pe),fr=Math.sin(Pe),Ue=function(ge,L){return ge=ge-Ae,L=L-Te,{x:ge*Xe-L*fr+Ae,y:ge*fr+L*Xe+Te}};return[Ue(Fe,lr),Ue(je,lr),Ue(je,ir),Ue(Fe,ir)]}else return[{x:Fe,y:lr},{x:je,y:lr},{x:je,y:ir},{x:Fe,y:ir}]}function b(le,he,be,fe){function ue(Se,Ae,Te){return(Te.y-Se.y)*(Ae.x-Se.x)>(Ae.y-Se.y)*(Te.x-Se.x)}return ue(le,be,fe)!==ue(he,be,fe)&&ue(le,he,be)!==ue(le,he,fe)}for(var w=0;w<a.length;w++){var x=a[w];if(x.isNode()){var _=x,C=_.pstyle("text-events").strValue==="yes",R=_.pstyle("box-selection").strValue,S=_.pstyle("box-select-labels").strValue==="yes";if(R==="none")continue;var A=(R==="overlap"||S)&&C,P=_.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:A});if(R==="contain"){var I=!1;if(S&&C){var D=m(_);D&&Tc(D,g)&&(s.push(_),I=!0)}!I&&h2(h,P)&&s.push(_)}else if(R==="overlap"&&Om(h,P)){var M=_.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),O=[{x:M.x1,y:M.y1},{x:M.x2,y:M.y1},{x:M.x2,y:M.y2},{x:M.x1,y:M.y2}];if(Tc(O,g))s.push(_);else{var N=m(_);N&&Tc(N,g)&&s.push(_)}}}else{var V=x,$=V._private,G=$.rscratch,U=V.pstyle("box-selection").strValue;if(U==="none")continue;if(U==="contain"){if(G.startX!=null&&G.startY!=null&&!pa(h,G.startX,G.startY)||G.endX!=null&&G.endY!=null&&!pa(h,G.endX,G.endY))continue;if(G.edgeType==="bezier"||G.edgeType==="multibezier"||G.edgeType==="self"||G.edgeType==="compound"||G.edgeType==="segments"||G.edgeType==="haystack"){for(var J=$.rstyle.bezierPts||$.rstyle.linePts||$.rstyle.haystackPts,W=!0,H=0;H<J.length;H++)if(!nw(h,J[H])){W=!1;break}W&&s.push(V)}else G.edgeType==="straight"&&s.push(V)}else if(U==="overlap"){var Z=!1;if(G.startX!=null&&G.startY!=null&&G.endX!=null&&G.endY!=null&&(pa(h,G.startX,G.startY)||pa(h,G.endX,G.endY)))s.push(V),Z=!0;else if(!Z&&G.edgeType==="haystack"){for(var ne=$.rstyle.haystackPts,F=0;F<ne.length;F++)if(nw(h,ne[F])){s.push(V),Z=!0;break}}if(!Z){var z=$.rstyle.bezierPts||$.rstyle.linePts||$.rstyle.haystackPts;if((!z||z.length<2)&&G.edgeType==="straight"&&G.startX!=null&&G.startY!=null&&G.endX!=null&&G.endY!=null&&(z=[{x:G.startX,y:G.startY},{x:G.endX,y:G.endY}]),!z||z.length<2)continue;for(var j=0;j<z.length-1;j++){for(var ee=z[j],ie=z[j+1],oe=0;oe<p.length;oe++){var Y=Kr(p[oe],2),X=Y[0],re=Y[1];if(b(ee,ie,X,re)){s.push(V),Z=!0;break}}if(Z)break}}}}}return s};var Qu={};Qu.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,c,v,h,g,b,w;if(t?(c=e.haystackPts[0],v=e.haystackPts[1],h=e.haystackPts[2],g=e.haystackPts[3]):(c=e.arrowStartX,v=e.arrowStartY,h=e.arrowEndX,g=e.arrowEndY),b=e.midX,w=e.midY,i)u=c-e.segpts[0],l=v-e.segpts[1];else if(a||o||s||n){var p=e.allpts,E=at(p[0],p[2],p[4],.1),m=at(p[1],p[3],p[5],.1);u=c-E,l=v-m}else u=c-b,l=v-w;e.srcArrowAngle=pu(u,l);var b=e.midX,w=e.midY;if(t&&(b=(c+h)/2,w=(v+g)/2),u=h-c,l=g-v,i){var p=e.allpts;if(p.length/2%2===0){var x=p.length/2,_=x-2;u=p[x]-p[_],l=p[x+1]-p[_+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var x=p.length/2-1,_=x-2;u=p[x]-p[_],l=p[x+1]-p[_+1]}}else if(a||o||s){var p=e.allpts,C=e.ctrlpts,R,S,A,P;if(C.length/2%2===0){var I=p.length/2-1,D=I+2,M=D+2;R=at(p[I],p[D],p[M],0),S=at(p[I+1],p[D+1],p[M+1],0),A=at(p[I],p[D],p[M],1e-4),P=at(p[I+1],p[D+1],p[M+1],1e-4)}else{var D=p.length/2-1,I=D-2,M=D+2;R=at(p[I],p[D],p[M],.4999),S=at(p[I+1],p[D+1],p[M+1],.4999),A=at(p[I],p[D],p[M],.5),P=at(p[I+1],p[D+1],p[M+1],.5)}u=A-R,l=P-S}if(e.midtgtArrowAngle=pu(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var x=p.length/2-1,O=x+2;u=-(p[O]-p[x]),l=-(p[O+1]-p[x+1])}}}if(e.midsrcArrowAngle=pu(u,l),i)u=h-e.segpts[e.segpts.length-2],l=g-e.segpts[e.segpts.length-1];else if(a||o||s||n){var p=e.allpts,N=p.length,E=at(p[N-6],p[N-4],p[N-2],.9),m=at(p[N-5],p[N-3],p[N-1],.9);u=h-E,l=g-m}else u=h-b,l=g-w;e.tgtArrowAngle=pu(u,l)};Qu.getArrowWidth=Qu.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=n,n)};var gm,pm,An={},an={},Fx,zx,Qa,Lu,Un,Ka,Za,Tn,Ni,Cu,uA,lA,ym,mm,$x,Vx=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},J5=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},e$=function(e,t,n,a,i){if(e!==$x?Vx(t,e,An):J5(an,An),Vx(t,n,an),Fx=An.nx*an.ny-An.ny*an.nx,zx=An.nx*an.nx-An.ny*-an.ny,Un=Math.asin(Math.max(-1,Math.min(1,Fx))),Math.abs(Un)<1e-6){gm=t.x,pm=t.y,Za=Ni=0;return}Qa=1,Lu=!1,zx<0?Un<0?Un=Math.PI+Un:(Un=Math.PI-Un,Qa=-1,Lu=!0):Un>0&&(Qa=-1,Lu=!0),t.radius!==void 0?Ni=t.radius:Ni=a,Ka=Un/2,Cu=Math.min(An.len/2,an.len/2),i?(Tn=Math.abs(Math.cos(Ka)*Ni/Math.sin(Ka)),Tn>Cu?(Tn=Cu,Za=Math.abs(Tn*Math.sin(Ka)/Math.cos(Ka))):Za=Ni):(Tn=Math.min(Cu,Ni),Za=Math.abs(Tn*Math.sin(Ka)/Math.cos(Ka))),ym=t.x+an.nx*Tn,mm=t.y+an.ny*Tn,gm=ym-an.ny*Za*Qa,pm=mm+an.nx*Za*Qa,uA=t.x+An.nx*Tn,lA=t.y+An.ny*Tn,$x=t};function fA(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Um(r,e,t,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(e$(r,e,t,n,a),{cx:gm,cy:pm,radius:Za,startX:uA,startY:lA,stopX:ym,stopY:mm,startAngle:An.ang+Math.PI/2*Qa,endAngle:an.ang-Math.PI/2*Qa,counterClockwise:Lu})}var as=.01,r$=Math.sqrt(2*as),_t={};_t.findMidptPtsEtc=function(r,e){var t=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=r.pstyle("source-endpoint"),s=r.pstyle("target-endpoint"),u=o.units!=null&&s.units!=null,l=function(C,R,S,A){var P=A-R,I=S-C,D=Math.sqrt(I*I+P*P);return{x:-P/D,y:I/D}},c=r.pstyle("edge-distances").value;switch(c){case"node-position":i=t;break;case"intersection":i=n;break;case"endpoints":{if(u){var v=this.manualEndptToPx(r.source()[0],o),h=Kr(v,2),g=h[0],p=h[1],E=this.manualEndptToPx(r.target()[0],s),m=Kr(E,2),b=m[0],w=m[1],x={x1:g,y1:p,x2:b,y2:w};a=l(g,p,b,w),i=x}else Er("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}};_t.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],n=t._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source,s=n.target,u=o.position(),l=s.position(),c=o.width(),v=s.width(),h=o.height(),g=s.height(),p=t.pstyle("haystack-radius").value,E=p/2;a.haystackPts=a.allpts=[a.source.x*c*E+u.x,a.source.y*h*E+u.y,a.target.x*v*E+l.x,a.target.y*g*E+l.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}};_t.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),a=r.pstyle("segment-distances"),i=r.pstyle("segment-radii"),o=r.pstyle("radius-type"),s=Math.min(n.pfValue.length,a.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var c=0;c<s;c++){var v=n.pfValue[c],h=a.pfValue[c],g=1-v,p=v,E=this.findMidptPtsEtc(r,e),m=E.midptPts,b=E.vectorNormInverse,w={x:m.x1*g+m.x2*p,y:m.y1*g+m.y2*p};t.segpts.push(w.x+b.x*h,w.y+b.y*h),t.radii.push(i.pfValue[c]!==void 0?i.pfValue[c]:u),t.isArcRadius.push((o.pfValue[c]!==void 0?o.pfValue[c]:l)==="arc-radius")}};_t.findLoopPoints=function(r,e,t,n){var a=r._private.rscratch,i=e.dirCounts,o=e.srcPos,s=r.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=r.pstyle("loop-direction").pfValue,c=r.pstyle("loop-sweep").pfValue,v=r.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=t,g=v;n&&(h=0,g=u);var p=l-Math.PI/2,E=p-c/2,m=p+c/2,b=l+"_"+c;h=i[b]===void 0?i[b]=0:++i[b],a.ctrlpts=[o.x+Math.cos(E)*1.4*g*(h/3+1),o.y+Math.sin(E)*1.4*g*(h/3+1),o.x+Math.cos(m)*1.4*g*(h/3+1),o.y+Math.sin(m)*1.4*g*(h/3+1)]};_t.findCompoundLoopPoints=function(r,e,t,n){var a=r._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,c=e.tgtH,v=r.pstyle("control-point-step-size").pfValue,h=r.pstyle("control-point-distances"),g=h?h.pfValue[0]:void 0,p=t,E=v;n&&(p=0,E=g);var m=50,b={x:i.x-s/2,y:i.y-u/2},w={x:o.x-l/2,y:o.y-c/2},x={x:Math.min(b.x,w.x),y:Math.min(b.y,w.y)},_=.5,C=Math.max(_,Math.log(s*as)),R=Math.max(_,Math.log(l*as));a.ctrlpts=[x.x,x.y-(1+Math.pow(m,1.12)/100)*E*(p/3+1)*C,x.x-(1+Math.pow(m,1.12)/100)*E*(p/3+1)*R,x.y]};_t.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};_t.findBezierPoints=function(r,e,t,n,a){var i=r._private.rscratch,o=r.pstyle("control-point-step-size").pfValue,s=r.pstyle("control-point-distances"),u=r.pstyle("control-point-weights"),l=s&&u?Math.min(s.value.length,u.value.length):1,c=s?s.pfValue[0]:void 0,v=u.value[0],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var g=0;g<l;g++){var p=(.5-e.eles.length/2+t)*o*(a?-1:1),E=void 0,m=Bm(p);h&&(c=s?s.pfValue[g]:o,v=u.value[g]),n?E=c:E=c!==void 0?m*c:void 0;var b=E!==void 0?E:p,w=1-v,x=v,_=this.findMidptPtsEtc(r,e),C=_.midptPts,R=_.vectorNormInverse,S={x:C.x1*w+C.x2*x,y:C.y1*w+C.y2*x};i.ctrlpts.push(S.x+R.x*b,S.y+R.y*b)}};_t.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",c=e.posPts,v=e.srcW,h=e.srcH,g=e.tgtW,p=e.tgtH,E=r.pstyle("edge-distances").value,m=E!=="node-position",b=r.pstyle("taxi-direction").value,w=b,x=r.pstyle("taxi-turn"),_=x.units==="%",C=x.pfValue,R=C<0,S=r.pstyle("taxi-turn-min-distance").pfValue,A=m?(v+g)/2:0,P=m?(h+p)/2:0,I=c.x2-c.x1,D=c.y2-c.y1,M=function(L,se){return L>0?Math.max(L-se,0):Math.min(L+se,0)},O=M(I,A),N=M(D,P),V=!1;w===l?b=Math.abs(O)>Math.abs(N)?a:n:w===u||w===s?(b=n,V=!0):(w===i||w===o)&&(b=a,V=!0);var $=b===n,G=$?N:O,U=$?D:I,J=Bm(U),W=!1;!(V&&(_||R))&&(w===s&&U<0||w===u&&U>0||w===i&&U>0||w===o&&U<0)&&(J*=-1,G=J*Math.abs(G),W=!0);var H;if(_){var Z=C<0?1+C:C;H=Z*G}else{var ne=C<0?G:0;H=ne+C*J}var F=function(L){return Math.abs(L)<S||Math.abs(L)>=Math.abs(G)},z=F(H),j=F(Math.abs(G)-Math.abs(H)),ee=z||j;if(ee&&!W)if($){var ie=Math.abs(U)<=h/2,oe=Math.abs(I)<=g/2;if(ie){var Y=(c.x1+c.x2)/2,X=c.y1,re=c.y2;t.segpts=[Y,X,Y,re]}else if(oe){var le=(c.y1+c.y2)/2,he=c.x1,be=c.x2;t.segpts=[he,le,be,le]}else t.segpts=[c.x1,c.y2]}else{var fe=Math.abs(U)<=v/2,ue=Math.abs(D)<=p/2;if(fe){var Se=(c.y1+c.y2)/2,Ae=c.x1,Te=c.x2;t.segpts=[Ae,Se,Te,Se]}else if(ue){var Pe=(c.x1+c.x2)/2,Ie=c.y1,Le=c.y2;t.segpts=[Pe,Ie,Pe,Le]}else t.segpts=[c.x2,c.y1]}else if($){var Fe=c.y1+H+(m?h/2*J:0),je=c.x1,lr=c.x2;t.segpts=[je,Fe,lr,Fe]}else{var ir=c.x1+H+(m?v/2*J:0),Xe=c.y1,fr=c.y2;t.segpts=[ir,Xe,ir,fr]}if(t.isRound){var Ue=r.pstyle("taxi-radius").value,Oe=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(Ue),t.isArcRadius=new Array(t.segpts.length/2).fill(Oe)}};_t.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,c=e.tgtShape,v=e.srcCornerRadius,h=e.tgtCornerRadius,g=e.srcRs,p=e.tgtRs,E=!De(t.startX)||!De(t.startY),m=!De(t.arrowStartX)||!De(t.arrowStartY),b=!De(t.endX)||!De(t.endY),w=!De(t.arrowEndX)||!De(t.arrowEndY),x=3,_=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=x*_,R=ni({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),S=R<C,A=ni({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),P=A<C,I=!1;if(E||m||S){I=!0;var D={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},M=Math.sqrt(D.x*D.x+D.y*D.y),O={x:D.x/M,y:D.y/M},N=Math.max(i,o),V={x:t.ctrlpts[0]+O.x*2*N,y:t.ctrlpts[1]+O.y*2*N},$=l.intersectLine(n.x,n.y,i,o,V.x,V.y,0,v,g);S?(t.ctrlpts[0]=t.ctrlpts[0]+O.x*(C-R),t.ctrlpts[1]=t.ctrlpts[1]+O.y*(C-R)):(t.ctrlpts[0]=$[0]+O.x*C,t.ctrlpts[1]=$[1]+O.y*C)}if(b||w||P){I=!0;var G={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},U=Math.sqrt(G.x*G.x+G.y*G.y),J={x:G.x/U,y:G.y/U},W=Math.max(i,o),H={x:t.ctrlpts[0]+J.x*2*W,y:t.ctrlpts[1]+J.y*2*W},Z=c.intersectLine(a.x,a.y,s,u,H.x,H.y,0,h,p);P?(t.ctrlpts[0]=t.ctrlpts[0]+J.x*(C-A),t.ctrlpts[1]=t.ctrlpts[1]+J.y*(C-A)):(t.ctrlpts[0]=Z[0]+J.x*C,t.ctrlpts[1]=Z[1]+J.y*C)}I&&this.findEndpoints(r)}};_t.storeAllpts=function(r){var e=r._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=at(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=at(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(Um({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var c=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[c],e.midY=e.segpts[c+1];else{var v={x:e.segpts[c],y:e.segpts[c+1]},h=e.roundCorners[c/2];if(h.radius===0){var g={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=v.x,e.midY=v.y,e.midVector=[v.y-g.y,g.x-v.x]}else{var p=[v.x-h.cx,v.y-h.cy],E=h.radius/Math.sqrt(Math.pow(p[0],2)+Math.pow(p[1],2));p=p.map(function(m){return m*E}),e.midX=h.cx+p[0],e.midY=h.cy+p[1],e.midVector=p}}}}};_t.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||De(e.startX)&&De(e.startY)&&De(e.endX)&&De(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Er("Edge `"+r.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};_t.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,n=t.cy,a=n.hasCompoundNodes(),i=new Kn,o=function(P,I){return[].concat(Vu(P),[I?1:0]).join("-")},s=[],u=[],l=0;l<r.length;l++){var c=r[l],v=c._private,h=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(h==="haystack"){u.push(c);continue}var g=h==="unbundled-bezier"||ga(h,"segments")||h==="straight"||h==="straight-triangle"||ga(h,"taxi"),p=h==="unbundled-bezier"||h==="bezier",E=v.source,m=v.target,b=E.poolIndex(),w=m.poolIndex(),x=[b,w].sort(),_=o(x,g),C=i.get(_);C==null&&(C={eles:[]},s.push({pairId:x,edgeIsUnbundled:g}),i.set(_,C)),C.eles.push(c),g&&(C.hasUnbundled=!0),p&&(C.hasBezier=!0)}}for(var R=function(){var P=s[S],I=P.pairId,D=P.edgeIsUnbundled,M=o(I,D),O=i.get(M),N;if(!O.hasUnbundled){var V=O.eles[0].parallelEdges().filter(function(Oe){return Oe.isBundledBezier()});Dm(O.eles),V.forEach(function(Oe){return O.eles.push(Oe)}),O.eles.sort(function(Oe,ge){return Oe.poolIndex()-ge.poolIndex()})}var $=O.eles[0],G=$.source(),U=$.target();if(G.poolIndex()>U.poolIndex()){var J=G;G=U,U=J}var W=O.srcPos=G.position(),H=O.tgtPos=U.position(),Z=O.srcW=G.outerWidth(),ne=O.srcH=G.outerHeight(),F=O.tgtW=U.outerWidth(),z=O.tgtH=U.outerHeight(),j=O.srcShape=t.nodeShapes[e.getNodeShape(G)],ee=O.tgtShape=t.nodeShapes[e.getNodeShape(U)],ie=O.srcCornerRadius=G.pstyle("corner-radius").value==="auto"?"auto":G.pstyle("corner-radius").pfValue,oe=O.tgtCornerRadius=U.pstyle("corner-radius").value==="auto"?"auto":U.pstyle("corner-radius").pfValue,Y=O.tgtRs=U._private.rscratch,X=O.srcRs=G._private.rscratch;O.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re<O.eles.length;re++){var le=O.eles[re],he=le[0]._private.rscratch,be=le.pstyle("curve-style").value,fe=be==="unbundled-bezier"||ga(be,"segments")||ga(be,"taxi"),ue=!G.same(le.source());if(!O.calculatedIntersection&&G!==U&&(O.hasBezier||O.hasUnbundled)){O.calculatedIntersection=!0;var Se=j.intersectLine(W.x,W.y,Z,ne,H.x,H.y,0,ie,X),Ae=O.srcIntn=Se,Te=ee.intersectLine(H.x,H.y,F,z,W.x,W.y,0,oe,Y),Pe=O.tgtIntn=Te,Ie=O.intersectionPts={x1:Se[0],x2:Te[0],y1:Se[1],y2:Te[1]},Le=O.posPts={x1:W.x,x2:H.x,y1:W.y,y2:H.y},Fe=Te[1]-Se[1],je=Te[0]-Se[0],lr=Math.sqrt(je*je+Fe*Fe);De(lr)&&lr>=r$||(lr=Math.sqrt(Math.max(je*je,as)+Math.max(Fe*Fe,as)));var ir=O.vector={x:je,y:Fe},Xe=O.vectorNorm={x:ir.x/lr,y:ir.y/lr},fr={x:-Xe.y,y:Xe.x};O.nodesOverlap=!De(lr)||ee.checkPoint(Se[0],Se[1],0,F,z,H.x,H.y,oe,Y)||j.checkPoint(Te[0],Te[1],0,Z,ne,W.x,W.y,ie,X),O.vectorNormInverse=fr,N={nodesOverlap:O.nodesOverlap,dirCounts:O.dirCounts,calculatedIntersection:!0,hasBezier:O.hasBezier,hasUnbundled:O.hasUnbundled,eles:O.eles,srcPos:H,srcRs:Y,tgtPos:W,tgtRs:X,srcW:F,srcH:z,tgtW:Z,tgtH:ne,srcIntn:Pe,tgtIntn:Ae,srcShape:ee,tgtShape:j,posPts:{x1:Le.x2,y1:Le.y2,x2:Le.x1,y2:Le.y1},intersectionPts:{x1:Ie.x2,y1:Ie.y2,x2:Ie.x1,y2:Ie.y1},vector:{x:-ir.x,y:-ir.y},vectorNorm:{x:-Xe.x,y:-Xe.y},vectorNormInverse:{x:-fr.x,y:-fr.y}}}var Ue=ue?N:O;he.nodesOverlap=Ue.nodesOverlap,he.srcIntn=Ue.srcIntn,he.tgtIntn=Ue.tgtIntn,he.isRound=be.startsWith("round"),a&&(G.isParent()||G.isChild()||U.isParent()||U.isChild())&&(G.parents().anySame(U)||U.parents().anySame(G)||G.same(U)&&G.isParent())?e.findCompoundLoopPoints(le,Ue,re,fe):G===U?e.findLoopPoints(le,Ue,re,fe):be.endsWith("segments")?e.findSegmentsPoints(le,Ue):be.endsWith("taxi")?e.findTaxiPoints(le,Ue):be==="straight"||!fe&&O.eles.length%2===1&&re===Math.floor(O.eles.length/2)?e.findStraightEdgePoints(le):e.findBezierPoints(le,Ue,re,fe,ue),e.findEndpoints(le),e.tryToCorrectInvalidPoints(le,Ue),e.checkForInvalidEdgeWarning(le),e.storeAllpts(le),e.storeEdgeProjections(le),e.calculateArrowAngles(le),e.recalculateEdgeLabelProjections(le),e.calculateLabelAngles(le)}},S=0;S<s.length;S++)R();this.findHaystackPoints(u)}};function cA(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var n=r[t],a=r[t+1];e.push({x:n,y:a})}return e}}_t.getSegmentPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="segments")return cA(e.segpts)};_t.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return cA(e.ctrlpts)};_t.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var ys={};ys.manualEndptToPx=function(r,e){var t=this,n=r.position(),a=r.outerWidth(),i=r.outerHeight(),o=r._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*a),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=n.x,s[1]+=n.y,s}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(a,i),c=[n.x+Math.cos(u)*l,n.y+Math.sin(u)*l];return t.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,a,i,c[0],c[1],0,r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,o)}};ys.findEndpoints=function(r){var e,t,n,a,i=this,o,s=r.source()[0],u=r.target()[0],l=s.position(),c=u.position(),v=r.pstyle("target-arrow-shape").value,h=r.pstyle("source-arrow-shape").value,g=r.pstyle("target-distance-from-node").pfValue,p=r.pstyle("source-distance-from-node").pfValue,E=s._private.rscratch,m=u._private.rscratch,b=r.pstyle("curve-style").value,w=r._private.rscratch,x=w.edgeType,_=ga(b,"taxi"),C=x==="self"||x==="compound",R=x==="bezier"||x==="multibezier"||C,S=x!=="bezier",A=x==="straight"||x==="segments",P=x==="segments",I=R||S||A,D=C||_,M=r.pstyle("source-endpoint"),O=D?"outside-to-node":M.value,N=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,V=r.pstyle("target-endpoint"),$=D?"outside-to-node":V.value,G=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;w.srcManEndpt=M,w.tgtManEndpt=V;var U,J,W,H,Z=(e=(V==null||(t=V.pfValue)===null||t===void 0?void 0:t.length)===2?V.pfValue:null)!==null&&e!==void 0?e:[0,0],ne=(n=(M==null||(a=M.pfValue)===null||a===void 0?void 0:a.length)===2?M.pfValue:null)!==null&&n!==void 0?n:[0,0];if(R){var F=[w.ctrlpts[0],w.ctrlpts[1]],z=S?[w.ctrlpts[w.ctrlpts.length-2],w.ctrlpts[w.ctrlpts.length-1]]:F;U=z,J=F}else if(A){var j=P?w.segpts.slice(0,2):[c.x+Z[0],c.y+Z[1]],ee=P?w.segpts.slice(w.segpts.length-2):[l.x+ne[0],l.y+ne[1]];U=ee,J=j}if($==="inside-to-node")o=[c.x,c.y];else if(V.units)o=this.manualEndptToPx(u,V);else if($==="outside-to-line")o=w.tgtIntn;else if($==="outside-to-node"||$==="outside-to-node-or-label"?W=U:($==="outside-to-line"||$==="outside-to-line-or-label")&&(W=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(c.x,c.y,u.outerWidth(),u.outerHeight(),W[0],W[1],0,G,m),$==="outside-to-node-or-label"||$==="outside-to-line-or-label"){var ie=u._private.rscratch,oe=ie.labelWidth,Y=ie.labelHeight,X=ie.labelX,re=ie.labelY,le=oe/2,he=Y/2,be=u.pstyle("text-valign").value;be==="top"?re-=he:be==="bottom"&&(re+=he);var fe=u.pstyle("text-halign").value;fe==="left"?X-=le:fe==="right"&&(X+=le);var ue=Jo(W[0],W[1],[X-le,re-he,X+le,re-he,X+le,re+he,X-le,re+he],c.x,c.y);if(ue.length>0){var Se=l,Ae=Ya(Se,Gi(o)),Te=Ya(Se,Gi(ue)),Pe=Ae;if(Te<Ae&&(o=ue,Pe=Te),ue.length>2){var Ie=Ya(Se,{x:ue[2],y:ue[3]});Ie<Pe&&(o=[ue[2],ue[3]])}}}var Le=yu(o,U,i.arrowShapes[v].spacing(r)+g),Fe=yu(o,U,i.arrowShapes[v].gap(r)+g);if(w.endX=Fe[0],w.endY=Fe[1],w.arrowEndX=Le[0],w.arrowEndY=Le[1],O==="inside-to-node")o=[l.x,l.y];else if(M.units)o=this.manualEndptToPx(s,M);else if(O==="outside-to-line")o=w.srcIntn;else if(O==="outside-to-node"||O==="outside-to-node-or-label"?H=J:(O==="outside-to-line"||O==="outside-to-line-or-label")&&(H=[c.x,c.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),H[0],H[1],0,N,E),O==="outside-to-node-or-label"||O==="outside-to-line-or-label"){var je=s._private.rscratch,lr=je.labelWidth,ir=je.labelHeight,Xe=je.labelX,fr=je.labelY,Ue=lr/2,Oe=ir/2,ge=s.pstyle("text-valign").value;ge==="top"?fr-=Oe:ge==="bottom"&&(fr+=Oe);var L=s.pstyle("text-halign").value;L==="left"?Xe-=Ue:L==="right"&&(Xe+=Ue);var se=Jo(H[0],H[1],[Xe-Ue,fr-Oe,Xe+Ue,fr-Oe,Xe+Ue,fr+Oe,Xe-Ue,fr+Oe],l.x,l.y);if(se.length>0){var de=c,ve=Ya(de,Gi(o)),ye=Ya(de,Gi(se)),Me=ve;if(ye<ve&&(o=[se[0],se[1]],Me=ye),se.length>2){var _e=Ya(de,{x:se[2],y:se[3]});_e<Me&&(o=[se[2],se[3]])}}}var ze=yu(o,J,i.arrowShapes[h].spacing(r)+p),qe=yu(o,J,i.arrowShapes[h].gap(r)+p);w.startX=qe[0],w.startY=qe[1],w.arrowStartX=ze[0],w.arrowStartY=ze[1],I&&(!De(w.startX)||!De(w.startY)||!De(w.endX)||!De(w.endY)?w.badLine=!0:w.badLine=!1)};ys.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};ys.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Hm={};function t$(r,e,t){for(var n=function(l,c,v,h){return at(l,c,v,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<r.bezierProjPcts.length;o++){var s=r.bezierProjPcts[o];i.push({x:n(t[0],t[2],t[4],s),y:n(t[1],t[3],t[5],s)})}}Hm.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,n=t.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<t.allpts.length;a+=4)t$(this,r,t.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<t.allpts.length;a+=2)i.push({x:t.allpts[a],y:t.allpts[a+1]});else if(n==="haystack"){var o=t.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth};Hm.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Bn={};Bn.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!xa(e)){var t,n,a=r._private,i=r.width(),o=r.height(),s=r.padding(),u=r.position(),l=r.pstyle("text-halign").strValue,c=r.pstyle("text-valign").strValue,v=a.rscratch,h=a.rstyle;switch(l){case"left":t=u.x-i/2-s;break;case"right":t=u.x+i/2+s;break;default:t=u.x}switch(c){case"top":n=u.y-o/2-s;break;case"bottom":n=u.y+o/2+s;break;default:n=u.y}v.labelX=t,v.labelY=n,h.labelX=t,h.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var dA=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},vA=function(e,t){var n=t.x-e.x,a=t.y-e.y;return dA(n,a)},n$=function(e,t,n,a){var i=Qo(0,a-.001,1),o=Qo(0,a+.001,1),s=Ki(e,t,n,i),u=Ki(e,t,n,o);return vA(s,u)};Bn.recalculateEdgeLabelProjections=function(r){var e,t=r._private,n=t.rscratch,a=this,i={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var o=function(v,h,g){Hn(t.rscratch,v,h,g),Hn(t.rstyle,v,h,g)};o("labelX",null,e.x),o("labelY",null,e.y);var s=dA(n.midDispX,n.midDispY);o("labelAutoAngle",null,s);var u=function(){if(u.cache)return u.cache;for(var v=[],h=0;h+5<n.allpts.length;h+=4){var g={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},E={x:n.allpts[h+4],y:n.allpts[h+5]};v.push({p0:g,p1:p,p2:E,startDist:0,length:0,segments:[]})}var m=t.rstyle.bezierPts,b=a.bezierProjPcts.length;function w(S,A,P,I,D){var M=ni(A,P),O=S.segments[S.segments.length-1],N={p0:A,p1:P,t0:I,t1:D,startDist:O?O.startDist+O.length:0,length:M};S.segments.push(N),S.length+=M}for(var x=0;x<v.length;x++){var _=v[x],C=v[x-1];C&&(_.startDist=C.startDist+C.length),w(_,_.p0,m[x*b],0,a.bezierProjPcts[0]);for(var R=0;R<b-1;R++)w(_,m[x*b+R],m[x*b+R+1],a.bezierProjPcts[R],a.bezierProjPcts[R+1]);w(_,m[x*b+b-1],_.p2,a.bezierProjPcts[b-1],1)}return u.cache=v},l=function(v){var h,g=v==="source";if(i[v]){var p=r.pstyle(v+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var E=u(),m,b=0,w=0,x=0;x<E.length;x++){for(var _=E[g?x:E.length-1-x],C=0;C<_.segments.length;C++){var R=_.segments[g?C:_.segments.length-1-C],S=x===E.length-1&&C===_.segments.length-1;if(b=w,w+=R.length,w>=p||S){m={cp:_,segment:R};break}}if(m)break}var A=m.cp,P=m.segment,I=(p-b)/P.length,D=P.t1-P.t0,M=g?P.t0+D*I:P.t1-D*I;M=Qo(0,M,1),e=Ki(A.p0,A.p1,A.p2,M),h=n$(A.p0,A.p1,A.p2,M);break}case"straight":case"segments":case"haystack":{for(var O=0,N,V,$,G,U=n.allpts.length,J=0;J+3<U&&(g?($={x:n.allpts[J],y:n.allpts[J+1]},G={x:n.allpts[J+2],y:n.allpts[J+3]}):($={x:n.allpts[U-2-J],y:n.allpts[U-1-J]},G={x:n.allpts[U-4-J],y:n.allpts[U-3-J]}),N=ni($,G),V=O,O+=N,!(O>=p));J+=2);var W=p-V,H=W/N;H=Qo(0,H,1),e=SN($,G,H),h=vA($,G);break}}o("labelX",v,e.x),o("labelY",v,e.y),o("labelAutoAngle",v,h)}};l("source"),l("target"),this.applyLabelDimensions(r)}};Bn.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Bn.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),a=ti(n,r._private.labelDimsKey);if(qt(t.rscratch,"prefixedLabelDimsKey",e)!==a){Hn(t.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(r,n),o=r.pstyle("line-height").pfValue,s=r.pstyle("text-wrap").strValue,u=qt(t.rscratch,"labelWrapCachedLines",e)||[],l=s!=="wrap"?1:Math.max(u.length,1),c=i.height/l,v=c*o,h=i.width,g=i.height+(l-1)*(o-1)*c;Hn(t.rstyle,"labelWidth",e,h),Hn(t.rscratch,"labelWidth",e,h),Hn(t.rstyle,"labelHeight",e,g),Hn(t.rscratch,"labelHeight",e,g),Hn(t.rscratch,"labelLineHeight",e,v)}};Bn.getLabelText=function(r,e){var t=r._private,n=e?e+"-":"",a=r.pstyle(n+"label").strValue,i=r.pstyle("text-transform").value,o=function(ne,F){return F?(Hn(t.rscratch,ne,e,F),F):qt(t.rscratch,ne,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var s=r.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="",c=a.split(`
|
|
15
|
-
`),
|
|
16
|
-
`)),o("labelWrapKey",
|
|
17
|
-
`),m=0;m<E.length;m++){var b=E[m],w=v.measureText(b),x=Math.ceil(w.width),_=s;g=Math.max(x,g),p+=_}return g+=i,p+=i,{width:g,height:p}};Bn.calculateLabelAngle=function(r,e){var t=r._private,n=t.rscratch,a=r.isEdge(),i=e?e+"-":"",o=r.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:a&&s==="autorotate"?n.labelAutoAngle:s==="autorotate"?0:o.pfValue};Bn.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),n=r._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(r),t&&(a.sourceLabelAngle=e.calculateLabelAngle(r,"source"),a.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var hA={},Gx=28,Wx=!1;hA.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Gx||r.height()<Gx))return Wx||(Er("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Wx=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var n=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return t};var wl={};wl.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,n=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u],c=l._private,v=c.rstyle;v.clean=!1,v.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(o){var s=o.target;n(s)}).on("style.* background.*",function(o){var s=o.target;n(s,!1)});var a=function(o){if(o){var s=t.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],c=l._private.rstyle;l.isNode()&&!c.cleanConnected&&(n(l.connectedEdges()),c.cleanConnected=!0)}if(s)for(var v=0;v<s.length;v++){var h=s[v];h(o,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){a(!0)},t.beforeRender(a,t.beforeRenderPriorities.eleCalcs)};wl.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};wl.recalculateRenderedStyle=function(r,e){var t=function(_){return _._private.rstyle.cleanConnected};if(r.length!==0){var n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var o=r[i],s=o._private,u=s.rstyle;o.isEdge()&&(!t(o.source())||!t(o.target()))&&(u.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(x){return!x._private.rstyle.clean&&x.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?a.push(o):n.push(o),u.clean=!0)}for(var l=0;l<a.length;l++){var c=a[l],v=c._private,h=v.rstyle,g=c.position();this.recalculateNodeLabelProjection(c),h.nodeX=g.x,h.nodeY=g.y,h.nodeW=c.pstyle("width").pfValue,h.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var E=n[p],m=E._private,b=m.rstyle,w=m.rscratch;b.srcX=w.arrowStartX,b.srcY=w.arrowStartY,b.tgtX=w.arrowEndX,b.tgtY=w.arrowEndY,b.midX=w.midX,b.midY=w.midY,b.labelAngle=w.labelAngle,b.sourceLabelAngle=w.sourceLabelAngle,b.targetLabelAngle=w.targetLabelAngle}}}};var xl={};xl.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var n=r[t],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(var t=0;t<e.length;t++){var n=e[t];r.drag.push(n)}}};xl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};xl.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Y2),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var gA={};[ui,Qu,_t,ys,Hm,Bn,hA,wl,xl].forEach(function(r){He(gA,r)});var pA={};pA.getCachedImage=function(r,e,t){var n=this,a=n.imageCache=n.imageCache||{},i=a[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=a[r]=a[r]||{};var o=i.image=new Image;o.addEventListener("load",t),o.addEventListener("error",function(){o.error=!0});var s="data:",u=r.substring(0,s.length).toLowerCase()===s;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=r,o};var io={};io.registerBinding=function(r,e,t,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],o=0;o<r.length;o++){var s=r[o];if(s!==void 0){var u=this.binder(s);i.push(u.on.apply(u,a))}}return i}var u=this.binder(r);return u.on.apply(u,a)};io.binder=function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||gq(r);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});t.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var o=function(u,l,c){var v=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(v[2]={capture:c??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:v}),(r.addEventListener||r.on).apply(r,v),this};return{on:o,addEventListener:o,addListener:o,bind:o}};io.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};io.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};io.load=function(){var r=this,e=r.cy.window(),t=function(L){return L.selected()},n=function(L){var se=L.getRootNode();if(se&&se.nodeType===11&&se.host!==void 0)return se},a=function(L,se,de,ve){L==null&&(L=r.cy);for(var ye=0;ye<se.length;ye++){var Me=se[ye];L.emit({originalEvent:de,type:Me,position:ve})}},i=function(L){return L.shiftKey||L.metaKey||L.ctrlKey},o=function(L,se){var de=!0;if(r.cy.hasCompoundNodes()&&L&&L.pannable())for(var ve=0;se&&ve<se.length;ve++){var L=se[ve];if(L.isNode()&&L.isParent()&&!L.pannable()){de=!1;break}}else de=!0;return de},s=function(L){L[0]._private.grabbed=!0},u=function(L){L[0]._private.grabbed=!1},l=function(L){L[0]._private.rscratch.inDragLayer=!0},c=function(L){L[0]._private.rscratch.inDragLayer=!1},v=function(L){L[0]._private.rscratch.isGrabTarget=!0},h=function(L){L[0]._private.rscratch.isGrabTarget=!1},g=function(L,se){var de=se.addToList,ve=de.has(L);!ve&&L.grabbable()&&!L.locked()&&(de.merge(L),s(L))},p=function(L,se){if(L.cy().hasCompoundNodes()&&!(se.inDragLayer==null&&se.addToList==null)){var de=L.descendants();se.inDragLayer&&(de.forEach(l),de.connectedEdges().forEach(l)),se.addToList&&g(de,se)}},E=function(L,se){se=se||{};var de=L.cy().hasCompoundNodes();se.inDragLayer&&(L.forEach(l),L.neighborhood().stdFilter(function(ve){return!de||ve.isEdge()}).forEach(l)),se.addToList&&L.forEach(function(ve){g(ve,se)}),p(L,se),w(L,{inDragLayer:se.inDragLayer}),r.updateCachedGrabbedEles()},m=E,b=function(L){L&&(r.getCachedZSortedEles().forEach(function(se){u(se),c(se),h(se)}),r.updateCachedGrabbedEles())},w=function(L,se){if(!(se.inDragLayer==null&&se.addToList==null)&&L.cy().hasCompoundNodes()){var de=L.ancestors().orphans();if(!de.same(L)){var ve=de.descendants().spawnSelf().merge(de).unmerge(L).unmerge(L.descendants()),ye=ve.connectedEdges();se.inDragLayer&&(ye.forEach(l),ve.forEach(l)),se.addToList&&ve.forEach(function(Me){g(Me,se)})}}},x=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},_=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";_?(r.removeObserver=new MutationObserver(function(ge){for(var L=0;L<ge.length;L++){var se=ge[L],de=se.removedNodes;if(de)for(var ve=0;ve<de.length;ve++){var ye=de[ve];if(ye===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(ge){r.destroy()});var R=vs(function(){r.cy.resize()},100);_&&(r.styleObserver=new MutationObserver(R),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",R),C&&(r.resizeObserver=new ResizeObserver(R),r.resizeObserver.observe(r.container));var S=function(L,se){for(;L!=null;)se(L),L=L.parentNode},A=function(){r.invalidateContainerClientCoordsCache()};S(r.container,function(ge){r.registerBinding(ge,"transitionend",A),r.registerBinding(ge,"animationend",A),r.registerBinding(ge,"scroll",A)}),r.registerBinding(r.container,"contextmenu",function(ge){ge.preventDefault()});var P=function(){return r.selection[4]!==0},I=function(L){for(var se=r.findContainerClientCoords(),de=se[0],ve=se[1],ye=se[2],Me=se[3],_e=L.touches?L.touches:[L],ze=!1,qe=0;qe<_e.length;qe++){var We=_e[qe];if(de<=We.clientX&&We.clientX<=de+ye&&ve<=We.clientY&&We.clientY<=ve+Me){ze=!0;break}}if(!ze)return!1;for(var nr=r.container,er=L.target,$e=er.parentNode,or=!1;$e;){if($e===nr){or=!0;break}$e=$e.parentNode}return!!or};r.registerBinding(r.container,"mousedown",function(L){if(I(L)&&!(r.hoverData.which===1&&L.which!==1)){L.preventDefault(),x(),r.hoverData.capture=!0,r.hoverData.which=L.which;var se=r.cy,de=[L.clientX,L.clientY],ve=r.projectIntoViewport(de[0],de[1]),ye=r.selection,Me=r.findNearestElements(ve[0],ve[1],!0,!1),_e=Me[0],ze=r.dragData.possibleDragElements;r.hoverData.mdownPos=ve,r.hoverData.mdownGPos=de;var qe=function(rr){return{originalEvent:L,type:rr,position:{x:ve[0],y:ve[1]}}},We=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var rr=r.hoverData.down;rr?rr.emit(qe("taphold")):se.emit(qe("taphold"))}},r.tapholdDuration)};if(L.which==3){r.hoverData.cxtStarted=!0;var nr={originalEvent:L,type:"cxttapstart",position:{x:ve[0],y:ve[1]}};_e?(_e.activate(),_e.emit(nr),r.hoverData.down=_e):se.emit(nr),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(L.which==1){_e&&_e.activate();{if(_e!=null&&r.nodeIsGrabbable(_e)){var er=function(rr){rr.emit(qe("grab"))};if(v(_e),!_e.selected())ze=r.dragData.possibleDragElements=se.collection(),m(_e,{addToList:ze}),_e.emit(qe("grabon")).emit(qe("grab"));else{ze=r.dragData.possibleDragElements=se.collection();var $e=se.$(function(or){return or.isNode()&&or.selected()&&r.nodeIsGrabbable(or)});E($e,{addToList:ze}),_e.emit(qe("grabon")),$e.forEach(er)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=_e,r.hoverData.downs=Me,r.hoverData.downTime=new Date().getTime()}a(_e,["mousedown","tapstart","vmousedown"],L,{x:ve[0],y:ve[1]}),_e==null?(ye[4]=1,r.data.bgActivePosistion={x:ve[0],y:ve[1]},r.redrawHint("select",!0),r.redraw()):_e.pannable()&&(ye[4]=1),We()}ye[0]=ye[2]=ve[0],ye[1]=ye[3]=ve[1]}},!1);var D=n(r.container);r.registerBinding([e,D],"mousemove",function(L){var se=r.hoverData.capture;if(!(!se&&!I(L))){var de=!1,ve=r.cy,ye=ve.zoom(),Me=[L.clientX,L.clientY],_e=r.projectIntoViewport(Me[0],Me[1]),ze=r.hoverData.mdownPos,qe=r.hoverData.mdownGPos,We=r.selection,nr=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(nr=r.findNearestElement(_e[0],_e[1],!0,!1));var er=r.hoverData.last,$e=r.hoverData.down,or=[_e[0]-We[2],_e[1]-We[3]],rr=r.dragData.possibleDragElements,Vr;if(qe){var Ir=Me[0]-qe[0],st=Ir*Ir,Br=Me[1]-qe[1],Ur=Br*Br,Lr=st+Ur;r.hoverData.isOverThresholdDrag=Vr=Lr>=r.desktopTapThreshold2}var Yr=i(L);Vr&&(r.hoverData.tapholdCancelled=!0);var En=function(){var Bt=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Bt.length===0?(Bt.push(or[0]),Bt.push(or[1])):(Bt[0]+=or[0],Bt[1]+=or[1])};de=!0,a(nr,["mousemove","vmousemove","tapdrag"],L,{x:_e[0],y:_e[1]});var Fr=function(Bt){return{originalEvent:L,type:Bt,position:{x:_e[0],y:_e[1]}}},cn=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||ve.emit(Fr("boxstart")),We[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Vr){var dn=Fr("cxtdrag");$e?$e.emit(dn):ve.emit(dn),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||nr!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(Fr("cxtdragout")),r.hoverData.cxtOver=nr,nr&&nr.emit(Fr("cxtdragover")))}}else if(r.hoverData.dragging){if(de=!0,ve.panningEnabled()&&ve.userPanningEnabled()){var ea;if(r.hoverData.justStartedPan){var hi=r.hoverData.mdownPos;ea={x:(_e[0]-hi[0])*ye,y:(_e[1]-hi[1])*ye},r.hoverData.justStartedPan=!1}else ea={x:or[0]*ye,y:or[1]*ye};ve.panBy(ea),ve.emit(Fr("dragpan")),r.hoverData.dragged=!0}_e=r.projectIntoViewport(L.clientX,L.clientY)}else if(We[4]==1&&($e==null||$e.pannable())){if(Vr){if(!r.hoverData.dragging&&ve.boxSelectionEnabled()&&(Yr||!ve.panningEnabled()||!ve.userPanningEnabled()))cn();else if(!r.hoverData.selecting&&ve.panningEnabled()&&ve.userPanningEnabled()){var kn=o($e,r.hoverData.downs);kn&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,We[4]=0,r.data.bgActivePosistion=Gi(ze),r.redrawHint("select",!0),r.redraw())}$e&&$e.pannable()&&$e.active()&&$e.unactivate()}}else{if($e&&$e.pannable()&&$e.active()&&$e.unactivate(),(!$e||!$e.grabbed())&&nr!=er&&(er&&a(er,["mouseout","tapdragout"],L,{x:_e[0],y:_e[1]}),nr&&a(nr,["mouseover","tapdragover"],L,{x:_e[0],y:_e[1]}),r.hoverData.last=nr),$e)if(Vr){if(ve.boxSelectionEnabled()&&Yr)$e&&$e.grabbed()&&(b(rr),$e.emit(Fr("freeon")),rr.emit(Fr("free")),r.dragData.didDrag&&($e.emit(Fr("dragfreeon")),rr.emit(Fr("dragfree")))),cn();else if($e&&$e.grabbed()&&r.nodeIsDraggable($e)){var ut=!r.dragData.didDrag;ut&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||E(rr,{inDragLayer:!0});var tt={x:0,y:0};if(De(or[0])&&De(or[1])&&(tt.x+=or[0],tt.y+=or[1],ut)){var pt=r.hoverData.dragDelta;pt&&De(pt[0])&&De(pt[1])&&(tt.x+=pt[0],tt.y+=pt[1])}r.hoverData.draggingEles=!0,rr.silentShift(tt).emit(Fr("position")).emit(Fr("drag")),r.redrawHint("drag",!0),r.redraw()}}else En();de=!0}if(We[2]=_e[0],We[3]=_e[1],de)return L.stopPropagation&&L.stopPropagation(),L.preventDefault&&L.preventDefault(),!1}},!1);var M,O,N;r.registerBinding(e,"mouseup",function(L){if(!(r.hoverData.which===1&&L.which!==1&&r.hoverData.capture)){var se=r.hoverData.capture;if(se){r.hoverData.capture=!1;var de=r.cy,ve=r.projectIntoViewport(L.clientX,L.clientY),ye=r.selection,Me=r.findNearestElement(ve[0],ve[1],!0,!1),_e=r.dragData.possibleDragElements,ze=r.hoverData.down,qe=i(L);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,ze&&ze.unactivate();var We=function(Ir){return{originalEvent:L,type:Ir,position:{x:ve[0],y:ve[1]}}};if(r.hoverData.which===3){var nr=We("cxttapend");if(ze?ze.emit(nr):de.emit(nr),!r.hoverData.cxtDragged){var er=We("cxttap");ze?ze.emit(er):de.emit(er)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(a(Me,["mouseup","tapend","vmouseup"],L,{x:ve[0],y:ve[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(ze,["click","tap","vclick"],L,{x:ve[0],y:ve[1]}),O=!1,L.timeStamp-N<=de.multiClickDebounceTime()?(M&&clearTimeout(M),O=!0,N=null,a(ze,["dblclick","dbltap","vdblclick"],L,{x:ve[0],y:ve[1]})):(M=setTimeout(function(){O||a(ze,["oneclick","onetap","voneclick"],L,{x:ve[0],y:ve[1]})},de.multiClickDebounceTime()),N=L.timeStamp)),ze==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(L)&&(de.$(t).unselect(["tapunselect"]),_e.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=_e=de.collection()),Me==ze&&!r.dragData.didDrag&&!r.hoverData.selecting&&Me!=null&&Me._private.selectable&&(r.hoverData.dragging||(de.selectionType()==="additive"||qe?Me.selected()?Me.unselect(["tapunselect"]):Me.select(["tapselect"]):qe||(de.$(t).unmerge(Me).unselect(["tapunselect"]),Me.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var $e=de.collection(r.getAllInBox(ye[0],ye[1],ye[2],ye[3]));r.redrawHint("select",!0),$e.length>0&&r.redrawHint("eles",!0),de.emit(We("boxend"));var or=function(Ir){return Ir.selectable()&&!Ir.selected()};de.selectionType()==="additive"||qe||de.$(t).unmerge($e).unselect(),$e.emit(We("box")).stdFilter(or).select().emit(We("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!ye[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var rr=ze&&ze.grabbed();b(_e),rr&&(ze.emit(We("freeon")),_e.emit(We("free")),r.dragData.didDrag&&(ze.emit(We("dragfreeon")),_e.emit(We("dragfree"))))}}ye[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var V=[],$=4,G,U=1e5,J=function(L,se){for(var de=0;de<L.length;de++)if(L[de]%se!==0)return!1;return!0},W=function(L){for(var se=Math.abs(L[0]),de=1;de<L.length;de++)if(Math.abs(L[de])!==se)return!1;return!0},H=function(L){var se=!1,de=L.deltaY;if(de==null&&(L.wheelDeltaY!=null?de=L.wheelDeltaY/4:L.wheelDelta!=null&&(de=L.wheelDelta/4)),de!==0){if(G==null)if(V.length>=$){var ve=V;if(G=J(ve,5),!G){var ye=Math.abs(ve[0]);G=W(ve)&&ye>5}if(G)for(var Me=0;Me<ve.length;Me++)U=Math.min(Math.abs(ve[Me]),U)}else V.push(de),se=!0;else G&&(U=Math.min(Math.abs(de),U));if(!r.scrollingPage){var _e=r.cy,ze=_e.zoom(),qe=_e.pan(),We=r.projectIntoViewport(L.clientX,L.clientY),nr=[We[0]*ze+qe.x,We[1]*ze+qe.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||P()){L.preventDefault();return}if(_e.panningEnabled()&&_e.userPanningEnabled()&&_e.zoomingEnabled()&&_e.userZoomingEnabled()){L.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var er;se&&Math.abs(de)>5&&(de=Bm(de)*5),er=de/-250,G&&(er/=U,er*=3),er=er*r.wheelSensitivity;var $e=L.deltaMode===1;$e&&(er*=33);var or=_e.zoom()*Math.pow(10,er);L.type==="gesturechange"&&(or=r.gestureStartZoom*L.scale),_e.zoom({level:or,renderedPosition:{x:nr[0],y:nr[1]}}),_e.emit({type:L.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:L,position:{x:We[0],y:We[1]}})}}}};r.registerBinding(r.container,"wheel",H,!0),r.registerBinding(e,"scroll",function(L){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(L){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||L.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(ge){r.hasTouchStarted||H(ge)},!0),r.registerBinding(r.container,"mouseout",function(L){var se=r.projectIntoViewport(L.clientX,L.clientY);r.cy.emit({originalEvent:L,type:"mouseout",position:{x:se[0],y:se[1]}})},!1),r.registerBinding(r.container,"mouseover",function(L){var se=r.projectIntoViewport(L.clientX,L.clientY);r.cy.emit({originalEvent:L,type:"mouseover",position:{x:se[0],y:se[1]}})},!1);var Z,ne,F,z,j,ee,ie,oe,Y,X,re,le,he,be=function(L,se,de,ve){return Math.sqrt((de-L)*(de-L)+(ve-se)*(ve-se))},fe=function(L,se,de,ve){return(de-L)*(de-L)+(ve-se)*(ve-se)},ue;r.registerBinding(r.container,"touchstart",ue=function(L){if(r.hasTouchStarted=!0,!!I(L)){x(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var se=r.cy,de=r.touchData.now,ve=r.touchData.earlier;if(L.touches[0]){var ye=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);de[0]=ye[0],de[1]=ye[1]}if(L.touches[1]){var ye=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);de[2]=ye[0],de[3]=ye[1]}if(L.touches[2]){var ye=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);de[4]=ye[0],de[5]=ye[1]}var Me=function(Yr){return{originalEvent:L,type:Yr,position:{x:de[0],y:de[1]}}};if(L.touches[1]){r.touchData.singleTouchMoved=!0,b(r.dragData.touchDragEles);var _e=r.findContainerClientCoords();Y=_e[0],X=_e[1],re=_e[2],le=_e[3],Z=L.touches[0].clientX-Y,ne=L.touches[0].clientY-X,F=L.touches[1].clientX-Y,z=L.touches[1].clientY-X,he=0<=Z&&Z<=re&&0<=F&&F<=re&&0<=ne&&ne<=le&&0<=z&&z<=le;var ze=se.pan(),qe=se.zoom();j=be(Z,ne,F,z),ee=fe(Z,ne,F,z),ie=[(Z+F)/2,(ne+z)/2],oe=[(ie[0]-ze.x)/qe,(ie[1]-ze.y)/qe];var We=200,nr=We*We;if(ee<nr&&!L.touches[2]){var er=r.findNearestElement(de[0],de[1],!0,!0),$e=r.findNearestElement(de[2],de[3],!0,!0);er&&er.isNode()?(er.activate().emit(Me("cxttapstart")),r.touchData.start=er):$e&&$e.isNode()?($e.activate().emit(Me("cxttapstart")),r.touchData.start=$e):se.emit(Me("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(L.touches[2])se.boxSelectionEnabled()&&L.preventDefault();else if(!L.touches[1]){if(L.touches[0]){var or=r.findNearestElements(de[0],de[1],!0,!0),rr=or[0];if(rr!=null&&(rr.activate(),r.touchData.start=rr,r.touchData.starts=or,r.nodeIsGrabbable(rr))){var Vr=r.dragData.touchDragEles=se.collection(),Ir=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),rr.selected()?(Ir=se.$(function(Lr){return Lr.selected()&&r.nodeIsGrabbable(Lr)}),E(Ir,{addToList:Vr})):m(rr,{addToList:Vr}),v(rr),rr.emit(Me("grabon")),Ir?Ir.forEach(function(Lr){Lr.emit(Me("grab"))}):rr.emit(Me("grab"))}a(rr,["touchstart","tapstart","vmousedown"],L,{x:de[0],y:de[1]}),rr==null&&(r.data.bgActivePosistion={x:ye[0],y:ye[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&a(r.touchData.start,["taphold"],L,{x:de[0],y:de[1]})},r.tapholdDuration)}}if(L.touches.length>=1){for(var st=r.touchData.startPosition=[null,null,null,null,null,null],Br=0;Br<de.length;Br++)st[Br]=ve[Br]=de[Br];var Ur=L.touches[0];r.touchData.startGPosition=[Ur.clientX,Ur.clientY]}}},!1);var Se;r.registerBinding(e,"touchmove",Se=function(L){var se=r.touchData.capture;if(!(!se&&!I(L))){var de=r.selection,ve=r.cy,ye=r.touchData.now,Me=r.touchData.earlier,_e=ve.zoom();if(L.touches[0]){var ze=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);ye[0]=ze[0],ye[1]=ze[1]}if(L.touches[1]){var ze=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);ye[2]=ze[0],ye[3]=ze[1]}if(L.touches[2]){var ze=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);ye[4]=ze[0],ye[5]=ze[1]}var qe=function(bi){return{originalEvent:L,type:bi,position:{x:ye[0],y:ye[1]}}},We=r.touchData.startGPosition,nr;if(se&&L.touches[0]&&We){for(var er=[],$e=0;$e<ye.length;$e++)er[$e]=ye[$e]-Me[$e];var or=L.touches[0].clientX-We[0],rr=or*or,Vr=L.touches[0].clientY-We[1],Ir=Vr*Vr,st=rr+Ir;nr=st>=r.touchTapThreshold2}if(se&&r.touchData.cxt){L.preventDefault();var Br=L.touches[0].clientX-Y,Ur=L.touches[0].clientY-X,Lr=L.touches[1].clientX-Y,Yr=L.touches[1].clientY-X,En=fe(Br,Ur,Lr,Yr),Fr=En/ee,cn=150,dn=cn*cn,ea=1.5,hi=ea*ea;if(Fr>=hi||En>=dn){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var kn=qe("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(kn),r.touchData.start=null):ve.emit(kn)}}if(se&&r.touchData.cxt){var kn=qe("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(kn):ve.emit(kn),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var ut=r.findNearestElement(ye[0],ye[1],!0,!0);(!r.touchData.cxtOver||ut!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(qe("cxtdragout")),r.touchData.cxtOver=ut,ut&&ut.emit(qe("cxtdragover")))}else if(se&&L.touches[2]&&ve.boxSelectionEnabled())L.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||ve.emit(qe("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,de[4]=1,!de||de.length===0||de[0]===void 0?(de[0]=(ye[0]+ye[2]+ye[4])/3,de[1]=(ye[1]+ye[3]+ye[5])/3,de[2]=(ye[0]+ye[2]+ye[4])/3+1,de[3]=(ye[1]+ye[3]+ye[5])/3+1):(de[2]=(ye[0]+ye[2]+ye[4])/3,de[3]=(ye[1]+ye[3]+ye[5])/3),r.redrawHint("select",!0),r.redraw();else if(se&&L.touches[1]&&!r.touchData.didSelect&&ve.zoomingEnabled()&&ve.panningEnabled()&&ve.userZoomingEnabled()&&ve.userPanningEnabled()){L.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var tt=r.dragData.touchDragEles;if(tt){r.redrawHint("drag",!0);for(var pt=0;pt<tt.length;pt++){var La=tt[pt]._private;La.grabbed=!1,La.rscratch.inDragLayer=!1}}var Bt=r.touchData.start,Br=L.touches[0].clientX-Y,Ur=L.touches[0].clientY-X,Lr=L.touches[1].clientX-Y,Yr=L.touches[1].clientY-X,Ss=be(Br,Ur,Lr,Yr),$l=Ss/j;if(he){var gi=Br-Z,Vl=Ur-ne,pi=Lr-F,Gl=Yr-z,Wl=(gi+pi)/2,Ul=(Vl+Gl)/2,ra=ve.zoom(),yi=ra*$l,qa=ve.pan(),Ts=oe[0]*ra+qa.x,Rs=oe[1]*ra+qa.y,Hl={x:-yi/ra*(Ts-qa.x-Wl)+Ts,y:-yi/ra*(Rs-qa.y-Ul)+Rs};if(Bt&&Bt.active()){var tt=r.dragData.touchDragEles;b(tt),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Bt.unactivate().emit(qe("freeon")),tt.emit(qe("free")),r.dragData.didDrag&&(Bt.emit(qe("dragfreeon")),tt.emit(qe("dragfree")))}ve.viewport({zoom:yi,pan:Hl,cancelOnFailedZoom:!0}),ve.emit(qe("pinchzoom")),j=Ss,Z=Br,ne=Ur,F=Lr,z=Yr,r.pinching=!0}if(L.touches[0]){var ze=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);ye[0]=ze[0],ye[1]=ze[1]}if(L.touches[1]){var ze=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);ye[2]=ze[0],ye[3]=ze[1]}if(L.touches[2]){var ze=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);ye[4]=ze[0],ye[5]=ze[1]}}else if(L.touches[0]&&!r.touchData.didSelect){var $t=r.touchData.start,mi=r.touchData.last,ut;if(!r.hoverData.draggingEles&&!r.swipePanning&&(ut=r.findNearestElement(ye[0],ye[1],!0,!0)),se&&$t!=null&&L.preventDefault(),se&&$t!=null&&r.nodeIsDraggable($t))if(nr){var tt=r.dragData.touchDragEles,vo=!r.dragData.didDrag;vo&&E(tt,{inDragLayer:!0}),r.dragData.didDrag=!0;var ta={x:0,y:0};if(De(er[0])&&De(er[1])&&(ta.x+=er[0],ta.y+=er[1],vo)){r.redrawHint("eles",!0);var Ct=r.touchData.dragDelta;Ct&&De(Ct[0])&&De(Ct[1])&&(ta.x+=Ct[0],ta.y+=Ct[1])}r.hoverData.draggingEles=!0,tt.silentShift(ta).emit(qe("position")).emit(qe("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==Me[0]&&r.touchData.startPosition[1]==Me[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Ct=r.touchData.dragDelta=r.touchData.dragDelta||[];Ct.length===0?(Ct.push(er[0]),Ct.push(er[1])):(Ct[0]+=er[0],Ct[1]+=er[1])}if(a($t||ut,["touchmove","tapdrag","vmousemove"],L,{x:ye[0],y:ye[1]}),(!$t||!$t.grabbed())&&ut!=mi&&(mi&&mi.emit(qe("tapdragout")),ut&&ut.emit(qe("tapdragover"))),r.touchData.last=ut,se)for(var pt=0;pt<ye.length;pt++)ye[pt]&&r.touchData.startPosition[pt]&&nr&&(r.touchData.singleTouchMoved=!0);if(se&&($t==null||$t.pannable())&&ve.panningEnabled()&&ve.userPanningEnabled()){var Kl=o($t,r.touchData.starts);Kl&&(L.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=Gi(r.touchData.startPosition)),r.swipePanning?(ve.panBy({x:er[0]*_e,y:er[1]*_e}),ve.emit(qe("dragpan"))):nr&&(r.swipePanning=!0,ve.panBy({x:or*_e,y:Vr*_e}),ve.emit(qe("dragpan")),$t&&($t.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var ze=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);ye[0]=ze[0],ye[1]=ze[1]}}for(var $e=0;$e<ye.length;$e++)Me[$e]=ye[$e];se&&L.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var Ae;r.registerBinding(e,"touchcancel",Ae=function(L){var se=r.touchData.start;r.touchData.capture=!1,se&&se.unactivate()});var Te,Pe,Ie,Le;if(r.registerBinding(e,"touchend",Te=function(L){var se=r.touchData.start,de=r.touchData.capture;if(de)L.touches.length===0&&(r.touchData.capture=!1),L.preventDefault();else return;var ve=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var ye=r.cy,Me=ye.zoom(),_e=r.touchData.now,ze=r.touchData.earlier;if(L.touches[0]){var qe=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);_e[0]=qe[0],_e[1]=qe[1]}if(L.touches[1]){var qe=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);_e[2]=qe[0],_e[3]=qe[1]}if(L.touches[2]){var qe=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);_e[4]=qe[0],_e[5]=qe[1]}var We=function(dn){return{originalEvent:L,type:dn,position:{x:_e[0],y:_e[1]}}};se&&se.unactivate();var nr;if(r.touchData.cxt){if(nr=We("cxttapend"),se?se.emit(nr):ye.emit(nr),!r.touchData.cxtDragged){var er=We("cxttap");se?se.emit(er):ye.emit(er)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!L.touches[2]&&ye.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var $e=ye.collection(r.getAllInBox(ve[0],ve[1],ve[2],ve[3]));ve[0]=void 0,ve[1]=void 0,ve[2]=void 0,ve[3]=void 0,ve[4]=0,r.redrawHint("select",!0),ye.emit(We("boxend"));var or=function(dn){return dn.selectable()&&!dn.selected()};$e.emit(We("box")).stdFilter(or).select().emit(We("boxselect")),$e.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(se!=null&&se.unactivate(),L.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!L.touches[1]){if(!L.touches[0]){if(!L.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var rr=r.dragData.touchDragEles;if(se!=null){var Vr=se._private.grabbed;b(rr),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Vr&&(se.emit(We("freeon")),rr.emit(We("free")),r.dragData.didDrag&&(se.emit(We("dragfreeon")),rr.emit(We("dragfree")))),a(se,["touchend","tapend","vmouseup","tapdragout"],L,{x:_e[0],y:_e[1]}),se.unactivate(),r.touchData.start=null}else{var Ir=r.findNearestElement(_e[0],_e[1],!0,!0);a(Ir,["touchend","tapend","vmouseup","tapdragout"],L,{x:_e[0],y:_e[1]})}var st=r.touchData.startPosition[0]-_e[0],Br=st*st,Ur=r.touchData.startPosition[1]-_e[1],Lr=Ur*Ur,Yr=Br+Lr,En=Yr*Me*Me;r.touchData.singleTouchMoved||(se||ye.$(":selected").unselect(["tapunselect"]),a(se,["tap","vclick"],L,{x:_e[0],y:_e[1]}),Pe=!1,L.timeStamp-Le<=ye.multiClickDebounceTime()?(Ie&&clearTimeout(Ie),Pe=!0,Le=null,a(se,["dbltap","vdblclick"],L,{x:_e[0],y:_e[1]})):(Ie=setTimeout(function(){Pe||a(se,["onetap","voneclick"],L,{x:_e[0],y:_e[1]})},ye.multiClickDebounceTime()),Le=L.timeStamp)),se!=null&&!r.dragData.didDrag&&se._private.selectable&&En<r.touchTapThreshold2&&!r.pinching&&(ye.selectionType()==="single"?(ye.$(t).unmerge(se).unselect(["tapunselect"]),se.select(["tapselect"])):se.selected()?se.unselect(["tapunselect"]):se.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var Fr=0;Fr<_e.length;Fr++)ze[Fr]=_e[Fr];r.dragData.didDrag=!1,L.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),L.touches.length<2&&(L.touches.length===1&&(r.touchData.startGPosition=[L.touches[0].clientX,L.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent>"u"){var Fe=[],je=function(L){return{clientX:L.clientX,clientY:L.clientY,force:1,identifier:L.pointerId,pageX:L.pageX,pageY:L.pageY,radiusX:L.width/2,radiusY:L.height/2,screenX:L.screenX,screenY:L.screenY,target:L.target}},lr=function(L){return{event:L,touch:je(L)}},ir=function(L){Fe.push(lr(L))},Xe=function(L){for(var se=0;se<Fe.length;se++){var de=Fe[se];if(de.event.pointerId===L.pointerId){Fe.splice(se,1);return}}},fr=function(L){var se=Fe.filter(function(de){return de.event.pointerId===L.pointerId})[0];se.event=L,se.touch=je(L)},Ue=function(L){L.touches=Fe.map(function(se){return se.touch})},Oe=function(L){return L.pointerType==="mouse"||L.pointerType===4};r.registerBinding(r.container,"pointerdown",function(ge){Oe(ge)||(ge.preventDefault(),ir(ge),Ue(ge),ue(ge))}),r.registerBinding(r.container,"pointerup",function(ge){Oe(ge)||(Xe(ge),Ue(ge),Te(ge))}),r.registerBinding(r.container,"pointercancel",function(ge){Oe(ge)||(Xe(ge),Ue(ge),Ae(ge))}),r.registerBinding(r.container,"pointermove",function(ge){Oe(ge)||(ge.preventDefault(),fr(ge),Ue(ge),Se(ge))})}};var Zn={};Zn.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,a,i,o,s,u){this.renderer.nodeShapeImpl("polygon",n,a,i,o,s,this.points)},intersectLine:function(n,a,i,o,s,u,l,c){return Jo(s,u,this.points,n,a,i/2,o/2,l)},checkPoint:function(n,a,i,o,s,u,l,c){return Yn(n,a,this.points,u,l,o,s,[0,-1],i)},hasMiterBounds:r!=="rectangle",miterBounds:function(n,a,i,o,s,u){return IN(this.points,n,a,i,o,s)}}};Zn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,u){return FN(i,o,e,t,n/2+s,a/2+s)},checkPoint:function(e,t,n,a,i,o,s,u){return ei(e,t,a,i,o,s,n)}}};Zn.generateRoundPolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,a,i,o,s,u,l){if(u[l]!==void 0&&u[l+"-cx"]===n&&u[l+"-cy"]===a)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=n,u[l+"-cy"]=a;var c=i/2,v=o/2;s=s==="auto"?y2(i,o):s;for(var h=new Array(e.length/2),g=0;g<e.length/2;g++)h[g]={x:n+c*e[g*2],y:a+v*e[g*2+1]};var p,E,m,b,w=h.length;for(E=h[w-1],p=0;p<w;p++)m=h[p%w],b=h[(p+1)%w],u[l][p]=Um(E,m,b,s),E=m,m=b;return u[l]},draw:function(n,a,i,o,s,u,l){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,s,this.points,this.getOrCreateCorners(a,i,o,s,u,l,"drawCorners"))},intersectLine:function(n,a,i,o,s,u,l,c,v){return $N(s,u,this.points,n,a,i,o,l,this.getOrCreateCorners(n,a,i,o,c,v,"corners"))},checkPoint:function(n,a,i,o,s,u,l,c,v){return NN(n,a,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,c,v,"corners"))}}};Zn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:At(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,u){return g2(i,o,e,t,n,a,s,u)},checkPoint:function(e,t,n,a,i,o,s,u){var l=a/2,c=i/2;u=u==="auto"?_a(a,i):u,u=Math.min(l,c,u);var v=u*2;return!!(Yn(e,t,this.points,o,s,a,i-v,[0,-1],n)||Yn(e,t,this.points,o,s,a-v,i,[0,-1],n)||ei(e,t,v,v,o-l+u,s-c+u,n)||ei(e,t,v,v,o+l-u,s-c+u,n)||ei(e,t,v,v,o+l-u,s+c-u,n)||ei(e,t,v,v,o-l+u,s+c-u,n))}}};Zn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Mm(),points:At(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,null,o)},generateCutTrianglePts:function(e,t,n,a,i){var o=i==="auto"?this.cornerLength:i,s=t/2,u=e/2,l=n-u,c=n+u,v=a-s,h=a+s;return{topLeft:[l,v+o,l+o,v,l+o,v+o],topRight:[c-o,v,c,v+o,c-o,v+o],bottomRight:[c,h-o,c-o,h,c-o,h-o],bottomLeft:[l+o,h,l,h-o,l+o,h-o]}},intersectLine:function(e,t,n,a,i,o,s,u){var l=this.generateCutTrianglePts(n+2*s,a+2*s,e,t,u),c=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return Jo(i,o,c,e,t)},checkPoint:function(e,t,n,a,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(Yn(e,t,this.points,o,s,a,i-2*l,[0,-1],n)||Yn(e,t,this.points,o,s,a-2*l,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,o,s);return Nt(e,t,c.topLeft)||Nt(e,t,c.topRight)||Nt(e,t,c.bottomRight)||Nt(e,t,c.bottomLeft)}}};Zn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:At(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,u){var l=.15,c=.5,v=.85,h=this.generateBarrelBezierPts(n+2*s,a+2*s,e,t),g=function(m){var b=Ki({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},l),w=Ki({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},c),x=Ki({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},v);return[m[0],m[1],b.x,b.y,w.x,w.y,x.x,x.y,m[4],m[5]]},p=[].concat(g(h.topLeft),g(h.topRight),g(h.bottomRight),g(h.bottomLeft));return Jo(i,o,p,e,t)},generateBarrelBezierPts:function(e,t,n,a){var i=t/2,o=e/2,s=n-o,u=n+o,l=a-i,c=a+i,v=om(e,t),h=v.heightOffset,g=v.widthOffset,p=v.ctrlPtOffsetPct*e,E={topLeft:[s,l+h,s+p,l,s+g,l],topRight:[u-g,l,u-p,l,u,l+h],bottomRight:[u,c-h,u-p,c,u-g,c],bottomLeft:[s+g,c,s+p,c,s,c-h]};return E.topLeft.isTop=!0,E.topRight.isTop=!0,E.bottomLeft.isBottom=!0,E.bottomRight.isBottom=!0,E},checkPoint:function(e,t,n,a,i,o,s,u){var l=om(a,i),c=l.heightOffset,v=l.widthOffset;if(Yn(e,t,this.points,o,s,a,i-2*c,[0,-1],n)||Yn(e,t,this.points,o,s,a-2*v,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,s),g=function(A,P,I){var D=I[4],M=I[2],O=I[0],N=I[5],V=I[1],$=Math.min(D,O),G=Math.max(D,O),U=Math.min(N,V),J=Math.max(N,V);if($<=A&&A<=G&&U<=P&&P<=J){var W=VN(D,M,O),H=MN(W[0],W[1],W[2],A),Z=H.filter(function(ne){return 0<=ne&&ne<=1});if(Z.length>0)return Z[0]}return null},p=Object.keys(h),E=0;E<p.length;E++){var m=p[E],b=h[m],w=g(e,t,b);if(w!=null){var x=b[5],_=b[3],C=b[1],R=at(x,_,C,w);if(b.isTop&&R<=t||b.isBottom&&t<=R)return!0}}return!1}}};Zn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:At(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,u){var l=e-(n/2+s),c=t-(a/2+s),v=c,h=e+(n/2+s),g=ya(i,o,e,t,l,c,h,v,!1);return g.length>0?g:g2(i,o,e,t,n,a,s,u)},checkPoint:function(e,t,n,a,i,o,s,u){u=u==="auto"?_a(a,i):u;var l=2*u;if(Yn(e,t,this.points,o,s,a,i-l,[0,-1],n)||Yn(e,t,this.points,o,s,a-l,i,[0,-1],n))return!0;var c=a/2+2*n,v=i/2+2*n,h=[o-c,s-v,o-c,s,o+c,s,o+c,s-v];return!!(Nt(e,t,h)||ei(e,t,l,l,o+a/2-u,s+i/2-u,n)||ei(e,t,l,l,o-a/2+u,s+i/2-u,n))}}};Zn.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",At(3,0)),this.generateRoundPolygon("round-triangle",At(3,0)),this.generatePolygon("rectangle",At(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",At(5,0)),this.generateRoundPolygon("round-pentagon",At(5,0)),this.generatePolygon("hexagon",At(6,0)),this.generateRoundPolygon("round-hexagon",At(6,0)),this.generatePolygon("heptagon",At(7,0)),this.generateRoundPolygon("round-heptagon",At(7,0)),this.generatePolygon("octagon",At(8,0)),this.generateRoundPolygon("round-octagon",At(8,0));var n=new Array(20);{var a=im(5,0),i=im(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)n[s*4]=a[s*2],n[s*4+1]=a[s*2+1],n[s*4+2]=i[s*2],n[s*4+3]=i[s*2+1]}n=p2(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}r.makePolygon=function(l){var c=l.join("$"),v="polygon-"+c,h;return(h=this[v])?h:e.generatePolygon(v,l)}};var ms={};ms.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};ms.redraw=function(r){r=r||c2();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r};ms.beforeRender=function(r,e){if(!this.destroyed){e==null&&Mr("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(n,a){return a.priority-n.priority})}};var Ux=function(e,t,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(t,n)};ms.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function(a){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){Ux(r,!0,a);var i=jn();r.render(r.renderOptions);var o=r.lastDrawTime=jn();r.averageRedrawTime===void 0&&(r.averageRedrawTime=o-i),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var s=o-i;r.redrawTotalTime+=s,r.lastRedrawTime=s,r.averageRedrawTime=r.averageRedrawTime/2+s/2,r.requestedFrame=!1}else Ux(r,!1,a);r.skipFrame=!1,Wu(t)}};Wu(t)}};var a$=function(e){this.init(e)},yA=a$,oo=yA.prototype;oo.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];oo.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=a.getElementById(o)!=null;if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!u){var l=a.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}var c=n.getComputedStyle(t),v=c.getPropertyValue("position");v==="static"&&Er("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=r.showFps,e.debug=r.debug,e.webgl=r.webgl,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=De(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};oo.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&n.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),r==="gc"&&t.redrawHint("gc",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};oo.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],n=t,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}};oo.isHeadless=function(){return!1};[Wm,gA,pA,io,Zn,ms].forEach(function(r){He(oo,r)});var Pd=1e3/60,mA={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=vs(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(l,c){var v=jn(),h=a.averageRedrawTime,g=a.lastRedrawTime,p=[],E=a.cy.extent(),m=a.getPixelRatio();for(l||a.flushRenderedStyleQueue();;){var b=jn(),w=b-v,x=b-c;if(g<Pd){var _=Pd-(l?h:0);if(x>=e.deqFastCost*_)break}else if(l){if(w>=e.deqCost*g||w>=e.deqAvgCost*h)break}else if(x>=e.deqNoDrawCost*Pd)break;var C=e.deq(n,m,E);if(C.length>0)for(var R=0;R<C.length;R++)p.push(C[R]);else break}p.length>0&&(e.onDeqd(n,p),!l&&e.shouldRedraw(n,p,m,E)&&i())},s=e.priority||Pm;a.beforeRender(o,s(n))}}}},i$=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Uu;Da(this,r),this.idsByKey=new Kn,this.keyForId=new Kn,this.cachesByLvl=new Kn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return Ia(r,[{key:"getIdsFor",value:function(t){t==null&&Mr("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(t);return a||(a=new ro,n.set(t,a)),a}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n),i=this.getKey(t);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),a=this.keyForId.get(n),i=this.getKey(t);return a!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,a=this.lvls,i=n.get(t);return i||(i=new Kn,n.set(t,i),a.push(t)),i}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var a=this.getKey(t),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,n){var a=this.keyForId.get(t.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var a=this.getKey(t);return this.hasCache(a,n)}},{key:"setCache",value:function(t,n,a){a.key=t,this.getCachesAt(n).set(t,a)}},{key:"set",value:function(t,n,a){var i=this.getKey(t);this.setCache(i,n,a),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var a=this.getKey(t);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(a){return n.deleteCache(t,a)})}},{key:"invalidate",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}])})(),Hx=25,Su=50,qu=-4,bm=3,bA=7.99,o$=8,s$=1024,u$=1024,l$=1024,f$=.2,c$=.8,d$=10,v$=.15,h$=.1,g$=.9,p$=.9,y$=100,m$=1,Ui={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},b$=ht({getKey:null,doesEleInvalidateKey:Uu,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:u2,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),No=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var a=b$(t);He(n,a),n.lookup=new i$(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},rt=No.prototype;rt.reasons=Ui;rt.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};rt.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=t[r]=t[r]||[];return n};rt.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new hs(function(t,n){return n.reqs-t.reqs});return e};rt.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};rt.getElement=function(r,e,t,n,a){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(n==null&&(n=Math.ceil(Im(s*t))),n<qu)n=qu;else if(s>=bA||n>bm)return null;var l=Math.pow(2,n),c=e.h*l,v=e.w*l,h=o.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,h))return null;var g=u.get(r,n);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;var p;if(c<=Hx?p=Hx:c<=Su?p=Su:p=Math.ceil(c/Su)*Su,c>l$||v>u$)return null;var E=i.getTextureQueue(p),m=E[E.length-2],b=function(){return i.recycleTexture(p,v)||i.addTexture(p,v)};m||(m=E[E.length-1]),m||(m=b()),m.width-m.usedWidth<v&&(m=b());for(var w=function($){return $&&$.scaledLabelShown===h},x=a&&a===Ui.dequeue,_=a&&a===Ui.highQuality,C=a&&a===Ui.downscale,R,S=n+1;S<=bm;S++){var A=u.get(r,S);if(A){R=A;break}}var P=R&&R.level===n+1?R:null,I=function(){m.context.drawImage(P.texture.canvas,P.x,0,P.width,P.height,m.usedWidth,0,v,c)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.usedWidth,0,v,p),w(P))I();else if(w(R))if(_){for(var D=R.level;D>n;D--)P=i.getElement(r,e,t,D,Ui.downscale);I()}else return i.queueElement(r,R.level-1),R;else{var M;if(!x&&!_&&!C)for(var O=n-1;O>=qu;O--){var N=u.get(r,O);if(N){M=N;break}}if(w(M))return i.queueElement(r,n),M;m.context.translate(m.usedWidth,0),m.context.scale(l,l),this.drawElement(m.context,r,e,h,!1),m.context.scale(1/l,1/l),m.context.translate(-m.usedWidth,0)}return g={x:m.usedWidth,texture:m,level:n,scale:l,width:v,height:c,scaledLabelShown:h},m.usedWidth+=Math.ceil(v+o$),m.eleCaches.push(g),u.set(r,n,g),i.checkTextureFullness(m),g};rt.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])};rt.invalidateElement=function(r){var e=this,t=e.lookup,n=[],a=t.isInvalid(r);if(a){for(var i=qu;i<=bm;i++){var o=t.getForCachedKey(r,i);o&&n.push(o)}var s=t.invalidate(r);if(s)for(var u=0;u<n.length;u++){var l=n[u],c=l.texture;c.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(c)}e.removeFromQueue(r)}};rt.checkTextureUtility=function(r){r.invalidatedWidth>=f$*r.width&&this.retireTexture(r)};rt.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>c$&&r.fullnessChecks>=d$?Ea(t,r):r.fullnessChecks++};rt.retireTexture=function(r){var e=this,t=r.height,n=e.getTextureQueue(t),a=this.lookup;Ea(n,r),r.retired=!0;for(var i=r.eleCaches,o=0;o<i.length;o++){var s=i[o];a.deleteCache(s.key,s.level)}Dm(i);var u=e.getRetiredTextureQueue(t);u.push(r)};rt.addTexture=function(r,e){var t=this,n=t.getTextureQueue(r),a={};return n.push(a),a.eleCaches=[],a.height=r,a.width=Math.max(s$,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=t.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};rt.recycleTexture=function(r,e){for(var t=this,n=t.getTextureQueue(r),a=t.getRetiredTextureQueue(r),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Dm(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ea(a,o),n.push(o),o}};rt.queueElement=function(r,e){var t=this,n=t.getElementQueue(),a=t.getElementKeyToQueue(),i=this.getKey(r),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(r),o.reqs++,n.updateItem(o);else{var s={eles:r.spawn().merge(r),level:e,reqs:1,key:i};n.push(s),a[i]=s}};rt.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<m$&&t.size()>0;o++){var s=t.pop(),u=s.key,l=s.eles[0],c=i.hasCache(l,s.level);if(n[u]=null,c)continue;a.push(s);var v=e.getBoundingBox(l);e.getElement(l,v,r,s.level,Ui.dequeue)}return a};rt.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(r),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=Am,t.updateItem(i),t.pop(),n[a]=null):i.eles.unmerge(r))};rt.onDequeue=function(r){this.onDequeues.push(r)};rt.offDequeue=function(r){Ea(this.onDequeues,r)};rt.setupDequeueing=mA.setupDequeueing({deqRedrawThreshold:y$,deqCost:v$,deqAvgCost:h$,deqNoDrawCost:g$,deqFastCost:p$,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(t)}},shouldRedraw:function(e,t,n,a){for(var i=0;i<t.length;i++)for(var o=t[i].eles,s=0;s<o.length;s++){var u=o[s].boundingBox();if(Om(u,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var w$=1,Uo=-4,Ju=2,x$=3.99,E$=50,_$=50,C$=.15,S$=.1,T$=.9,R$=.9,A$=1,Kx=250,P$=4e3*4e3,jx=32767,D$=!0,wA=function(e){var t=this,n=t.renderer=e,a=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=jn()-2*Kx,t.skipping=!1,t.eleTxrDeqs=a.collection(),t.scheduleElementRefinement=vs(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},_$),n.beforeRender(function(o,s){s-t.lastInvalidationTime<=Kx?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(s,u){return u.reqs-s.reqs};t.layersQueue=new hs(i),t.setupDequeueing()},gt=wA.prototype,Yx=0,I$=Math.pow(2,53)-1;gt.makeLayer=function(r,e){var t=Math.pow(2,e),n=Math.ceil(r.w*t),a=Math.ceil(r.h*t),i=this.renderer.makeOffscreenCanvas(n,a),o={id:Yx=++Yx%I$,bb:r,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(t,t),s.translate(u,l),o};gt.getLayers=function(r,e,t){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),s=n.firstGet;if(n.firstGet=!1,t==null){if(t=Math.ceil(Im(o*e)),t<Uo)t=Uo;else if(o>=x$||t>Ju)return null}n.validateLayersElesOrdering(t,r);var u=n.layersByLevel,l=Math.pow(2,t),c=u[t]=u[t]||[],v,h=n.levelIsComplete(t,r),g,p=function(){var I=function(V){if(n.validateLayersElesOrdering(V,r),n.levelIsComplete(V,r))return g=u[V],!0},D=function(V){if(!g)for(var $=t+V;Uo<=$&&$<=Ju&&!I($);$+=V);};D(1),D(-1);for(var M=c.length-1;M>=0;M--){var O=c[M];O.invalid&&Ea(c,O)}};if(!h)p();else return c;var E=function(){if(!v){v=Dt();for(var I=0;I<r.length;I++)AN(v,r[I].boundingBox())}return v},m=function(I){I=I||{};var D=I.after;E();var M=Math.ceil(v.w*l),O=Math.ceil(v.h*l);if(M>jx||O>jx)return null;var N=M*O;if(N>P$)return null;var V=n.makeLayer(v,t);if(D!=null){var $=c.indexOf(D)+1;c.splice($,0,V)}else(I.insert===void 0||I.insert)&&c.unshift(V);return V};if(n.skipping&&!s)return null;for(var b=null,w=r.length/w$,x=!s,_=0;_<r.length;_++){var C=r[_],R=C._private.rscratch,S=R.imgLayerCaches=R.imgLayerCaches||{},A=S[t];if(A){b=A;continue}if((!b||b.eles.length>=w||!h2(b.bb,C.boundingBox()))&&(b=m({insert:!0,after:b}),!b))return null;g||x?n.queueLayer(b,C):n.drawEleInLayer(b,C,t,e),b.eles.push(C),S[t]=b}return g||(x?null:c)};gt.getEleLevelForLayerLevel=function(r,e){return r};gt.drawEleInLayer=function(r,e,t,n){var a=this,i=this.renderer,o=r.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(t=a.getEleLevelForLayerLevel(t,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,t,D$),i.setImgSmoothing(o,!0))};gt.levelIsComplete=function(r,e){var t=this,n=t.layersByLevel[r];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length};gt.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var n=0;n<t.length;n++){for(var a=t[n],i=-1,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var s=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[s+o]){this.invalidateLayer(a);break}}};gt.updateElementsInLayers=function(r,e){for(var t=this,n=ls(r[0]),a=0;a<r.length;a++)for(var i=n?null:r[a],o=n?r[a]:r[a].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=Uo;l<=Ju;l++){var c=u[l];c&&(i&&t.getEleLevelForLayerLevel(c.level)!==i.level||e(c,o,i))}};gt.haveLayers=function(){for(var r=this,e=!1,t=Uo;t<=Ju;t++){var n=r.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e};gt.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=jn(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(n,a,i){e.invalidateLayer(n)}))};gt.invalidateLayer=function(r){if(this.lastInvalidationTime=jn(),!r.invalid){var e=r.level,t=r.eles,n=this.layersByLevel[e];Ea(n,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var a=0;a<t.length;a++){var i=t[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};gt.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};gt.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()};gt.queueLayer=function(r,e){var t=this,n=t.layersQueue,a=r.elesQueue,i=a.hasId=a.hasId||{};if(!r.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}r.reqs?(r.reqs++,n.updateItem(r)):(r.reqs=1,n.push(r))}};gt.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],a=0;a<A$&&t.size()!==0;){var i=t.peek();if(i.replacement){t.pop();continue}if(i.replaces&&i!==i.replaces.replacement){t.pop();continue}if(i.invalid){t.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,r),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n};gt.applyLayerReplacement=function(r){var e=this,t=e.layersByLevel[r.level],n=r.replaces,a=t.indexOf(n);if(!(a<0||n.invalid)){t[a]=r;for(var i=0;i<r.eles.length;i++){var o=r.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[r.level]=r)}e.requestRedraw()}};gt.requestRedraw=vs(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);gt.setupDequeueing=mA.setupDequeueing({deqRedrawThreshold:E$,deqCost:C$,deqAvgCost:S$,deqNoDrawCost:T$,deqFastCost:R$,deq:function(e,t){return e.dequeue(t)},onDeqd:Pm,shouldRedraw:u2,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var xA={},Zx;function B$(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function O$(r,e,t){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function Xx(r,e,t){r.beginPath&&r.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];r.lineTo(i.x,i.y)}var o=t,s=t[0];r.moveTo(s.x,s.y);for(var a=1;a<o.length;a++){var i=o[a];r.lineTo(i.x,i.y)}r.closePath&&r.closePath()}function M$(r,e,t,n,a){r.beginPath&&r.beginPath(),r.arc(t,n,a,0,Math.PI*2,!1);var i=e,o=i[0];r.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];r.lineTo(u.x,u.y)}r.closePath&&r.closePath()}function k$(r,e,t,n){r.arc(e,t,n,0,Math.PI*2,!1)}xA.arrowShapeImpl=function(r){return(Zx||(Zx={polygon:B$,"triangle-backcurve":O$,"triangle-tee":Xx,"circle-triangle":M$,"triangle-cross":Xx,circle:k$}))[r]};var On={};On.drawElement=function(r,e,t,n,a,i){var o=this;e.isNode()?o.drawNode(r,e,t,n,a,i):o.drawEdge(r,e,t,n,a,i)};On.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};On.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};On.drawCachedElementPortion=function(r,e,t,n,a,i,o,s){var u=this,l=t.getBoundingBox(e);if(!(l.w===0||l.h===0)){var c=t.getElement(e,l,n,a,i);if(c!=null){var v=s(u,e);if(v===0)return;var h=o(u,e),g=l.x1,p=l.y1,E=l.w,m=l.h,b,w,x,_,C;if(h!==0){var R=t.getRotationPoint(e);x=R.x,_=R.y,r.translate(x,_),r.rotate(h),C=u.getImgSmoothing(r),C||u.setImgSmoothing(r,!0);var S=t.getRotationOffset(e);b=S.x,w=S.y}else b=g,w=p;var A;v!==1&&(A=r.globalAlpha,r.globalAlpha=A*v),r.drawImage(c.texture.canvas,c.x,0,c.width,c.height,b,w,E,m),v!==1&&(r.globalAlpha=A),h!==0&&(r.rotate(-h),r.translate(-x,-_),C||u.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var L$=function(){return 0},q$=function(e,t){return e.getTextAngle(t,null)},N$=function(e,t){return e.getTextAngle(t,"source")},F$=function(e,t){return e.getTextAngle(t,"target")},z$=function(e,t){return t.effectiveOpacity()},Dd=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};On.drawCachedElement=function(r,e,t,n,a,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,c=s.slbTxrCache,v=s.tlbTxrCache,h=e.boundingBox(),g=i===!0?u.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||Om(h,n))){var p=e.isEdge(),E=e.element()._private.rscratch.badLine;o.drawElementUnderlay(r,e),o.drawCachedElementPortion(r,e,u,t,a,g,L$,z$),(!p||!E)&&o.drawCachedElementPortion(r,e,l,t,a,g,q$,Dd),p&&!E&&(o.drawCachedElementPortion(r,e,c,t,a,g,N$,Dd),o.drawCachedElementPortion(r,e,v,t,a,g,F$,Dd)),o.drawElementOverlay(r,e)}};On.drawElements=function(r,e){for(var t=this,n=0;n<e.length;n++){var a=e[n];t.drawElement(r,a)}};On.drawCachedElements=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(r,o,t,n)}};On.drawCachedNodes=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(r,o,t,n)}};On.drawLayeredElements=function(r,e,t,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,t);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||r.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else a.drawCachedElements(r,e,t,n)};var Xn={};Xn.drawEdge=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;t&&(u=t,r.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,c=i?e.pstyle("line-opacity").value:1,v=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,E=e.pstyle("line-outline-width").value,m=e.pstyle("line-outline-color").value,b=l*c,w=l*c,x=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;v==="straight-triangle"?(o.eleStrokeStyle(r,e,V),o.drawEdgeTrianglePath(e,r,s.allpts)):(r.lineWidth=g,r.lineCap=p,o.eleStrokeStyle(r,e,V),o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},_=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;if(r.lineWidth=g+E,r.lineCap=p,E>0)o.colorStrokeStyle(r,m[0],m[1],m[2],V);else{r.lineCap="butt";return}v==="straight-triangle"?o.drawEdgeTrianglePath(e,r,s.allpts):(o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},C=function(){a&&o.drawEdgeOverlay(r,e)},R=function(){a&&o.drawEdgeUnderlay(r,e)},S=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;o.drawArrowheads(r,e,V)},A=function(){o.drawElementText(r,e,null,n)};r.lineJoin="round";var P=e.pstyle("ghost").value==="yes";if(P){var I=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,M=e.pstyle("ghost-opacity").value,O=b*M;r.translate(I,D),x(O),S(O),r.translate(-I,-D)}else _();R(),x(),S(),C(),A(),t&&r.translate(u.x1,u.y1)}};var EA=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,o=i.usePaths(),s=n._private.rscratch,u=n.pstyle("".concat(e,"-padding")).pfValue,l=2*u,c=n.pstyle("".concat(e,"-color")).value;t.lineWidth=l,s.edgeType==="self"&&!o?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,c[0],c[1],c[2],a),i.drawEdgePath(n,t,s.allpts,"solid")}}}};Xn.drawEdgeOverlay=EA("overlay");Xn.drawEdgeUnderlay=EA("underlay");Xn.drawEdgePath=function(r,e,t,n){var a=r._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,c=r.pstyle("line-dash-offset").pfValue;if(u){var v=t.join("$"),h=a.pathCacheKey&&a.pathCacheKey===v;h?(o=e=a.pathCache,s=!0):(o=e=new Path2D,a.pathCacheKey=v,a.pathCache=o)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=c;break;case"solid":i.setLineDash([]);break}if(!s&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var g=2;g+3<t.length;g+=4)e.quadraticCurveTo(t[g],t[g+1],t[g+2],t[g+3]);break;case"straight":case"haystack":for(var p=2;p+1<t.length;p+=2)e.lineTo(t[p],t[p+1]);break;case"segments":if(a.isRound){var E=Ft(a.roundCorners),m;try{for(E.s();!(m=E.n()).done;){var b=m.value;fA(e,b)}}catch(x){E.e(x)}finally{E.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var w=2;w+1<t.length;w+=2)e.lineTo(t[w],t[w+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};Xn.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var n=r.pstyle("width").pfValue,a=0;a+1<t.length;a+=2){var i=[t[a+2]-t[a],t[a+3]-t[a+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*n/2,s[1]*n/2];e.beginPath(),e.moveTo(t[a]-u[0],t[a+1]-u[1]),e.lineTo(t[a]+u[0],t[a+1]+u[1]),e.lineTo(t[a+2],t[a+3]),e.closePath(),e.fill()}};Xn.drawArrowheads=function(r,e,t){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(r,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,t),a||this.drawArrowhead(r,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,t)};Xn.drawArrowhead=function(r,e,t,n,a,i,o){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(t+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",c=e.pstyle(t+"-arrow-fill").value,v=e.pstyle("width").pfValue,h=e.pstyle(t+"-arrow-width"),g=h.value==="match-line"?v:h.pfValue;h.units==="%"&&(g*=v);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var E=r.globalCompositeOperation;(o!==1||c==="hollow")&&(r.globalCompositeOperation="destination-out",s.colorFillStyle(r,255,255,255,1),s.colorStrokeStyle(r,255,255,255,1),s.drawArrowShape(e,r,l,v,u,g,n,a,i),r.globalCompositeOperation=E);var m=e.pstyle(t+"-arrow-color").value;s.colorFillStyle(r,m[0],m[1],m[2],o),s.colorStrokeStyle(r,m[0],m[1],m[2],o),s.drawArrowShape(e,r,c,v,u,g,n,a,i)}}};Xn.drawArrowShape=function(r,e,t,n,a,i,o,s,u){var l=this,c=this.usePaths()&&a!=="triangle-cross",v=!1,h,g=e,p={x:o,y:s},E=r.pstyle("arrow-scale").value,m=this.getArrowWidth(n,E),b=l.arrowShapes[a];if(c){var w=l.arrowPathCache=l.arrowPathCache||[],x=ti(a),_=w[x];_!=null?(h=e=_,v=!0):(h=e=new Path2D,w[x]=h)}v||(e.beginPath&&e.beginPath(),c?b.draw(e,1,0,{x:0,y:0},1):b.draw(e,m,u,p,n),e.closePath&&e.closePath()),e=g,c&&(e.translate(o,s),e.rotate(u),e.scale(m,m)),(t==="filled"||t==="both")&&(c?e.fill(h):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=i/(c?m:1),e.lineJoin="miter",c?e.stroke(h):e.stroke()),c&&(e.scale(1/m,1/m),e.rotate(-u),e.translate(-o,-s))};var Km={};Km.safeDrawImage=function(r,e,t,n,a,i,o,s,u,l){if(!(a<=0||i<=0||u<=0||l<=0))try{r.drawImage(e,t,n,a,i,o,s,u,l)}catch(c){Er(c)}};Km.drawInscribedImage=function(r,e,t,n,a){var i=this,o=t.position(),s=o.x,u=o.y,l=t.cy().style(),c=l.getIndexedStyle.bind(l),v=c(t,"background-fit","value",n),h=c(t,"background-repeat","value",n),g=t.width(),p=t.height(),E=t.padding()*2,m=g+(c(t,"background-width-relative-to","value",n)==="inner"?0:E),b=p+(c(t,"background-height-relative-to","value",n)==="inner"?0:E),w=t._private.rscratch,x=c(t,"background-clip","value",n),_=x==="node",C=c(t,"background-image-opacity","value",n)*a,R=c(t,"background-image-smoothing","value",n),S=t.pstyle("corner-radius").value;S!=="auto"&&(S=t.pstyle("corner-radius").pfValue);var A=e.width||e.cachedW,P=e.height||e.cachedH;(A==null||P==null)&&(document.body.appendChild(e),A=e.cachedW=e.width||e.offsetWidth,P=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var I=A,D=P;if(c(t,"background-width","value",n)!=="auto"&&(c(t,"background-width","units",n)==="%"?I=c(t,"background-width","pfValue",n)*m:I=c(t,"background-width","pfValue",n)),c(t,"background-height","value",n)!=="auto"&&(c(t,"background-height","units",n)==="%"?D=c(t,"background-height","pfValue",n)*b:D=c(t,"background-height","pfValue",n)),!(I===0||D===0)){if(v==="contain"){var M=Math.min(m/I,b/D);I*=M,D*=M}else if(v==="cover"){var M=Math.max(m/I,b/D);I*=M,D*=M}var O=s-m/2,N=c(t,"background-position-x","units",n),V=c(t,"background-position-x","pfValue",n);N==="%"?O+=(m-I)*V:O+=V;var $=c(t,"background-offset-x","units",n),G=c(t,"background-offset-x","pfValue",n);$==="%"?O+=(m-I)*G:O+=G;var U=u-b/2,J=c(t,"background-position-y","units",n),W=c(t,"background-position-y","pfValue",n);J==="%"?U+=(b-D)*W:U+=W;var H=c(t,"background-offset-y","units",n),Z=c(t,"background-offset-y","pfValue",n);H==="%"?U+=(b-D)*Z:U+=Z,w.pathCache&&(O-=s,U-=u,s=0,u=0);var ne=r.globalAlpha;r.globalAlpha=C;var F=i.getImgSmoothing(r),z=!1;if(R==="no"&&F?(i.setImgSmoothing(r,!1),z=!0):R==="yes"&&!F&&(i.setImgSmoothing(r,!0),z=!0),h==="no-repeat")_&&(r.save(),w.pathCache?r.clip(w.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,s,u,m,b,S,w),r.clip())),i.safeDrawImage(r,e,0,0,A,P,O,U,I,D),_&&r.restore();else{var j=r.createPattern(e,h);r.fillStyle=j,i.nodeShapes[i.getNodeShape(t)].draw(r,s,u,m,b,S,w),r.translate(O,U),r.fill(),r.translate(-O,-U)}r.globalAlpha=ne,z&&i.setImgSmoothing(r,F)}};var li={};li.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Im(t*n));e=Math.pow(2,a)}var i=r.pstyle("font-size").pfValue*e,o=r.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};li.drawElementText=function(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e);r.textAlign=u,r.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,c=e.pstyle("label"),v=e.pstyle("source-label"),h=e.pstyle("target-label");if(l||(!c||!c.value)&&(!v||!v.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var g=!t,p;t&&(p=t,r.translate(-p.x1,-p.y1)),a==null?(o.drawText(r,e,null,g,i),e.isEdge()&&(o.drawText(r,e,"source",g,i),o.drawText(r,e,"target",g,i))):o.drawText(r,e,a,g,i),t&&r.translate(p.x1,p.y1)};li.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e};li.setupTextStyle=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;r.font=n+" "+o+" "+a+" "+i,r.lineJoin="round",this.colorFillStyle(r,l[0],l[1],l[2],s),this.colorStrokeStyle(r,c[0],c[1],c[2],u)};function $$(r,e,t,n,a){var i=Math.min(n,a),o=i/2,s=e+n/2,u=t+a/2;r.beginPath(),r.arc(s,u,o,0,Math.PI*2),r.closePath()}function Qx(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,n/2,a/2);r.beginPath(),r.moveTo(e+o,t),r.lineTo(e+n-o,t),r.quadraticCurveTo(e+n,t,e+n,t+o),r.lineTo(e+n,t+a-o),r.quadraticCurveTo(e+n,t+a,e+n-o,t+a),r.lineTo(e+o,t+a),r.quadraticCurveTo(e,t+a,e,t+a-o),r.lineTo(e,t+o),r.quadraticCurveTo(e,t,e+o,t),r.closePath()}li.getTextAngle=function(r,e){var t,n=r._private,a=n.rscratch,i=e?e+"-":"",o=r.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=qt(a,"labelAngle",e);t=r.isEdge()?s:0}else o.strValue==="none"?t=0:t=o.pfValue;return t};li.drawText=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=a?e.effectiveOpacity():1;if(!(a&&(s===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=qt(o,"labelX",t),l=qt(o,"labelY",t),c,v,h=this.getLabelText(e,t);if(h!=null&&h!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,a);var g=t?t+"-":"",p=qt(o,"labelWidth",t),E=qt(o,"labelHeight",t),m=e.pstyle(g+"text-margin-x").pfValue,b=e.pstyle(g+"text-margin-y").pfValue,w=e.isEdge(),x=e.pstyle("text-halign").value,_=e.pstyle("text-valign").value;w&&(x="center",_="center"),u+=m,l+=b;var C;switch(n?C=this.getTextAngle(e,t):C=0,C!==0&&(c=u,v=l,r.translate(c,v),r.rotate(C),u=0,l=0),_){case"top":break;case"center":l+=E/2;break;case"bottom":l+=E;break}var R=e.pstyle("text-background-opacity").value,S=e.pstyle("text-border-opacity").value,A=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,I=e.pstyle("text-background-shape").strValue,D=I==="round-rectangle"||I==="roundrectangle",M=I==="circle",O=2;if(R>0||A>0&&S>0){var N=r.fillStyle,V=r.strokeStyle,$=r.lineWidth,G=e.pstyle("text-background-color").value,U=e.pstyle("text-border-color").value,J=e.pstyle("text-border-style").value,W=R>0,H=A>0&&S>0,Z=u-P;switch(x){case"left":Z-=p;break;case"center":Z-=p/2;break}var ne=l-E-P,F=p+2*P,z=E+2*P;if(W&&(r.fillStyle="rgba(".concat(G[0],",").concat(G[1],",").concat(G[2],",").concat(R*s,")")),H&&(r.strokeStyle="rgba(".concat(U[0],",").concat(U[1],",").concat(U[2],",").concat(S*s,")"),r.lineWidth=A,r.setLineDash))switch(J){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=A/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(D?(r.beginPath(),Qx(r,Z,ne,F,z,O)):M?(r.beginPath(),$$(r,Z,ne,F,z)):(r.beginPath(),r.rect(Z,ne,F,z)),W&&r.fill(),H&&r.stroke(),H&&J==="double"){var j=A/2;r.beginPath(),D?Qx(r,Z+j,ne+j,F-2*j,z-2*j,O):r.rect(Z+j,ne+j,F-2*j,z-2*j),r.stroke()}r.fillStyle=N,r.strokeStyle=V,r.lineWidth=$,r.setLineDash&&r.setLineDash([])}var ee=2*e.pstyle("text-outline-width").pfValue;if(ee>0&&(r.lineWidth=ee),e.pstyle("text-wrap").value==="wrap"){var ie=qt(o,"labelWrapCachedLines",t),oe=qt(o,"labelLineHeight",t),Y=p/2,X=this.getLabelJustification(e);switch(X==="auto"||(x==="left"?X==="left"?u+=-p:X==="center"&&(u+=-Y):x==="center"?X==="left"?u+=-Y:X==="right"&&(u+=Y):x==="right"&&(X==="center"?u+=Y:X==="right"&&(u+=p))),_){case"top":l-=(ie.length-1)*oe;break;case"center":case"bottom":l-=(ie.length-1)*oe;break}for(var re=0;re<ie.length;re++)ee>0&&r.strokeText(ie[re],u,l),r.fillText(ie[re],u,l),l+=oe}else ee>0&&r.strokeText(h,u,l),r.fillText(h,u,l);C!==0&&(r.rotate(-C),r.translate(-c,-v))}}};var Oa={};Oa.drawNode=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,u,l=e._private,c=l.rscratch,v=e.position();if(!(!De(v.x)||!De(v.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,g=o.usePaths(),p,E=!1,m=e.padding();s=e.width()+2*m,u=e.height()+2*m;var b;t&&(b=t,r.translate(-b.x1,-b.y1));for(var w=e.pstyle("background-image"),x=w.value,_=new Array(x.length),C=new Array(x.length),R=0,S=0;S<x.length;S++){var A=x[S],P=_[S]=A!=null&&A!=="none";if(P){var I=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);R++,C[S]=o.getCachedImage(A,I,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,M=e.pstyle("border-width").pfValue,O=e.pstyle("background-opacity").value*h,N=e.pstyle("border-color").value,V=e.pstyle("border-style").value,$=e.pstyle("border-join").value,G=e.pstyle("border-cap").value,U=e.pstyle("border-position").value,J=e.pstyle("border-dash-pattern").pfValue,W=e.pstyle("border-dash-offset").pfValue,H=e.pstyle("border-opacity").value*h,Z=e.pstyle("outline-width").pfValue,ne=e.pstyle("outline-color").value,F=e.pstyle("outline-style").value,z=e.pstyle("outline-opacity").value*h,j=e.pstyle("outline-offset").value,ee=e.pstyle("corner-radius").value;ee!=="auto"&&(ee=e.pstyle("corner-radius").pfValue);var ie=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O;o.eleFillStyle(r,e,Oe)},oe=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;o.colorStrokeStyle(r,N[0],N[1],N[2],Oe)},Y=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;o.colorStrokeStyle(r,ne[0],ne[1],ne[2],Oe)},X=function(Oe,ge,L,se){var de=o.nodePathCache=o.nodePathCache||[],ve=s2(L==="polygon"?L+","+se.join(","):L,""+ge,""+Oe,""+ee),ye=de[ve],Me,_e=!1;return ye!=null?(Me=ye,_e=!0,c.pathCache=Me):(Me=new Path2D,de[ve]=c.pathCache=Me),{path:Me,cacheHit:_e}},re=e.pstyle("shape").strValue,le=e.pstyle("shape-polygon-points").pfValue;if(g){r.translate(v.x,v.y);var he=X(s,u,re,le);p=he.path,E=he.cacheHit}var be=function(){if(!E){var Oe=v;g&&(Oe={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||r,Oe.x,Oe.y,s,u,ee,c)}g?r.fill(p):r.fill()},fe=function(){for(var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,L=l.backgrounding,se=0,de=0;de<C.length;de++){var ve=e.cy().style().getIndexedStyle(e,"background-image-containment","value",de);if(ge&&ve==="over"||!ge&&ve==="inside"){se++;continue}_[de]&&C[de].complete&&!C[de].error&&(se++,o.drawInscribedImage(r,C[de],e,de,Oe))}l.backgrounding=se!==R,L!==l.backgrounding&&e.updateStyle(!1)},ue=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(r,e,ge),Oe&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,v.x,v.y,s,u,ee,c)))},Se=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasStripe(e)&&(r.save(),g?r.clip(c.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(r,v.x,v.y,s,u,ee,c),r.clip()),o.drawStripe(r,e,ge),r.restore(),Oe&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,v.x,v.y,s,u,ee,c)))},Ae=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ge=(D>0?D:-D)*Oe,L=D>0?0:255;D!==0&&(o.colorFillStyle(r,L,L,L,ge),g?r.fill(p):r.fill())},Te=function(){if(M>0){if(r.lineWidth=M,r.lineCap=G,r.lineJoin=$,r.setLineDash)switch(V){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(J),r.lineDashOffset=W;break;case"solid":case"double":r.setLineDash([]);break}if(U!=="center"){if(r.save(),r.lineWidth*=2,U==="inside")g?r.clip(p):r.clip();else{var Oe=new Path2D;Oe.rect(-s/2-M,-u/2-M,s+2*M,u+2*M),Oe.addPath(p),r.clip(Oe,"evenodd")}g?r.stroke(p):r.stroke(),r.restore()}else g?r.stroke(p):r.stroke();if(V==="double"){r.lineWidth=M/3;var ge=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(p):r.stroke(),r.globalCompositeOperation=ge}r.setLineDash&&r.setLineDash([])}},Pe=function(){if(Z>0){if(r.lineWidth=Z,r.lineCap="butt",r.setLineDash)switch(F){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var Oe=v;g&&(Oe={x:0,y:0});var ge=o.getNodeShape(e),L=M;U==="inside"&&(L=0),U==="outside"&&(L*=2);var se=(s+L+(Z+j))/s,de=(u+L+(Z+j))/u,ve=s*se,ye=u*de,Me=o.nodeShapes[ge].points,_e;if(g){var ze=X(ve,ye,ge,Me);_e=ze.path}if(ge==="ellipse")o.drawEllipsePath(_e||r,Oe.x,Oe.y,ve,ye);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ge)){var qe=0,We=0,nr=0;ge==="round-diamond"?qe=(L+j+Z)*1.4:ge==="round-heptagon"?(qe=(L+j+Z)*1.075,nr=-(L/2+j+Z)/35):ge==="round-hexagon"?qe=(L+j+Z)*1.12:ge==="round-pentagon"?(qe=(L+j+Z)*1.13,nr=-(L/2+j+Z)/15):ge==="round-tag"?(qe=(L+j+Z)*1.12,We=(L/2+Z+j)*.07):ge==="round-triangle"&&(qe=(L+j+Z)*(Math.PI/2),nr=-(L+j/2+Z)/Math.PI),qe!==0&&(se=(s+qe)/s,ve=s*se,["round-hexagon","round-tag"].includes(ge)||(de=(u+qe)/u,ye=u*de)),ee=ee==="auto"?y2(ve,ye):ee;for(var er=ve/2,$e=ye/2,or=ee+(L+Z+j)/2,rr=new Array(Me.length/2),Vr=new Array(Me.length/2),Ir=0;Ir<Me.length/2;Ir++)rr[Ir]={x:Oe.x+We+er*Me[Ir*2],y:Oe.y+nr+$e*Me[Ir*2+1]};var st,Br,Ur,Lr,Yr=rr.length;for(Br=rr[Yr-1],st=0;st<Yr;st++)Ur=rr[st%Yr],Lr=rr[(st+1)%Yr],Vr[st]=Um(Br,Ur,Lr,or),Br=Ur,Ur=Lr;o.drawRoundPolygonPath(_e||r,Oe.x+We,Oe.y+nr,s*se,u*de,Me,Vr)}else if(["roundrectangle","round-rectangle"].includes(ge))ee=ee==="auto"?_a(ve,ye):ee,o.drawRoundRectanglePath(_e||r,Oe.x,Oe.y,ve,ye,ee+(L+Z+j)/2);else if(["cutrectangle","cut-rectangle"].includes(ge))ee=ee==="auto"?Mm():ee,o.drawCutRectanglePath(_e||r,Oe.x,Oe.y,ve,ye,null,ee+(L+Z+j)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ge))ee=ee==="auto"?_a(ve,ye):ee,o.drawBottomRoundRectanglePath(_e||r,Oe.x,Oe.y,ve,ye,ee+(L+Z+j)/2);else if(ge==="barrel")o.drawBarrelPath(_e||r,Oe.x,Oe.y,ve,ye);else if(ge.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ge)){var En=(L+Z+j)/s;Me=Hu(Ku(Me,En)),o.drawPolygonPath(_e||r,Oe.x,Oe.y,s,u,Me)}else{var Fr=(L+Z+j)/s;Me=Hu(Ku(Me,-Fr)),o.drawPolygonPath(_e||r,Oe.x,Oe.y,s,u,Me)}if(g?r.stroke(_e):r.stroke(),F==="double"){r.lineWidth=L/3;var cn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(_e):r.stroke(),r.globalCompositeOperation=cn}r.setLineDash&&r.setLineDash([])}},Ie=function(){a&&o.drawNodeOverlay(r,e,v,s,u)},Le=function(){a&&o.drawNodeUnderlay(r,e,v,s,u)},Fe=function(){o.drawElementText(r,e,null,n)},je=e.pstyle("ghost").value==="yes";if(je){var lr=e.pstyle("ghost-offset-x").pfValue,ir=e.pstyle("ghost-offset-y").pfValue,Xe=e.pstyle("ghost-opacity").value,fr=Xe*h;r.translate(lr,ir),Y(),Pe(),ie(Xe*O),be(),fe(fr,!0),oe(Xe*H),Te(),ue(D!==0||M!==0),Se(D!==0||M!==0),fe(fr,!1),Ae(fr),r.translate(-lr,-ir)}g&&r.translate(-v.x,-v.y),Le(),g&&r.translate(v.x,v.y),Y(),Pe(),ie(),be(),fe(h,!0),oe(),Te(),ue(D!==0||M!==0),Se(D!==0||M!==0),fe(h,!1),Ae(),g&&r.translate(-v.x,-v.y),Fe(),Ie(),t&&r.translate(b.x1,b.y1)}};var _A=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,a,i,o){var s=this;if(n.visible()){var u=n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,v=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(a=a||n.position(),i==null||o==null){var g=n.padding();i=n.width()+2*g,o=n.height()+2*g}s.colorFillStyle(t,c[0],c[1],c[2],l),s.nodeShapes[v].draw(t,a.x,a.y,i+u*2,o+u*2,h),t.fill()}}}};Oa.drawNodeOverlay=_A("overlay");Oa.drawNodeUnderlay=_A("underlay");Oa.hasPie=function(r){return r=r[0],r._private.hasPie};Oa.hasStripe=function(r){return r=r[0],r._private.hasStripe};Oa.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,u=n.x,l=n.y,c=e.width(),v=e.height(),h=Math.min(c,v)/2,g,p=0,E=this.usePaths();if(E&&(u=0,l=0),i.units==="%"?h=h*i.pfValue:i.pfValue!==void 0&&(h=i.pfValue/2),o.units==="%"?g=h*o.pfValue:o.pfValue!==void 0&&(g=o.pfValue/2),!(g>=h))for(var m=1;m<=a.pieBackgroundN;m++){var b=e.pstyle("pie-"+m+"-background-size").value,w=e.pstyle("pie-"+m+"-background-color").value,x=e.pstyle("pie-"+m+"-background-opacity").value*t,_=b/100;_+p>1&&(_=1-p);var C=1.5*Math.PI+2*Math.PI*p;C+=s;var R=2*Math.PI*_,S=C+R;b===0||p>=1||p+_>1||(g===0?(r.beginPath(),r.moveTo(u,l),r.arc(u,l,h,C,S),r.closePath()):(r.beginPath(),r.arc(u,l,h,C,S),r.arc(u,l,g,S,C,!0),r.closePath()),this.colorFillStyle(r,w[0],w[1],w[2],x),r.fill(),p+=_)}};Oa.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,o=n.y,s=e.width(),u=e.height(),l=0,c=this.usePaths();r.save();var v=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(v){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var g=s,p=u;h.units==="%"?(g=g*h.pfValue,p=p*h.pfValue):h.pfValue!==void 0&&(g=h.pfValue,p=h.pfValue),c&&(i=0,o=0),o-=g/2,i-=p/2;for(var E=1;E<=a.stripeBackgroundN;E++){var m=e.pstyle("stripe-"+E+"-background-size").value,b=e.pstyle("stripe-"+E+"-background-color").value,w=e.pstyle("stripe-"+E+"-background-opacity").value*t,x=m/100;x+l>1&&(x=1-l),!(m===0||l>=1||l+x>1)&&(r.beginPath(),r.rect(i,o+p*l,g,p*x),r.closePath(),this.colorFillStyle(r,b[0],b[1],b[2],w),r.fill(),l+=x)}r.restore()};var It={},V$=100;It.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};It.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===r){t=!1;break}return t&&(n={context:r},e.push(n)),n};It.createGradientStyleFor=function(r,e,t,n,a){var i,o=this.usePaths(),s=t.pstyle(e+"-gradient-stop-colors").value,u=t.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(t.isEdge()){var l=t.sourceEndpoint(),c=t.targetEndpoint(),v=t.midpoint(),h=ni(l,v),g=ni(c,v);i=r.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(h,g))}else{var p=o?{x:0,y:0}:t.position(),E=t.paddedWidth(),m=t.paddedHeight();i=r.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(E,m))}else if(t.isEdge()){var b=t.sourceEndpoint(),w=t.targetEndpoint();i=r.createLinearGradient(b.x,b.y,w.x,w.y)}else{var x=o?{x:0,y:0}:t.position(),_=t.paddedWidth(),C=t.paddedHeight(),R=_/2,S=C/2,A=t.pstyle("background-gradient-direction").value;switch(A){case"to-bottom":i=r.createLinearGradient(x.x,x.y-S,x.x,x.y+S);break;case"to-top":i=r.createLinearGradient(x.x,x.y+S,x.x,x.y-S);break;case"to-left":i=r.createLinearGradient(x.x+R,x.y,x.x-R,x.y);break;case"to-right":i=r.createLinearGradient(x.x-R,x.y,x.x+R,x.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(x.x-R,x.y-S,x.x+R,x.y+S);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(x.x-R,x.y+S,x.x+R,x.y-S);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(x.x+R,x.y-S,x.x-R,x.y+S);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(x.x+R,x.y+S,x.x-R,x.y-S);break}}if(!i)return null;for(var P=u.length===s.length,I=s.length,D=0;D<I;D++)i.addColorStop(P?u[D]:D/(I-1),"rgba("+s[D][0]+","+s[D][1]+","+s[D][2]+","+a+")");return i};It.gradientFillStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"background",e,t,n);if(!a)return null;r.fillStyle=a};It.colorFillStyle=function(r,e,t,n,a){r.fillStyle="rgba("+e+","+t+","+n+","+a+")"};It.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(r,e,n,t);else{var a=e.pstyle("background-color").value;this.colorFillStyle(r,a[0],a[1],a[2],t)}};It.gradientStrokeStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"line",e,t,n);if(!a)return null;r.strokeStyle=a};It.colorStrokeStyle=function(r,e,t,n,a){r.strokeStyle="rgba("+e+","+t+","+n+","+a+")"};It.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(r,e,n,t);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(r,a[0],a[1],a[2],t)}};It.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=a*o,l=i*o,c;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var v=t.canvasContainer;v.style.width=a+"px",v.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)c=t.canvases[h],c.width=u,c.height=l,c.style.width=a+"px",c.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)c=t.bufferCanvases[h],c.width=u,c.height=l,c.style.width=a+"px",c.style.height=i+"px";e.textureMult=1,o<=1&&(c=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,c.width=u*e.textureMult,c.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=o}};It.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})};It.clearCanvas=function(){var r=this,e=r.data;function t(n){n.clearRect(0,0,r.canvasWidth,r.canvasHeight)}t(e.contexts[r.NODE]),t(e.contexts[r.DRAG])};It.render=function(r){var e=this;r=r||c2();var t=e.cy,n=r.forcedContext,a=r.drawAllLayers,i=r.drawOnlyNodeLayer,o=r.forcedZoom,s=r.forcedPan,u=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,l=e.data,c=l.canvasNeedsRedraw,v=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=r.motionBlur!==void 0?r.motionBlur:e.motionBlur,g=e.motionBlurPxRatio,p=t.hasCompoundNodes(),E=e.hoverData.draggingEles,m=!!(e.hoverData.selecting||e.touchData.selecting);h=h&&!n&&e.motionBlurEnabled&&!m;var b=h;n||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),h&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(b=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!v&&(c[e.NODE]=!0,c[e.SELECT_BOX]=!0);var w=t.style(),x=t.zoom(),_=o!==void 0?o:x,C=t.pan(),R={x:C.x,y:C.y},S={zoom:x,pan:{x:C.x,y:C.y}},A=e.prevViewport,P=A===void 0||S.zoom!==A.zoom||S.pan.x!==A.pan.x||S.pan.y!==A.pan.y;!P&&!(E&&!p)&&(e.motionBlurPxRatio=1),s&&(R=s),_*=u,R.x*=u,R.y*=u;var I=e.getCachedZSortedEles();function D(oe,Y,X,re,le){var he=oe.globalCompositeOperation;oe.globalCompositeOperation="destination-out",e.colorFillStyle(oe,255,255,255,e.motionBlurTransparency),oe.fillRect(Y,X,re,le),oe.globalCompositeOperation=he}function M(oe,Y){var X,re,le,he;!e.clearingMotionBlur&&(oe===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||oe===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(X={x:C.x*g,y:C.y*g},re=x*g,le=e.canvasWidth*g,he=e.canvasHeight*g):(X=R,re=_,le=e.canvasWidth,he=e.canvasHeight),oe.setTransform(1,0,0,1,0,0),Y==="motionBlur"?D(oe,0,0,le,he):!n&&(Y===void 0||Y)&&oe.clearRect(0,0,le,he),a||(oe.translate(X.x,X.y),oe.scale(re,re)),s&&oe.translate(s.x,s.y),o&&oe.scale(o,o)}if(v||(e.textureDrawLastFrame=!1),v){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var O=e.data.bufferContexts[e.TEXTURE_BUFFER];O.setTransform(1,0,0,1,0,0),O.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:O,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var S=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var N=l.contexts[e.NODE],V=e.textureCache.texture,S=e.textureCache.viewport;N.setTransform(1,0,0,1,0,0),h?D(N,0,0,S.width,S.height):N.clearRect(0,0,S.width,S.height);var $=w.core("outside-texture-bg-color").value,G=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(N,$[0],$[1],$[2],G),N.fillRect(0,0,S.width,S.height);var x=t.zoom();M(N,!1),N.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/u,S.height/S.zoom/u),N.drawImage(V,S.mpan.x,S.mpan.y,S.width/S.zoom/u,S.height/S.zoom/u)}else e.textureOnViewport&&!n&&(e.textureCache=null);var U=t.extent(),J=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),W=e.hideEdgesOnViewport&&J,H=[];if(H[e.NODE]=!c[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,H[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),H[e.DRAG]=!c[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,H[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||a||i||H[e.NODE]){var Z=h&&!H[e.NODE]&&g!==1,N=n||(Z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),ne=h&&!Z?"motionBlur":void 0;M(N,ne),W?e.drawCachedNodes(N,I.nondrag,u,U):e.drawLayeredElements(N,I.nondrag,u,U),e.debug&&e.drawDebugPoints(N,I.nondrag),!a&&!h&&(c[e.NODE]=!1)}if(!i&&(c[e.DRAG]||a||H[e.DRAG])){var Z=h&&!H[e.DRAG]&&g!==1,N=n||(Z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);M(N,h&&!Z?"motionBlur":void 0),W?e.drawCachedNodes(N,I.drag,u,U):e.drawCachedElements(N,I.drag,u,U),e.debug&&e.drawDebugPoints(N,I.drag),!a&&!h&&(c[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,M),h&&g!==1){var F=l.contexts[e.NODE],z=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],j=l.contexts[e.DRAG],ee=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ie=function(Y,X,re){Y.setTransform(1,0,0,1,0,0),re||!b?Y.clearRect(0,0,e.canvasWidth,e.canvasHeight):D(Y,0,0,e.canvasWidth,e.canvasHeight);var le=g;Y.drawImage(X,0,0,e.canvasWidth*le,e.canvasHeight*le,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||H[e.NODE])&&(ie(F,z,H[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||H[e.DRAG])&&(ie(j,ee,H[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),h&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!v,e.mbFrames=0,c[e.NODE]=!0,c[e.DRAG]=!0,e.redraw()},V$)),n||t.emit("render")};var Oo;It.drawSelectionRectangle=function(r,e){var t=this,n=t.cy,a=t.data,i=n.style(),o=r.drawOnlyNodeLayer,s=r.drawAllLayers,u=a.canvasNeedsRedraw,l=r.forcedContext;if(t.showFps||!o&&u[t.SELECT_BOX]&&!s){var c=l||a.contexts[t.SELECT_BOX];if(e(c),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var v=t.cy.zoom(),h=i.core("selection-box-border-width").value/v;c.lineWidth=h,c.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",c.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),h>0&&(c.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",c.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(a.bgActivePosistion&&!t.hoverData.selecting){var v=t.cy.zoom(),g=a.bgActivePosistion;c.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",c.beginPath(),c.arc(g.x,g.y,i.core("active-bg-size").pfValue/v,0,2*Math.PI),c.fill()}var p=t.lastRedrawTime;if(t.showFps&&p){p=Math.round(p);var E=Math.round(1e3/p),m="1 frame = "+p+" ms = "+E+" fps";if(c.setTransform(1,0,0,1,0,0),c.fillStyle="rgba(255, 0, 0, 0.75)",c.strokeStyle="rgba(255, 0, 0, 0.75)",c.font="30px Arial",!Oo){var b=c.measureText(m);Oo=b.actualBoundingBoxAscent}c.fillText(m,0,Oo);var w=60;c.strokeRect(0,Oo+10,250,20),c.fillRect(0,Oo+10,250*Math.min(E/w,1),20)}s||(u[t.SELECT_BOX]=!1)}};function Jx(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(n));return n}function G$(r,e,t){var n=Jx(r,r.VERTEX_SHADER,e),a=Jx(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,n),r.attachShader(i,a),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function W$(r,e,t){t===void 0&&(t=e);var n=r.makeOffscreenCanvas(e,t),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function jm(r){var e=r.pixelRatio,t=r.cy.zoom(),n=r.cy.pan();return{zoom:t*e,pan:{x:n.x*e,y:n.y*e}}}function U$(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function H$(r,e,t,n,a){var i=n*t+e.x,o=a*t+e.y;return o=Math.round(r.canvasHeight-o),[i,o]}function K$(r){return r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function j$(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function ja(r,e,t){var n=r[0]/255,a=r[1]/255,i=r[2]/255,o=e,s=t||new Array(4);return s[0]=n*o,s[1]=a*o,s[2]=i*o,s[3]=o,s}function Fi(r,e){var t=e||new Array(4);return t[0]=(r>>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function Y$(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function Z$(r,e){var t=r.createTexture();return t.buffer=function(n){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function CA(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function SA(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function X$(r,e,t,n,a,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*n,a);case r.INT:return new Int32Array(t.buffer,i*n,a)}}function Q$(r,e,t,n){var a=CA(r,e),i=Kr(a,2),o=i[0],s=i[1],u=SA(r,s,n),l=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,u,r.STATIC_DRAW),s===r.FLOAT?r.vertexAttribPointer(t,o,s,!1,0,0):s===r.INT&&r.vertexAttribIPointer(t,o,s,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),l}function Rn(r,e,t,n){var a=CA(r,t),i=Kr(a,3),o=i[0],s=i[1],u=i[2],l=SA(r,s,e*o),c=o*u,v=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,v),r.bufferData(r.ARRAY_BUFFER,e*c,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),s===r.FLOAT?r.vertexAttribPointer(n,o,s,!1,c,0):s===r.INT&&r.vertexAttribIPointer(n,o,s,c,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var h=new Array(e),g=0;g<e;g++)h[g]=X$(r,s,l,c,o,g);return v.dataArray=l,v.stride=c,v.size=o,v.getView=function(p){return h[p]},v.setPoint=function(p,E,m){var b=h[p];b[0]=E,b[1]=m},v.bufferSubData=function(p){r.bindBuffer(r.ARRAY_BUFFER,v),p?r.bufferSubData(r.ARRAY_BUFFER,0,l,0,p*o):r.bufferSubData(r.ARRAY_BUFFER,0,l)},v}function J$(r,e,t){for(var n=9,a=new Float32Array(e*n),i=new Array(e),o=0;o<e;o++){var s=o*n*4;i[o]=new Float32Array(a.buffer,s,n)}var u=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,a.byteLength,r.DYNAMIC_DRAW);for(var l=0;l<3;l++){var c=t+l;r.enableVertexAttribArray(c),r.vertexAttribPointer(c,3,r.FLOAT,!1,36,l*12),r.vertexAttribDivisor(c,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),u.getMatrixView=function(v){return i[v]},u.setData=function(v,h){i[h].set(v,0)},u.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferSubData(r.ARRAY_BUFFER,0,a)},u}function eV(r){var e=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,e);var t=r.createTexture();return r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),r.bindFramebuffer(r.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,a){r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,a,0,r.RGBA,r.UNSIGNED_BYTE,null)},e}var eE=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});function Id(){var r=new eE(9);return eE!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function rE(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function rV(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],v=e[8],h=t[0],g=t[1],p=t[2],E=t[3],m=t[4],b=t[5],w=t[6],x=t[7],_=t[8];return r[0]=h*n+g*o+p*l,r[1]=h*a+g*s+p*c,r[2]=h*i+g*u+p*v,r[3]=E*n+m*o+b*l,r[4]=E*a+m*s+b*c,r[5]=E*i+m*u+b*v,r[6]=w*n+x*o+_*l,r[7]=w*a+x*s+_*c,r[8]=w*i+x*u+_*v,r}function Nu(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],v=e[8],h=t[0],g=t[1];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=s,r[5]=u,r[6]=h*n+g*o+l,r[7]=h*a+g*s+c,r[8]=h*i+g*u+v,r}function tE(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],v=e[8],h=Math.sin(t),g=Math.cos(t);return r[0]=g*n+h*o,r[1]=g*a+h*s,r[2]=g*i+h*u,r[3]=g*o-h*n,r[4]=g*s-h*a,r[5]=g*u-h*i,r[6]=l,r[7]=c,r[8]=v,r}function wm(r,e,t){var n=t[0],a=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=a*e[3],r[4]=a*e[4],r[5]=a*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function tV(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}var nV=(function(){function r(e,t,n,a){Da(this,r),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=t,this.texRows=n,this.texHeight=Math.floor(t/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(e,t,t),this.scratch=a(e,t,this.texHeight,"scratch")}return Ia(r,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(t){var n=t.w,a=t.h,i=this.texHeight,o=this.texSize,s=i/a,u=n*s,l=a*s;return u>o&&(s=o/n,u=n*s,l=a*s),{scale:s,texW:u,texH:l}}},{key:"draw",value:function(t,n,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,u=this.texHeight,l=this.getScale(n),c=l.scale,v=l.texW,h=l.texH,g=function(x,_){if(a&&_){var C=_.context,R=x.x,S=x.row,A=R,P=u*S;C.save(),C.translate(A,P),C.scale(c,c),a(C,n),C.restore()}},p=[null,null],E=function(){g(i.freePointer,i.canvas),p[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:v,h},p[1]={x:i.freePointer.x+v,y:i.freePointer.row*u,w:0,h},i.freePointer.x+=v,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},m=function(){var x=i.scratch,_=i.canvas;x.clear(),g({x:0,row:0},x);var C=o-i.freePointer.x,R=v-C,S=u;{var A=i.freePointer.x,P=i.freePointer.row*u,I=C;_.context.drawImage(x,0,0,I,S,A,P,I,S),p[0]={x:A,y:P,w:I,h}}{var D=C,M=(i.freePointer.row+1)*u,O=R;_&&_.context.drawImage(x,D,0,O,S,0,M,O,S),p[1]={x:0,y:M,w:O,h}}i.freePointer.x=R,i.freePointer.row++},b=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+v<=o)E();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(b(),E()):this.enableWrapping?m():(b(),E())}return this.keyToLocation.set(t,p),this.needsBuffer=!0,p}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(t),o=i.texW;return this.freePointer.x+o>n?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=Z$(t,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),aV=(function(){function r(e,t,n,a){Da(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Ia(r,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new nV(t,n,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas,o=Math.floor(n/a);this.scratch=i(t,n,o,"scratch")}return this.scratch}},{key:"draw",value:function(t,n,a){var i=this.styleKeyToAtlas.get(t);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(n))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(t,n,a),this.styleKeyToAtlas.set(t,i)),i}},{key:"getAtlas",value:function(t){return this.styleKeyToAtlas.get(t)}},{key:"hasAtlas",value:function(t){return this.styleKeyToAtlas.has(t)}},{key:"markKeyForGC",value:function(t){this.markedKeys.add(t)}},{key:"gc",value:function(){var t=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,o=null,s=Ft(this.atlases),u;try{var l=function(){var v=u.value,h=v.getKeys(),g=iV(n,h);if(g.size===0)return a.push(v),h.forEach(function(C){return i.set(C,v)}),1;o||(o=t._createAtlas(),a.push(o));var p=Ft(h),E;try{for(p.s();!(E=p.n()).done;){var m=E.value;if(!g.has(m)){var b=v.getOffsets(m),w=Kr(b,2),x=w[0],_=w[1];o.canFit({w:x.w+_.w,h:x.h})||(o.lock(),o=t._createAtlas(),a.push(o)),v.canvas&&(t._copyTextureToNewAtlas(m,v,o),i.set(m,o))}}}catch(C){p.e(C)}finally{p.f()}v.dispose()};for(s.s();!(u=s.n()).done;)l()}catch(c){s.e(c)}finally{s.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(t,n,a){var i=n.getOffsets(t),o=Kr(i,2),s=o[0],u=o[1];if(u.w===0)a.draw(t,s,function(h){h.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var l=this._getScratchCanvas();l.clear(),l.context.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),l.context.drawImage(n.canvas,u.x,u.y,u.w,u.h,s.w,0,u.w,u.h);var c=s.w+u.w,v=s.h;a.draw(t,{w:c,h:v},function(h){h.drawImage(l,0,0,c,v,0,0,c,v)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function iV(r,e){return r.intersection?r.intersection(e):new Set(Vu(r).filter(function(t){return e.has(t)}))}var oV=(function(){function r(e,t){Da(this,r),this.r=e,this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Ia(r,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var a=this.globalOptions,i=a.webglTexSize,o=a.createTextureCanvas,s=n.texRows,u=this._cacheScratchCanvas(o),l=new aV(this.r,i,s,u);this.collections.set(t,l)}},{key:"addRenderType",value:function(t,n){var a=n.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),o=He({type:t,atlasCollection:i},n);this.renderTypes.set(t,o)}},{key:"getRenderTypeOpts",value:function(t){return this.renderTypes.get(t)}},{key:"getAtlasCollection",value:function(t){return this.collections.get(t)}},{key:"_cacheScratchCanvas",value:function(t){var n=-1,a=-1,i=null;return function(o,s,u,l){return l?((!i||s!=n||u!=a)&&(n=s,a=u,i=t(o,s,u)),i):t(o,s,u)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,o=i===void 0?!1:i,s=a.filterEle,u=s===void 0?function(){return!0}:s,l=a.filterType,c=l===void 0?function(){return!0}:l,v=!1,h=!1,g=Ft(t),p;try{for(g.s();!(p=g.n()).done;){var E=p.value;if(u(E)){var m=Ft(this.renderTypes.values()),b;try{var w=function(){var _=b.value,C=_.type;if(c(C)){var R=n.collections.get(_.collection),S=_.getKey(E),A=Array.isArray(S)?S:[S];if(o)A.forEach(function(M){return R.markKeyForGC(M)}),h=!0;else{var P=_.getID?_.getID(E):E.id(),I=n._key(C,P),D=n.typeAndIdToKey.get(I);D!==void 0&&!j$(A,D)&&(v=!0,n.typeAndIdToKey.delete(I),D.forEach(function(M){return R.markKeyForGC(M)}))}}};for(m.s();!(b=m.n()).done;)w()}catch(x){m.e(x)}finally{m.f()}}}}catch(x){g.e(x)}finally{g.f()}return h&&(this.gc(),v=!1),v}},{key:"gc",value:function(){var t=Ft(this.collections.values()),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;a.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,a,i){var o=this.renderTypes.get(n),s=this.collections.get(o.collection),u=!1,l=s.draw(i,a,function(h){o.drawClipped?(h.save(),h.beginPath(),h.rect(0,0,a.w,a.h),h.clip(),o.drawElement(h,t,a,!0,!0),h.restore()):o.drawElement(h,t,a,!0,!0),u=!0});if(u){var c=o.getID?o.getID(t):t.id(),v=this._key(n,c);this.typeAndIdToKey.has(v)?this.typeAndIdToKey.get(v).push(i):this.typeAndIdToKey.set(v,[i])}return l}},{key:"getAtlasInfo",value:function(t,n){var a=this,i=this.renderTypes.get(n),o=i.getKey(t),s=Array.isArray(o)?o:[o];return s.map(function(u){var l=i.getBoundingBox(t,u),c=a.getOrCreateAtlas(t,n,l,u),v=c.getOffsets(u),h=Kr(v,2),g=h[0],p=h[1];return{atlas:c,tex:g,tex1:g,tex2:p,bb:l}})}},{key:"getDebugInfo",value:function(){var t=[],n=Ft(this.collections),a;try{for(n.s();!(a=n.n()).done;){var i=Kr(a.value,2),o=i[0],s=i[1],u=s.getCounts(),l=u.keyCount,c=u.atlasCount;t.push({type:o,keyCount:l,atlasCount:c})}}catch(v){n.e(v)}finally{n.f()}return t}}])})(),sV=(function(){function r(e){Da(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ia(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var n=this.batchAtlases.indexOf(t);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),n=this.batchAtlases.length-1}return n}}])})(),uV=`
|
|
14
|
+
*/var YR=function(e,t){this.recycle(e,t)};function Bo(){return!1}function Eu(){return!0}YR.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Bo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Eu:Bo):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Eu;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Eu;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Eu,this.stopPropagation()},isDefaultPrevented:Bo,isPropagationStopped:Bo,isImmediatePropagationStopped:Bo};var ZR=/^([^.]+)(\.(?:[^.]+))?$/,x5=".*",XR={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Tx=Object.keys(XR),E5={};function gl(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E5,e=arguments.length>1?arguments[1]:void 0,t=0;t<Tx.length;t++){var n=Tx[t];this[n]=r[n]||XR[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Aa=gl.prototype,QR=function(e,t,n,a,i,o,s){zr(a)&&(i=a,a=null),s&&(o==null?o=s:o=Ye({},o,s));for(var l=Sr(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var c=l[u];if(!Ca(c)){var d=c.match(ZR);if(d){var h=d[1],g=d[2]?d[2]:null,p=t(e,c,h,g,a,i,o);if(p===!1)break}}}},Rx=function(e,t){return e.addEventFields(e.context,t),new YR(t.type,t)},C5=function(e,t,n){if(Pq(n)){t(e,n);return}else if(pr(n)){t(e,Rx(e,n));return}for(var a=Sr(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!Ca(o)){var s=o.match(ZR);if(s){var l=s[1],u=s[2]?s[2]:null,c=Rx(e,{type:l,namespace:u,target:e.context});t(e,c)}}}};Aa.on=Aa.addListener=function(r,e,t,n,a){return QR(this,function(i,o,s,l,u,c,d){zr(c)&&i.listeners.push({event:o,callback:c,type:s,namespace:l,qualifier:u,conf:d})},r,e,t,n,a),this};Aa.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})};Aa.removeListener=Aa.off=function(r,e,t,n){var a=this;this.emitting!==0&&(this.listeners=cN(this.listeners));for(var i=this.listeners,o=function(u){var c=i[u];QR(a,function(d,h,g,p,E,y){if((c.type===g||r==="*")&&(!p&&c.namespace!==".*"||c.namespace===p)&&(!E||d.qualifierCompare(c.qualifier,E))&&(!y||c.callback===y))return i.splice(u,1),!1},r,e,t,n)},s=i.length-1;s>=0;s--)o(s);return this};Aa.removeAllListeners=function(){return this.removeListener("*")};Aa.emit=Aa.trigger=function(r,e,t){var n=this.listeners,a=n.length;return this.emitting++,Sr(e)||(e=[e]),C5(this,function(i,o){t!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:t}],a=n.length);for(var s=function(){var c=n[l];if(c.type===o.type&&(!c.namespace||c.namespace===o.namespace||c.namespace===x5)&&i.eventMatches(i.context,c,o)){var d=[o];e!=null&&vN(d,e),i.beforeEmit(i.context,c,o),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==c}));var h=i.callbackContext(i.context,c,o),g=c.callback.apply(h,d);i.afterEmit(i.context,c,o),g===!1&&(o.stopPropagation(),o.preventDefault())}},l=0;l<a;l++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},r),this.emitting--,this};var _5={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&fs(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Cu=function(e){return Ke(e)?new Ta(e):e},JR={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new gl(_5,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var a=Cu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,t,n){for(var a=Cu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,n){for(var a=Cu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,t,n){for(var a=Cu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};xr.eventAliasesOn(JR);var eA={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):t.push(a)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(Ke(e)||Yt(e))return new Ta(e).filter(this);if(zr(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);s&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ke(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||t.push(a)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ke(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,s=o?a:i,l=o?i:a,u=0;u<s.length;u++){var c=s[u];l.has(c)&&n.push(c)}return n},xor:function(e){var t=this._private.cy;Ke(e)&&(e=t.$(e));var n=this.spawn(),a=this,i=e,o=function(l,u){for(var c=0;c<l.length;c++){var d=l[c],h=d._private.data.id,g=u.hasElementWithId(h);g||n.push(d)}};return o(a,i),o(i,a),n},diff:function(e){var t=this._private.cy;Ke(e)&&(e=t.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,s=e,l=function(c,d,h){for(var g=0;g<c.length;g++){var p=c[g],E=p._private.data.id,y=d.hasElementWithId(E);y?i.merge(p):h.push(p)}};return l(o,s,n),l(s,o,a),{left:n,right:a,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(Ke(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&a.push(o)}return a},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&Ke(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=t.map,o=0;o<e.length;o++){var s=e[o],l=s._private.data.id,u=!i.has(l);if(u){var c=this.length++;this[c]=s,i.set(l,{ele:s,index:c})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,a=t.map,i=a.get(n);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&Ke(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);n.push(s)}return n},reduce:function(e,t){for(var n=t,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,t){for(var n=-1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],l=t?e.apply(t,[s,o,i]):e(s,o,i);l>n&&(n=l,a=s)}return{value:n,ele:a}},min:function(e,t){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],l=t?e.apply(t,[s,o,i]):e(s,o,i);l<n&&(n=l,a=s)}return{value:n,ele:a}}},yr=eA;yr.u=yr["|"]=yr["+"]=yr.union=yr.or=yr.add;yr["\\"]=yr["!"]=yr["-"]=yr.difference=yr.relativeComplement=yr.subtract=yr.not;yr.n=yr["&"]=yr["."]=yr.and=yr.intersection=yr.intersect;yr["^"]=yr["(+)"]=yr["(-)"]=yr.symmetricDifference=yr.symdiff=yr.xor;yr.fnFilter=yr.filterFn=yr.stdFilter=yr.filter;yr.complement=yr.abscomp=yr.absoluteComplement;var S5={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},rA=function(e,t){var n=e.cy(),a=n.hasCompoundNodes();function i(c){var d=c.pstyle("z-compound-depth");return d.value==="auto"?a?c.zDepth():0:d.value==="bottom"?-1:d.value==="top"?Pm:0}var o=i(e)-i(t);if(o!==0)return o;function s(c){var d=c.pstyle("z-index-compare");return d.value==="auto"&&c.isNode()?1:0}var l=s(e)-s(t);if(l!==0)return l;var u=e.pstyle("z-index").value-t.pstyle("z-index").value;return u!==0?u:e.poolIndex()-t.poolIndex()},Zu={forEach:function(e,t){if(zr(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=t?e.apply(t,[i,a,this]):e(i,a,this);if(o===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],a=this.length;t==null&&(t=a),e==null&&(e=0),e<0&&(e=a+e),t<0&&(t=a+t);for(var i=e;i>=0&&i<t&&i<a;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!zr(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(rA)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var a=t.data.parent?e.parents().size():0;return e.isParent()?a:Pm-1}else{var i=t.source,o=t.target,s=i.zDepth(),l=o.zDepth();return Math.max(s,l,0)}}}};Zu.each=Zu.forEach;var T5=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":tt(Symbol))!=e&&tt(Symbol.iterator)!=e;t&&(Zu[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return J2({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};T5();var R5=yt({nodeDimensionsIncludeLabels:!1}),Mu={layoutDimensions:function(e){e=R5(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var a=this.nodes().filter(function(T){return!T.isParent()}),i=this.cy(),o=t.eles,s=function(S){return S.id()},l=Ji(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(S,_,A){var P={x:_.x1+_.w/2,y:_.y1+_.h/2},I={x:(A.x-P.x)*S,y:(A.y-P.y)*S};return{x:P.x+I.x,y:P.y+I.y}},c=t.spacingFactor&&t.spacingFactor!==1,d=function(){if(!c)return null;for(var S=Dt(),_=0;_<a.length;_++){var A=a[_],P=l(A,_);bR(S,P.x,P.y)}return S},h=d(),g=Ji(function(T,S){var _=l(T,S);if(c){var A=Math.abs(t.spacingFactor);_=u(A,h,_)}return t.transform!=null&&(_=t.transform(T,_)),_},s);if(t.animate){for(var p=0;p<a.length;p++){var E=a[p],y=g(E,p),b=t.animateFilter==null||t.animateFilter(E,p);if(b){var w=E.animation({position:y,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}else E.position(y)}if(t.fit){var x=i.animation({fit:{boundingBox:o.boundingBoxAt(g),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(x)}else if(t.zoom!==void 0&&t.pan!==void 0){var C=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(C)}e.animations.forEach(function(T){return T.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),no.all(e.animations.map(function(T){return T.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(g),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(Ye({},e,{eles:this}))}};Mu.createLayout=Mu.makeLayout=Mu.layout;function tA(r,e,t){var n=t._private,a=n.styleCache=n.styleCache||[],i;return(i=a[r])!=null||(i=a[r]=e(t)),i}function pl(r,e){return r=ai(r),function(n){return tA(r,e,n)}}function yl(r,e){r=ai(r);var t=function(a){return e.call(a)};return function(){var a=this[0];if(a)return tA(r,t,a)}}var gt={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),a=t.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(a){t(a),a.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var n=t._private.batchStyleEles;return n.merge(this),this}var a=t.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var i=n._private.style[e];return i??(t?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(pr(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ke(e))if(t===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,t,a),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,a=t.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];a.removeAllBypasses(s,n)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];a.removeBypasses(u,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=a.data.parent?n.parents():null;if(o)for(var s=0;s<o.length;s++){var l=o[s],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();if(t)return n?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function Rd(r,e){var t=r._private,n=t.data.parent?r.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function $m(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,n=r.parentOk||r.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],o=a.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||Rd(i,n);var l=s.source,u=s.target;return t(l)&&(!o||Rd(l,t))&&(l===u||t(u)&&(!o||Rd(u,t)))}}}var ao=pl("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});gt.takesUpSpace=yl("takesUpSpace",$m({ok:ao}));var A5=pl("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&ao(r)}),P5=pl("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&ao(r)});gt.interactive=yl("interactive",$m({ok:A5,parentOk:P5,edgeOkViaNode:ao}));gt.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var I5=pl("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&ao(r)}),D5=ao;gt.visible=yl("visible",$m({ok:I5,edgeOkViaNode:D5}));gt.hidden=function(){var r=this[0];if(r)return!r.visible()};gt.isBundledBezier=yl("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});gt.bypass=gt.css=gt.style;gt.renderedCss=gt.renderedStyle;gt.removeBypass=gt.removeCss=gt.removeStyle;gt.pstyle=gt.parsedStyle;var Ea={};function Ax(r){return function(){var e=arguments,t=[];if(e.length===2){var n=e[0],a=e[1];this.on(r.event,n,a)}else if(e.length===1&&zr(e[0])){var i=e[0];this.on(r.event,i)}else if(e.length===0||e.length===1&&Sr(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var l=this[s],u=!r.ableField||l._private[r.ableField],c=l._private[r.field]!=r.value;if(r.overrideAble){var d=r.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[r.field]=r.value,c&&t.push(l))}var h=this.spawn(t);h.updateStyle(),h.emit(r.event),o&&h.emit(o)}return this}}function io(r){Ea[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},Ea[r.on]=Ax({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),Ea[r.off]=Ax({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}io({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});io({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});io({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});io({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Ea.deselect=Ea.unselect;Ea.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};io({field:"active",on:"activate",off:"unactivate"});io({field:"pannable",on:"panify",off:"unpanify"});Ea.inactive=function(){var r=this[0];if(r)return!r._private.active};var Ct={},Px=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var s=a[o];if(s.isNode()){for(var l=!1,u=s.connectedEdges(),c=0;c<u.length;c++){var d=u[c],h=d.source(),g=d.target();if(e.noIncomingEdges&&g===s&&h!==s||e.noOutgoingEdges&&h===s&&g!==s){l=!0;break}}l||i.push(s)}}return this.spawn(i,!0).filter(n)}},Ix=function(e){return function(t){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var s=o.connectedEdges(),l=0;l<s.length;l++){var u=s[l],c=u.source(),d=u.target();e.outgoing&&c===o?(a.push(u),a.push(d)):e.incoming&&d===o&&(a.push(u),a.push(c))}}return this.spawn(a,!0).filter(t)}},Dx=function(e){return function(t){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var s=!1,l=0;l<o.length;l++){var u=o[l],c=u.id();i[c]||(i[c]=!0,a.push(u),s=!0)}if(!s)break;n=o}return this.spawn(a,!0).filter(t)}};Ct.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};Ye(Ct,{roots:Px({noIncomingEdges:!0}),leaves:Px({noOutgoingEdges:!0}),outgoers:ln(Ix({outgoing:!0}),"outgoers"),successors:Dx({outgoing:!0}),incomers:ln(Ix({incoming:!0}),"incomers"),predecessors:Dx({})});Ye(Ct,{neighborhood:ln(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var a=t[n],i=a.connectedEdges(),o=0;o<i.length;o++){var s=i[o],l=s.source(),u=s.target(),c=a===l?u:l;c.length>0&&e.push(c[0]),e.push(s[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});Ct.neighbourhood=Ct.neighborhood;Ct.closedNeighbourhood=Ct.closedNeighborhood;Ct.openNeighbourhood=Ct.openNeighborhood;Ye(Ct,{source:ln(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:ln(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Bx({attr:"source"}),targets:Bx({attr:"target"})});function Bx(r){return function(t){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[r.attr];o&&n.push(o)}return this.spawn(n,!0).filter(t)}}Ye(Ct,{edgesWith:ln(Mx(),"edgesWith"),edgesTo:ln(Mx({thisIsSrc:!0}),"edgesTo")});function Mx(r){return function(t){var n=[],a=this._private.cy,i=r||{};Ke(t)&&(t=a.$(t));for(var o=0;o<t.length;o++)for(var s=t[o]._private.edges,l=0;l<s.length;l++){var u=s[l],c=u._private.data,d=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),h=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target),g=d||h;g&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!h)||n.push(u))}return this.spawn(n,!0)}}Ye(Ct,{connectedEdges:ln(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];if(a.isNode())for(var i=a._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:ln(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:ln(kx(),"parallelEdges"),codirectedEdges:ln(kx({codirected:!0}),"codirectedEdges")});function kx(r){var e={codirected:!1};return r=Ye({},e,r),function(n){for(var a=[],i=this.edges(),o=r,s=0;s<i.length;s++)for(var l=i[s],u=l._private,c=u.source,d=c._private.data.id,h=u.data.target,g=c._private.edges,p=0;p<g.length;p++){var E=g[p],y=E._private.data,b=y.target,w=y.source,x=b===h&&w===d,C=d===b&&h===w;(o.codirected&&x||!o.codirected&&(x||C))&&a.push(E)}return this.spawn(a,!0).filter(n)}}Ye(Ct,{components:function(e){var t=this,n=t.cy(),a=n.collection(),i=e==null?t.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(c,d){a.merge(c),i.unmerge(c),d.merge(c)};if(i.empty())return t.spawn();var l=function(){var c=n.collection();o.push(c);var d=i[0];s(d,c),t.bfs({directed:!1,roots:d,visit:function(g){return s(g,c)}}),c.forEach(function(h){h.connectedEdges().forEach(function(g){t.has(g)&&c.has(g.source())&&c.has(g.target())&&c.merge(g)})})};do l();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Ct.componentsOf=Ct.components;var pt=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Lr("A collection must have a reference to the core");return}var i=new jn,o=!1;if(!t)t=[];else if(t.length>0&&pr(t[0])&&!fs(t[0])){o=!0;for(var s=[],l=new to,u=0,c=t.length;u<c;u++){var d=t[u];d.data==null&&(d.data={});var h=d.data;if(h.id==null)h.id=pR();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var g=new sl(e,d,!1);s.push(g),l.add(h.id)}t=s}this.length=0;for(var p=0,E=t.length;p<E;p++){var y=t[p][0];if(y!=null){var b=y._private.data.id;(!n||!i.has(b))&&(n&&i.set(b,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(w){this.lazyMap=w},rebuildMap:function(){for(var x=this.lazyMap=new jn,C=this.eles,T=0;T<C.length;T++){var S=C[T];x.set(S.id(),{index:T,ele:S})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Pr=sl.prototype=pt.prototype=Object.create(Array.prototype);Pr.instanceString=function(){return"collection"};Pr.spawn=function(r,e){return new pt(this.cy(),r,e)};Pr.spawnSelf=function(){return this.spawn(this)};Pr.cy=function(){return this._private.cy};Pr.renderer=function(){return this._private.cy.renderer()};Pr.element=function(){return this[0]};Pr.collection=function(){return tR(this)?this:new pt(this._private.cy,[this])};Pr.unique=function(){return new pt(this._private.cy,this,!0)};Pr.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)};Pr.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new pt(e)};Pr.$id=Pr.getElementById;Pr.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index};Pr.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index};Pr.indexOfId=function(r){return r=""+r,this._private.map.get(r).index};Pr.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var n=e._private;if(pr(r)){if(t.startBatch(),r.data){e.data(r.data);var a=n.data;if(e.isEdge()){var i=!1,o={},s=r.data.source,l=r.data.target;s!=null&&s!=a.source&&(o.source=""+s,i=!0),l!=null&&l!=a.target&&(o.target=""+l,i=!0),i&&(e=e.move(o))}else{var u="parent"in r.data,c=r.data.parent;u&&(c!=null||a.parent!=null)&&c!=a.parent&&(c===void 0&&(c=null),c!=null&&(c=""+c),e=e.move({parent:c}))}}r.position&&e.position(r.position);var d=function(E,y,b){var w=r[E];w!=null&&w!==n[E]&&(w?e[y]():e[b]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var h={data:Dn(n.data),position:Dn(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};h.classes="";var g=0;return n.classes.forEach(function(p){return h.classes+=g++===0?p:" "+p}),h}}};Pr.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],n=t.json();r.push(n)}return r};Pr.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var n=this[t],a=n.json(),i=new sl(r,a,!1);e.push(i)}return new pt(r,e)};Pr.copy=Pr.clone;Pr.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=t.cy(),a=n._private,i=[],o=[],s,l=0,u=t.length;l<u;l++){var c=t[l];e&&!c.removed()||(c.isNode()?i.push(c):o.push(c))}s=i.concat(o);var d,h=function(){s.splice(d,1),d--};for(d=0;d<s.length;d++){var g=s[d],p=g._private,E=p.data;if(g.clearTraversalCache(),!(!e&&!p.removed)){if(E.id===void 0)E.id=pR();else if(Me(E.id))E.id=""+E.id;else if(Ca(E.id)||!Ke(E.id)){Lr("Can not create element with invalid string ID `"+E.id+"`"),h();continue}else if(n.hasElementWithId(E.id)){Lr("Can not create second element with ID `"+E.id+"`"),h();continue}}var y=E.id;if(g.isNode()){var b=p.position;b.x==null&&(b.x=0),b.y==null&&(b.y=0)}if(g.isEdge()){for(var w=g,x=["source","target"],C=x.length,T=!1,S=0;S<C;S++){var _=x[S],A=E[_];Me(A)&&(A=E[_]=""+E[_]),A==null||A===""?(Lr("Can not create edge `"+y+"` with unspecified "+_),T=!0):n.hasElementWithId(A)||(Lr("Can not create edge `"+y+"` with nonexistant "+_+" `"+A+"`"),T=!0)}if(T){h();continue}var P=n.getElementById(E.source),I=n.getElementById(E.target);P.same(I)?P._private.edges.push(w):(P._private.edges.push(w),I._private.edges.push(w)),w._private.source=P,w._private.target=I}p.map=new jn,p.map.set(y,{ele:g,index:0}),p.removed=!1,e&&n.addToPool(g)}for(var D=0;D<i.length;D++){var k=i[D],M=k._private.data;Me(M.parent)&&(M.parent=""+M.parent);var N=M.parent,z=N!=null;if(z||k._private.parent){var $=k._private.parent?n.collection().merge(k._private.parent):n.getElementById(N);if($.empty())M.parent=void 0;else if($[0].removed())Er("Node added with missing parent, reference to parent removed"),M.parent=void 0,k._private.parent=null;else{for(var q=!1,V=$;!V.empty();){if(k.same(V)){q=!0,M.parent=void 0;break}V=V.parent()}q||($[0]._private.children.push(k),k._private.parent=$[0],a.hasCompoundNodes=!0)}}}if(s.length>0){for(var Z=s.length===t.length?t:new pt(n,s),K=0;K<Z.length;K++){var j=Z[K];j.isNode()||(j.parallelEdges().clearTraversalCache(),j.source().clearTraversalCache(),j.target().clearTraversalCache())}var ee;a.hasCompoundNodes?ee=n.collection().merge(Z).merge(Z.connectedNodes()).merge(Z.parent()):ee=Z,ee.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?Z.emitAndNotify("add"):e&&Z.emit("add")}return t};Pr.removed=function(){var r=this[0];return r&&r._private.removed};Pr.inside=function(){var r=this[0];return r&&!r._private.removed};Pr.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=[],a={},i=t._private.cy;function o(N){for(var z=N._private.edges,$=0;$<z.length;$++)l(z[$])}function s(N){for(var z=N._private.children,$=0;$<z.length;$++)l(z[$])}function l(N){var z=a[N.id()];e&&N.removed()||z||(a[N.id()]=!0,N.isNode()?(n.push(N),o(N),s(N)):n.unshift(N))}for(var u=0,c=t.length;u<c;u++){var d=t[u];l(d)}function h(N,z){var $=N._private.edges;_a($,z),N.clearTraversalCache()}function g(N){N.clearTraversalCache()}var p=[];p.ids={};function E(N,z){z=z[0],N=N[0];var $=N._private.children,q=N.id();_a($,z),z._private.parent=null,p.ids[q]||(p.ids[q]=!0,p.push(N))}t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var y=0;y<n.length;y++){var b=n[y];if(b.isEdge()){var w=b.source()[0],x=b.target()[0];h(w,b),h(x,b);for(var C=b.parallelEdges(),T=0;T<C.length;T++){var S=C[T];g(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var _=b.parent();_.length!==0&&E(_,b)}e&&(b._private.removed=!0)}var A=i._private.elements;i._private.hasCompoundNodes=!1;for(var P=0;P<A.length;P++){var I=A[P];if(I.isParent()){i._private.hasCompoundNodes=!0;break}}var D=new pt(this.cy(),n);D.size()>0&&(r?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var k=0;k<p.length;k++){var M=p[k];(!e||!M.removed())&&M.updateStyle()}return D};Pr.move=function(r){var e=this._private.cy,t=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(r.source!==void 0||r.target!==void 0){var o=i(r.source),s=i(r.target),l=o!=null&&e.hasElementWithId(o),u=s!=null&&e.hasElementWithId(s);(l||u)&&(e.batch(function(){t.remove(n,a),t.emitAndNotify("moveout");for(var g=0;g<t.length;g++){var p=t[g],E=p._private.data;p.isEdge()&&(l&&(E.source=o),u&&(E.target=s))}t.restore(n,a)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var c=i(r.parent),d=c===null||e.hasElementWithId(c);if(d){var h=c===null?void 0:c;e.batch(function(){var g=t.remove(n,a);g.emitAndNotify("moveout");for(var p=0;p<t.length;p++){var E=t[p],y=E._private.data;E.isNode()&&(y.parent=h)}g.restore(n,a)}),t.emitAndNotify("move")}}return this};[AR,Vz,Bu,xa,ro,a5,hl,w5,JR,eA,S5,Zu,Mu,gt,Ea,Ct].forEach(function(r){Ye(Pr,r)});var B5={add:function(e){var t,n=this;if(Yt(e)){var a=e;if(a._private.cy===n)t=a.restore();else{for(var i=[],o=0;o<a.length;o++){var s=a[o];i.push(s.json())}t=new pt(n,i)}}else if(Sr(e)){var l=e;t=new pt(n,l)}else if(pr(e)&&(Sr(e.nodes)||Sr(e.edges))){for(var u=e,c=[],d=["nodes","edges"],h=0,g=d.length;h<g;h++){var p=d[h],E=u[p];if(Sr(E))for(var y=0,b=E.length;y<b;y++){var w=Ye({group:p},E[y]);c.push(w)}}t=new pt(n,c)}else{var x=e;t=new sl(n,x).collection()}return t},remove:function(e){if(!Yt(e)){if(Ke(e)){var t=e;e=this.$(t)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function M5(r,e,t,n){var a=4,i=.001,o=1e-7,s=10,l=11,u=1/(l-1),c=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var h=c?new Float32Array(l):new Array(l);function g(I,D){return 1-3*D+3*I}function p(I,D){return 3*D-6*I}function E(I){return 3*I}function y(I,D,k){return((g(D,k)*I+p(D,k))*I+E(D))*I}function b(I,D,k){return 3*g(D,k)*I*I+2*p(D,k)*I+E(D)}function w(I,D){for(var k=0;k<a;++k){var M=b(D,r,t);if(M===0)return D;var N=y(D,r,t)-I;D-=N/M}return D}function x(){for(var I=0;I<l;++I)h[I]=y(I*u,r,t)}function C(I,D,k){var M,N,z=0;do N=D+(k-D)/2,M=y(N,r,t)-I,M>0?k=N:D=N;while(Math.abs(M)>o&&++z<s);return N}function T(I){for(var D=0,k=1,M=l-1;k!==M&&h[k]<=I;++k)D+=u;--k;var N=(I-h[k])/(h[k+1]-h[k]),z=D+N*u,$=b(z,r,t);return $>=i?w(I,z):$===0?z:C(I,D,D+u)}var S=!1;function _(){S=!0,(r!==e||t!==n)&&x()}var A=function(D){return S||_(),r===e&&t===n?D:D===0?0:D===1?1:y(T(D),e,n)};A.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var P="generateBezier("+[r,e,t,n]+")";return A.toString=function(){return P},A}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var k5=(function(){function r(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:r(o)}}function t(n,a){var i={dx:n.v,dv:r(n)},o=e(n,a*.5,i),s=e(n,a*.5,o),l=e(n,a,s),u=1/6*(i.dx+2*(o.dx+s.dx)+l.dx),c=1/6*(i.dv+2*(o.dv+s.dv)+l.dv);return n.x=n.x+u*a,n.v=n.v+c*a,n}return function n(a,i,o){var s={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1/1e4,d=16/1e3,h,g,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,s.tension=a,s.friction=i,h=o!==null,h?(u=n(a,i),g=u/o*d):g=d;p=t(p||s,g),l.push(1+p.x),u+=16,Math.abs(p.x)>c&&Math.abs(p.v)>c;);return h?function(E){return l[E*(l.length-1)|0]}:u}})(),Ar=function(e,t,n,a){var i=M5(e,t,n,a);return function(o,s,l){return o+(s-o)*i(l)}},ku={linear:function(e,t,n){return e+(t-e)*n},ease:Ar(.25,.1,.25,1),"ease-in":Ar(.42,0,1,1),"ease-out":Ar(0,0,.58,1),"ease-in-out":Ar(.42,0,.58,1),"ease-in-sine":Ar(.47,0,.745,.715),"ease-out-sine":Ar(.39,.575,.565,1),"ease-in-out-sine":Ar(.445,.05,.55,.95),"ease-in-quad":Ar(.55,.085,.68,.53),"ease-out-quad":Ar(.25,.46,.45,.94),"ease-in-out-quad":Ar(.455,.03,.515,.955),"ease-in-cubic":Ar(.55,.055,.675,.19),"ease-out-cubic":Ar(.215,.61,.355,1),"ease-in-out-cubic":Ar(.645,.045,.355,1),"ease-in-quart":Ar(.895,.03,.685,.22),"ease-out-quart":Ar(.165,.84,.44,1),"ease-in-out-quart":Ar(.77,0,.175,1),"ease-in-quint":Ar(.755,.05,.855,.06),"ease-out-quint":Ar(.23,1,.32,1),"ease-in-out-quint":Ar(.86,0,.07,1),"ease-in-expo":Ar(.95,.05,.795,.035),"ease-out-expo":Ar(.19,1,.22,1),"ease-in-out-expo":Ar(1,0,0,1),"ease-in-circ":Ar(.6,.04,.98,.335),"ease-out-circ":Ar(.075,.82,.165,1),"ease-in-out-circ":Ar(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return ku.linear;var a=k5(e,t,n);return function(i,o,s){return i+(o-i)*a(s)}},"cubic-bezier":Ar};function Ox(r,e,t,n,a){if(n===1||e===t)return t;var i=a(e,t,n);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function Lx(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function qi(r,e,t,n,a){var i=a!=null?a.type:null;t<0?t=0:t>1&&(t=1);var o=Lx(r,a),s=Lx(e,a);if(Me(o)&&Me(s))return Ox(i,o,s,t,n);if(Sr(o)&&Sr(s)){for(var l=[],u=0;u<s.length;u++){var c=o[u],d=s[u];if(c!=null&&d!=null){var h=Ox(i,c,d,t,n);l.push(h)}else l.push(d)}return l}}function O5(r,e,t,n){var a=!n,i=r._private,o=e._private,s=o.easing,l=o.startTime,u=n?r:r.cy(),c=u.style();if(!o.easingImpl)if(s==null)o.easingImpl=ku.linear;else{var d;if(Ke(s)){var h=c.parse("transition-timing-function",s);d=h.value}else d=s;var g,p;Ke(d)?(g=d,p=[]):(g=d[1],p=d.slice(2).map(function(Z){return+Z})),p.length>0?(g==="spring"&&p.push(o.duration),o.easingImpl=ku[g].apply(null,p)):o.easingImpl=ku[g]}var E=o.easingImpl,y;if(o.duration===0?y=1:y=(t-l)/o.duration,o.applying&&(y=o.progress),y<0?y=0:y>1&&(y=1),o.delay==null){var b=o.startPosition,w=o.position;if(w&&a&&!r.locked()){var x={};Mo(b.x,w.x)&&(x.x=qi(b.x,w.x,y,E)),Mo(b.y,w.y)&&(x.y=qi(b.y,w.y,y,E)),r.position(x)}var C=o.startPan,T=o.pan,S=i.pan,_=T!=null&&n;_&&(Mo(C.x,T.x)&&(S.x=qi(C.x,T.x,y,E)),Mo(C.y,T.y)&&(S.y=qi(C.y,T.y,y,E)),r.emit("pan"));var A=o.startZoom,P=o.zoom,I=P!=null&&n;I&&(Mo(A,P)&&(i.zoom=Jo(i.minZoom,qi(A,P,y,E),i.maxZoom)),r.emit("zoom")),(_||I)&&r.emit("viewport");var D=o.style;if(D&&D.length>0&&a){for(var k=0;k<D.length;k++){var M=D[k],N=M.name,z=M,$=o.startStyle[N],q=c.properties[$.name],V=qi($,z,y,E,q);c.overrideBypass(r,N,V)}r.emit("style")}}return o.progress=y,y}function Mo(r,e){return r==null||e==null?!1:Me(r)&&Me(e)?!0:!!(r&&e)}function L5(r,e,t,n){var a=e._private;a.started=!0,a.startTime=t-a.progress*a.duration}function qx(r,e){var t=e._private.aniEles,n=[];function a(c,d){var h=c._private,g=h.animation.current,p=h.animation.queue,E=!1;if(g.length===0){var y=p.shift();y&&g.push(y)}for(var b=function(S){for(var _=S.length-1;_>=0;_--){var A=S[_];A()}S.splice(0,S.length)},w=g.length-1;w>=0;w--){var x=g[w],C=x._private;if(C.stopped){g.splice(w,1),C.hooked=!1,C.playing=!1,C.started=!1,b(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||L5(c,x,r),O5(c,x,r,d),C.applying&&(C.applying=!1),b(C.frames),C.step!=null&&C.step(r),x.completed()&&(g.splice(w,1),C.hooked=!1,C.playing=!1,C.started=!1,b(C.completes)),E=!0)}return!d&&g.length===0&&p.length===0&&n.push(c),E}for(var i=!1,o=0;o<t.length;o++){var s=t[o],l=a(s);i=i||l}var u=a(e,!0);(i||u)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var q5={animate:xr.animate(),animation:xr.animation(),animated:xr.animated(),clearQueue:xr.clearQueue(),delay:xr.delay(),delayAnimation:xr.delayAnimation(),stop:xr.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&Uu(function(i){qx(i,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){qx(o,e)},n.beforeRenderPriorities.animations):t()}},N5={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&fs(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},_u=function(e){return Ke(e)?new Ta(e):e},nA={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new gl(N5,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,_u(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,_u(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,_u(t),n),this},once:function(e,t,n){return this.emitter().one(e,_u(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};xr.eventAliasesOn(nA);var vm={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};vm.jpeg=vm.jpg;var Ou={layout:function(e){var t=this;if(e==null){Lr("Layout options must be specified to make a layout");return}if(e.name==null){Lr("A `name` must be specified to make a layout");return}var n=e.name,a=t.extension("layout",n);if(a==null){Lr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ke(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var o=new a(Ye({},e,{cy:t,eles:i}));return o}};Ou.createLayout=Ou.makeLayout=Ou.layout;var F5={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&a.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?t.notify(n):t.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],o=e[i],s=t.getElementById(i);s.data(o)}})}},z5=yt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),hm={renderTo:function(e,t,n,a){var i=this._private.renderer;return i.renderTo(e,t,n,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(n==null){Lr("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Er("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=z5(e);a.cy=t,t._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};hm.invalidateDimensions=hm.resize;var Lu={collection:function(e,t){return Ke(e)?this.$(e):Yt(e)?e.collection():Sr(e)?(t||(t={}),new pt(this,e,t.unique,t.removed)):new pt(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Lu.elements=Lu.filter=Lu.$;var ut={},Uo="t",$5="f";ut.apply=function(r){for(var e=this,t=e._private,n=t.cy,a=n.collection(),i=0;i<r.length;i++){var o=r[i],s=e.getContextMeta(o);if(!s.empty){var l=e.getContextStyle(s),u=e.applyContextStyle(s,l,o);o._private.appliedInitStyle?e.updateTransitions(o,u.diffProps):o._private.appliedInitStyle=!0;var c=e.updateStyleHints(o);c&&a.push(o)}}return a};ut.getPropertiesDiff=function(r,e){var t=this,n=t._private.propDiffs=t._private.propDiffs||{},a=r+"-"+e,i=n[a];if(i)return i;for(var o=[],s={},l=0;l<t.length;l++){var u=t[l],c=r[l]===Uo,d=e[l]===Uo,h=c!==d,g=u.mappedProperties.length>0;if(h||d&&g){var p=void 0;h&&g||h?p=u.properties:g&&(p=u.mappedProperties);for(var E=0;E<p.length;E++){for(var y=p[E],b=y.name,w=!1,x=l+1;x<t.length;x++){var C=t[x],T=e[x]===Uo;if(T&&(w=C.properties[y.name]!=null,w))break}!s[b]&&!w&&(s[b]=!0,o.push(b))}}}return n[a]=o,o};ut.getContextMeta=function(r){for(var e=this,t="",n,a=r._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(r);s?t+=Uo:t+=$5}return n=e.getPropertiesDiff(a,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:n.length===0}};ut.getContextStyle=function(r){var e=r.key,t=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<t.length;i++){var o=t[i],s=e[i]===Uo;if(s)for(var l=0;l<o.properties.length;l++){var u=o.properties[l];a[u.name]=u}}return n[e]=a,a};ut.applyContextStyle=function(r,e,t){for(var n=this,a=r.diffPropNames,i={},o=n.types,s=0;s<a.length;s++){var l=a[s],u=e[l],c=t.pstyle(l);if(!u)if(c)c.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(c!==u){if(u.mapped===o.fn&&c!=null&&c.mapping!=null&&c.mapping.value===u.value){var d=c.mapping,h=d.fnValue=u.value(t);if(h===d.prevFnValue)continue}var g=i[l]={prev:c};n.applyParsedProperty(t,u),g.next=t.pstyle(l),g.next&&g.next.bypass&&(g.next=g.next.bypassed)}}return{diffProps:i}};ut.updateStyleHints=function(r){var e=r._private,t=this,n=t.propertyGroupNames,a=t.propertyGroupKeys,i=function(ae,te,ce){return t.getPropertiesHash(ae,te,ce)},o=e.styleKey;if(r.removed())return!1;var s=e.group==="nodes",l=r._private.style;n=Object.keys(l);for(var u=0;u<a.length;u++){var c=a[u];e.styleKeys[c]=[Ja,Gi]}for(var d=function(ae,te){return e.styleKeys[te][0]=Zo(ae,e.styleKeys[te][0])},h=function(ae,te){return e.styleKeys[te][1]=Xo(ae,e.styleKeys[te][1])},g=function(ae,te){d(ae,te),h(ae,te)},p=function(ae,te){for(var ce=0;ce<ae.length;ce++){var _e=ae.charCodeAt(ce);d(_e,te),h(_e,te)}},E=2e9,y=function(ae){return-128<ae&&ae<128&&Math.floor(ae)!==ae?E-(ae*1024|0):ae},b=0;b<n.length;b++){var w=n[b],x=l[w];if(x!=null){var C=this.properties[w],T=C.type,S=C.groupKey,_=void 0;C.hashOverride!=null?_=C.hashOverride(r,x):x.pfValue!=null&&(_=x.pfValue);var A=C.enums==null?x.value:null,P=_!=null,I=A!=null,D=P||I,k=x.units;if(T.number&&D&&!T.multiple){var M=P?_:A;g(y(M),S),!P&&k!=null&&p(k,S)}else p(x.strValue,S)}}for(var N=[Ja,Gi],z=0;z<a.length;z++){var $=a[z],q=e.styleKeys[$];N[0]=Zo(q[0],N[0]),N[1]=Xo(q[1],N[1])}e.styleKey=nN(N[0],N[1]);var V=e.styleKeys;e.labelDimsKey=ha(V.labelDimensions);var Z=i(r,["label"],V.labelDimensions);if(e.labelKey=ha(Z),e.labelStyleKey=ha(pu(V.commonLabel,Z)),!s){var K=i(r,["source-label"],V.labelDimensions);e.sourceLabelKey=ha(K),e.sourceLabelStyleKey=ha(pu(V.commonLabel,K));var j=i(r,["target-label"],V.labelDimensions);e.targetLabelKey=ha(j),e.targetLabelStyleKey=ha(pu(V.commonLabel,j))}if(s){var ee=e.styleKeys,le=ee.nodeBody,W=ee.nodeBorder,G=ee.nodeOutline,Y=ee.backgroundImage,re=ee.compound,de=ee.pie,se=ee.stripe,X=[le,W,G,Y,re,de,se].filter(function(Q){return Q!=null}).reduce(pu,[Ja,Gi]);e.nodeKey=ha(X),e.hasPie=de!=null&&de[0]!==Ja&&de[1]!==Gi,e.hasStripe=se!=null&&se[0]!==Ja&&se[1]!==Gi}return o!==e.styleKey};ut.clearStyleHints=function(r){var e=r._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};ut.applyParsedProperty=function(r,e){var t=this,n=e,a=r._private.style,i,o=t.types,s=t.properties[n.name].type,l=n.bypass,u=a[n.name],c=u&&u.bypass,d=r._private,h="mapping",g=function(le){return le==null?null:le.pfValue!=null?le.pfValue:le.value},p=function(){var le=g(u),W=g(n);t.checkTriggers(r,n.name,le,W)};if(e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,p(),!0):!1:(p(),!0);var E=function(){Er("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{for(var y=n.field.split("."),b=d.data,w=0;w<y.length&&b;w++){var x=y[w];b=b[x]}if(b==null)return E(),!1;var C;if(Me(b)){var T=n.fieldMax-n.fieldMin;T===0?C=0:C=(b-n.fieldMin)/T}else return Er("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+b+"` for `"+r.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),s.color){var S=n.valueMin[0],_=n.valueMax[0],A=n.valueMin[1],P=n.valueMax[1],I=n.valueMin[2],D=n.valueMax[2],k=n.valueMin[3]==null?1:n.valueMin[3],M=n.valueMax[3]==null?1:n.valueMax[3],N=[Math.round(S+(_-S)*C),Math.round(A+(P-A)*C),Math.round(I+(D-I)*C),Math.round(k+(M-k)*C)];i={bypass:n.bypass,name:n.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else if(s.number){var z=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,z,n.bypass,h)}else return!1;if(!i)return E(),!1;i.mapping=n,n=i;break}case o.data:{for(var $=n.field.split("."),q=d.data,V=0;V<$.length&&q;V++){var Z=$[V];q=q[Z]}if(q!=null&&(i=this.parse(n.name,q,n.bypass,h)),!i)return E(),!1;i.mapping=n,n=i;break}case o.fn:{var K=n.value,j=n.fnValue!=null?n.fnValue:K(r);if(n.prevFnValue=j,j==null)return Er("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(i=this.parse(n.name,j,n.bypass,h),!i)return Er("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+r.id()+"` is invalid)"),!1;i.mapping=Dn(n),n=i;break}case void 0:break;default:return!1}return l?(c?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):c?u.bypassed=n:a[n.name]=n,p(),!0};ut.cleanElements=function(r,e){for(var t=0;t<r.length;t++){var n=r[t];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],l=a[s];l!=null&&(l.bypass?l.bypassed=null:a[s]=null)}}};ut.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()};ut.updateTransitions=function(r,e){var t=this,n=r._private,a=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,o=r.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var s={},l=!1,u=0;u<a.length;u++){var c=a[u],d=r.pstyle(c),h=e[c];if(h){var g=h.prev,p=g,E=h.next!=null?h.next:d,y=!1,b=void 0,w=1e-6;p&&(Me(p.pfValue)&&Me(E.pfValue)?(y=E.pfValue-p.pfValue,b=p.pfValue+w*y):Me(p.value)&&Me(E.value)?(y=E.value-p.value,b=p.value+w*y):Sr(p.value)&&Sr(E.value)&&(y=p.value[0]!==E.value[0]||p.value[1]!==E.value[1]||p.value[2]!==E.value[2],b=p.strValue),y&&(s[c]=E.strValue,this.applyBypass(r,c,b),l=!0))}}if(!l)return;n.transitioning=!0,new no(function(x){o>0?r.delayAnimation(o).play().promise().then(x):x()}).then(function(){return r.animation({style:s,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1)};ut.checkTrigger=function(r,e,t,n,a,i){var o=this.properties[e],s=a(o);r.removed()||s!=null&&s(t,n,r)&&i(o)};ut.checkZOrderTrigger=function(r,e,t,n){var a=this;this.checkTrigger(r,e,t,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",r)})};ut.checkBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBounds},function(a){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};ut.checkConnectedEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfConnectedEdges},function(a){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ut.checkParallelEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfParallelEdges},function(a){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ut.checkTriggers=function(r,e,t,n){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,n),this.checkBoundsTrigger(r,e,t,n),this.checkConnectedEdgesBoundsTrigger(r,e,t,n),this.checkParallelEdgesBoundsTrigger(r,e,t,n)};var ys={};ys.applyBypass=function(r,e,t,n){var a=this,i=[],o=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var s=0;s<a.properties.length;s++){var l=a.properties[s],u=l.name,c=this.parse(u,t,!0);c&&i.push(c)}}else if(Ke(e)){var d=this.parse(e,t,!0);d&&i.push(d)}else if(pr(e)){var h=e;n=t;for(var g=Object.keys(h),p=0;p<g.length;p++){var E=g[p],y=h[E];if(y===void 0&&(y=h[il(E)]),y!==void 0){var b=this.parse(E,y,!0);b&&i.push(b)}}}else return!1;if(i.length===0)return!1;for(var w=!1,x=0;x<r.length;x++){for(var C=r[x],T={},S=void 0,_=0;_<i.length;_++){var A=i[_];if(n){var P=C.pstyle(A.name);S=T[A.name]={prev:P}}w=this.applyParsedProperty(C,Dn(A))||w,n&&(S.next=C.pstyle(A.name))}w&&this.updateStyleHints(C),n&&this.updateTransitions(C,T,o)}return w};ys.overrideBypass=function(r,e,t){e=Rm(e);for(var n=0;n<r.length;n++){var a=r[n],i=a._private.style[e],o=this.properties[e].type,s=o.color,l=o.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,t):(i.value=t,i.pfValue!=null&&(i.pfValue=t),s?i.strValue="rgb("+t.join(",")+")":l?i.strValue=t.join(" "):i.strValue=""+t,this.updateStyleHints(a)),this.checkTriggers(a,e,u,t)}};ys.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};ys.removeBypasses=function(r,e,t){for(var n=!0,a=0;a<r.length;a++){for(var i=r[a],o={},s=0;s<e.length;s++){var l=e[s],u=this.properties[l],c=i.pstyle(u.name);if(!(!c||!c.bypass)){var d="",h=this.parse(l,d,!0),g=o[u.name]={prev:c};this.applyParsedProperty(i,h),g.next=i.pstyle(u.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,o,n)}};var Vm={};Vm.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};Vm.containerCss=function(r){var e=this._private.cy,t=e.container(),n=e.window();if(n&&t&&n.getComputedStyle)return n.getComputedStyle(t).getPropertyValue(r)};var Bn={};Bn.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};Bn.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var n={},a=0;a<t.properties.length;a++){var i=t.properties[a],o=t.getStylePropertyValue(r,i.name,e);o!=null&&(n[i.name]=o,n[il(i.name)]=o)}return n}};Bn.getIndexedStyle=function(r,e,t,n){var a=r.pstyle(e)[t][n];return a??r.cy().style().getDefaultProperty(e)[t][0]};Bn.getStylePropertyValue=function(r,e,t){var n=this;if(r=r[0],r){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,o=r.pstyle(a.name);if(o){var s=o.value,l=o.units,u=o.strValue;if(t&&i.number&&s!=null&&Me(s)){var c=r.cy().zoom(),d=function(y){return y*c},h=function(y,b){return d(y)+b},g=Sr(s),p=g?l.every(function(E){return E!=null}):l!=null;return p?g?s.map(function(E,y){return h(E,l[y])}).join(" "):h(s,l):g?s.map(function(E){return Ke(E)?E:""+d(E)}).join(" "):""+d(s)}else if(u!=null)return u}return null}};Bn.getAnimationStartStyle=function(r,e){for(var t={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=r.pstyle(i);o!==void 0&&(pr(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(t[i]=o)}return t};Bn.getPropsList=function(r){var e=this,t=[],n=r,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],l=n[s],u=a[s]||a[Rm(s)],c=this.parse(u.name,l);c&&t.push(c)}return t};Bn.getNonDefaultPropertiesHash=function(r,e,t){var n=t.slice(),a,i,o,s,l,u;for(l=0;l<e.length;l++)if(a=e[l],i=r.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=Zo(s,n[0]),n[1]=Xo(s,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)s=o.charCodeAt(u),n[0]=Zo(s,n[0]),n[1]=Xo(s,n[1]);return n};Bn.getPropertiesHash=Bn.getNonDefaultPropertiesHash;var ml={};ml.appendFromJson=function(r){for(var e=this,t=0;t<r.length;t++){var n=r[t],a=n.selector,i=n.style||n.css,o=Object.keys(i);e.selector(a);for(var s=0;s<o.length;s++){var l=o[s],u=i[l];e.css(l,u)}}return e};ml.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};ml.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,a=t.properties,i={},o=0;o<a.length;o++){var s=a[o];i[s.name]=s.strValue}r.push({selector:n?n.toString():"core",style:i})}return r};var Gm={};Gm.appendFromString=function(r){var e=this,t=this,n=""+r,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){n.length>a.length?n=n.substr(a.length):n=""}function l(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Er("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=c[0];var d=c[1];if(d!=="core"){var h=new Ta(d);if(h.invalid){Er("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),s();continue}}var g=c[2],p=!1;i=g;for(var E=[];;){var y=i.match(/^\s*$/);if(y)break;var b=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!b){Er("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+g),p=!0;break}o=b[0];var w=b[1],x=b[2],C=e.properties[w];if(!C){Er("Skipping property: Invalid property name in: "+o),l();continue}var T=t.parse(w,x);if(!T){Er("Skipping property: Invalid property definition in: "+o),l();continue}E.push({name:w,val:x}),l()}if(p){s();break}t.selector(d);for(var S=0;S<E.length;S++){var _=E[S];t.css(_.name,_.val)}s()}return t};Gm.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var jr={};(function(){var r=rt,e=Oq,t=qq,n=Nq,a=Fq,i=function(Q){return"^"+Q+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(Q){var ae=r+"|\\w+|"+e+"|"+t+"|"+n+"|"+a;return"^"+Q+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+ae+")\\s*\\,\\s*("+ae+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];jr.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(Q,ae){switch(Q.length){case 2:return ae[0]!=="deg"&&ae[0]!=="rad"&&ae[1]!=="deg"&&ae[1]!=="rad";case 1:return Ke(Q[0])||ae[0]==="deg"||ae[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(Q){var ae=Q.length;return ae===1||ae===2||ae===4}}};var l={zeroNonZero:function(Q,ae){return(Q==null||ae==null)&&Q!==ae||Q==0&&ae!=0?!0:Q!=0&&ae==0},any:function(Q,ae){return Q!=ae},emptyNonEmpty:function(Q,ae){var te=Ca(Q),ce=Ca(ae);return te&&!ce||!te&&ce}},u=jr.types,c=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],g=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],p=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],E=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],y=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(Q,ae,te){return Q===ae?!1:te.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],b=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],w=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],x=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],C=function(Q,ae){return ae.value==="label"?-Q.poolIndex():ae.pfValue},T=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:C},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:C},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],S=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],_=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],A=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],P=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],I=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(Q,ae){return Q===ae?!1:Q==="bezier"||ae==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],D=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],k=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],M=[];jr.pieBackgroundN=16,M.push({name:"pie-size",type:u.sizeMaybePercent}),M.push({name:"pie-hole",type:u.sizeMaybePercent}),M.push({name:"pie-start-angle",type:u.angle});for(var N=1;N<=jr.pieBackgroundN;N++)M.push({name:"pie-"+N+"-background-color",type:u.color}),M.push({name:"pie-"+N+"-background-size",type:u.percent}),M.push({name:"pie-"+N+"-background-opacity",type:u.zeroOneNumber});var z=[];jr.stripeBackgroundN=16,z.push({name:"stripe-size",type:u.sizeMaybePercent}),z.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var $=1;$<=jr.stripeBackgroundN;$++)z.push({name:"stripe-"+$+"-background-color",type:u.color}),z.push({name:"stripe-"+$+"-background-size",type:u.percent}),z.push({name:"stripe-"+$+"-background-opacity",type:u.zeroOneNumber});var q=[],V=jr.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(X){V.forEach(function(Q){var ae=Q+"-"+X.name,te=X.type,ce=X.triggersBounds;q.push({name:ae,type:te,triggersBounds:ce})})},{});var Z=jr.properties=[].concat(E,x,y,b,w,D,p,g,c,d,h,T,S,_,A,M,z,P,I,q,k),K=jr.propertyGroups={behavior:E,transition:x,visibility:y,overlay:b,underlay:w,ghost:D,commonLabel:p,labelDimensions:g,mainLabel:c,sourceLabel:d,targetLabel:h,nodeBody:T,nodeBorder:S,nodeOutline:_,backgroundImage:A,pie:M,stripe:z,compound:P,edgeLine:I,edgeArrow:q,core:k},j=jr.propertyGroupNames={},ee=jr.propertyGroupKeys=Object.keys(K);ee.forEach(function(X){j[X]=K[X].map(function(Q){return Q.name}),K[X].forEach(function(Q){return Q.groupKey=X})});var le=jr.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];jr.propertyNames=Z.map(function(X){return X.name});for(var W=0;W<Z.length;W++){var G=Z[W];Z[G.name]=G}for(var Y=0;Y<le.length;Y++){var re=le[Y],de=Z[re.pointsTo],se={name:re.name,alias:!0,pointsTo:de};Z.push(se),Z[re.name]=se}})();jr.getDefaultProperty=function(r){return this.getDefaultProperties()[r]};jr.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=Ye({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=jr.pieBackgroundN;c++){var d=u.name.replace("{{i}}",c),h=u.value;l[d]=h}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=jr.stripeBackgroundN;c++){var d=u.name.replace("{{i}}",c),h=u.value;l[d]=h}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return jr.arrowPrefixes.forEach(function(c){var d=c+"-"+u.name,h=u.value;l[d]=h}),l},{})),t={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],s=this.parse(i,o);t[i]=s}}return r.defaultProperties=t,r.defaultProperties};jr.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var bl={};bl.parse=function(r,e,t,n){var a=this;if(zr(e))return a.parseImplWarn(r,e,t,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=t?"t":"f",s=""+e,l=vR(r,s,o,i),u=a.propCache=a.propCache||[],c;return(c=u[l])||(c=u[l]=a.parseImplWarn(r,e,t,n)),(t||n==="mapping")&&(c=Dn(c),c&&(c.value=Dn(c.value))),c};bl.parseImplWarn=function(r,e,t,n){var a=this.parseImpl(r,e,t,n);return!a&&e!=null&&Er("The style property `".concat(r,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Er("The style value of `label` is deprecated for `"+a.name+"`"),a};bl.parseImpl=function(r,e,t,n){var a=this;r=Rm(r);var i=a.properties[r],o=e,s=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,r=i.name);var l=Ke(e);l&&(e=e.trim());var u=i.type;if(!u)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(zr(e))return{name:r,value:e,strValue:"fn",mapped:s.fn,bypass:t};var c,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(c=new RegExp(s.data.regex).exec(e))){if(t)return!1;var h=s.data;return{name:r,value:c,strValue:""+e,mapped:h,field:c[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(s.mapData.regex).exec(e))){if(t||u.multiple)return!1;var g=s.mapData;if(!(u.color||u.number))return!1;var p=this.parse(r,d[4]);if(!p||p.mapped)return!1;var E=this.parse(r,d[5]);if(!E||E.mapped)return!1;if(p.pfValue===E.pfValue||p.strValue===E.strValue)return Er("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+p.strValue+"`"),this.parse(r,p.strValue);if(u.color){var y=p.value,b=E.value,w=y[0]===b[0]&&y[1]===b[1]&&y[2]===b[2]&&(y[3]===b[3]||(y[3]==null||y[3]===1)&&(b[3]==null||b[3]===1));if(w)return!1}return{name:r,value:d,strValue:""+e,mapped:g,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:p.value,valueMax:E.value,bypass:t}}}if(u.multiple&&n!=="multiple"){var x;if(l?x=e.split(/\s+/):Sr(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var C=[],T=[],S=[],_="",A=!1,P=0;P<x.length;P++){var I=a.parse(r,x[P],t,"multiple");A=A||Ke(I.value),C.push(I.value),S.push(I.pfValue!=null?I.pfValue:I.value),T.push(I.units),_+=(P>0?" ":"")+I.strValue}return u.validate&&!u.validate(C,T)?null:u.singleEnum&&A?C.length===1&&Ke(C[0])?{name:r,value:C[0],strValue:C[0],bypass:t}:null:{name:r,value:C,pfValue:S,strValue:_,bypass:t,units:T}}var D=function(){for(var se=0;se<u.enums.length;se++){var X=u.enums[se];if(X===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(u.number){var k,M="px";if(u.units&&(k=u.units),u.implicitUnits&&(M=u.implicitUnits),!u.unitless)if(l){var N="px|em"+(u.allowPercent?"|\\%":"");k&&(N=k);var z=e.match("^("+rt+")("+N+")?$");z&&(e=z[1],k=z[2]||M)}else(!k||u.implicitUnits)&&(k=M);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=o,D();if(u.integer&&!Aq(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var $={name:r,value:e,strValue:""+e+(k||""),units:k,bypass:t};return u.unitless||k!=="px"&&k!=="em"?$.pfValue=e:$.pfValue=k==="px"||!k?e:this.getEmSizeInPixels()*e,(k==="ms"||k==="s")&&($.pfValue=k==="ms"?e:1e3*e),(k==="deg"||k==="rad")&&($.pfValue=k==="rad"?e:NN(e)),k==="%"&&($.pfValue=e/100),$}else if(u.propList){var q=[],V=""+e;if(V!=="none"){for(var Z=V.split(/\s*,\s*|\s+/),K=0;K<Z.length;K++){var j=Z[K].trim();a.properties[j]?q.push(j):Er("`"+j+"` is not a valid property name")}if(q.length===0)return null}return{name:r,value:q,strValue:q.length===0?"none":q.join(" "),bypass:t}}else if(u.color){var ee=oR(e);return ee?{name:r,value:ee,pfValue:ee,strValue:"rgb("+ee[0]+","+ee[1]+","+ee[2]+")",bypass:t}:null}else if(u.regex||u.regexes){if(u.enums){var le=D();if(le)return le}for(var W=u.regexes?u.regexes:[u.regex],G=0;G<W.length;G++){var Y=new RegExp(W[G]),re=Y.exec(e);if(re)return{name:r,value:u.singleRegexMatchValue?re[1]:re,strValue:""+e,bypass:t}}return null}else return u.string?{name:r,value:""+e,strValue:""+e,bypass:t}:u.enums?D():null};var st=function(e){if(!(this instanceof st))return new st(e);if(!Tm(e)){Lr("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},_t=st.prototype;_t.instanceString=function(){return"style"};_t.clear=function(){for(var r=this._private,e=r.cy,t=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};_t.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};_t.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};_t.selector=function(r){var e=r==="core"?null:new Ta(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};_t.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],n=0;n<r.properties.length;n++){var a=r.properties[n],i=t[a.name];i===void 0&&(i=t[il(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};_t.style=_t.css;_t.cssRule=function(r,e){var t=this.parse(r,e);if(t){var n=this.length-1;this[n].properties.push(t),this[n].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.name.match(/stripe-(\d+)-background-size/)&&t.value&&(this._private.hasStripe=!0),t.mapped&&this[n].mappedProperties.push(t);var a=!this[n].selector;a&&(this._private.coreStyle[t.name]=t)}return this};_t.append=function(r){return nR(r)?r.appendToStyle(this):Sr(r)?this.appendFromJson(r):Ke(r)&&this.appendFromString(r),this};st.fromJson=function(r,e){var t=new st(r);return t.fromJson(e),t};st.fromString=function(r,e){return new st(r).fromString(e)};[ut,ys,Vm,Bn,ml,Gm,jr,bl].forEach(function(r){Ye(_t,r)});st.types=_t.types;st.properties=_t.properties;st.propertyGroups=_t.propertyGroups;st.propertyGroupNames=_t.propertyGroupNames;st.propertyGroupKeys=_t.propertyGroupKeys;var V5={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return nR(e)?t.style=e.generateStyle(this):Sr(e)?t.style=st.fromJson(this,e):Ke(e)?t.style=st.fromString(this,e):t.style=st(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},G5="single",si={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=G5),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,a,i,o,s;switch(e.length){case 0:return t;case 1:if(Ke(e[0]))return n=e[0],t[n];if(pr(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,Me(o)&&(t.x=o),Me(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&Me(a)&&(t[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,a=this._private.pan,i,o,s,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:pr(e)&&(s=n[0],l=s.x,u=s.y,Me(l)&&(a.x+=l),Me(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=t,(i==="x"||i==="y")&&Me(o)&&(a[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(Me(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ke(e)){var a=e;e=this.$(a)}else if(Dq(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Yt(e)||(e=this.mutableElements());if(!(Yt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),s=this.height(),l;if(t=Me(t)?t:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*t)/n.w,(s-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(o-l*(n.x1+n.x2))/2,y:(s-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var a=e;e=a.min,t=a.max}return Me(e)&&Me(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):Me(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:Me(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,a=t.zoom,i,o,s=!1;if(t.zoomingEnabled||(s=!0),Me(e)?o=e:pr(e)&&(o=e.level,e.position!=null?i=ul(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(s=!0)),o=o>t.maxZoom?t.maxZoom:o,o=o<t.minZoom?t.minZoom:o,s||!Me(o)||o===a||i!=null&&(!Me(i.x)||!Me(i.y)))return null;if(i!=null){var l=n,u=a,c=o,d={x:-c/u*(i.x-l.x)+i.x,y:-c/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:c,pan:d}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,n=!0,a=!0,i=[],o=!1,s=!1;if(!e)return this;if(Me(e.zoom)||(n=!1),pr(e.pan)||(a=!1),!n&&!a)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=l,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;Me(u.x)&&(t.pan.x=u.x,s=!1),Me(u.y)&&(t.pan.y=u.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(Ke(e)){var n=e;e=this.mutableElements().filter(n)}else Yt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();t=t===void 0?this._private.zoom:t;var s={x:(i-t*(a.x1+a.x2))/2,y:(o-t*(a.y1+a.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?(function(){var a=n.window().getComputedStyle(t),i=function(s){return parseFloat(a.getPropertyValue(s))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};si.centre=si.center;si.autolockNodes=si.autolock;si.autoungrabifyNodes=si.autoungrabify;var ns={data:xr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:xr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:xr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ns.attr=ns.data;ns.removeAttr=ns.removeData;var as=function(e){var t=this;e=Ye({},e);var n=e.container;n&&!Wu(n)&&Wu(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=t;var o=et!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=Ye({name:o?"grid":"null"},s.layout),s.renderer=Ye({name:o?"canvas":"null"},s.renderer);var l=function(p,E,y){return E!==void 0?E:y!==void 0?y:p},u=this._private={container:n,ready:!1,options:s,elements:new pt(this),listeners:[],aniEles:new pt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:Me(s.zoom)?s.zoom:1,pan:{x:pr(s.pan)&&Me(s.pan.x)?s.pan.x:0,y:pr(s.pan)&&Me(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var c=function(p,E){var y=p.some(Bq);if(y)return no.all(p).then(E);E(p)};u.styleEnabled&&t.setStyle([]);var d=Ye({},s,s.renderer);t.initRenderer(d);var h=function(p,E,y){t.notifications(!1);var b=t.mutableElements();b.length>0&&b.remove(),p!=null&&(pr(p)||Sr(p))&&t.add(p),t.one("layoutready",function(x){t.notifications(!0),t.emit(x),t.one("load",E),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",y),t.emit("done")});var w=Ye({},t._private.options.layout);w.eles=t.elements(),t.layout(w).run()};c([s.style,s.elements],function(g){var p=g[0],E=g[1];u.styleEnabled&&t.style().append(p),h(E,function(){t.startAnimationLoop(),u.ready=!0,zr(s.ready)&&t.on("ready",s.ready);for(var y=0;y<i.length;y++){var b=i[y];t.on("ready",b)}a&&(a.readies=[]),t.emit("ready")},s.done)})},Xu=as.prototype;Ye(Xu,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return et;var t=this._private.container.ownerDocument;return t===void 0||t==null?et:t.defaultView||et},mount:function(e){if(e!=null){var t=this,n=t._private,a=n.options;return!Wu(e)&&Wu(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(Ye({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),t.startAnimationLoop(),t.style(a.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Dn(this._private.options)},json:function(e){var t=this,n=t._private,a=t.mutableElements(),i=function(C){return t.getElementById(C.id())};if(pr(e)){if(t.startBatch(),e.elements){var o={},s=function(C,T){for(var S=[],_=[],A=0;A<C.length;A++){var P=C[A];if(!P.data.id){Er("cy.json() cannot handle elements without an ID attribute");continue}var I=""+P.data.id,D=t.getElementById(I);o[I]=!0,D.length!==0?_.push({ele:D,json:P}):(T&&(P.group=T),S.push(P))}t.add(S);for(var k=0;k<_.length;k++){var M=_[k],N=M.ele,z=M.json;N.json(z)}};if(Sr(e.elements))s(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var c=l[u],d=e.elements[c];Sr(d)&&s(d,c)}var h=t.collection();a.filter(function(x){return!o[x.id()]}).forEach(function(x){x.isParent()?h.merge(x):x.remove()}),h.forEach(function(x){return x.children().move({parent:null})}),h.forEach(function(x){return i(x).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var g=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<g.length;p++){var E=g[p];e[E]!=null&&t[E](e[E])}return t.endBatch(),this}else{var y=!!e,b={};y?b.elements=this.elements().map(function(x){return x.json()}):(b.elements={},a.forEach(function(x){var C=x.group();b.elements[C]||(b.elements[C]=[]),b.elements[C].push(x.json())})),this._private.styleEnabled&&(b.style=t.style().json()),b.data=Dn(t.data());var w=n.options;return b.zoomingEnabled=n.zoomingEnabled,b.userZoomingEnabled=n.userZoomingEnabled,b.zoom=n.zoom,b.minZoom=n.minZoom,b.maxZoom=n.maxZoom,b.panningEnabled=n.panningEnabled,b.userPanningEnabled=n.userPanningEnabled,b.pan=Dn(n.pan),b.boxSelectionEnabled=n.boxSelectionEnabled,b.renderer=Dn(w.renderer),b.hideEdgesOnViewport=w.hideEdgesOnViewport,b.textureOnViewport=w.textureOnViewport,b.wheelSensitivity=w.wheelSensitivity,b.motionBlur=w.motionBlur,b.multiClickDebounceTime=w.multiClickDebounceTime,b}}});Xu.$id=Xu.getElementById;[B5,q5,nA,vm,Ou,F5,hm,Lu,V5,si,ns].forEach(function(r){Ye(Xu,r)});var W5={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},U5={maximal:!1,acyclic:!1},Ni=function(e){return e.scratch("breadthfirst")},Nx=function(e,t){return e.scratch("breadthfirst",t)};function aA(r){this.options=Ye({},W5,U5,r)}aA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(xe){return xe.isChildless()}),a=t,i=r.directed,o=r.acyclic||r.maximal||r.maximalAdjustments>0,s=!!r.boundingBox,l=Dt(s?r.boundingBox:structuredClone(e.extent())),u;if(Yt(r.roots))u=r.roots;else if(Sr(r.roots)){for(var c=[],d=0;d<r.roots.length;d++){var h=r.roots[d],g=e.getElementById(h);c.push(g)}u=e.collection(c)}else if(Ke(r.roots))u=e.$(r.roots);else if(i)u=n.roots();else{var p=t.components();u=e.collection();for(var E=function(){var ge=p[y],be=ge.maxDegree(!1),Ae=ge.filter(function(De){return De.degree(!1)===be});u=u.add(Ae)},y=0;y<p.length;y++)E()}var b=[],w={},x=function(ge,be){b[be]==null&&(b[be]=[]);var Ae=b[be].length;b[be].push(ge),Nx(ge,{index:Ae,depth:be})},C=function(ge,be){var Ae=Ni(ge),De=Ae.depth,Be=Ae.index;b[De][Be]=null,ge.isChildless()&&x(ge,be)};a.bfs({roots:u,directed:r.directed,visit:function(ge,be,Ae,De,Be){var Le=ge[0],He=Le.id();Le.isChildless()&&x(Le,Be),w[He]=!0}});for(var T=[],S=0;S<n.length;S++){var _=n[S];w[_.id()]||T.push(_)}var A=function(ge){for(var be=b[ge],Ae=0;Ae<be.length;Ae++){var De=be[Ae];if(De==null){be.splice(Ae,1),Ae--;continue}Nx(De,{depth:ge,index:Ae})}},P=function(ge,be){for(var Ae=Ni(ge),De=ge.incomers().filter(function($e){return $e.isNode()&&t.has($e)}),Be=-1,Le=ge.id(),He=0;He<De.length;He++){var Ve=De[He],Xe=Ni(Ve);Be=Math.max(Be,Xe.depth)}if(Ae.depth<=Be){if(!r.acyclic&&be[Le])return null;var er=Be+1;return C(ge,er),be[Le]=er,!0}return!1};if(i&&o){var I=[],D={},k=function(ge){return I.push(ge)},M=function(){return I.shift()};for(n.forEach(function(xe){return I.push(xe)});I.length>0;){var N=M(),z=P(N,D);if(z)N.outgoers().filter(function(xe){return xe.isNode()&&t.has(xe)}).forEach(k);else if(z===null){Er("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(r.avoidOverlap)for(var q=0;q<n.length;q++){var V=n[q],Z=V.layoutDimensions(r),K=Z.w,j=Z.h;$=Math.max($,K,j)}var ee={},le=function(ge){if(ee[ge.id()])return ee[ge.id()];for(var be=Ni(ge).depth,Ae=ge.neighborhood(),De=0,Be=0,Le=0;Le<Ae.length;Le++){var He=Ae[Le];if(!(He.isEdge()||He.isParent()||!n.has(He))){var Ve=Ni(He);if(Ve!=null){var Xe=Ve.index,er=Ve.depth;if(!(Xe==null||er==null)){var $e=b[er].length;er<be&&(De+=Xe/$e,Be++)}}}}return Be=Math.max(1,Be),De=De/Be,Be===0&&(De=0),ee[ge.id()]=De,De},W=function(ge,be){var Ae=le(ge),De=le(be),Be=Ae-De;return Be===0?iR(ge.id(),be.id()):Be};r.depthSort!==void 0&&(W=r.depthSort);for(var G=b.length,Y=0;Y<G;Y++)b[Y].sort(W),A(Y);for(var re=[],de=0;de<T.length;de++)re.push(T[de]);var se=function(){for(var ge=0;ge<G;ge++)A(ge)};re.length&&(b.unshift(re),G=b.length,se());for(var X=0,Q=0;Q<G;Q++)X=Math.max(b[Q].length,X);var ae={x:l.x1+l.w/2,y:l.y1+l.h/2},te=n.reduce(function(xe,ge){return(function(be){return{w:xe.w===-1?be.w:(xe.w+be.w)/2,h:xe.h===-1?be.h:(xe.h+be.h)/2}})(ge.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ce=Math.max(G===1?0:s?(l.h-r.padding*2-te.h)/(G-1):(l.h-r.padding*2-te.h)/(G+1),$),_e=b.reduce(function(xe,ge){return Math.max(xe,ge.length)},0),ve=function(ge){var be=Ni(ge),Ae=be.depth,De=be.index;if(r.circle){var Be=Math.min(l.w/2/G,l.h/2/G);Be=Math.max(Be,$);var Le=Be*Ae+Be-(G>0&&b[0].length<=3?Be/2:0),He=2*Math.PI/b[Ae].length*De;return Ae===0&&b[0].length===1&&(Le=1),{x:ae.x+Le*Math.cos(He),y:ae.y+Le*Math.sin(He)}}else{var Ve=b[Ae].length,Xe=Math.max(Ve===1?0:s?(l.w-r.padding*2-te.w)/((r.grid?_e:Ve)-1):(l.w-r.padding*2-te.w)/((r.grid?_e:Ve)+1),$),er={x:ae.x+(De+1-(Ve+1)/2)*Xe,y:ae.y+(Ae+1-(G+1)/2)*ce};return er}},U={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(U).indexOf(r.direction)===-1&&Lr("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(U).join(", ")));var fe=function(ge){return sN(ve(ge),l,U[r.direction])};return t.nodes().layoutPositions(this,r,fe),this};var H5={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function iA(r){this.options=Ye({},H5,r)}iA.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Dt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),c,d=0,h=0;h<i.length;h++){var g=i[h],p=g.layoutDimensions(e),E=p.w,y=p.h;d=Math.max(d,E,y)}if(Me(e.radius)?c=e.radius:i.length<=1?c=0:c=Math.min(o.h,o.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var b=Math.cos(u)-Math.cos(0),w=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(b*b+w*w));c=Math.max(x,c)}var C=function(S,_){var A=e.startAngle+_*u*(a?1:-1),P=c*Math.cos(A),I=c*Math.sin(A),D={x:s.x+P,y:s.y+I};return D};return n.nodes().layoutPositions(this,e,C),this};var K5={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function oA(r){this.options=Ye({},K5,r)}oA.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=r.cy,a=e.eles,i=a.nodes().not(":parent"),o=Dt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=0,c=0;c<i.length;c++){var d=i[c],h=void 0;h=e.concentric(d),l.push({value:h,node:d}),d._private.scratch.concentric=h}i.updateStyle();for(var g=0;g<i.length;g++){var p=i[g],E=p.layoutDimensions(e);u=Math.max(u,E.w,E.h)}l.sort(function(ce,_e){return _e.value-ce.value});for(var y=e.levelWidth(i),b=[[]],w=b[0],x=0;x<l.length;x++){var C=l[x];if(w.length>0){var T=Math.abs(w[0].value-C.value);T>=y&&(w=[],b.push(w))}w.push(C)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var _=b.length>0&&b[0].length>1,A=Math.min(o.w,o.h)/2-S,P=A/(b.length+_?1:0);S=Math.min(S,P)}for(var I=0,D=0;D<b.length;D++){var k=b[D],M=e.sweep===void 0?2*Math.PI-2*Math.PI/k.length:e.sweep,N=k.dTheta=M/Math.max(1,k.length-1);if(k.length>1&&e.avoidOverlap){var z=Math.cos(N)-Math.cos(0),$=Math.sin(N)-Math.sin(0),q=Math.sqrt(S*S/(z*z+$*$));I=Math.max(q,I)}k.r=I,I+=S}if(e.equidistant){for(var V=0,Z=0,K=0;K<b.length;K++){var j=b[K],ee=j.r-Z;V=Math.max(V,ee)}Z=0;for(var le=0;le<b.length;le++){var W=b[le];le===0&&(Z=W.r),W.r=Z,Z+=V}}for(var G={},Y=0;Y<b.length;Y++)for(var re=b[Y],de=re.dTheta,se=re.r,X=0;X<re.length;X++){var Q=re[X],ae=e.startAngle+(t?1:-1)*de*X,te={x:s.x+se*Math.cos(ae),y:s.y+se*Math.sin(ae)};G[Q.node.id()]=te}return a.nodes().layoutPositions(this,e,function(ce){var _e=ce.id();return G[_e]}),this};var Ad,j5={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function wl(r){this.options=Ye({},j5,r),this.options.layout=this;var e=this.options.eles.nodes(),t=this.options.eles.edges(),n=t.filter(function(a){var i=a.source().data("id"),o=a.target().data("id"),s=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===o});return!s||!l});this.options.eles=this.options.eles.not(n)}wl.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?Ad=!0:Ad=!1;var n=Y5(e,t,r);Ad&&X5(n),r.randomize&&Q5(n);var a=Yn(),i=function(){J5(n,e,r),r.fit===!0&&e.fit(r.padding)},o=function(h){return!(t.stopped||h>=r.numIter||(e$(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},s=function(){if(r.animate===!0||r.animate===!1)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var h=r.eles.nodes(),g=uA(n,r,h);h.layoutPositions(t,r,g)}},l=0,u=!0;if(r.animate===!0){var c=function(){for(var h=0;u&&h<r.refresh;)u=o(l),l++,h++;if(!u)zx(n,r),s();else{var g=Yn();g-a>=r.animationThreshold&&i(),Uu(c)}};c()}else{for(;u;)u=o(l),l++;zx(n,r),s()}return this};wl.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};wl.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Y5=function(e,t,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Dt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},l=n.eles.components(),u={},c=0;c<l.length;c++)for(var d=l[c],h=0;h<d.length;h++){var g=d[h];u[g.id()]=c}for(var c=0;c<s.nodeSize;c++){var p=i[c],E=p.layoutDimensions(n),y={};y.isLocked=p.locked(),y.id=p.data("id"),y.parentId=p.data("parent"),y.cmptId=u[p.id()],y.children=[],y.positionX=p.position("x"),y.positionY=p.position("y"),y.offsetX=0,y.offsetY=0,y.height=E.w,y.width=E.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(p.style("padding")),y.padRight=parseFloat(p.style("padding")),y.padTop=parseFloat(p.style("padding")),y.padBottom=parseFloat(p.style("padding")),y.nodeRepulsion=zr(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,s.layoutNodes.push(y),s.idToIndex[y.id]=c}for(var b=[],w=0,x=-1,C=[],c=0;c<s.nodeSize;c++){var p=s.layoutNodes[c],T=p.parentId;T!=null?s.layoutNodes[s.idToIndex[T]].children.push(p.id):(b[++x]=p.id,C.push(p.id))}for(s.graphSet.push(C);w<=x;){var S=b[w++],_=s.idToIndex[S],g=s.layoutNodes[_],A=g.children;if(A.length>0){s.graphSet.push(A);for(var c=0;c<A.length;c++)b[++x]=A[c]}}for(var c=0;c<s.graphSet.length;c++)for(var P=s.graphSet[c],h=0;h<P.length;h++){var I=s.idToIndex[P[h]];s.indexToGraph[I]=c}for(var c=0;c<s.edgeSize;c++){var D=a[c],k={};k.id=D.data("id"),k.sourceId=D.data("source"),k.targetId=D.data("target");var M=zr(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,N=zr(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,z=s.idToIndex[k.sourceId],$=s.idToIndex[k.targetId],q=s.indexToGraph[z],V=s.indexToGraph[$];if(q!=V){for(var Z=Z5(k.sourceId,k.targetId,s),K=s.graphSet[Z],j=0,y=s.layoutNodes[z];K.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],j++;for(y=s.layoutNodes[$];K.indexOf(y.id)===-1;)y=s.layoutNodes[s.idToIndex[y.parentId]],j++;M*=j*n.nestingFactor}k.idealLength=M,k.elasticity=N,s.layoutEdges.push(k)}return s},Z5=function(e,t,n){var a=sA(e,t,0,n);return 2>a.count?0:a.graph},sA=function(e,t,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:n};for(var o=0,s=0;s<i.length;s++){var l=i[s],u=a.idToIndex[l],c=a.layoutNodes[u].children;if(c.length!==0){var d=a.indexToGraph[a.idToIndex[c[0]]],h=sA(e,t,d,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},X5,Q5=function(e,t){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},uA=function(e,t,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var l=e.layoutNodes[e.idToIndex[o.data("id")]];if(t.boundingBox){var u=i.w===0?.5:(l.positionX-i.x1)/i.w,c=i.h===0?.5:(l.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+c*a.h}}else return{x:l.positionX,y:l.positionY}}},J5=function(e,t,n){var a=n.layout,i=n.eles.nodes(),o=uA(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},e$=function(e,t,n){r$(e,t),a$(e),i$(e,t),o$(e),s$(e)},r$=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[a[o]]],l=o+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[a[l]]];t$(s,u,e,t)}},Fx=function(e){return-1+2*e*Math.random()},t$=function(e,t,n,a){var i=e.cmptId,o=t.cmptId;if(!(i!==o&&!n.isCompound)){var s=t.positionX-e.positionX,l=t.positionY-e.positionY,u=1;s===0&&l===0&&(s=Fx(u),l=Fx(u));var c=n$(e,t,s,l);if(c>0)var d=a.nodeOverlap*c,h=Math.sqrt(s*s+l*l),g=d*s/h,p=d*l/h;else var E=Qu(e,s,l),y=Qu(t,-1*s,-1*l),b=y.x-E.x,w=y.y-E.y,x=b*b+w*w,h=Math.sqrt(x),d=(e.nodeRepulsion+t.nodeRepulsion)/x,g=d*b/h,p=d*w/h;e.isLocked||(e.offsetX-=g,e.offsetY-=p),t.isLocked||(t.offsetX+=g,t.offsetY+=p)}},n$=function(e,t,n,a){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(a>0)var o=e.maxY-t.minY;else var o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Qu=function(e,t,n){var a=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,l=n/t,u=o/s,c={};return t===0&&0<n||t===0&&0>n?(c.x=a,c.y=i+o/2,c):0<t&&-1*u<=l&&l<=u?(c.x=a+s/2,c.y=i+s*n/2/t,c):0>t&&-1*u<=l&&l<=u?(c.x=a-s/2,c.y=i-s*n/2/t,c):0<n&&(l<=-1*u||l>=u)?(c.x=a+o*t/2/n,c.y=i+o/2,c):(0>n&&(l<=-1*u||l>=u)&&(c.x=a-o*t/2/n,c.y=i-o/2),c)},a$=function(e,t){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],s=e.idToIndex[a.targetId],l=e.layoutNodes[s],u=l.positionX-o.positionX,c=l.positionY-o.positionY;if(!(u===0&&c===0)){var d=Qu(o,u,c),h=Qu(l,-1*u,-1*c),g=h.x-d.x,p=h.y-d.y,E=Math.sqrt(g*g+p*p),y=Math.pow(a.idealLength-E,2)/a.elasticity;if(E!==0)var b=y*g/E,w=y*p/E;else var b=0,w=0;o.isLocked||(o.offsetX+=b,o.offsetY+=w),l.isLocked||(l.offsetX-=b,l.offsetY-=w)}}},i$=function(e,t){if(t.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=i.length;if(a===0)var s=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],c=e.layoutNodes[e.idToIndex[u.parentId]],s=c.positionX,l=c.positionY;for(var d=0;d<o;d++){var h=e.layoutNodes[e.idToIndex[i[d]]];if(!h.isLocked){var g=s-h.positionX,p=l-h.positionY,E=Math.sqrt(g*g+p*p);if(E>n){var y=t.gravity*g/E,b=t.gravity*p/E;h.offsetX+=y,h.offsetY+=b}}}}},o$=function(e,t){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var o=n[a++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0<u.length&&!l.isLocked){for(var c=l.offsetX,d=l.offsetY,h=0;h<u.length;h++){var g=e.layoutNodes[e.idToIndex[u[h]]];g.offsetX+=c,g.offsetY+=d,n[++i]=u[h]}l.offsetX=0,l.offsetY=0}}},s$=function(e,t){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=u$(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,lA(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},u$=function(e,t,n){var a=Math.sqrt(e*e+t*t);if(a>n)var i={x:n*e/a,y:n*t/a};else var i={x:e,y:t};return i},lA=function(e,t){var n=e.parentId;if(n!=null){var a=t.layoutNodes[t.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return lA(a,t)}},zx=function(e,t){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],s=o.cmptId,l=a[s]=a[s]||[];l.push(o)}for(var u=0,i=0;i<a.length;i++){var c=a[i];if(c){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var d=0;d<c.length;d++){var h=c[d];c.x1=Math.min(c.x1,h.positionX-h.width/2),c.x2=Math.max(c.x2,h.positionX+h.width/2),c.y1=Math.min(c.y1,h.positionY-h.height/2),c.y2=Math.max(c.y2,h.positionY+h.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,u+=c.w*c.h}}a.sort(function(w,x){return x.w*x.h-w.w*w.h});for(var g=0,p=0,E=0,y=0,b=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var c=a[i];if(c){for(var d=0;d<c.length;d++){var h=c[d];h.isLocked||(h.positionX+=g-c.x1,h.positionY+=p-c.y1)}g+=c.w+t.componentSpacing,E+=c.w+t.componentSpacing,y=Math.max(y,c.h),E>b&&(p+=y+t.componentSpacing,g=0,E=0,y=0)}}},l$={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function fA(r){this.options=Ye({},l$,r)}fA.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=Dt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(le){return{x:i.x1,y:i.y1}});else{var o=a.size(),s=Math.sqrt(o*i.h/i.w),l=Math.round(s),u=Math.round(i.w/i.h*s),c=function(W){if(W==null)return Math.min(l,u);var G=Math.min(l,u);G==l?l=W:u=W},d=function(W){if(W==null)return Math.max(l,u);var G=Math.max(l,u);G==l?l=W:u=W},h=e.rows,g=e.cols!=null?e.cols:e.columns;if(h!=null&&g!=null)l=h,u=g;else if(h!=null&&g==null)l=h,u=Math.ceil(o/l);else if(h==null&&g!=null)u=g,l=Math.ceil(o/u);else if(u*l>o){var p=c(),E=d();(p-1)*E>=o?c(p-1):(E-1)*p>=o&&d(E-1)}else for(;u*l<o;){var y=c(),b=d();(b+1)*y>=o?d(b+1):c(y+1)}var w=i.w/u,x=i.h/l;if(e.condense&&(w=0,x=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var T=a[C],S=T._private.position;(S.x==null||S.y==null)&&(S.x=0,S.y=0);var _=T.layoutDimensions(e),A=e.avoidOverlapPadding,P=_.w+A,I=_.h+A;w=Math.max(w,P),x=Math.max(x,I)}for(var D={},k=function(W,G){return!!D["c-"+W+"-"+G]},M=function(W,G){D["c-"+W+"-"+G]=!0},N=0,z=0,$=function(){z++,z>=u&&(z=0,N++)},q={},V=0;V<a.length;V++){var Z=a[V],K=e.position(Z);if(K&&(K.row!==void 0||K.col!==void 0)){var j={row:K.row,col:K.col};if(j.col===void 0)for(j.col=0;k(j.row,j.col);)j.col++;else if(j.row===void 0)for(j.row=0;k(j.row,j.col);)j.row++;q[Z.id()]=j,M(j.row,j.col)}}var ee=function(W,G){var Y,re;if(W.locked()||W.isParent())return!1;var de=q[W.id()];if(de)Y=de.col*w+w/2+i.x1,re=de.row*x+x/2+i.y1;else{for(;k(N,z);)$();Y=z*w+w/2+i.x1,re=N*x+x/2+i.y1,M(N,z),$()}return{x:Y,y:re}};a.layoutPositions(this,e,ee)}return this};var f$={ready:function(){},stop:function(){}};function Wm(r){this.options=Ye({},f$,r)}Wm.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this};Wm.prototype.stop=function(){return this};var c$={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cA(r){this.options=Ye({},c$,r)}cA.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),n=zr(r.positions);function a(i){if(r.positions==null)return MN(i.position());if(n)return r.positions(i);var o=r.positions[i._private.data.id];return o??null}return t.layoutPositions(this,r,function(i,o){var s=a(i);return i.locked()||s==null?!1:s}),this};var d$={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function dA(r){this.options=Ye({},d$,r)}dA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=Dt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,s){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return t.nodes().layoutPositions(this,r,a),this};var v$=[{name:"breadthfirst",impl:aA},{name:"circle",impl:iA},{name:"concentric",impl:oA},{name:"cose",impl:wl},{name:"grid",impl:fA},{name:"null",impl:Wm},{name:"preset",impl:cA},{name:"random",impl:dA}];function vA(r){this.options=r,this.notifications=0}var $x=function(){},Vx=function(){throw new Error("A headless instance can not render images")};vA.prototype={recalculateRenderedStyle:$x,notify:function(){this.notifications++},init:$x,isHeadless:function(){return!0},png:Vx,jpg:Vx};var Um={};Um.arrowShapeWidth=.3;Um.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(u,c,d,h,g,p,E){var y=g.x-d/2-E,b=g.x+d/2+E,w=g.y-d/2-E,x=g.y+d/2+E,C=y<=u&&u<=b&&w<=c&&c<=x;return C},n=function(u,c,d,h,g){var p=u*Math.cos(h)-c*Math.sin(h),E=u*Math.sin(h)+c*Math.cos(h),y=p*d,b=E*d,w=y+g.x,x=b+g.y;return{x:w,y:x}},a=function(u,c,d,h){for(var g=[],p=0;p<u.length;p+=2){var E=u[p],y=u[p+1];g.push(n(E,y,c,d,h))}return g},i=function(u){for(var c=[],d=0;d<u.length;d++){var h=u[d];c.push(h.x,h.y)}return c},o=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},s=function(u,c){Ke(c)&&(c=r[c]),r[u]=Ye({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,g,p,E,y,b){var w=i(a(this.points,p+2*b,E,y)),x=Ft(h,g,w);return x},roughCollide:t,draw:function(h,g,p,E){var y=a(this.points,g,p,E);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:o},c)};s("none",{collide:Hu,roughCollide:Hu,draw:Im,spacing:tw,gap:tw}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(u,c,d,h,g){var p=a(this.points,c,d,h),E=this.controlPoint,y=n(E[0],E[1],c,d,h);e.arrowShapeImpl(this.name)(u,p,y)},gap:function(u){return o(u)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,c,d,h,g,p,E){var y=i(a(this.points,d+2*E,h,g)),b=i(a(this.pointsTee,d+2*E,h,g)),w=Ft(u,c,y)||Ft(u,c,b);return w},draw:function(u,c,d,h,g){var p=a(this.points,c,d,h),E=a(this.pointsTee,c,d,h);e.arrowShapeImpl(this.name)(u,p,E)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,c,d,h,g,p,E){var y=g,b=Math.pow(y.x-u,2)+Math.pow(y.y-c,2)<=Math.pow((d+2*E)*this.radius,2),w=i(a(this.points,d+2*E,h,g));return Ft(u,c,w)||b},draw:function(u,c,d,h,g){var p=a(this.pointsTr,c,d,h);e.arrowShapeImpl(this.name)(u,p,h.x,h.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,c){var d=this.baseCrossLinePts.slice(),h=c/u,g=3,p=5;return d[g]=d[g]-h,d[p]=d[p]-h,d},collide:function(u,c,d,h,g,p,E){var y=i(a(this.points,d+2*E,h,g)),b=i(a(this.crossLinePts(d,p),d+2*E,h,g)),w=Ft(u,c,y)||Ft(u,c,b);return w},draw:function(u,c,d,h,g){var p=a(this.points,c,d,h),E=a(this.crossLinePts(c,g),c,d,h);e.arrowShapeImpl(this.name)(u,p,E)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return o(u)*.525}}),s("circle",{radius:.15,collide:function(u,c,d,h,g,p,E){var y=g,b=Math.pow(y.x-u,2)+Math.pow(y.y-c,2)<=Math.pow((d+2*E)*this.radius,2);return b},draw:function(u,c,d,h,g){e.arrowShapeImpl(this.name)(u,h.x,h.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var li={};li.projectIntoViewport=function(r,e){var t=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],s=t.pan(),l=t.zoom(),u=((r-a)/o-s.x)/l,c=((e-i)/o-s.y)/l;return[u,c]};li.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(b){return parseFloat(t.getPropertyValue(b))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=r.clientWidth,s=r.clientHeight,l=a.left+a.right,u=a.top+a.bottom,c=i.left+i.right,d=e.width/(o+c),h=o-l,g=s-u,p=e.left+a.left+i.left,E=e.top+a.top+i.top;return this.containerBB=[p,E,h,g,d]};li.invalidateContainerClientCoordsCache=function(){this.containerBB=null};li.findNearestElement=function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]};li.findNearestElements=function(r,e,t,n){var a=this,i=this,o=i.getCachedZSortedEles(),s=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),c=(n?24:8)/l,d=(n?8:2)/l,h=(n?8:2)/l,g=1/0,p,E;t&&(o=o.interactive);function y(_,A){if(_.isNode()){if(E)return;E=_,s.push(_)}if(_.isEdge()&&(A==null||A<g))if(p){if(p.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value){for(var P=0;P<s.length;P++)if(s[P].isEdge()){s[P]=_,p=_,g=A??g;break}}}else s.push(_),p=_,g=A??g}function b(_){var A=_.outerWidth()+2*d,P=_.outerHeight()+2*d,I=A/2,D=P/2,k=_.position(),M=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,N=_._private.rscratch;if(k.x-I<=r&&r<=k.x+I&&k.y-D<=e&&e<=k.y+D){var z=i.nodeShapes[a.getNodeShape(_)];if(z.checkPoint(r,e,0,A,P,k.x,k.y,M,N))return y(_,0),!0}}function w(_){var A=_._private,P=A.rscratch,I=_.pstyle("width").pfValue,D=_.pstyle("arrow-scale").value,k=I/2+c,M=k*k,N=k*2,V=A.source,Z=A.target,z;if(P.edgeType==="segments"||P.edgeType==="straight"||P.edgeType==="haystack"){for(var $=P.allpts,q=0;q+3<$.length;q+=2)if(KN(r,e,$[q],$[q+1],$[q+2],$[q+3],N)&&M>(z=QN(r,e,$[q],$[q+1],$[q+2],$[q+3])))return y(_,z),!0}else if(P.edgeType==="bezier"||P.edgeType==="multibezier"||P.edgeType==="self"||P.edgeType==="compound"){for(var $=P.allpts,q=0;q+5<P.allpts.length;q+=4)if(jN(r,e,$[q],$[q+1],$[q+2],$[q+3],$[q+4],$[q+5],N)&&M>(z=XN(r,e,$[q],$[q+1],$[q+2],$[q+3],$[q+4],$[q+5])))return y(_,z),!0}for(var V=V||A.source,Z=Z||A.target,K=a.getArrowWidth(I,D),j=[{name:"source",x:P.arrowStartX,y:P.arrowStartY,angle:P.srcArrowAngle},{name:"target",x:P.arrowEndX,y:P.arrowEndY,angle:P.tgtArrowAngle},{name:"mid-source",x:P.midX,y:P.midY,angle:P.midsrcArrowAngle},{name:"mid-target",x:P.midX,y:P.midY,angle:P.midtgtArrowAngle}],q=0;q<j.length;q++){var ee=j[q],le=i.arrowShapes[_.pstyle(ee.name+"-arrow-shape").value],W=_.pstyle("width").pfValue;if(le.roughCollide(r,e,K,ee.angle,{x:ee.x,y:ee.y},W,c)&&le.collide(r,e,K,ee.angle,{x:ee.x,y:ee.y},W,c))return y(_),!0}u&&s.length>0&&(b(V),b(Z))}function x(_,A,P){return Nt(_,A,P)}function C(_,A){var P=_._private,I=h,D;A?D=A+"-":D="",_.boundingBox();var k=P.labelBounds[A||"main"],M=_.pstyle(D+"label").value,N=_.pstyle("text-events").strValue==="yes";if(!(!N||!M)){var z=x(P.rscratch,"labelX",A),$=x(P.rscratch,"labelY",A),q=x(P.rscratch,"labelAngle",A),V=_.pstyle(D+"text-margin-x").pfValue,Z=_.pstyle(D+"text-margin-y").pfValue,K=k.x1-I-V,j=k.x2+I-V,ee=k.y1-I-Z,le=k.y2+I-Z;if(q){var W=Math.cos(q),G=Math.sin(q),Y=function(te,ce){return te=te-z,ce=ce-$,{x:te*W-ce*G+z,y:te*G+ce*W+$}},re=Y(K,ee),de=Y(K,le),se=Y(j,ee),X=Y(j,le),Q=[re.x+V,re.y+Z,se.x+V,se.y+Z,X.x+V,X.y+Z,de.x+V,de.y+Z];if(Ft(r,e,Q))return y(_),!0}else if(ma(k,r,e))return y(_),!0}}for(var T=o.length-1;T>=0;T--){var S=o[T];S.isNode()?b(S)||C(S):w(S)||C(S)||C(S,"source")||C(S,"target")}return s};li.getAllInBox=function(r,e,t,n){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),o=2/i,s=[],l=Math.min(r,t),u=Math.max(r,t),c=Math.min(e,n),d=Math.max(e,n);r=l,t=u,e=c,n=d;var h=Dt({x1:r,y1:e,x2:t,y2:n}),g=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],p=[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]],[g[3],g[0]]];function E(te,ce,_e){return Nt(te,ce,_e)}function y(te,ce){var _e=te._private,ve=o,U="";te.boundingBox();var fe=_e.labelBounds.main;if(!fe)return null;var xe=E(_e.rscratch,"labelX",ce),ge=E(_e.rscratch,"labelY",ce),be=E(_e.rscratch,"labelAngle",ce),Ae=te.pstyle(U+"text-margin-x").pfValue,De=te.pstyle(U+"text-margin-y").pfValue,Be=fe.x1-ve-Ae,Le=fe.x2+ve-Ae,He=fe.y1-ve-De,Ve=fe.y2+ve-De;if(be){var Xe=Math.cos(be),er=Math.sin(be),$e=function(ye,O){return ye=ye-xe,O=O-ge,{x:ye*Xe-O*er+xe,y:ye*er+O*Xe+ge}};return[$e(Be,He),$e(Le,He),$e(Le,Ve),$e(Be,Ve)]}else return[{x:Be,y:He},{x:Le,y:He},{x:Le,y:Ve},{x:Be,y:Ve}]}function b(te,ce,_e,ve){function U(fe,xe,ge){return(ge.y-fe.y)*(xe.x-fe.x)>(xe.y-fe.y)*(ge.x-fe.x)}return U(te,_e,ve)!==U(ce,_e,ve)&&U(te,ce,_e)!==U(te,ce,ve)}for(var w=0;w<a.length;w++){var x=a[w];if(x.isNode()){var C=x,T=C.pstyle("text-events").strValue==="yes",S=C.pstyle("box-selection").strValue,_=C.pstyle("box-select-labels").strValue==="yes";if(S==="none")continue;var A=(S==="overlap"||_)&&T,P=C.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:A});if(S==="contain"){var I=!1;if(_&&T){var D=y(C);D&&Tc(D,g)&&(s.push(C),I=!0)}!I&&wR(h,P)&&s.push(C)}else if(S==="overlap"&&km(h,P)){var k=C.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),M=[{x:k.x1,y:k.y1},{x:k.x2,y:k.y1},{x:k.x2,y:k.y2},{x:k.x1,y:k.y2}];if(Tc(M,g))s.push(C);else{var N=y(C);N&&Tc(N,g)&&s.push(C)}}}else{var z=x,$=z._private,q=$.rscratch,V=z.pstyle("box-selection").strValue;if(V==="none")continue;if(V==="contain"){if(q.startX!=null&&q.startY!=null&&!ma(h,q.startX,q.startY)||q.endX!=null&&q.endY!=null&&!ma(h,q.endX,q.endY))continue;if(q.edgeType==="bezier"||q.edgeType==="multibezier"||q.edgeType==="self"||q.edgeType==="compound"||q.edgeType==="segments"||q.edgeType==="haystack"){for(var Z=$.rstyle.bezierPts||$.rstyle.linePts||$.rstyle.haystackPts,K=!0,j=0;j<Z.length;j++)if(!sw(h,Z[j])){K=!1;break}K&&s.push(z)}else q.edgeType==="straight"&&s.push(z)}else if(V==="overlap"){var ee=!1;if(q.startX!=null&&q.startY!=null&&q.endX!=null&&q.endY!=null&&(ma(h,q.startX,q.startY)||ma(h,q.endX,q.endY)))s.push(z),ee=!0;else if(!ee&&q.edgeType==="haystack"){for(var le=$.rstyle.haystackPts,W=0;W<le.length;W++)if(sw(h,le[W])){s.push(z),ee=!0;break}}if(!ee){var G=$.rstyle.bezierPts||$.rstyle.linePts||$.rstyle.haystackPts;if((!G||G.length<2)&&q.edgeType==="straight"&&q.startX!=null&&q.startY!=null&&q.endX!=null&&q.endY!=null&&(G=[{x:q.startX,y:q.startY},{x:q.endX,y:q.endY}]),!G||G.length<2)continue;for(var Y=0;Y<G.length-1;Y++){for(var re=G[Y],de=G[Y+1],se=0;se<p.length;se++){var X=Yr(p[se],2),Q=X[0],ae=X[1];if(b(re,de,Q,ae)){s.push(z),ee=!0;break}}if(ee)break}}}}}return s};var Ju={};Ju.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",l,u,c,d,h,g,b,w;if(t?(c=e.haystackPts[0],d=e.haystackPts[1],h=e.haystackPts[2],g=e.haystackPts[3]):(c=e.arrowStartX,d=e.arrowStartY,h=e.arrowEndX,g=e.arrowEndY),b=e.midX,w=e.midY,i)l=c-e.segpts[0],u=d-e.segpts[1];else if(a||o||s||n){var p=e.allpts,E=ot(p[0],p[2],p[4],.1),y=ot(p[1],p[3],p[5],.1);l=c-E,u=d-y}else l=c-b,u=d-w;e.srcArrowAngle=yu(l,u);var b=e.midX,w=e.midY;if(t&&(b=(c+h)/2,w=(d+g)/2),l=h-c,u=g-d,i){var p=e.allpts;if(p.length/2%2===0){var x=p.length/2,C=x-2;l=p[x]-p[C],u=p[x+1]-p[C+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var x=p.length/2-1,C=x-2;l=p[x]-p[C],u=p[x+1]-p[C+1]}}else if(a||o||s){var p=e.allpts,T=e.ctrlpts,S,_,A,P;if(T.length/2%2===0){var I=p.length/2-1,D=I+2,k=D+2;S=ot(p[I],p[D],p[k],0),_=ot(p[I+1],p[D+1],p[k+1],0),A=ot(p[I],p[D],p[k],1e-4),P=ot(p[I+1],p[D+1],p[k+1],1e-4)}else{var D=p.length/2-1,I=D-2,k=D+2;S=ot(p[I],p[D],p[k],.4999),_=ot(p[I+1],p[D+1],p[k+1],.4999),A=ot(p[I],p[D],p[k],.5),P=ot(p[I+1],p[D+1],p[k+1],.5)}l=A-S,u=P-_}if(e.midtgtArrowAngle=yu(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var x=p.length/2-1,M=x+2;l=-(p[M]-p[x]),u=-(p[M+1]-p[x+1])}}}if(e.midsrcArrowAngle=yu(l,u),i)l=h-e.segpts[e.segpts.length-2],u=g-e.segpts[e.segpts.length-1];else if(a||o||s||n){var p=e.allpts,N=p.length,E=ot(p[N-6],p[N-4],p[N-2],.9),y=ot(p[N-5],p[N-3],p[N-1],.9);l=h-E,u=g-y}else l=h-b,u=g-w;e.tgtArrowAngle=yu(l,u)};Ju.getArrowWidth=Ju.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=n,n)};var gm,pm,Pn={},on={},Gx,Wx,ei,qu,Hn,Ya,Qa,Rn,Fi,Su,hA,gA,ym,mm,Ux,Hx=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},h$=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},g$=function(e,t,n,a,i){if(e!==Ux?Hx(t,e,Pn):h$(on,Pn),Hx(t,n,on),Gx=Pn.nx*on.ny-Pn.ny*on.nx,Wx=Pn.nx*on.nx-Pn.ny*-on.ny,Hn=Math.asin(Math.max(-1,Math.min(1,Gx))),Math.abs(Hn)<1e-6){gm=t.x,pm=t.y,Qa=Fi=0;return}ei=1,qu=!1,Wx<0?Hn<0?Hn=Math.PI+Hn:(Hn=Math.PI-Hn,ei=-1,qu=!0):Hn>0&&(ei=-1,qu=!0),t.radius!==void 0?Fi=t.radius:Fi=a,Ya=Hn/2,Su=Math.min(Pn.len/2,on.len/2),i?(Rn=Math.abs(Math.cos(Ya)*Fi/Math.sin(Ya)),Rn>Su?(Rn=Su,Qa=Math.abs(Rn*Math.sin(Ya)/Math.cos(Ya))):Qa=Fi):(Rn=Math.min(Su,Fi),Qa=Math.abs(Rn*Math.sin(Ya)/Math.cos(Ya))),ym=t.x+on.nx*Rn,mm=t.y+on.ny*Rn,gm=ym-on.ny*Qa*ei,pm=mm+on.nx*Qa*ei,hA=t.x+Pn.nx*Rn,gA=t.y+Pn.ny*Rn,Ux=t};function pA(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Hm(r,e,t,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(g$(r,e,t,n,a),{cx:gm,cy:pm,radius:Qa,startX:hA,startY:gA,stopX:ym,stopY:mm,startAngle:Pn.ang+Math.PI/2*ei,endAngle:on.ang-Math.PI/2*ei,counterClockwise:qu})}var is=.01,p$=Math.sqrt(2*is),St={};St.findMidptPtsEtc=function(r,e){var t=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=r.pstyle("source-endpoint"),s=r.pstyle("target-endpoint"),l=o.units!=null&&s.units!=null,u=function(T,S,_,A){var P=A-S,I=_-T,D=Math.sqrt(I*I+P*P);return{x:-P/D,y:I/D}},c=r.pstyle("edge-distances").value;switch(c){case"node-position":i=t;break;case"intersection":i=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(r.source()[0],o),h=Yr(d,2),g=h[0],p=h[1],E=this.manualEndptToPx(r.target()[0],s),y=Yr(E,2),b=y[0],w=y[1],x={x1:g,y1:p,x2:b,y2:w};a=u(g,p,b,w),i=x}else Er("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}};St.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],n=t._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source,s=n.target,l=o.position(),u=s.position(),c=o.width(),d=s.width(),h=o.height(),g=s.height(),p=t.pstyle("haystack-radius").value,E=p/2;a.haystackPts=a.allpts=[a.source.x*c*E+l.x,a.source.y*h*E+l.y,a.target.x*d*E+u.x,a.target.y*g*E+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}};St.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),a=r.pstyle("segment-distances"),i=r.pstyle("segment-radii"),o=r.pstyle("radius-type"),s=Math.min(n.pfValue.length,a.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=o.pfValue[o.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var c=0;c<s;c++){var d=n.pfValue[c],h=a.pfValue[c],g=1-d,p=d,E=this.findMidptPtsEtc(r,e),y=E.midptPts,b=E.vectorNormInverse,w={x:y.x1*g+y.x2*p,y:y.y1*g+y.y2*p};t.segpts.push(w.x+b.x*h,w.y+b.y*h),t.radii.push(i.pfValue[c]!==void 0?i.pfValue[c]:l),t.isArcRadius.push((o.pfValue[c]!==void 0?o.pfValue[c]:u)==="arc-radius")}};St.findLoopPoints=function(r,e,t,n){var a=r._private.rscratch,i=e.dirCounts,o=e.srcPos,s=r.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=r.pstyle("loop-direction").pfValue,c=r.pstyle("loop-sweep").pfValue,d=r.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=t,g=d;n&&(h=0,g=l);var p=u-Math.PI/2,E=p-c/2,y=p+c/2,b=u+"_"+c;h=i[b]===void 0?i[b]=0:++i[b],a.ctrlpts=[o.x+Math.cos(E)*1.4*g*(h/3+1),o.y+Math.sin(E)*1.4*g*(h/3+1),o.x+Math.cos(y)*1.4*g*(h/3+1),o.y+Math.sin(y)*1.4*g*(h/3+1)]};St.findCompoundLoopPoints=function(r,e,t,n){var a=r._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,l=e.srcH,u=e.tgtW,c=e.tgtH,d=r.pstyle("control-point-step-size").pfValue,h=r.pstyle("control-point-distances"),g=h?h.pfValue[0]:void 0,p=t,E=d;n&&(p=0,E=g);var y=50,b={x:i.x-s/2,y:i.y-l/2},w={x:o.x-u/2,y:o.y-c/2},x={x:Math.min(b.x,w.x),y:Math.min(b.y,w.y)},C=.5,T=Math.max(C,Math.log(s*is)),S=Math.max(C,Math.log(u*is));a.ctrlpts=[x.x,x.y-(1+Math.pow(y,1.12)/100)*E*(p/3+1)*T,x.x-(1+Math.pow(y,1.12)/100)*E*(p/3+1)*S,x.y]};St.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};St.findBezierPoints=function(r,e,t,n,a){var i=r._private.rscratch,o=r.pstyle("control-point-step-size").pfValue,s=r.pstyle("control-point-distances"),l=r.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,c=s?s.pfValue[0]:void 0,d=l.value[0],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var g=0;g<u;g++){var p=(.5-e.eles.length/2+t)*o*(a?-1:1),E=void 0,y=Mm(p);h&&(c=s?s.pfValue[g]:o,d=l.value[g]),n?E=c:E=c!==void 0?y*c:void 0;var b=E!==void 0?E:p,w=1-d,x=d,C=this.findMidptPtsEtc(r,e),T=C.midptPts,S=C.vectorNormInverse,_={x:T.x1*w+T.x2*x,y:T.y1*w+T.y2*x};i.ctrlpts.push(_.x+S.x*b,_.y+S.y*b)}};St.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",s="downward",l="upward",u="auto",c=e.posPts,d=e.srcW,h=e.srcH,g=e.tgtW,p=e.tgtH,E=r.pstyle("edge-distances").value,y=E!=="node-position",b=r.pstyle("taxi-direction").value,w=b,x=r.pstyle("taxi-turn"),C=x.units==="%",T=x.pfValue,S=T<0,_=r.pstyle("taxi-turn-min-distance").pfValue,A=y?(d+g)/2:0,P=y?(h+p)/2:0,I=c.x2-c.x1,D=c.y2-c.y1,k=function(O,oe){return O>0?Math.max(O-oe,0):Math.min(O+oe,0)},M=k(I,A),N=k(D,P),z=!1;w===u?b=Math.abs(M)>Math.abs(N)?a:n:w===l||w===s?(b=n,z=!0):(w===i||w===o)&&(b=a,z=!0);var $=b===n,q=$?N:M,V=$?D:I,Z=Mm(V),K=!1;!(z&&(C||S))&&(w===s&&V<0||w===l&&V>0||w===i&&V>0||w===o&&V<0)&&(Z*=-1,q=Z*Math.abs(q),K=!0);var j;if(C){var ee=T<0?1+T:T;j=ee*q}else{var le=T<0?q:0;j=le+T*Z}var W=function(O){return Math.abs(O)<_||Math.abs(O)>=Math.abs(q)},G=W(j),Y=W(Math.abs(q)-Math.abs(j)),re=G||Y;if(re&&!K)if($){var de=Math.abs(V)<=h/2,se=Math.abs(I)<=g/2;if(de){var X=(c.x1+c.x2)/2,Q=c.y1,ae=c.y2;t.segpts=[X,Q,X,ae]}else if(se){var te=(c.y1+c.y2)/2,ce=c.x1,_e=c.x2;t.segpts=[ce,te,_e,te]}else t.segpts=[c.x1,c.y2]}else{var ve=Math.abs(V)<=d/2,U=Math.abs(D)<=p/2;if(ve){var fe=(c.y1+c.y2)/2,xe=c.x1,ge=c.x2;t.segpts=[xe,fe,ge,fe]}else if(U){var be=(c.x1+c.x2)/2,Ae=c.y1,De=c.y2;t.segpts=[be,Ae,be,De]}else t.segpts=[c.x2,c.y1]}else if($){var Be=c.y1+j+(y?h/2*Z:0),Le=c.x1,He=c.x2;t.segpts=[Le,Be,He,Be]}else{var Ve=c.x1+j+(y?d/2*Z:0),Xe=c.y1,er=c.y2;t.segpts=[Ve,Xe,Ve,er]}if(t.isRound){var $e=r.pstyle("taxi-radius").value,ke=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill($e),t.isArcRadius=new Array(t.segpts.length/2).fill(ke)}};St.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,c=e.tgtShape,d=e.srcCornerRadius,h=e.tgtCornerRadius,g=e.srcRs,p=e.tgtRs,E=!Me(t.startX)||!Me(t.startY),y=!Me(t.arrowStartX)||!Me(t.arrowStartY),b=!Me(t.endX)||!Me(t.endY),w=!Me(t.arrowEndX)||!Me(t.arrowEndY),x=3,C=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=x*C,S=ii({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),_=S<T,A=ii({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),P=A<T,I=!1;if(E||y||_){I=!0;var D={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},k=Math.sqrt(D.x*D.x+D.y*D.y),M={x:D.x/k,y:D.y/k},N=Math.max(i,o),z={x:t.ctrlpts[0]+M.x*2*N,y:t.ctrlpts[1]+M.y*2*N},$=u.intersectLine(n.x,n.y,i,o,z.x,z.y,0,d,g);_?(t.ctrlpts[0]=t.ctrlpts[0]+M.x*(T-S),t.ctrlpts[1]=t.ctrlpts[1]+M.y*(T-S)):(t.ctrlpts[0]=$[0]+M.x*T,t.ctrlpts[1]=$[1]+M.y*T)}if(b||w||P){I=!0;var q={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},V=Math.sqrt(q.x*q.x+q.y*q.y),Z={x:q.x/V,y:q.y/V},K=Math.max(i,o),j={x:t.ctrlpts[0]+Z.x*2*K,y:t.ctrlpts[1]+Z.y*2*K},ee=c.intersectLine(a.x,a.y,s,l,j.x,j.y,0,h,p);P?(t.ctrlpts[0]=t.ctrlpts[0]+Z.x*(T-A),t.ctrlpts[1]=t.ctrlpts[1]+Z.y*(T-A)):(t.ctrlpts[0]=ee[0]+Z.x*T,t.ctrlpts[1]=ee[1]+Z.y*T)}I&&this.findEndpoints(r)}};St.storeAllpts=function(r){var e=r._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=ot(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=ot(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(Hm({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var c=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[c],e.midY=e.segpts[c+1];else{var d={x:e.segpts[c],y:e.segpts[c+1]},h=e.roundCorners[c/2];if(h.radius===0){var g={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-g.y,g.x-d.x]}else{var p=[d.x-h.cx,d.y-h.cy],E=h.radius/Math.sqrt(Math.pow(p[0],2)+Math.pow(p[1],2));p=p.map(function(y){return y*E}),e.midX=h.cx+p[0],e.midY=h.cy+p[1],e.midVector=p}}}}};St.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||Me(e.startX)&&Me(e.startY)&&Me(e.endX)&&Me(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Er("Edge `"+r.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};St.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,n=t.cy,a=n.hasCompoundNodes(),i=new jn,o=function(P,I){return[].concat(Gu(P),[I?1:0]).join("-")},s=[],l=[],u=0;u<r.length;u++){var c=r[u],d=c._private,h=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(h==="haystack"){l.push(c);continue}var g=h==="unbundled-bezier"||ya(h,"segments")||h==="straight"||h==="straight-triangle"||ya(h,"taxi"),p=h==="unbundled-bezier"||h==="bezier",E=d.source,y=d.target,b=E.poolIndex(),w=y.poolIndex(),x=[b,w].sort(),C=o(x,g),T=i.get(C);T==null&&(T={eles:[]},s.push({pairId:x,edgeIsUnbundled:g}),i.set(C,T)),T.eles.push(c),g&&(T.hasUnbundled=!0),p&&(T.hasBezier=!0)}}for(var S=function(){var P=s[_],I=P.pairId,D=P.edgeIsUnbundled,k=o(I,D),M=i.get(k),N;if(!M.hasUnbundled){var z=M.eles[0].parallelEdges().filter(function(ke){return ke.isBundledBezier()});Dm(M.eles),z.forEach(function(ke){return M.eles.push(ke)}),M.eles.sort(function(ke,ye){return ke.poolIndex()-ye.poolIndex()})}var $=M.eles[0],q=$.source(),V=$.target();if(q.poolIndex()>V.poolIndex()){var Z=q;q=V,V=Z}var K=M.srcPos=q.position(),j=M.tgtPos=V.position(),ee=M.srcW=q.outerWidth(),le=M.srcH=q.outerHeight(),W=M.tgtW=V.outerWidth(),G=M.tgtH=V.outerHeight(),Y=M.srcShape=t.nodeShapes[e.getNodeShape(q)],re=M.tgtShape=t.nodeShapes[e.getNodeShape(V)],de=M.srcCornerRadius=q.pstyle("corner-radius").value==="auto"?"auto":q.pstyle("corner-radius").pfValue,se=M.tgtCornerRadius=V.pstyle("corner-radius").value==="auto"?"auto":V.pstyle("corner-radius").pfValue,X=M.tgtRs=V._private.rscratch,Q=M.srcRs=q._private.rscratch;M.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ae=0;ae<M.eles.length;ae++){var te=M.eles[ae],ce=te[0]._private.rscratch,_e=te.pstyle("curve-style").value,ve=_e==="unbundled-bezier"||ya(_e,"segments")||ya(_e,"taxi"),U=!q.same(te.source());if(!M.calculatedIntersection&&q!==V&&(M.hasBezier||M.hasUnbundled)){M.calculatedIntersection=!0;var fe=Y.intersectLine(K.x,K.y,ee,le,j.x,j.y,0,de,Q),xe=M.srcIntn=fe,ge=re.intersectLine(j.x,j.y,W,G,K.x,K.y,0,se,X),be=M.tgtIntn=ge,Ae=M.intersectionPts={x1:fe[0],x2:ge[0],y1:fe[1],y2:ge[1]},De=M.posPts={x1:K.x,x2:j.x,y1:K.y,y2:j.y},Be=ge[1]-fe[1],Le=ge[0]-fe[0],He=Math.sqrt(Le*Le+Be*Be);Me(He)&&He>=p$||(He=Math.sqrt(Math.max(Le*Le,is)+Math.max(Be*Be,is)));var Ve=M.vector={x:Le,y:Be},Xe=M.vectorNorm={x:Ve.x/He,y:Ve.y/He},er={x:-Xe.y,y:Xe.x};M.nodesOverlap=!Me(He)||re.checkPoint(fe[0],fe[1],0,W,G,j.x,j.y,se,X)||Y.checkPoint(ge[0],ge[1],0,ee,le,K.x,K.y,de,Q),M.vectorNormInverse=er,N={nodesOverlap:M.nodesOverlap,dirCounts:M.dirCounts,calculatedIntersection:!0,hasBezier:M.hasBezier,hasUnbundled:M.hasUnbundled,eles:M.eles,srcPos:j,srcRs:X,tgtPos:K,tgtRs:Q,srcW:W,srcH:G,tgtW:ee,tgtH:le,srcIntn:be,tgtIntn:xe,srcShape:re,tgtShape:Y,posPts:{x1:De.x2,y1:De.y2,x2:De.x1,y2:De.y1},intersectionPts:{x1:Ae.x2,y1:Ae.y2,x2:Ae.x1,y2:Ae.y1},vector:{x:-Ve.x,y:-Ve.y},vectorNorm:{x:-Xe.x,y:-Xe.y},vectorNormInverse:{x:-er.x,y:-er.y}}}var $e=U?N:M;ce.nodesOverlap=$e.nodesOverlap,ce.srcIntn=$e.srcIntn,ce.tgtIntn=$e.tgtIntn,ce.isRound=_e.startsWith("round"),a&&(q.isParent()||q.isChild()||V.isParent()||V.isChild())&&(q.parents().anySame(V)||V.parents().anySame(q)||q.same(V)&&q.isParent())?e.findCompoundLoopPoints(te,$e,ae,ve):q===V?e.findLoopPoints(te,$e,ae,ve):_e.endsWith("segments")?e.findSegmentsPoints(te,$e):_e.endsWith("taxi")?e.findTaxiPoints(te,$e):_e==="straight"||!ve&&M.eles.length%2===1&&ae===Math.floor(M.eles.length/2)?e.findStraightEdgePoints(te):e.findBezierPoints(te,$e,ae,ve,U),e.findEndpoints(te),e.tryToCorrectInvalidPoints(te,$e),e.checkForInvalidEdgeWarning(te),e.storeAllpts(te),e.storeEdgeProjections(te),e.calculateArrowAngles(te),e.recalculateEdgeLabelProjections(te),e.calculateLabelAngles(te)}},_=0;_<s.length;_++)S();this.findHaystackPoints(l)}};function yA(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var n=r[t],a=r[t+1];e.push({x:n,y:a})}return e}}St.getSegmentPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="segments")return yA(e.segpts)};St.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return yA(e.ctrlpts)};St.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var ms={};ms.manualEndptToPx=function(r,e){var t=this,n=r.position(),a=r.outerWidth(),i=r.outerHeight(),o=r._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*a),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=n.x,s[1]+=n.y,s}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(a,i),c=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return t.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,a,i,c[0],c[1],0,r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,o)}};ms.findEndpoints=function(r){var e,t,n,a,i=this,o,s=r.source()[0],l=r.target()[0],u=s.position(),c=l.position(),d=r.pstyle("target-arrow-shape").value,h=r.pstyle("source-arrow-shape").value,g=r.pstyle("target-distance-from-node").pfValue,p=r.pstyle("source-distance-from-node").pfValue,E=s._private.rscratch,y=l._private.rscratch,b=r.pstyle("curve-style").value,w=r._private.rscratch,x=w.edgeType,C=ya(b,"taxi"),T=x==="self"||x==="compound",S=x==="bezier"||x==="multibezier"||T,_=x!=="bezier",A=x==="straight"||x==="segments",P=x==="segments",I=S||_||A,D=T||C,k=r.pstyle("source-endpoint"),M=D?"outside-to-node":k.value,N=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,z=r.pstyle("target-endpoint"),$=D?"outside-to-node":z.value,q=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;w.srcManEndpt=k,w.tgtManEndpt=z;var V,Z,K,j,ee=(e=(z==null||(t=z.pfValue)===null||t===void 0?void 0:t.length)===2?z.pfValue:null)!==null&&e!==void 0?e:[0,0],le=(n=(k==null||(a=k.pfValue)===null||a===void 0?void 0:a.length)===2?k.pfValue:null)!==null&&n!==void 0?n:[0,0];if(S){var W=[w.ctrlpts[0],w.ctrlpts[1]],G=_?[w.ctrlpts[w.ctrlpts.length-2],w.ctrlpts[w.ctrlpts.length-1]]:W;V=G,Z=W}else if(A){var Y=P?w.segpts.slice(0,2):[c.x+ee[0],c.y+ee[1]],re=P?w.segpts.slice(w.segpts.length-2):[u.x+le[0],u.y+le[1]];V=re,Z=Y}if($==="inside-to-node")o=[c.x,c.y];else if(z.units)o=this.manualEndptToPx(l,z);else if($==="outside-to-line")o=w.tgtIntn;else if($==="outside-to-node"||$==="outside-to-node-or-label"?K=V:($==="outside-to-line"||$==="outside-to-line-or-label")&&(K=[u.x,u.y]),o=i.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),K[0],K[1],0,q,y),$==="outside-to-node-or-label"||$==="outside-to-line-or-label"){var de=l._private.rscratch,se=de.labelWidth,X=de.labelHeight,Q=de.labelX,ae=de.labelY,te=se/2,ce=X/2,_e=l.pstyle("text-valign").value;_e==="top"?ae-=ce:_e==="bottom"&&(ae+=ce);var ve=l.pstyle("text-halign").value;ve==="left"?Q-=te:ve==="right"&&(Q+=te);var U=es(K[0],K[1],[Q-te,ae-ce,Q+te,ae-ce,Q+te,ae+ce,Q-te,ae+ce],c.x,c.y);if(U.length>0){var fe=u,xe=Xa(fe,Wi(o)),ge=Xa(fe,Wi(U)),be=xe;if(ge<xe&&(o=U,be=ge),U.length>2){var Ae=Xa(fe,{x:U[2],y:U[3]});Ae<be&&(o=[U[2],U[3]])}}}var De=mu(o,V,i.arrowShapes[d].spacing(r)+g),Be=mu(o,V,i.arrowShapes[d].gap(r)+g);if(w.endX=Be[0],w.endY=Be[1],w.arrowEndX=De[0],w.arrowEndY=De[1],M==="inside-to-node")o=[u.x,u.y];else if(k.units)o=this.manualEndptToPx(s,k);else if(M==="outside-to-line")o=w.srcIntn;else if(M==="outside-to-node"||M==="outside-to-node-or-label"?j=Z:(M==="outside-to-line"||M==="outside-to-line-or-label")&&(j=[c.x,c.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),j[0],j[1],0,N,E),M==="outside-to-node-or-label"||M==="outside-to-line-or-label"){var Le=s._private.rscratch,He=Le.labelWidth,Ve=Le.labelHeight,Xe=Le.labelX,er=Le.labelY,$e=He/2,ke=Ve/2,ye=s.pstyle("text-valign").value;ye==="top"?er-=ke:ye==="bottom"&&(er+=ke);var O=s.pstyle("text-halign").value;O==="left"?Xe-=$e:O==="right"&&(Xe+=$e);var oe=es(j[0],j[1],[Xe-$e,er-ke,Xe+$e,er-ke,Xe+$e,er+ke,Xe-$e,er+ke],u.x,u.y);if(oe.length>0){var me=c,we=Xa(me,Wi(o)),Ce=Xa(me,Wi(oe)),qe=we;if(Ce<we&&(o=[oe[0],oe[1]],qe=Ce),oe.length>2){var Pe=Xa(me,{x:oe[2],y:oe[3]});Pe<qe&&(o=[oe[2],oe[3]])}}}var Ge=mu(o,Z,i.arrowShapes[h].spacing(r)+p),Fe=mu(o,Z,i.arrowShapes[h].gap(r)+p);w.startX=Fe[0],w.startY=Fe[1],w.arrowStartX=Ge[0],w.arrowStartY=Ge[1],I&&(!Me(w.startX)||!Me(w.startY)||!Me(w.endX)||!Me(w.endY)?w.badLine=!0:w.badLine=!1)};ms.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};ms.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Km={};function y$(r,e,t){for(var n=function(u,c,d,h){return ot(u,c,d,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<r.bezierProjPcts.length;o++){var s=r.bezierProjPcts[o];i.push({x:n(t[0],t[2],t[4],s),y:n(t[1],t[3],t[5],s)})}}Km.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,n=t.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<t.allpts.length;a+=4)y$(this,r,t.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<t.allpts.length;a+=2)i.push({x:t.allpts[a],y:t.allpts[a+1]});else if(n==="haystack"){var o=t.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth};Km.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Mn={};Mn.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!Ca(e)){var t,n,a=r._private,i=r.width(),o=r.height(),s=r.padding(),l=r.position(),u=r.pstyle("text-halign").strValue,c=r.pstyle("text-valign").strValue,d=a.rscratch,h=a.rstyle;switch(u){case"left":t=l.x-i/2-s;break;case"right":t=l.x+i/2+s;break;default:t=l.x}switch(c){case"top":n=l.y-o/2-s;break;case"bottom":n=l.y+o/2+s;break;default:n=l.y}d.labelX=t,d.labelY=n,h.labelX=t,h.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var mA=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},bA=function(e,t){var n=t.x-e.x,a=t.y-e.y;return mA(n,a)},m$=function(e,t,n,a){var i=Jo(0,a-.001,1),o=Jo(0,a+.001,1),s=ji(e,t,n,i),l=ji(e,t,n,o);return bA(s,l)};Mn.recalculateEdgeLabelProjections=function(r){var e,t=r._private,n=t.rscratch,a=this,i={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var o=function(d,h,g){Kn(t.rscratch,d,h,g),Kn(t.rstyle,d,h,g)};o("labelX",null,e.x),o("labelY",null,e.y);var s=mA(n.midDispX,n.midDispY);o("labelAutoAngle",null,s);var l=function(){if(l.cache)return l.cache;for(var d=[],h=0;h+5<n.allpts.length;h+=4){var g={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},E={x:n.allpts[h+4],y:n.allpts[h+5]};d.push({p0:g,p1:p,p2:E,startDist:0,length:0,segments:[]})}var y=t.rstyle.bezierPts,b=a.bezierProjPcts.length;function w(_,A,P,I,D){var k=ii(A,P),M=_.segments[_.segments.length-1],N={p0:A,p1:P,t0:I,t1:D,startDist:M?M.startDist+M.length:0,length:k};_.segments.push(N),_.length+=k}for(var x=0;x<d.length;x++){var C=d[x],T=d[x-1];T&&(C.startDist=T.startDist+T.length),w(C,C.p0,y[x*b],0,a.bezierProjPcts[0]);for(var S=0;S<b-1;S++)w(C,y[x*b+S],y[x*b+S+1],a.bezierProjPcts[S],a.bezierProjPcts[S+1]);w(C,y[x*b+b-1],C.p2,a.bezierProjPcts[b-1],1)}return l.cache=d},u=function(d){var h,g=d==="source";if(i[d]){var p=r.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var E=l(),y,b=0,w=0,x=0;x<E.length;x++){for(var C=E[g?x:E.length-1-x],T=0;T<C.segments.length;T++){var S=C.segments[g?T:C.segments.length-1-T],_=x===E.length-1&&T===C.segments.length-1;if(b=w,w+=S.length,w>=p||_){y={cp:C,segment:S};break}}if(y)break}var A=y.cp,P=y.segment,I=(p-b)/P.length,D=P.t1-P.t0,k=g?P.t0+D*I:P.t1-D*I;k=Jo(0,k,1),e=ji(A.p0,A.p1,A.p2,k),h=m$(A.p0,A.p1,A.p2,k);break}case"straight":case"segments":case"haystack":{for(var M=0,N,z,$,q,V=n.allpts.length,Z=0;Z+3<V&&(g?($={x:n.allpts[Z],y:n.allpts[Z+1]},q={x:n.allpts[Z+2],y:n.allpts[Z+3]}):($={x:n.allpts[V-2-Z],y:n.allpts[V-1-Z]},q={x:n.allpts[V-4-Z],y:n.allpts[V-3-Z]}),N=ii($,q),z=M,M+=N,!(M>=p));Z+=2);var K=p-z,j=K/N;j=Jo(0,j,1),e=zN($,q,j),h=bA($,q);break}}o("labelX",d,e.x),o("labelY",d,e.y),o("labelAutoAngle",d,h)}};u("source"),u("target"),this.applyLabelDimensions(r)}};Mn.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Mn.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),a=ai(n,r._private.labelDimsKey);if(Nt(t.rscratch,"prefixedLabelDimsKey",e)!==a){Kn(t.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(r,n),o=r.pstyle("line-height").pfValue,s=r.pstyle("text-wrap").strValue,l=Nt(t.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(l.length,1),c=i.height/u,d=c*o,h=i.width,g=i.height+(u-1)*(o-1)*c;Kn(t.rstyle,"labelWidth",e,h),Kn(t.rscratch,"labelWidth",e,h),Kn(t.rstyle,"labelHeight",e,g),Kn(t.rscratch,"labelHeight",e,g),Kn(t.rscratch,"labelLineHeight",e,d)}};Mn.getLabelText=function(r,e){var t=r._private,n=e?e+"-":"",a=r.pstyle(n+"label").strValue,i=r.pstyle("text-transform").value,o=function(le,W){return W?(Kn(t.rscratch,le,e,W),W):Nt(t.rscratch,le,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var s=r.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="",c=a.split(`
|
|
15
|
+
`),d=r.pstyle("text-max-width").pfValue,h=r.pstyle("text-overflow-wrap").value,g=h==="anywhere",p=[],E=/[\s\u200b]+|$/g,y=0;y<c.length;y++){var b=c[y],w=this.calculateLabelDimensions(r,b),x=w.width;if(g){var C=b.split("").join(u);b=C}if(x>d){var T=b.matchAll(E),S="",_=0,A=zt(T),P;try{for(A.s();!(P=A.n()).done;){var I=P.value,D=I[0],k=b.substring(_,I.index);_=I.index+D.length;var M=S.length===0?k:S+k+D,N=this.calculateLabelDimensions(r,M),z=N.width;z<=d?S+=k+D:(S&&p.push(S),S=k+D)}}catch(ee){A.e(ee)}finally{A.f()}S.match(/^[\s\u200b]+$/)||p.push(S)}else p.push(b)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
|
|
16
|
+
`)),o("labelWrapKey",l)}else if(s==="ellipsis"){var $=r.pstyle("text-max-width").pfValue,q="",V="…",Z=!1;if(this.calculateLabelDimensions(r,a).width<$)return a;for(var K=0;K<a.length;K++){var j=this.calculateLabelDimensions(r,q+a[K]+V).width;if(j>$)break;q+=a[K],K===a.length-1&&(Z=!0)}return Z||(q+=V),q}return a};Mn.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Mn.calculateLabelDimensions=function(r,e){var t=this,n=t.cy.window(),a=n.document,i=0,o=r.pstyle("font-style").strValue,s=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,u=r.pstyle("font-weight").strValue,c=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=a.createElement("canvas"),d=this.labelCalcCanvasContext=c.getContext("2d");var h=c.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}d.font="".concat(o," ").concat(u," ").concat(s,"px ").concat(l);for(var g=0,p=0,E=e.split(`
|
|
17
|
+
`),y=0;y<E.length;y++){var b=E[y],w=d.measureText(b),x=Math.ceil(w.width),C=s;g=Math.max(x,g),p+=C}return g+=i,p+=i,{width:g,height:p}};Mn.calculateLabelAngle=function(r,e){var t=r._private,n=t.rscratch,a=r.isEdge(),i=e?e+"-":"",o=r.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:a&&s==="autorotate"?n.labelAutoAngle:s==="autorotate"?0:o.pfValue};Mn.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),n=r._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(r),t&&(a.sourceLabelAngle=e.calculateLabelAngle(r,"source"),a.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var wA={},Kx=28,jx=!1;wA.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Kx||r.height()<Kx))return jx||(Er("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),jx=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var n=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return t};var xl={};xl.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,n=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var l=0;l<o.length;l++){var u=o[l],c=u._private,d=c.rstyle;d.clean=!1,d.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(o){var s=o.target;n(s)}).on("style.* background.*",function(o){var s=o.target;n(s,!1)});var a=function(o){if(o){var s=t.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],c=u._private.rstyle;u.isNode()&&!c.cleanConnected&&(n(u.connectedEdges()),c.cleanConnected=!0)}if(s)for(var d=0;d<s.length;d++){var h=s[d];h(o,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){a(!0)},t.beforeRender(a,t.beforeRenderPriorities.eleCalcs)};xl.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};xl.recalculateRenderedStyle=function(r,e){var t=function(C){return C._private.rstyle.cleanConnected};if(r.length!==0){var n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var o=r[i],s=o._private,l=s.rstyle;o.isEdge()&&(!t(o.source())||!t(o.target()))&&(l.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(x){return!x._private.rstyle.clean&&x.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?a.push(o):n.push(o),l.clean=!0)}for(var u=0;u<a.length;u++){var c=a[u],d=c._private,h=d.rstyle,g=c.position();this.recalculateNodeLabelProjection(c),h.nodeX=g.x,h.nodeY=g.y,h.nodeW=c.pstyle("width").pfValue,h.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var E=n[p],y=E._private,b=y.rstyle,w=y.rscratch;b.srcX=w.arrowStartX,b.srcY=w.arrowStartY,b.tgtX=w.arrowEndX,b.tgtY=w.arrowEndY,b.midX=w.midX,b.midY=w.midY,b.labelAngle=w.labelAngle,b.sourceLabelAngle=w.sourceLabelAngle,b.targetLabelAngle=w.targetLabelAngle}}}};var El={};El.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var n=r[t],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(var t=0;t<e.length;t++){var n=e[t];r.drag.push(n)}}};El.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};El.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(rA),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var xA={};[li,Ju,St,ms,Km,Mn,wA,xl,El].forEach(function(r){Ye(xA,r)});var EA={};EA.getCachedImage=function(r,e,t){var n=this,a=n.imageCache=n.imageCache||{},i=a[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=a[r]=a[r]||{};var o=i.image=new Image;o.addEventListener("load",t),o.addEventListener("error",function(){o.error=!0});var s="data:",l=r.substring(0,s.length).toLowerCase()===s;return l||(e=e==="null"?null:e,o.crossOrigin=e),o.src=r,o};var oo={};oo.registerBinding=function(r,e,t,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],o=0;o<r.length;o++){var s=r[o];if(s!==void 0){var l=this.binder(s);i.push(l.on.apply(l,a))}}return i}var l=this.binder(r);return l.on.apply(l,a)};oo.binder=function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||Iq(r);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});t.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var o=function(l,u,c){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:c??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:d}),(r.addEventListener||r.on).apply(r,d),this};return{on:o,addEventListener:o,addListener:o,bind:o}};oo.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};oo.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};oo.load=function(){var r=this,e=r.cy.window(),t=function(O){return O.selected()},n=function(O){var oe=O.getRootNode();if(oe&&oe.nodeType===11&&oe.host!==void 0)return oe},a=function(O,oe,me,we){O==null&&(O=r.cy);for(var Ce=0;Ce<oe.length;Ce++){var qe=oe[Ce];O.emit({originalEvent:me,type:qe,position:we})}},i=function(O){return O.shiftKey||O.metaKey||O.ctrlKey},o=function(O,oe){var me=!0;if(r.cy.hasCompoundNodes()&&O&&O.pannable())for(var we=0;oe&&we<oe.length;we++){var O=oe[we];if(O.isNode()&&O.isParent()&&!O.pannable()){me=!1;break}}else me=!0;return me},s=function(O){O[0]._private.grabbed=!0},l=function(O){O[0]._private.grabbed=!1},u=function(O){O[0]._private.rscratch.inDragLayer=!0},c=function(O){O[0]._private.rscratch.inDragLayer=!1},d=function(O){O[0]._private.rscratch.isGrabTarget=!0},h=function(O){O[0]._private.rscratch.isGrabTarget=!1},g=function(O,oe){var me=oe.addToList,we=me.has(O);!we&&O.grabbable()&&!O.locked()&&(me.merge(O),s(O))},p=function(O,oe){if(O.cy().hasCompoundNodes()&&!(oe.inDragLayer==null&&oe.addToList==null)){var me=O.descendants();oe.inDragLayer&&(me.forEach(u),me.connectedEdges().forEach(u)),oe.addToList&&g(me,oe)}},E=function(O,oe){oe=oe||{};var me=O.cy().hasCompoundNodes();oe.inDragLayer&&(O.forEach(u),O.neighborhood().stdFilter(function(we){return!me||we.isEdge()}).forEach(u)),oe.addToList&&O.forEach(function(we){g(we,oe)}),p(O,oe),w(O,{inDragLayer:oe.inDragLayer}),r.updateCachedGrabbedEles()},y=E,b=function(O){O&&(r.getCachedZSortedEles().forEach(function(oe){l(oe),c(oe),h(oe)}),r.updateCachedGrabbedEles())},w=function(O,oe){if(!(oe.inDragLayer==null&&oe.addToList==null)&&O.cy().hasCompoundNodes()){var me=O.ancestors().orphans();if(!me.same(O)){var we=me.descendants().spawnSelf().merge(me).unmerge(O).unmerge(O.descendants()),Ce=we.connectedEdges();oe.inDragLayer&&(Ce.forEach(u),we.forEach(u)),oe.addToList&&we.forEach(function(qe){g(qe,oe)})}}},x=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},C=typeof MutationObserver<"u",T=typeof ResizeObserver<"u";C?(r.removeObserver=new MutationObserver(function(ye){for(var O=0;O<ye.length;O++){var oe=ye[O],me=oe.removedNodes;if(me)for(var we=0;we<me.length;we++){var Ce=me[we];if(Ce===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(ye){r.destroy()});var S=hs(function(){r.cy.resize()},100);C&&(r.styleObserver=new MutationObserver(S),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",S),T&&(r.resizeObserver=new ResizeObserver(S),r.resizeObserver.observe(r.container));var _=function(O,oe){for(;O!=null;)oe(O),O=O.parentNode},A=function(){r.invalidateContainerClientCoordsCache()};_(r.container,function(ye){r.registerBinding(ye,"transitionend",A),r.registerBinding(ye,"animationend",A),r.registerBinding(ye,"scroll",A)}),r.registerBinding(r.container,"contextmenu",function(ye){ye.preventDefault()});var P=function(){return r.selection[4]!==0},I=function(O){for(var oe=r.findContainerClientCoords(),me=oe[0],we=oe[1],Ce=oe[2],qe=oe[3],Pe=O.touches?O.touches:[O],Ge=!1,Fe=0;Fe<Pe.length;Fe++){var je=Pe[Fe];if(me<=je.clientX&&je.clientX<=me+Ce&&we<=je.clientY&&je.clientY<=we+qe){Ge=!0;break}}if(!Ge)return!1;for(var or=r.container,nr=O.target,We=nr.parentNode,ur=!1;We;){if(We===or){ur=!0;break}We=We.parentNode}return!!ur};r.registerBinding(r.container,"mousedown",function(O){if(I(O)&&!(r.hoverData.which===1&&O.which!==1)){O.preventDefault(),x(),r.hoverData.capture=!0,r.hoverData.which=O.which;var oe=r.cy,me=[O.clientX,O.clientY],we=r.projectIntoViewport(me[0],me[1]),Ce=r.selection,qe=r.findNearestElements(we[0],we[1],!0,!1),Pe=qe[0],Ge=r.dragData.possibleDragElements;r.hoverData.mdownPos=we,r.hoverData.mdownGPos=me;var Fe=function(ar){return{originalEvent:O,type:ar,position:{x:we[0],y:we[1]}}},je=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var ar=r.hoverData.down;ar?ar.emit(Fe("taphold")):oe.emit(Fe("taphold"))}},r.tapholdDuration)};if(O.which==3){r.hoverData.cxtStarted=!0;var or={originalEvent:O,type:"cxttapstart",position:{x:we[0],y:we[1]}};Pe?(Pe.activate(),Pe.emit(or),r.hoverData.down=Pe):oe.emit(or),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(O.which==1){Pe&&Pe.activate();{if(Pe!=null&&r.nodeIsGrabbable(Pe)){var nr=function(ar){ar.emit(Fe("grab"))};if(d(Pe),!Pe.selected())Ge=r.dragData.possibleDragElements=oe.collection(),y(Pe,{addToList:Ge}),Pe.emit(Fe("grabon")).emit(Fe("grab"));else{Ge=r.dragData.possibleDragElements=oe.collection();var We=oe.$(function(ur){return ur.isNode()&&ur.selected()&&r.nodeIsGrabbable(ur)});E(We,{addToList:Ge}),Pe.emit(Fe("grabon")),We.forEach(nr)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Pe,r.hoverData.downs=qe,r.hoverData.downTime=new Date().getTime()}a(Pe,["mousedown","tapstart","vmousedown"],O,{x:we[0],y:we[1]}),Pe==null?(Ce[4]=1,r.data.bgActivePosistion={x:we[0],y:we[1]},r.redrawHint("select",!0),r.redraw()):Pe.pannable()&&(Ce[4]=1),je()}Ce[0]=Ce[2]=we[0],Ce[1]=Ce[3]=we[1]}},!1);var D=n(r.container);r.registerBinding([e,D],"mousemove",function(O){var oe=r.hoverData.capture;if(!(!oe&&!I(O))){var me=!1,we=r.cy,Ce=we.zoom(),qe=[O.clientX,O.clientY],Pe=r.projectIntoViewport(qe[0],qe[1]),Ge=r.hoverData.mdownPos,Fe=r.hoverData.mdownGPos,je=r.selection,or=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(or=r.findNearestElement(Pe[0],Pe[1],!0,!1));var nr=r.hoverData.last,We=r.hoverData.down,ur=[Pe[0]-je[2],Pe[1]-je[3]],ar=r.dragData.possibleDragElements,Wr;if(Fe){var Mr=qe[0]-Fe[0],lt=Mr*Mr,kr=qe[1]-Fe[1],Kr=kr*kr,Nr=lt+Kr;r.hoverData.isOverThresholdDrag=Wr=Nr>=r.desktopTapThreshold2}var Xr=i(O);Wr&&(r.hoverData.tapholdCancelled=!0);var Cn=function(){var Mt=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Mt.length===0?(Mt.push(ur[0]),Mt.push(ur[1])):(Mt[0]+=ur[0],Mt[1]+=ur[1])};me=!0,a(or,["mousemove","vmousemove","tapdrag"],O,{x:Pe[0],y:Pe[1]});var $r=function(Mt){return{originalEvent:O,type:Mt,position:{x:Pe[0],y:Pe[1]}}},dn=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||we.emit($r("boxstart")),je[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Wr){var vn=$r("cxtdrag");We?We.emit(vn):we.emit(vn),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||or!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit($r("cxtdragout")),r.hoverData.cxtOver=or,or&&or.emit($r("cxtdragover")))}}else if(r.hoverData.dragging){if(me=!0,we.panningEnabled()&&we.userPanningEnabled()){var ta;if(r.hoverData.justStartedPan){var gi=r.hoverData.mdownPos;ta={x:(Pe[0]-gi[0])*Ce,y:(Pe[1]-gi[1])*Ce},r.hoverData.justStartedPan=!1}else ta={x:ur[0]*Ce,y:ur[1]*Ce};we.panBy(ta),we.emit($r("dragpan")),r.hoverData.dragged=!0}Pe=r.projectIntoViewport(O.clientX,O.clientY)}else if(je[4]==1&&(We==null||We.pannable())){if(Wr){if(!r.hoverData.dragging&&we.boxSelectionEnabled()&&(Xr||!we.panningEnabled()||!we.userPanningEnabled()))dn();else if(!r.hoverData.selecting&&we.panningEnabled()&&we.userPanningEnabled()){var Ln=o(We,r.hoverData.downs);Ln&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,je[4]=0,r.data.bgActivePosistion=Wi(Ge),r.redrawHint("select",!0),r.redraw())}We&&We.pannable()&&We.active()&&We.unactivate()}}else{if(We&&We.pannable()&&We.active()&&We.unactivate(),(!We||!We.grabbed())&&or!=nr&&(nr&&a(nr,["mouseout","tapdragout"],O,{x:Pe[0],y:Pe[1]}),or&&a(or,["mouseover","tapdragover"],O,{x:Pe[0],y:Pe[1]}),r.hoverData.last=or),We)if(Wr){if(we.boxSelectionEnabled()&&Xr)We&&We.grabbed()&&(b(ar),We.emit($r("freeon")),ar.emit($r("free")),r.dragData.didDrag&&(We.emit($r("dragfreeon")),ar.emit($r("dragfree")))),dn();else if(We&&We.grabbed()&&r.nodeIsDraggable(We)){var ft=!r.dragData.didDrag;ft&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||E(ar,{inDragLayer:!0});var at={x:0,y:0};if(Me(ur[0])&&Me(ur[1])&&(at.x+=ur[0],at.y+=ur[1],ft)){var bt=r.hoverData.dragDelta;bt&&Me(bt[0])&&Me(bt[1])&&(at.x+=bt[0],at.y+=bt[1])}r.hoverData.draggingEles=!0,ar.silentShift(at).emit($r("position")).emit($r("drag")),r.redrawHint("drag",!0),r.redraw()}}else Cn();me=!0}if(je[2]=Pe[0],je[3]=Pe[1],me)return O.stopPropagation&&O.stopPropagation(),O.preventDefault&&O.preventDefault(),!1}},!1);var k,M,N;r.registerBinding(e,"mouseup",function(O){if(!(r.hoverData.which===1&&O.which!==1&&r.hoverData.capture)){var oe=r.hoverData.capture;if(oe){r.hoverData.capture=!1;var me=r.cy,we=r.projectIntoViewport(O.clientX,O.clientY),Ce=r.selection,qe=r.findNearestElement(we[0],we[1],!0,!1),Pe=r.dragData.possibleDragElements,Ge=r.hoverData.down,Fe=i(O);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var je=function(Mr){return{originalEvent:O,type:Mr,position:{x:we[0],y:we[1]}}};if(r.hoverData.which===3){var or=je("cxttapend");if(Ge?Ge.emit(or):me.emit(or),!r.hoverData.cxtDragged){var nr=je("cxttap");Ge?Ge.emit(nr):me.emit(nr)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(a(qe,["mouseup","tapend","vmouseup"],O,{x:we[0],y:we[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(Ge,["click","tap","vclick"],O,{x:we[0],y:we[1]}),M=!1,O.timeStamp-N<=me.multiClickDebounceTime()?(k&&clearTimeout(k),M=!0,N=null,a(Ge,["dblclick","dbltap","vdblclick"],O,{x:we[0],y:we[1]})):(k=setTimeout(function(){M||a(Ge,["oneclick","onetap","voneclick"],O,{x:we[0],y:we[1]})},me.multiClickDebounceTime()),N=O.timeStamp)),Ge==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(O)&&(me.$(t).unselect(["tapunselect"]),Pe.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Pe=me.collection()),qe==Ge&&!r.dragData.didDrag&&!r.hoverData.selecting&&qe!=null&&qe._private.selectable&&(r.hoverData.dragging||(me.selectionType()==="additive"||Fe?qe.selected()?qe.unselect(["tapunselect"]):qe.select(["tapselect"]):Fe||(me.$(t).unmerge(qe).unselect(["tapunselect"]),qe.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var We=me.collection(r.getAllInBox(Ce[0],Ce[1],Ce[2],Ce[3]));r.redrawHint("select",!0),We.length>0&&r.redrawHint("eles",!0),me.emit(je("boxend"));var ur=function(Mr){return Mr.selectable()&&!Mr.selected()};me.selectionType()==="additive"||Fe||me.$(t).unmerge(We).unselect(),We.emit(je("box")).stdFilter(ur).select().emit(je("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!Ce[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var ar=Ge&&Ge.grabbed();b(Pe),ar&&(Ge.emit(je("freeon")),Pe.emit(je("free")),r.dragData.didDrag&&(Ge.emit(je("dragfreeon")),Pe.emit(je("dragfree"))))}}Ce[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var z=[],$=4,q,V=1e5,Z=function(O,oe){for(var me=0;me<O.length;me++)if(O[me]%oe!==0)return!1;return!0},K=function(O){for(var oe=Math.abs(O[0]),me=1;me<O.length;me++)if(Math.abs(O[me])!==oe)return!1;return!0},j=function(O){var oe=!1,me=O.deltaY;if(me==null&&(O.wheelDeltaY!=null?me=O.wheelDeltaY/4:O.wheelDelta!=null&&(me=O.wheelDelta/4)),me!==0){if(q==null)if(z.length>=$){var we=z;if(q=Z(we,5),!q){var Ce=Math.abs(we[0]);q=K(we)&&Ce>5}if(q)for(var qe=0;qe<we.length;qe++)V=Math.min(Math.abs(we[qe]),V)}else z.push(me),oe=!0;else q&&(V=Math.min(Math.abs(me),V));if(!r.scrollingPage){var Pe=r.cy,Ge=Pe.zoom(),Fe=Pe.pan(),je=r.projectIntoViewport(O.clientX,O.clientY),or=[je[0]*Ge+Fe.x,je[1]*Ge+Fe.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||P()){O.preventDefault();return}if(Pe.panningEnabled()&&Pe.userPanningEnabled()&&Pe.zoomingEnabled()&&Pe.userZoomingEnabled()){O.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var nr;oe&&Math.abs(me)>5&&(me=Mm(me)*5),nr=me/-250,q&&(nr/=V,nr*=3),nr=nr*r.wheelSensitivity;var We=O.deltaMode===1;We&&(nr*=33);var ur=Pe.zoom()*Math.pow(10,nr);O.type==="gesturechange"&&(ur=r.gestureStartZoom*O.scale),Pe.zoom({level:ur,renderedPosition:{x:or[0],y:or[1]}}),Pe.emit({type:O.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:O,position:{x:je[0],y:je[1]}})}}}};r.registerBinding(r.container,"wheel",j,!0),r.registerBinding(e,"scroll",function(O){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(O){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||O.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(ye){r.hasTouchStarted||j(ye)},!0),r.registerBinding(r.container,"mouseout",function(O){var oe=r.projectIntoViewport(O.clientX,O.clientY);r.cy.emit({originalEvent:O,type:"mouseout",position:{x:oe[0],y:oe[1]}})},!1),r.registerBinding(r.container,"mouseover",function(O){var oe=r.projectIntoViewport(O.clientX,O.clientY);r.cy.emit({originalEvent:O,type:"mouseover",position:{x:oe[0],y:oe[1]}})},!1);var ee,le,W,G,Y,re,de,se,X,Q,ae,te,ce,_e=function(O,oe,me,we){return Math.sqrt((me-O)*(me-O)+(we-oe)*(we-oe))},ve=function(O,oe,me,we){return(me-O)*(me-O)+(we-oe)*(we-oe)},U;r.registerBinding(r.container,"touchstart",U=function(O){if(r.hasTouchStarted=!0,!!I(O)){x(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var oe=r.cy,me=r.touchData.now,we=r.touchData.earlier;if(O.touches[0]){var Ce=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);me[0]=Ce[0],me[1]=Ce[1]}if(O.touches[1]){var Ce=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);me[2]=Ce[0],me[3]=Ce[1]}if(O.touches[2]){var Ce=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);me[4]=Ce[0],me[5]=Ce[1]}var qe=function(Xr){return{originalEvent:O,type:Xr,position:{x:me[0],y:me[1]}}};if(O.touches[1]){r.touchData.singleTouchMoved=!0,b(r.dragData.touchDragEles);var Pe=r.findContainerClientCoords();X=Pe[0],Q=Pe[1],ae=Pe[2],te=Pe[3],ee=O.touches[0].clientX-X,le=O.touches[0].clientY-Q,W=O.touches[1].clientX-X,G=O.touches[1].clientY-Q,ce=0<=ee&&ee<=ae&&0<=W&&W<=ae&&0<=le&&le<=te&&0<=G&&G<=te;var Ge=oe.pan(),Fe=oe.zoom();Y=_e(ee,le,W,G),re=ve(ee,le,W,G),de=[(ee+W)/2,(le+G)/2],se=[(de[0]-Ge.x)/Fe,(de[1]-Ge.y)/Fe];var je=200,or=je*je;if(re<or&&!O.touches[2]){var nr=r.findNearestElement(me[0],me[1],!0,!0),We=r.findNearestElement(me[2],me[3],!0,!0);nr&&nr.isNode()?(nr.activate().emit(qe("cxttapstart")),r.touchData.start=nr):We&&We.isNode()?(We.activate().emit(qe("cxttapstart")),r.touchData.start=We):oe.emit(qe("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(O.touches[2])oe.boxSelectionEnabled()&&O.preventDefault();else if(!O.touches[1]){if(O.touches[0]){var ur=r.findNearestElements(me[0],me[1],!0,!0),ar=ur[0];if(ar!=null&&(ar.activate(),r.touchData.start=ar,r.touchData.starts=ur,r.nodeIsGrabbable(ar))){var Wr=r.dragData.touchDragEles=oe.collection(),Mr=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),ar.selected()?(Mr=oe.$(function(Nr){return Nr.selected()&&r.nodeIsGrabbable(Nr)}),E(Mr,{addToList:Wr})):y(ar,{addToList:Wr}),d(ar),ar.emit(qe("grabon")),Mr?Mr.forEach(function(Nr){Nr.emit(qe("grab"))}):ar.emit(qe("grab"))}a(ar,["touchstart","tapstart","vmousedown"],O,{x:me[0],y:me[1]}),ar==null&&(r.data.bgActivePosistion={x:Ce[0],y:Ce[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&a(r.touchData.start,["taphold"],O,{x:me[0],y:me[1]})},r.tapholdDuration)}}if(O.touches.length>=1){for(var lt=r.touchData.startPosition=[null,null,null,null,null,null],kr=0;kr<me.length;kr++)lt[kr]=we[kr]=me[kr];var Kr=O.touches[0];r.touchData.startGPosition=[Kr.clientX,Kr.clientY]}}},!1);var fe;r.registerBinding(e,"touchmove",fe=function(O){var oe=r.touchData.capture;if(!(!oe&&!I(O))){var me=r.selection,we=r.cy,Ce=r.touchData.now,qe=r.touchData.earlier,Pe=we.zoom();if(O.touches[0]){var Ge=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);Ce[0]=Ge[0],Ce[1]=Ge[1]}if(O.touches[1]){var Ge=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);Ce[2]=Ge[0],Ce[3]=Ge[1]}if(O.touches[2]){var Ge=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);Ce[4]=Ge[0],Ce[5]=Ge[1]}var Fe=function(wi){return{originalEvent:O,type:wi,position:{x:Ce[0],y:Ce[1]}}},je=r.touchData.startGPosition,or;if(oe&&O.touches[0]&&je){for(var nr=[],We=0;We<Ce.length;We++)nr[We]=Ce[We]-qe[We];var ur=O.touches[0].clientX-je[0],ar=ur*ur,Wr=O.touches[0].clientY-je[1],Mr=Wr*Wr,lt=ar+Mr;or=lt>=r.touchTapThreshold2}if(oe&&r.touchData.cxt){O.preventDefault();var kr=O.touches[0].clientX-X,Kr=O.touches[0].clientY-Q,Nr=O.touches[1].clientX-X,Xr=O.touches[1].clientY-Q,Cn=ve(kr,Kr,Nr,Xr),$r=Cn/re,dn=150,vn=dn*dn,ta=1.5,gi=ta*ta;if($r>=gi||Cn>=vn){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Ln=Fe("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(Ln),r.touchData.start=null):we.emit(Ln)}}if(oe&&r.touchData.cxt){var Ln=Fe("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(Ln):we.emit(Ln),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var ft=r.findNearestElement(Ce[0],Ce[1],!0,!0);(!r.touchData.cxtOver||ft!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(Fe("cxtdragout")),r.touchData.cxtOver=ft,ft&&ft.emit(Fe("cxtdragover")))}else if(oe&&O.touches[2]&&we.boxSelectionEnabled())O.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||we.emit(Fe("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,me[4]=1,!me||me.length===0||me[0]===void 0?(me[0]=(Ce[0]+Ce[2]+Ce[4])/3,me[1]=(Ce[1]+Ce[3]+Ce[5])/3,me[2]=(Ce[0]+Ce[2]+Ce[4])/3+1,me[3]=(Ce[1]+Ce[3]+Ce[5])/3+1):(me[2]=(Ce[0]+Ce[2]+Ce[4])/3,me[3]=(Ce[1]+Ce[3]+Ce[5])/3),r.redrawHint("select",!0),r.redraw();else if(oe&&O.touches[1]&&!r.touchData.didSelect&&we.zoomingEnabled()&&we.panningEnabled()&&we.userZoomingEnabled()&&we.userPanningEnabled()){O.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var at=r.dragData.touchDragEles;if(at){r.redrawHint("drag",!0);for(var bt=0;bt<at.length;bt++){var Na=at[bt]._private;Na.grabbed=!1,Na.rscratch.inDragLayer=!1}}var Mt=r.touchData.start,kr=O.touches[0].clientX-X,Kr=O.touches[0].clientY-Q,Nr=O.touches[1].clientX-X,Xr=O.touches[1].clientY-Q,Ts=_e(kr,Kr,Nr,Xr),Vl=Ts/Y;if(ce){var pi=kr-ee,Gl=Kr-le,yi=Nr-W,Wl=Xr-G,Ul=(pi+yi)/2,Hl=(Gl+Wl)/2,na=we.zoom(),mi=na*Vl,Fa=we.pan(),Rs=se[0]*na+Fa.x,As=se[1]*na+Fa.y,Kl={x:-mi/na*(Rs-Fa.x-Ul)+Rs,y:-mi/na*(As-Fa.y-Hl)+As};if(Mt&&Mt.active()){var at=r.dragData.touchDragEles;b(at),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Mt.unactivate().emit(Fe("freeon")),at.emit(Fe("free")),r.dragData.didDrag&&(Mt.emit(Fe("dragfreeon")),at.emit(Fe("dragfree")))}we.viewport({zoom:mi,pan:Kl,cancelOnFailedZoom:!0}),we.emit(Fe("pinchzoom")),Y=Ts,ee=kr,le=Kr,W=Nr,G=Xr,r.pinching=!0}if(O.touches[0]){var Ge=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);Ce[0]=Ge[0],Ce[1]=Ge[1]}if(O.touches[1]){var Ge=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);Ce[2]=Ge[0],Ce[3]=Ge[1]}if(O.touches[2]){var Ge=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);Ce[4]=Ge[0],Ce[5]=Ge[1]}}else if(O.touches[0]&&!r.touchData.didSelect){var Vt=r.touchData.start,bi=r.touchData.last,ft;if(!r.hoverData.draggingEles&&!r.swipePanning&&(ft=r.findNearestElement(Ce[0],Ce[1],!0,!0)),oe&&Vt!=null&&O.preventDefault(),oe&&Vt!=null&&r.nodeIsDraggable(Vt))if(or){var at=r.dragData.touchDragEles,ho=!r.dragData.didDrag;ho&&E(at,{inDragLayer:!0}),r.dragData.didDrag=!0;var aa={x:0,y:0};if(Me(nr[0])&&Me(nr[1])&&(aa.x+=nr[0],aa.y+=nr[1],ho)){r.redrawHint("eles",!0);var Tt=r.touchData.dragDelta;Tt&&Me(Tt[0])&&Me(Tt[1])&&(aa.x+=Tt[0],aa.y+=Tt[1])}r.hoverData.draggingEles=!0,at.silentShift(aa).emit(Fe("position")).emit(Fe("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==qe[0]&&r.touchData.startPosition[1]==qe[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Tt=r.touchData.dragDelta=r.touchData.dragDelta||[];Tt.length===0?(Tt.push(nr[0]),Tt.push(nr[1])):(Tt[0]+=nr[0],Tt[1]+=nr[1])}if(a(Vt||ft,["touchmove","tapdrag","vmousemove"],O,{x:Ce[0],y:Ce[1]}),(!Vt||!Vt.grabbed())&&ft!=bi&&(bi&&bi.emit(Fe("tapdragout")),ft&&ft.emit(Fe("tapdragover"))),r.touchData.last=ft,oe)for(var bt=0;bt<Ce.length;bt++)Ce[bt]&&r.touchData.startPosition[bt]&&or&&(r.touchData.singleTouchMoved=!0);if(oe&&(Vt==null||Vt.pannable())&&we.panningEnabled()&&we.userPanningEnabled()){var jl=o(Vt,r.touchData.starts);jl&&(O.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=Wi(r.touchData.startPosition)),r.swipePanning?(we.panBy({x:nr[0]*Pe,y:nr[1]*Pe}),we.emit(Fe("dragpan"))):or&&(r.swipePanning=!0,we.panBy({x:ur*Pe,y:Wr*Pe}),we.emit(Fe("dragpan")),Vt&&(Vt.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var Ge=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);Ce[0]=Ge[0],Ce[1]=Ge[1]}}for(var We=0;We<Ce.length;We++)qe[We]=Ce[We];oe&&O.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var xe;r.registerBinding(e,"touchcancel",xe=function(O){var oe=r.touchData.start;r.touchData.capture=!1,oe&&oe.unactivate()});var ge,be,Ae,De;if(r.registerBinding(e,"touchend",ge=function(O){var oe=r.touchData.start,me=r.touchData.capture;if(me)O.touches.length===0&&(r.touchData.capture=!1),O.preventDefault();else return;var we=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var Ce=r.cy,qe=Ce.zoom(),Pe=r.touchData.now,Ge=r.touchData.earlier;if(O.touches[0]){var Fe=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);Pe[0]=Fe[0],Pe[1]=Fe[1]}if(O.touches[1]){var Fe=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);Pe[2]=Fe[0],Pe[3]=Fe[1]}if(O.touches[2]){var Fe=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);Pe[4]=Fe[0],Pe[5]=Fe[1]}var je=function(vn){return{originalEvent:O,type:vn,position:{x:Pe[0],y:Pe[1]}}};oe&&oe.unactivate();var or;if(r.touchData.cxt){if(or=je("cxttapend"),oe?oe.emit(or):Ce.emit(or),!r.touchData.cxtDragged){var nr=je("cxttap");oe?oe.emit(nr):Ce.emit(nr)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!O.touches[2]&&Ce.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var We=Ce.collection(r.getAllInBox(we[0],we[1],we[2],we[3]));we[0]=void 0,we[1]=void 0,we[2]=void 0,we[3]=void 0,we[4]=0,r.redrawHint("select",!0),Ce.emit(je("boxend"));var ur=function(vn){return vn.selectable()&&!vn.selected()};We.emit(je("box")).stdFilter(ur).select().emit(je("boxselect")),We.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(oe!=null&&oe.unactivate(),O.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!O.touches[1]){if(!O.touches[0]){if(!O.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var ar=r.dragData.touchDragEles;if(oe!=null){var Wr=oe._private.grabbed;b(ar),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Wr&&(oe.emit(je("freeon")),ar.emit(je("free")),r.dragData.didDrag&&(oe.emit(je("dragfreeon")),ar.emit(je("dragfree")))),a(oe,["touchend","tapend","vmouseup","tapdragout"],O,{x:Pe[0],y:Pe[1]}),oe.unactivate(),r.touchData.start=null}else{var Mr=r.findNearestElement(Pe[0],Pe[1],!0,!0);a(Mr,["touchend","tapend","vmouseup","tapdragout"],O,{x:Pe[0],y:Pe[1]})}var lt=r.touchData.startPosition[0]-Pe[0],kr=lt*lt,Kr=r.touchData.startPosition[1]-Pe[1],Nr=Kr*Kr,Xr=kr+Nr,Cn=Xr*qe*qe;r.touchData.singleTouchMoved||(oe||Ce.$(":selected").unselect(["tapunselect"]),a(oe,["tap","vclick"],O,{x:Pe[0],y:Pe[1]}),be=!1,O.timeStamp-De<=Ce.multiClickDebounceTime()?(Ae&&clearTimeout(Ae),be=!0,De=null,a(oe,["dbltap","vdblclick"],O,{x:Pe[0],y:Pe[1]})):(Ae=setTimeout(function(){be||a(oe,["onetap","voneclick"],O,{x:Pe[0],y:Pe[1]})},Ce.multiClickDebounceTime()),De=O.timeStamp)),oe!=null&&!r.dragData.didDrag&&oe._private.selectable&&Cn<r.touchTapThreshold2&&!r.pinching&&(Ce.selectionType()==="single"?(Ce.$(t).unmerge(oe).unselect(["tapunselect"]),oe.select(["tapselect"])):oe.selected()?oe.unselect(["tapunselect"]):oe.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var $r=0;$r<Pe.length;$r++)Ge[$r]=Pe[$r];r.dragData.didDrag=!1,O.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),O.touches.length<2&&(O.touches.length===1&&(r.touchData.startGPosition=[O.touches[0].clientX,O.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent>"u"){var Be=[],Le=function(O){return{clientX:O.clientX,clientY:O.clientY,force:1,identifier:O.pointerId,pageX:O.pageX,pageY:O.pageY,radiusX:O.width/2,radiusY:O.height/2,screenX:O.screenX,screenY:O.screenY,target:O.target}},He=function(O){return{event:O,touch:Le(O)}},Ve=function(O){Be.push(He(O))},Xe=function(O){for(var oe=0;oe<Be.length;oe++){var me=Be[oe];if(me.event.pointerId===O.pointerId){Be.splice(oe,1);return}}},er=function(O){var oe=Be.filter(function(me){return me.event.pointerId===O.pointerId})[0];oe.event=O,oe.touch=Le(O)},$e=function(O){O.touches=Be.map(function(oe){return oe.touch})},ke=function(O){return O.pointerType==="mouse"||O.pointerType===4};r.registerBinding(r.container,"pointerdown",function(ye){ke(ye)||(ye.preventDefault(),Ve(ye),$e(ye),U(ye))}),r.registerBinding(r.container,"pointerup",function(ye){ke(ye)||(Xe(ye),$e(ye),ge(ye))}),r.registerBinding(r.container,"pointercancel",function(ye){ke(ye)||(Xe(ye),$e(ye),xe(ye))}),r.registerBinding(r.container,"pointermove",function(ye){ke(ye)||(ye.preventDefault(),er(ye),$e(ye),fe(ye))})}};var Qn={};Qn.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,a,i,o,s,l){this.renderer.nodeShapeImpl("polygon",n,a,i,o,s,this.points)},intersectLine:function(n,a,i,o,s,l,u,c){return es(s,l,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,s,l,u,c){return Zn(n,a,this.points,l,u,o,s,[0,-1],i)},hasMiterBounds:r!=="rectangle",miterBounds:function(n,a,i,o,s,l){return HN(this.points,n,a,i,o,s)}}};Qn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,l){return eF(i,o,e,t,n/2+s,a/2+s)},checkPoint:function(e,t,n,a,i,o,s,l){return ti(e,t,a,i,o,s,n)}}};Qn.generateRoundPolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,a,i,o,s,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===a)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=a;var c=i/2,d=o/2;s=s==="auto"?CR(i,o):s;for(var h=new Array(e.length/2),g=0;g<e.length/2;g++)h[g]={x:n+c*e[g*2],y:a+d*e[g*2+1]};var p,E,y,b,w=h.length;for(E=h[w-1],p=0;p<w;p++)y=h[p%w],b=h[(p+1)%w],l[u][p]=Hm(E,y,b,s),E=y,y=b;return l[u]},draw:function(n,a,i,o,s,l,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,s,this.points,this.getOrCreateCorners(a,i,o,s,l,u,"drawCorners"))},intersectLine:function(n,a,i,o,s,l,u,c,d){return tF(s,l,this.points,n,a,i,o,u,this.getOrCreateCorners(n,a,i,o,c,d,"corners"))},checkPoint:function(n,a,i,o,s,l,u,c,d){return JN(n,a,this.points,l,u,o,s,this.getOrCreateCorners(l,u,o,s,c,d,"corners"))}}};Qn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,l){return xR(i,o,e,t,n,a,s,l)},checkPoint:function(e,t,n,a,i,o,s,l){var u=a/2,c=i/2;l=l==="auto"?Sa(a,i):l,l=Math.min(u,c,l);var d=l*2;return!!(Zn(e,t,this.points,o,s,a,i-d,[0,-1],n)||Zn(e,t,this.points,o,s,a-d,i,[0,-1],n)||ti(e,t,d,d,o-u+l,s-c+l,n)||ti(e,t,d,d,o+u-l,s-c+l,n)||ti(e,t,d,d,o+u-l,s+c-l,n)||ti(e,t,d,d,o-u+l,s+c-l,n))}}};Qn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Om(),points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,null,o)},generateCutTrianglePts:function(e,t,n,a,i){var o=i==="auto"?this.cornerLength:i,s=t/2,l=e/2,u=n-l,c=n+l,d=a-s,h=a+s;return{topLeft:[u,d+o,u+o,d,u+o,d+o],topRight:[c-o,d,c,d+o,c-o,d+o],bottomRight:[c,h-o,c-o,h,c-o,h-o],bottomLeft:[u+o,h,u,h-o,u+o,h-o]}},intersectLine:function(e,t,n,a,i,o,s,l){var u=this.generateCutTrianglePts(n+2*s,a+2*s,e,t,l),c=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return es(i,o,c,e,t)},checkPoint:function(e,t,n,a,i,o,s,l){var u=l==="auto"?this.cornerLength:l;if(Zn(e,t,this.points,o,s,a,i-2*u,[0,-1],n)||Zn(e,t,this.points,o,s,a-2*u,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,o,s);return Ft(e,t,c.topLeft)||Ft(e,t,c.topRight)||Ft(e,t,c.bottomRight)||Ft(e,t,c.bottomLeft)}}};Qn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,l){var u=.15,c=.5,d=.85,h=this.generateBarrelBezierPts(n+2*s,a+2*s,e,t),g=function(y){var b=ji({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),w=ji({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},c),x=ji({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d);return[y[0],y[1],b.x,b.y,w.x,w.y,x.x,x.y,y[4],y[5]]},p=[].concat(g(h.topLeft),g(h.topRight),g(h.bottomRight),g(h.bottomLeft));return es(i,o,p,e,t)},generateBarrelBezierPts:function(e,t,n,a){var i=t/2,o=e/2,s=n-o,l=n+o,u=a-i,c=a+i,d=om(e,t),h=d.heightOffset,g=d.widthOffset,p=d.ctrlPtOffsetPct*e,E={topLeft:[s,u+h,s+p,u,s+g,u],topRight:[l-g,u,l-p,u,l,u+h],bottomRight:[l,c-h,l-p,c,l-g,c],bottomLeft:[s+g,c,s+p,c,s,c-h]};return E.topLeft.isTop=!0,E.topRight.isTop=!0,E.bottomLeft.isBottom=!0,E.bottomRight.isBottom=!0,E},checkPoint:function(e,t,n,a,i,o,s,l){var u=om(a,i),c=u.heightOffset,d=u.widthOffset;if(Zn(e,t,this.points,o,s,a,i-2*c,[0,-1],n)||Zn(e,t,this.points,o,s,a-2*d,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,s),g=function(A,P,I){var D=I[4],k=I[2],M=I[0],N=I[5],z=I[1],$=Math.min(D,M),q=Math.max(D,M),V=Math.min(N,z),Z=Math.max(N,z);if($<=A&&A<=q&&V<=P&&P<=Z){var K=nF(D,k,M),j=YN(K[0],K[1],K[2],A),ee=j.filter(function(le){return 0<=le&&le<=1});if(ee.length>0)return ee[0]}return null},p=Object.keys(h),E=0;E<p.length;E++){var y=p[E],b=h[y],w=g(e,t,b);if(w!=null){var x=b[5],C=b[3],T=b[1],S=ot(x,C,T,w);if(b.isTop&&S<=t||b.isBottom&&t<=S)return!0}}return!1}}};Qn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,l){var u=e-(n/2+s),c=t-(a/2+s),d=c,h=e+(n/2+s),g=ba(i,o,e,t,u,c,h,d,!1);return g.length>0?g:xR(i,o,e,t,n,a,s,l)},checkPoint:function(e,t,n,a,i,o,s,l){l=l==="auto"?Sa(a,i):l;var u=2*l;if(Zn(e,t,this.points,o,s,a,i-u,[0,-1],n)||Zn(e,t,this.points,o,s,a-u,i,[0,-1],n))return!0;var c=a/2+2*n,d=i/2+2*n,h=[o-c,s-d,o-c,s,o+c,s,o+c,s-d];return!!(Ft(e,t,h)||ti(e,t,u,u,o+a/2-l,s+i/2-l,n)||ti(e,t,u,u,o-a/2+l,s+i/2-l,n))}}};Qn.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",It(3,0)),this.generateRoundPolygon("round-triangle",It(3,0)),this.generatePolygon("rectangle",It(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",It(5,0)),this.generateRoundPolygon("round-pentagon",It(5,0)),this.generatePolygon("hexagon",It(6,0)),this.generateRoundPolygon("round-hexagon",It(6,0)),this.generatePolygon("heptagon",It(7,0)),this.generateRoundPolygon("round-heptagon",It(7,0)),this.generatePolygon("octagon",It(8,0)),this.generateRoundPolygon("round-octagon",It(8,0));var n=new Array(20);{var a=im(5,0),i=im(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)n[s*4]=a[s*2],n[s*4+1]=a[s*2+1],n[s*4+2]=i[s*2],n[s*4+3]=i[s*2+1]}n=ER(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}r.makePolygon=function(u){var c=u.join("$"),d="polygon-"+c,h;return(h=this[d])?h:e.generatePolygon(d,u)}};var bs={};bs.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};bs.redraw=function(r){r=r||yR();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r};bs.beforeRender=function(r,e){if(!this.destroyed){e==null&&Lr("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(n,a){return a.priority-n.priority})}};var Yx=function(e,t,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(t,n)};bs.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function(a){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){Yx(r,!0,a);var i=Yn();r.render(r.renderOptions);var o=r.lastDrawTime=Yn();r.averageRedrawTime===void 0&&(r.averageRedrawTime=o-i),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var s=o-i;r.redrawTotalTime+=s,r.lastRedrawTime=s,r.averageRedrawTime=r.averageRedrawTime/2+s/2,r.requestedFrame=!1}else Yx(r,!1,a);r.skipFrame=!1,Uu(t)}};Uu(t)}};var b$=function(e){this.init(e)},CA=b$,so=CA.prototype;so.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];so.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",l=a.getElementById(o)!=null;if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!l){var u=a.createElement("style");u.id=o,u.textContent="."+s+" { position: relative; }",i.insertBefore(u,i.children[0])}var c=n.getComputedStyle(t),d=c.getPropertyValue("position");d==="static"&&Er("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=r.showFps,e.debug=r.debug,e.webgl=r.webgl,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=Me(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};so.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&n.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),r==="gc"&&t.redrawHint("gc",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};so.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],n=t,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}};so.isHeadless=function(){return!1};[Um,xA,EA,oo,Qn,bs].forEach(function(r){Ye(so,r)});var Pd=1e3/60,_A={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=hs(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,c){var d=Yn(),h=a.averageRedrawTime,g=a.lastRedrawTime,p=[],E=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var b=Yn(),w=b-d,x=b-c;if(g<Pd){var C=Pd-(u?h:0);if(x>=e.deqFastCost*C)break}else if(u){if(w>=e.deqCost*g||w>=e.deqAvgCost*h)break}else if(x>=e.deqNoDrawCost*Pd)break;var T=e.deq(n,y,E);if(T.length>0)for(var S=0;S<T.length;S++)p.push(T[S]);else break}p.length>0&&(e.onDeqd(n,p),!u&&e.shouldRedraw(n,p,y,E)&&i())},s=e.priority||Im;a.beforeRender(o,s(n))}}}},w$=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hu;Ba(this,r),this.idsByKey=new jn,this.keyForId=new jn,this.cachesByLvl=new jn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return Ma(r,[{key:"getIdsFor",value:function(t){t==null&&Lr("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(t);return a||(a=new to,n.set(t,a)),a}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n),i=this.getKey(t);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),a=this.keyForId.get(n),i=this.getKey(t);return a!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,a=this.lvls,i=n.get(t);return i||(i=new jn,n.set(t,i),a.push(t)),i}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var a=this.getKey(t),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,n){var a=this.keyForId.get(t.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var a=this.getKey(t);return this.hasCache(a,n)}},{key:"setCache",value:function(t,n,a){a.key=t,this.getCachesAt(n).set(t,a)}},{key:"set",value:function(t,n,a){var i=this.getKey(t);this.setCache(i,n,a),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var a=this.getKey(t);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(a){return n.deleteCache(t,a)})}},{key:"invalidate",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}])})(),Zx=25,Tu=50,Nu=-4,bm=3,SA=7.99,x$=8,E$=1024,C$=1024,_$=1024,S$=.2,T$=.8,R$=10,A$=.15,P$=.1,I$=.9,D$=.9,B$=100,M$=1,Hi={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},k$=yt({getKey:null,doesEleInvalidateKey:Hu,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:hR,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Fo=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var a=k$(t);Ye(n,a),n.lookup=new w$(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},nt=Fo.prototype;nt.reasons=Hi;nt.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};nt.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=t[r]=t[r]||[];return n};nt.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new gs(function(t,n){return n.reqs-t.reqs});return e};nt.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};nt.getElement=function(r,e,t,n,a){var i=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(n==null&&(n=Math.ceil(Bm(s*t))),n<Nu)n=Nu;else if(s>=SA||n>bm)return null;var u=Math.pow(2,n),c=e.h*u,d=e.w*u,h=o.eleTextBiggerThanMin(r,u);if(!this.isVisible(r,h))return null;var g=l.get(r,n);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;var p;if(c<=Zx?p=Zx:c<=Tu?p=Tu:p=Math.ceil(c/Tu)*Tu,c>_$||d>C$)return null;var E=i.getTextureQueue(p),y=E[E.length-2],b=function(){return i.recycleTexture(p,d)||i.addTexture(p,d)};y||(y=E[E.length-1]),y||(y=b()),y.width-y.usedWidth<d&&(y=b());for(var w=function($){return $&&$.scaledLabelShown===h},x=a&&a===Hi.dequeue,C=a&&a===Hi.highQuality,T=a&&a===Hi.downscale,S,_=n+1;_<=bm;_++){var A=l.get(r,_);if(A){S=A;break}}var P=S&&S.level===n+1?S:null,I=function(){y.context.drawImage(P.texture.canvas,P.x,0,P.width,P.height,y.usedWidth,0,d,c)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,d,p),w(P))I();else if(w(S))if(C){for(var D=S.level;D>n;D--)P=i.getElement(r,e,t,D,Hi.downscale);I()}else return i.queueElement(r,S.level-1),S;else{var k;if(!x&&!C&&!T)for(var M=n-1;M>=Nu;M--){var N=l.get(r,M);if(N){k=N;break}}if(w(k))return i.queueElement(r,n),k;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,r,e,h,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return g={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:c,scaledLabelShown:h},y.usedWidth+=Math.ceil(d+x$),y.eleCaches.push(g),l.set(r,n,g),i.checkTextureFullness(y),g};nt.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])};nt.invalidateElement=function(r){var e=this,t=e.lookup,n=[],a=t.isInvalid(r);if(a){for(var i=Nu;i<=bm;i++){var o=t.getForCachedKey(r,i);o&&n.push(o)}var s=t.invalidate(r);if(s)for(var l=0;l<n.length;l++){var u=n[l],c=u.texture;c.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(c)}e.removeFromQueue(r)}};nt.checkTextureUtility=function(r){r.invalidatedWidth>=S$*r.width&&this.retireTexture(r)};nt.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>T$&&r.fullnessChecks>=R$?_a(t,r):r.fullnessChecks++};nt.retireTexture=function(r){var e=this,t=r.height,n=e.getTextureQueue(t),a=this.lookup;_a(n,r),r.retired=!0;for(var i=r.eleCaches,o=0;o<i.length;o++){var s=i[o];a.deleteCache(s.key,s.level)}Dm(i);var l=e.getRetiredTextureQueue(t);l.push(r)};nt.addTexture=function(r,e){var t=this,n=t.getTextureQueue(r),a={};return n.push(a),a.eleCaches=[],a.height=r,a.width=Math.max(E$,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=t.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};nt.recycleTexture=function(r,e){for(var t=this,n=t.getTextureQueue(r),a=t.getRetiredTextureQueue(r),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Dm(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),_a(a,o),n.push(o),o}};nt.queueElement=function(r,e){var t=this,n=t.getElementQueue(),a=t.getElementKeyToQueue(),i=this.getKey(r),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(r),o.reqs++,n.updateItem(o);else{var s={eles:r.spawn().merge(r),level:e,reqs:1,key:i};n.push(s),a[i]=s}};nt.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<M$&&t.size()>0;o++){var s=t.pop(),l=s.key,u=s.eles[0],c=i.hasCache(u,s.level);if(n[l]=null,c)continue;a.push(s);var d=e.getBoundingBox(u);e.getElement(u,d,r,s.level,Hi.dequeue)}return a};nt.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(r),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=Pm,t.updateItem(i),t.pop(),n[a]=null):i.eles.unmerge(r))};nt.onDequeue=function(r){this.onDequeues.push(r)};nt.offDequeue=function(r){_a(this.onDequeues,r)};nt.setupDequeueing=_A.setupDequeueing({deqRedrawThreshold:B$,deqCost:A$,deqAvgCost:P$,deqNoDrawCost:I$,deqFastCost:D$,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(t)}},shouldRedraw:function(e,t,n,a){for(var i=0;i<t.length;i++)for(var o=t[i].eles,s=0;s<o.length;s++){var l=o[s].boundingBox();if(km(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var O$=1,Ho=-4,el=2,L$=3.99,q$=50,N$=50,F$=.15,z$=.1,$$=.9,V$=.9,G$=1,Xx=250,W$=4e3*4e3,Qx=32767,U$=!0,TA=function(e){var t=this,n=t.renderer=e,a=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Yn()-2*Xx,t.skipping=!1,t.eleTxrDeqs=a.collection(),t.scheduleElementRefinement=hs(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},N$),n.beforeRender(function(o,s){s-t.lastInvalidationTime<=Xx?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(s,l){return l.reqs-s.reqs};t.layersQueue=new gs(i),t.setupDequeueing()},mt=TA.prototype,Jx=0,H$=Math.pow(2,53)-1;mt.makeLayer=function(r,e){var t=Math.pow(2,e),n=Math.ceil(r.w*t),a=Math.ceil(r.h*t),i=this.renderer.makeOffscreenCanvas(n,a),o={id:Jx=++Jx%H$,bb:r,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,l=-o.bb.x1,u=-o.bb.y1;return s.scale(t,t),s.translate(l,u),o};mt.getLayers=function(r,e,t){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),s=n.firstGet;if(n.firstGet=!1,t==null){if(t=Math.ceil(Bm(o*e)),t<Ho)t=Ho;else if(o>=L$||t>el)return null}n.validateLayersElesOrdering(t,r);var l=n.layersByLevel,u=Math.pow(2,t),c=l[t]=l[t]||[],d,h=n.levelIsComplete(t,r),g,p=function(){var I=function(z){if(n.validateLayersElesOrdering(z,r),n.levelIsComplete(z,r))return g=l[z],!0},D=function(z){if(!g)for(var $=t+z;Ho<=$&&$<=el&&!I($);$+=z);};D(1),D(-1);for(var k=c.length-1;k>=0;k--){var M=c[k];M.invalid&&_a(c,M)}};if(!h)p();else return c;var E=function(){if(!d){d=Dt();for(var I=0;I<r.length;I++)GN(d,r[I].boundingBox())}return d},y=function(I){I=I||{};var D=I.after;E();var k=Math.ceil(d.w*u),M=Math.ceil(d.h*u);if(k>Qx||M>Qx)return null;var N=k*M;if(N>W$)return null;var z=n.makeLayer(d,t);if(D!=null){var $=c.indexOf(D)+1;c.splice($,0,z)}else(I.insert===void 0||I.insert)&&c.unshift(z);return z};if(n.skipping&&!s)return null;for(var b=null,w=r.length/O$,x=!s,C=0;C<r.length;C++){var T=r[C],S=T._private.rscratch,_=S.imgLayerCaches=S.imgLayerCaches||{},A=_[t];if(A){b=A;continue}if((!b||b.eles.length>=w||!wR(b.bb,T.boundingBox()))&&(b=y({insert:!0,after:b}),!b))return null;g||x?n.queueLayer(b,T):n.drawEleInLayer(b,T,t,e),b.eles.push(T),_[t]=b}return g||(x?null:c)};mt.getEleLevelForLayerLevel=function(r,e){return r};mt.drawEleInLayer=function(r,e,t,n){var a=this,i=this.renderer,o=r.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(t=a.getEleLevelForLayerLevel(t,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,t,U$),i.setImgSmoothing(o,!0))};mt.levelIsComplete=function(r,e){var t=this,n=t.layersByLevel[r];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length};mt.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var n=0;n<t.length;n++){for(var a=t[n],i=-1,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var s=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[s+o]){this.invalidateLayer(a);break}}};mt.updateElementsInLayers=function(r,e){for(var t=this,n=fs(r[0]),a=0;a<r.length;a++)for(var i=n?null:r[a],o=n?r[a]:r[a].ele,s=o._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=Ho;u<=el;u++){var c=l[u];c&&(i&&t.getEleLevelForLayerLevel(c.level)!==i.level||e(c,o,i))}};mt.haveLayers=function(){for(var r=this,e=!1,t=Ho;t<=el;t++){var n=r.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e};mt.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Yn(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(n,a,i){e.invalidateLayer(n)}))};mt.invalidateLayer=function(r){if(this.lastInvalidationTime=Yn(),!r.invalid){var e=r.level,t=r.eles,n=this.layersByLevel[e];_a(n,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var a=0;a<t.length;a++){var i=t[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};mt.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};mt.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()};mt.queueLayer=function(r,e){var t=this,n=t.layersQueue,a=r.elesQueue,i=a.hasId=a.hasId||{};if(!r.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}r.reqs?(r.reqs++,n.updateItem(r)):(r.reqs=1,n.push(r))}};mt.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],a=0;a<G$&&t.size()!==0;){var i=t.peek();if(i.replacement){t.pop();continue}if(i.replaces&&i!==i.replaces.replacement){t.pop();continue}if(i.invalid){t.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,r),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n};mt.applyLayerReplacement=function(r){var e=this,t=e.layersByLevel[r.level],n=r.replaces,a=t.indexOf(n);if(!(a<0||n.invalid)){t[a]=r;for(var i=0;i<r.eles.length;i++){var o=r.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[r.level]=r)}e.requestRedraw()}};mt.requestRedraw=hs(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);mt.setupDequeueing=_A.setupDequeueing({deqRedrawThreshold:q$,deqCost:F$,deqAvgCost:z$,deqNoDrawCost:$$,deqFastCost:V$,deq:function(e,t){return e.dequeue(t)},onDeqd:Im,shouldRedraw:hR,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var RA={},eE;function K$(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function j$(r,e,t){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function rE(r,e,t){r.beginPath&&r.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];r.lineTo(i.x,i.y)}var o=t,s=t[0];r.moveTo(s.x,s.y);for(var a=1;a<o.length;a++){var i=o[a];r.lineTo(i.x,i.y)}r.closePath&&r.closePath()}function Y$(r,e,t,n,a){r.beginPath&&r.beginPath(),r.arc(t,n,a,0,Math.PI*2,!1);var i=e,o=i[0];r.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var l=i[s];r.lineTo(l.x,l.y)}r.closePath&&r.closePath()}function Z$(r,e,t,n){r.arc(e,t,n,0,Math.PI*2,!1)}RA.arrowShapeImpl=function(r){return(eE||(eE={polygon:K$,"triangle-backcurve":j$,"triangle-tee":rE,"circle-triangle":Y$,"triangle-cross":rE,circle:Z$}))[r]};var kn={};kn.drawElement=function(r,e,t,n,a,i){var o=this;e.isNode()?o.drawNode(r,e,t,n,a,i):o.drawEdge(r,e,t,n,a,i)};kn.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};kn.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};kn.drawCachedElementPortion=function(r,e,t,n,a,i,o,s){var l=this,u=t.getBoundingBox(e);if(!(u.w===0||u.h===0)){var c=t.getElement(e,u,n,a,i);if(c!=null){var d=s(l,e);if(d===0)return;var h=o(l,e),g=u.x1,p=u.y1,E=u.w,y=u.h,b,w,x,C,T;if(h!==0){var S=t.getRotationPoint(e);x=S.x,C=S.y,r.translate(x,C),r.rotate(h),T=l.getImgSmoothing(r),T||l.setImgSmoothing(r,!0);var _=t.getRotationOffset(e);b=_.x,w=_.y}else b=g,w=p;var A;d!==1&&(A=r.globalAlpha,r.globalAlpha=A*d),r.drawImage(c.texture.canvas,c.x,0,c.width,c.height,b,w,E,y),d!==1&&(r.globalAlpha=A),h!==0&&(r.rotate(-h),r.translate(-x,-C),T||l.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var X$=function(){return 0},Q$=function(e,t){return e.getTextAngle(t,null)},J$=function(e,t){return e.getTextAngle(t,"source")},e3=function(e,t){return e.getTextAngle(t,"target")},r3=function(e,t){return t.effectiveOpacity()},Id=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};kn.drawCachedElement=function(r,e,t,n,a,i){var o=this,s=o.data,l=s.eleTxrCache,u=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,h=e.boundingBox(),g=i===!0?l.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||km(h,n))){var p=e.isEdge(),E=e.element()._private.rscratch.badLine;o.drawElementUnderlay(r,e),o.drawCachedElementPortion(r,e,l,t,a,g,X$,r3),(!p||!E)&&o.drawCachedElementPortion(r,e,u,t,a,g,Q$,Id),p&&!E&&(o.drawCachedElementPortion(r,e,c,t,a,g,J$,Id),o.drawCachedElementPortion(r,e,d,t,a,g,e3,Id)),o.drawElementOverlay(r,e)}};kn.drawElements=function(r,e){for(var t=this,n=0;n<e.length;n++){var a=e[n];t.drawElement(r,a)}};kn.drawCachedElements=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(r,o,t,n)}};kn.drawCachedNodes=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(r,o,t,n)}};kn.drawLayeredElements=function(r,e,t,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,t);if(i)for(var o=0;o<i.length;o++){var s=i[o],l=s.bb;l.w===0||l.h===0||r.drawImage(s.canvas,l.x1,l.y1,l.w,l.h)}else a.drawCachedElements(r,e,t,n)};var Jn={};Jn.drawEdge=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var l;t&&(l=t,r.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,c=i?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,E=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,b=u*c,w=u*c,x=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;d==="straight-triangle"?(o.eleStrokeStyle(r,e,z),o.drawEdgeTrianglePath(e,r,s.allpts)):(r.lineWidth=g,r.lineCap=p,o.eleStrokeStyle(r,e,z),o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},C=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;if(r.lineWidth=g+E,r.lineCap=p,E>0)o.colorStrokeStyle(r,y[0],y[1],y[2],z);else{r.lineCap="butt";return}d==="straight-triangle"?o.drawEdgeTrianglePath(e,r,s.allpts):(o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},T=function(){a&&o.drawEdgeOverlay(r,e)},S=function(){a&&o.drawEdgeUnderlay(r,e)},_=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;o.drawArrowheads(r,e,z)},A=function(){o.drawElementText(r,e,null,n)};r.lineJoin="round";var P=e.pstyle("ghost").value==="yes";if(P){var I=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,k=e.pstyle("ghost-opacity").value,M=b*k;r.translate(I,D),x(M),_(M),r.translate(-I,-D)}else C();S(),x(),_(),T(),A(),t&&r.translate(l.x1,l.y1)}};var AA=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,o=i.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,c=n.pstyle("".concat(e,"-color")).value;t.lineWidth=u,s.edgeType==="self"&&!o?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,c[0],c[1],c[2],a),i.drawEdgePath(n,t,s.allpts,"solid")}}}};Jn.drawEdgeOverlay=AA("overlay");Jn.drawEdgeUnderlay=AA("underlay");Jn.drawEdgePath=function(r,e,t,n){var a=r._private.rscratch,i=e,o,s=!1,l=this.usePaths(),u=r.pstyle("line-dash-pattern").pfValue,c=r.pstyle("line-dash-offset").pfValue;if(l){var d=t.join("$"),h=a.pathCacheKey&&a.pathCacheKey===d;h?(o=e=a.pathCache,s=!0):(o=e=new Path2D,a.pathCacheKey=d,a.pathCache=o)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=c;break;case"solid":i.setLineDash([]);break}if(!s&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var g=2;g+3<t.length;g+=4)e.quadraticCurveTo(t[g],t[g+1],t[g+2],t[g+3]);break;case"straight":case"haystack":for(var p=2;p+1<t.length;p+=2)e.lineTo(t[p],t[p+1]);break;case"segments":if(a.isRound){var E=zt(a.roundCorners),y;try{for(E.s();!(y=E.n()).done;){var b=y.value;pA(e,b)}}catch(x){E.e(x)}finally{E.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var w=2;w+1<t.length;w+=2)e.lineTo(t[w],t[w+1]);break}e=i,l?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};Jn.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var n=r.pstyle("width").pfValue,a=0;a+1<t.length;a+=2){var i=[t[a+2]-t[a],t[a+3]-t[a+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],l=[s[0]*n/2,s[1]*n/2];e.beginPath(),e.moveTo(t[a]-l[0],t[a+1]-l[1]),e.lineTo(t[a]+l[0],t[a+1]+l[1]),e.lineTo(t[a+2],t[a+3]),e.closePath(),e.fill()}};Jn.drawArrowheads=function(r,e,t){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(r,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,t),a||this.drawArrowhead(r,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,t)};Jn.drawArrowhead=function(r,e,t,n,a,i,o){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var s=this,l=e.pstyle(t+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",c=e.pstyle(t+"-arrow-fill").value,d=e.pstyle("width").pfValue,h=e.pstyle(t+"-arrow-width"),g=h.value==="match-line"?d:h.pfValue;h.units==="%"&&(g*=d);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var E=r.globalCompositeOperation;(o!==1||c==="hollow")&&(r.globalCompositeOperation="destination-out",s.colorFillStyle(r,255,255,255,1),s.colorStrokeStyle(r,255,255,255,1),s.drawArrowShape(e,r,u,d,l,g,n,a,i),r.globalCompositeOperation=E);var y=e.pstyle(t+"-arrow-color").value;s.colorFillStyle(r,y[0],y[1],y[2],o),s.colorStrokeStyle(r,y[0],y[1],y[2],o),s.drawArrowShape(e,r,c,d,l,g,n,a,i)}}};Jn.drawArrowShape=function(r,e,t,n,a,i,o,s,l){var u=this,c=this.usePaths()&&a!=="triangle-cross",d=!1,h,g=e,p={x:o,y:s},E=r.pstyle("arrow-scale").value,y=this.getArrowWidth(n,E),b=u.arrowShapes[a];if(c){var w=u.arrowPathCache=u.arrowPathCache||[],x=ai(a),C=w[x];C!=null?(h=e=C,d=!0):(h=e=new Path2D,w[x]=h)}d||(e.beginPath&&e.beginPath(),c?b.draw(e,1,0,{x:0,y:0},1):b.draw(e,y,l,p,n),e.closePath&&e.closePath()),e=g,c&&(e.translate(o,s),e.rotate(l),e.scale(y,y)),(t==="filled"||t==="both")&&(c?e.fill(h):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=i/(c?y:1),e.lineJoin="miter",c?e.stroke(h):e.stroke()),c&&(e.scale(1/y,1/y),e.rotate(-l),e.translate(-o,-s))};var jm={};jm.safeDrawImage=function(r,e,t,n,a,i,o,s,l,u){if(!(a<=0||i<=0||l<=0||u<=0))try{r.drawImage(e,t,n,a,i,o,s,l,u)}catch(c){Er(c)}};jm.drawInscribedImage=function(r,e,t,n,a){var i=this,o=t.position(),s=o.x,l=o.y,u=t.cy().style(),c=u.getIndexedStyle.bind(u),d=c(t,"background-fit","value",n),h=c(t,"background-repeat","value",n),g=t.width(),p=t.height(),E=t.padding()*2,y=g+(c(t,"background-width-relative-to","value",n)==="inner"?0:E),b=p+(c(t,"background-height-relative-to","value",n)==="inner"?0:E),w=t._private.rscratch,x=c(t,"background-clip","value",n),C=x==="node",T=c(t,"background-image-opacity","value",n)*a,S=c(t,"background-image-smoothing","value",n),_=t.pstyle("corner-radius").value;_!=="auto"&&(_=t.pstyle("corner-radius").pfValue);var A=e.width||e.cachedW,P=e.height||e.cachedH;(A==null||P==null)&&(document.body.appendChild(e),A=e.cachedW=e.width||e.offsetWidth,P=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var I=A,D=P;if(c(t,"background-width","value",n)!=="auto"&&(c(t,"background-width","units",n)==="%"?I=c(t,"background-width","pfValue",n)*y:I=c(t,"background-width","pfValue",n)),c(t,"background-height","value",n)!=="auto"&&(c(t,"background-height","units",n)==="%"?D=c(t,"background-height","pfValue",n)*b:D=c(t,"background-height","pfValue",n)),!(I===0||D===0)){if(d==="contain"){var k=Math.min(y/I,b/D);I*=k,D*=k}else if(d==="cover"){var k=Math.max(y/I,b/D);I*=k,D*=k}var M=s-y/2,N=c(t,"background-position-x","units",n),z=c(t,"background-position-x","pfValue",n);N==="%"?M+=(y-I)*z:M+=z;var $=c(t,"background-offset-x","units",n),q=c(t,"background-offset-x","pfValue",n);$==="%"?M+=(y-I)*q:M+=q;var V=l-b/2,Z=c(t,"background-position-y","units",n),K=c(t,"background-position-y","pfValue",n);Z==="%"?V+=(b-D)*K:V+=K;var j=c(t,"background-offset-y","units",n),ee=c(t,"background-offset-y","pfValue",n);j==="%"?V+=(b-D)*ee:V+=ee,w.pathCache&&(M-=s,V-=l,s=0,l=0);var le=r.globalAlpha;r.globalAlpha=T;var W=i.getImgSmoothing(r),G=!1;if(S==="no"&&W?(i.setImgSmoothing(r,!1),G=!0):S==="yes"&&!W&&(i.setImgSmoothing(r,!0),G=!0),h==="no-repeat")C&&(r.save(),w.pathCache?r.clip(w.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,s,l,y,b,_,w),r.clip())),i.safeDrawImage(r,e,0,0,A,P,M,V,I,D),C&&r.restore();else{var Y=r.createPattern(e,h);r.fillStyle=Y,i.nodeShapes[i.getNodeShape(t)].draw(r,s,l,y,b,_,w),r.translate(M,V),r.fill(),r.translate(-M,-V)}r.globalAlpha=le,G&&i.setImgSmoothing(r,W)}};var fi={};fi.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Bm(t*n));e=Math.pow(2,a)}var i=r.pstyle("font-size").pfValue*e,o=r.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};fi.drawElementText=function(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(e);r.textAlign=l,r.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,c=e.pstyle("label"),d=e.pstyle("source-label"),h=e.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var g=!t,p;t&&(p=t,r.translate(-p.x1,-p.y1)),a==null?(o.drawText(r,e,null,g,i),e.isEdge()&&(o.drawText(r,e,"source",g,i),o.drawText(r,e,"target",g,i))):o.drawText(r,e,a,g,i),t&&r.translate(p.x1,p.y1)};fi.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e};fi.setupTextStyle=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;r.font=n+" "+o+" "+a+" "+i,r.lineJoin="round",this.colorFillStyle(r,u[0],u[1],u[2],s),this.colorStrokeStyle(r,c[0],c[1],c[2],l)};function t3(r,e,t,n,a){var i=Math.min(n,a),o=i/2,s=e+n/2,l=t+a/2;r.beginPath(),r.arc(s,l,o,0,Math.PI*2),r.closePath()}function tE(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,n/2,a/2);r.beginPath(),r.moveTo(e+o,t),r.lineTo(e+n-o,t),r.quadraticCurveTo(e+n,t,e+n,t+o),r.lineTo(e+n,t+a-o),r.quadraticCurveTo(e+n,t+a,e+n-o,t+a),r.lineTo(e+o,t+a),r.quadraticCurveTo(e,t+a,e,t+a-o),r.lineTo(e,t+o),r.quadraticCurveTo(e,t,e+o,t),r.closePath()}fi.getTextAngle=function(r,e){var t,n=r._private,a=n.rscratch,i=e?e+"-":"",o=r.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=Nt(a,"labelAngle",e);t=r.isEdge()?s:0}else o.strValue==="none"?t=0:t=o.pfValue;return t};fi.drawText=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=a?e.effectiveOpacity():1;if(!(a&&(s===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var l=Nt(o,"labelX",t),u=Nt(o,"labelY",t),c,d,h=this.getLabelText(e,t);if(h!=null&&h!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(r,e,a);var g=t?t+"-":"",p=Nt(o,"labelWidth",t),E=Nt(o,"labelHeight",t),y=e.pstyle(g+"text-margin-x").pfValue,b=e.pstyle(g+"text-margin-y").pfValue,w=e.isEdge(),x=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;w&&(x="center",C="center"),l+=y,u+=b;var T;switch(n?T=this.getTextAngle(e,t):T=0,T!==0&&(c=l,d=u,r.translate(c,d),r.rotate(T),l=0,u=0),C){case"top":break;case"center":u+=E/2;break;case"bottom":u+=E;break}var S=e.pstyle("text-background-opacity").value,_=e.pstyle("text-border-opacity").value,A=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,I=e.pstyle("text-background-shape").strValue,D=I==="round-rectangle"||I==="roundrectangle",k=I==="circle",M=2;if(S>0||A>0&&_>0){var N=r.fillStyle,z=r.strokeStyle,$=r.lineWidth,q=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,Z=e.pstyle("text-border-style").value,K=S>0,j=A>0&&_>0,ee=l-P;switch(x){case"left":ee-=p;break;case"center":ee-=p/2;break}var le=u-E-P,W=p+2*P,G=E+2*P;if(K&&(r.fillStyle="rgba(".concat(q[0],",").concat(q[1],",").concat(q[2],",").concat(S*s,")")),j&&(r.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(_*s,")"),r.lineWidth=A,r.setLineDash))switch(Z){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=A/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(D?(r.beginPath(),tE(r,ee,le,W,G,M)):k?(r.beginPath(),t3(r,ee,le,W,G)):(r.beginPath(),r.rect(ee,le,W,G)),K&&r.fill(),j&&r.stroke(),j&&Z==="double"){var Y=A/2;r.beginPath(),D?tE(r,ee+Y,le+Y,W-2*Y,G-2*Y,M):r.rect(ee+Y,le+Y,W-2*Y,G-2*Y),r.stroke()}r.fillStyle=N,r.strokeStyle=z,r.lineWidth=$,r.setLineDash&&r.setLineDash([])}var re=2*e.pstyle("text-outline-width").pfValue;if(re>0&&(r.lineWidth=re),e.pstyle("text-wrap").value==="wrap"){var de=Nt(o,"labelWrapCachedLines",t),se=Nt(o,"labelLineHeight",t),X=p/2,Q=this.getLabelJustification(e);switch(Q==="auto"||(x==="left"?Q==="left"?l+=-p:Q==="center"&&(l+=-X):x==="center"?Q==="left"?l+=-X:Q==="right"&&(l+=X):x==="right"&&(Q==="center"?l+=X:Q==="right"&&(l+=p))),C){case"top":u-=(de.length-1)*se;break;case"center":case"bottom":u-=(de.length-1)*se;break}for(var ae=0;ae<de.length;ae++)re>0&&r.strokeText(de[ae],l,u),r.fillText(de[ae],l,u),u+=se}else re>0&&r.strokeText(h,l,u),r.fillText(h,l,u);T!==0&&(r.rotate(-T),r.translate(-c,-d))}}};var Oa={};Oa.drawNode=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,l,u=e._private,c=u.rscratch,d=e.position();if(!(!Me(d.x)||!Me(d.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,g=o.usePaths(),p,E=!1,y=e.padding();s=e.width()+2*y,l=e.height()+2*y;var b;t&&(b=t,r.translate(-b.x1,-b.y1));for(var w=e.pstyle("background-image"),x=w.value,C=new Array(x.length),T=new Array(x.length),S=0,_=0;_<x.length;_++){var A=x[_],P=C[_]=A!=null&&A!=="none";if(P){var I=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",_);S++,T[_]=o.getCachedImage(A,I,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,k=e.pstyle("border-width").pfValue,M=e.pstyle("background-opacity").value*h,N=e.pstyle("border-color").value,z=e.pstyle("border-style").value,$=e.pstyle("border-join").value,q=e.pstyle("border-cap").value,V=e.pstyle("border-position").value,Z=e.pstyle("border-dash-pattern").pfValue,K=e.pstyle("border-dash-offset").pfValue,j=e.pstyle("border-opacity").value*h,ee=e.pstyle("outline-width").pfValue,le=e.pstyle("outline-color").value,W=e.pstyle("outline-style").value,G=e.pstyle("outline-opacity").value*h,Y=e.pstyle("outline-offset").value,re=e.pstyle("corner-radius").value;re!=="auto"&&(re=e.pstyle("corner-radius").pfValue);var de=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M;o.eleFillStyle(r,e,ke)},se=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j;o.colorStrokeStyle(r,N[0],N[1],N[2],ke)},X=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;o.colorStrokeStyle(r,le[0],le[1],le[2],ke)},Q=function(ke,ye,O,oe){var me=o.nodePathCache=o.nodePathCache||[],we=vR(O==="polygon"?O+","+oe.join(","):O,""+ye,""+ke,""+re),Ce=me[we],qe,Pe=!1;return Ce!=null?(qe=Ce,Pe=!0,c.pathCache=qe):(qe=new Path2D,me[we]=c.pathCache=qe),{path:qe,cacheHit:Pe}},ae=e.pstyle("shape").strValue,te=e.pstyle("shape-polygon-points").pfValue;if(g){r.translate(d.x,d.y);var ce=Q(s,l,ae,te);p=ce.path,E=ce.cacheHit}var _e=function(){if(!E){var ke=d;g&&(ke={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||r,ke.x,ke.y,s,l,re,c)}g?r.fill(p):r.fill()},ve=function(){for(var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=u.backgrounding,oe=0,me=0;me<T.length;me++){var we=e.cy().style().getIndexedStyle(e,"background-image-containment","value",me);if(ye&&we==="over"||!ye&&we==="inside"){oe++;continue}C[me]&&T[me].complete&&!T[me].error&&(oe++,o.drawInscribedImage(r,T[me],e,me,ke))}u.backgrounding=oe!==S,O!==u.backgrounding&&e.updateStyle(!1)},U=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(r,e,ye),ke&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c)))},fe=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasStripe(e)&&(r.save(),g?r.clip(c.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c),r.clip()),o.drawStripe(r,e,ye),r.restore(),ke&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c)))},xe=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ye=(D>0?D:-D)*ke,O=D>0?0:255;D!==0&&(o.colorFillStyle(r,O,O,O,ye),g?r.fill(p):r.fill())},ge=function(){if(k>0){if(r.lineWidth=k,r.lineCap=q,r.lineJoin=$,r.setLineDash)switch(z){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(Z),r.lineDashOffset=K;break;case"solid":case"double":r.setLineDash([]);break}if(V!=="center"){if(r.save(),r.lineWidth*=2,V==="inside")g?r.clip(p):r.clip();else{var ke=new Path2D;ke.rect(-s/2-k,-l/2-k,s+2*k,l+2*k),ke.addPath(p),r.clip(ke,"evenodd")}g?r.stroke(p):r.stroke(),r.restore()}else g?r.stroke(p):r.stroke();if(z==="double"){r.lineWidth=k/3;var ye=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(p):r.stroke(),r.globalCompositeOperation=ye}r.setLineDash&&r.setLineDash([])}},be=function(){if(ee>0){if(r.lineWidth=ee,r.lineCap="butt",r.setLineDash)switch(W){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var ke=d;g&&(ke={x:0,y:0});var ye=o.getNodeShape(e),O=k;V==="inside"&&(O=0),V==="outside"&&(O*=2);var oe=(s+O+(ee+Y))/s,me=(l+O+(ee+Y))/l,we=s*oe,Ce=l*me,qe=o.nodeShapes[ye].points,Pe;if(g){var Ge=Q(we,Ce,ye,qe);Pe=Ge.path}if(ye==="ellipse")o.drawEllipsePath(Pe||r,ke.x,ke.y,we,Ce);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ye)){var Fe=0,je=0,or=0;ye==="round-diamond"?Fe=(O+Y+ee)*1.4:ye==="round-heptagon"?(Fe=(O+Y+ee)*1.075,or=-(O/2+Y+ee)/35):ye==="round-hexagon"?Fe=(O+Y+ee)*1.12:ye==="round-pentagon"?(Fe=(O+Y+ee)*1.13,or=-(O/2+Y+ee)/15):ye==="round-tag"?(Fe=(O+Y+ee)*1.12,je=(O/2+ee+Y)*.07):ye==="round-triangle"&&(Fe=(O+Y+ee)*(Math.PI/2),or=-(O+Y/2+ee)/Math.PI),Fe!==0&&(oe=(s+Fe)/s,we=s*oe,["round-hexagon","round-tag"].includes(ye)||(me=(l+Fe)/l,Ce=l*me)),re=re==="auto"?CR(we,Ce):re;for(var nr=we/2,We=Ce/2,ur=re+(O+ee+Y)/2,ar=new Array(qe.length/2),Wr=new Array(qe.length/2),Mr=0;Mr<qe.length/2;Mr++)ar[Mr]={x:ke.x+je+nr*qe[Mr*2],y:ke.y+or+We*qe[Mr*2+1]};var lt,kr,Kr,Nr,Xr=ar.length;for(kr=ar[Xr-1],lt=0;lt<Xr;lt++)Kr=ar[lt%Xr],Nr=ar[(lt+1)%Xr],Wr[lt]=Hm(kr,Kr,Nr,ur),kr=Kr,Kr=Nr;o.drawRoundPolygonPath(Pe||r,ke.x+je,ke.y+or,s*oe,l*me,qe,Wr)}else if(["roundrectangle","round-rectangle"].includes(ye))re=re==="auto"?Sa(we,Ce):re,o.drawRoundRectanglePath(Pe||r,ke.x,ke.y,we,Ce,re+(O+ee+Y)/2);else if(["cutrectangle","cut-rectangle"].includes(ye))re=re==="auto"?Om():re,o.drawCutRectanglePath(Pe||r,ke.x,ke.y,we,Ce,null,re+(O+ee+Y)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ye))re=re==="auto"?Sa(we,Ce):re,o.drawBottomRoundRectanglePath(Pe||r,ke.x,ke.y,we,Ce,re+(O+ee+Y)/2);else if(ye==="barrel")o.drawBarrelPath(Pe||r,ke.x,ke.y,we,Ce);else if(ye.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ye)){var Cn=(O+ee+Y)/s;qe=Ku(ju(qe,Cn)),o.drawPolygonPath(Pe||r,ke.x,ke.y,s,l,qe)}else{var $r=(O+ee+Y)/s;qe=Ku(ju(qe,-$r)),o.drawPolygonPath(Pe||r,ke.x,ke.y,s,l,qe)}if(g?r.stroke(Pe):r.stroke(),W==="double"){r.lineWidth=O/3;var dn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(Pe):r.stroke(),r.globalCompositeOperation=dn}r.setLineDash&&r.setLineDash([])}},Ae=function(){a&&o.drawNodeOverlay(r,e,d,s,l)},De=function(){a&&o.drawNodeUnderlay(r,e,d,s,l)},Be=function(){o.drawElementText(r,e,null,n)},Le=e.pstyle("ghost").value==="yes";if(Le){var He=e.pstyle("ghost-offset-x").pfValue,Ve=e.pstyle("ghost-offset-y").pfValue,Xe=e.pstyle("ghost-opacity").value,er=Xe*h;r.translate(He,Ve),X(),be(),de(Xe*M),_e(),ve(er,!0),se(Xe*j),ge(),U(D!==0||k!==0),fe(D!==0||k!==0),ve(er,!1),xe(er),r.translate(-He,-Ve)}g&&r.translate(-d.x,-d.y),De(),g&&r.translate(d.x,d.y),X(),be(),de(),_e(),ve(h,!0),se(),ge(),U(D!==0||k!==0),fe(D!==0||k!==0),ve(h,!1),xe(),g&&r.translate(-d.x,-d.y),Be(),Ae(),t&&r.translate(b.x1,b.y1)}};var PA=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,a,i,o){var s=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||o==null){var g=n.padding();i=n.width()+2*g,o=n.height()+2*g}s.colorFillStyle(t,c[0],c[1],c[2],u),s.nodeShapes[d].draw(t,a.x,a.y,i+l*2,o+l*2,h),t.fill()}}}};Oa.drawNodeOverlay=PA("overlay");Oa.drawNodeUnderlay=PA("underlay");Oa.hasPie=function(r){return r=r[0],r._private.hasPie};Oa.hasStripe=function(r){return r=r[0],r._private.hasStripe};Oa.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,c=e.width(),d=e.height(),h=Math.min(c,d)/2,g,p=0,E=this.usePaths();if(E&&(l=0,u=0),i.units==="%"?h=h*i.pfValue:i.pfValue!==void 0&&(h=i.pfValue/2),o.units==="%"?g=h*o.pfValue:o.pfValue!==void 0&&(g=o.pfValue/2),!(g>=h))for(var y=1;y<=a.pieBackgroundN;y++){var b=e.pstyle("pie-"+y+"-background-size").value,w=e.pstyle("pie-"+y+"-background-color").value,x=e.pstyle("pie-"+y+"-background-opacity").value*t,C=b/100;C+p>1&&(C=1-p);var T=1.5*Math.PI+2*Math.PI*p;T+=s;var S=2*Math.PI*C,_=T+S;b===0||p>=1||p+C>1||(g===0?(r.beginPath(),r.moveTo(l,u),r.arc(l,u,h,T,_),r.closePath()):(r.beginPath(),r.arc(l,u,h,T,_),r.arc(l,u,g,_,T,!0),r.closePath()),this.colorFillStyle(r,w[0],w[1],w[2],x),r.fill(),p+=C)}};Oa.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,o=n.y,s=e.width(),l=e.height(),u=0,c=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var g=s,p=l;h.units==="%"?(g=g*h.pfValue,p=p*h.pfValue):h.pfValue!==void 0&&(g=h.pfValue,p=h.pfValue),c&&(i=0,o=0),o-=g/2,i-=p/2;for(var E=1;E<=a.stripeBackgroundN;E++){var y=e.pstyle("stripe-"+E+"-background-size").value,b=e.pstyle("stripe-"+E+"-background-color").value,w=e.pstyle("stripe-"+E+"-background-opacity").value*t,x=y/100;x+u>1&&(x=1-u),!(y===0||u>=1||u+x>1)&&(r.beginPath(),r.rect(i,o+p*u,g,p*x),r.closePath(),this.colorFillStyle(r,b[0],b[1],b[2],w),r.fill(),u+=x)}r.restore()};var Bt={},n3=100;Bt.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};Bt.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===r){t=!1;break}return t&&(n={context:r},e.push(n)),n};Bt.createGradientStyleFor=function(r,e,t,n,a){var i,o=this.usePaths(),s=t.pstyle(e+"-gradient-stop-colors").value,l=t.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(t.isEdge()){var u=t.sourceEndpoint(),c=t.targetEndpoint(),d=t.midpoint(),h=ii(u,d),g=ii(c,d);i=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,g))}else{var p=o?{x:0,y:0}:t.position(),E=t.paddedWidth(),y=t.paddedHeight();i=r.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(E,y))}else if(t.isEdge()){var b=t.sourceEndpoint(),w=t.targetEndpoint();i=r.createLinearGradient(b.x,b.y,w.x,w.y)}else{var x=o?{x:0,y:0}:t.position(),C=t.paddedWidth(),T=t.paddedHeight(),S=C/2,_=T/2,A=t.pstyle("background-gradient-direction").value;switch(A){case"to-bottom":i=r.createLinearGradient(x.x,x.y-_,x.x,x.y+_);break;case"to-top":i=r.createLinearGradient(x.x,x.y+_,x.x,x.y-_);break;case"to-left":i=r.createLinearGradient(x.x+S,x.y,x.x-S,x.y);break;case"to-right":i=r.createLinearGradient(x.x-S,x.y,x.x+S,x.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(x.x-S,x.y-_,x.x+S,x.y+_);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(x.x-S,x.y+_,x.x+S,x.y-_);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(x.x+S,x.y-_,x.x-S,x.y+_);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(x.x+S,x.y+_,x.x-S,x.y-_);break}}if(!i)return null;for(var P=l.length===s.length,I=s.length,D=0;D<I;D++)i.addColorStop(P?l[D]:D/(I-1),"rgba("+s[D][0]+","+s[D][1]+","+s[D][2]+","+a+")");return i};Bt.gradientFillStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"background",e,t,n);if(!a)return null;r.fillStyle=a};Bt.colorFillStyle=function(r,e,t,n,a){r.fillStyle="rgba("+e+","+t+","+n+","+a+")"};Bt.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(r,e,n,t);else{var a=e.pstyle("background-color").value;this.colorFillStyle(r,a[0],a[1],a[2],t)}};Bt.gradientStrokeStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"line",e,t,n);if(!a)return null;r.strokeStyle=a};Bt.colorStrokeStyle=function(r,e,t,n,a){r.strokeStyle="rgba("+e+","+t+","+n+","+a+")"};Bt.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(r,e,n,t);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(r,a[0],a[1],a[2],t)}};Bt.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var l=a*o,u=i*o,c;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var d=t.canvasContainer;d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)c=t.canvases[h],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)c=t.bufferCanvases[h],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";e.textureMult=1,o<=1&&(c=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,c.width=l*e.textureMult,c.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=o}};Bt.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})};Bt.clearCanvas=function(){var r=this,e=r.data;function t(n){n.clearRect(0,0,r.canvasWidth,r.canvasHeight)}t(e.contexts[r.NODE]),t(e.contexts[r.DRAG])};Bt.render=function(r){var e=this;r=r||yR();var t=e.cy,n=r.forcedContext,a=r.drawAllLayers,i=r.drawOnlyNodeLayer,o=r.forcedZoom,s=r.forcedPan,l=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,u=e.data,c=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=r.motionBlur!==void 0?r.motionBlur:e.motionBlur,g=e.motionBlurPxRatio,p=t.hasCompoundNodes(),E=e.hoverData.draggingEles,y=!!(e.hoverData.selecting||e.touchData.selecting);h=h&&!n&&e.motionBlurEnabled&&!y;var b=h;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),h&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(b=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(c[e.NODE]=!0,c[e.SELECT_BOX]=!0);var w=t.style(),x=t.zoom(),C=o!==void 0?o:x,T=t.pan(),S={x:T.x,y:T.y},_={zoom:x,pan:{x:T.x,y:T.y}},A=e.prevViewport,P=A===void 0||_.zoom!==A.zoom||_.pan.x!==A.pan.x||_.pan.y!==A.pan.y;!P&&!(E&&!p)&&(e.motionBlurPxRatio=1),s&&(S=s),C*=l,S.x*=l,S.y*=l;var I=e.getCachedZSortedEles();function D(se,X,Q,ae,te){var ce=se.globalCompositeOperation;se.globalCompositeOperation="destination-out",e.colorFillStyle(se,255,255,255,e.motionBlurTransparency),se.fillRect(X,Q,ae,te),se.globalCompositeOperation=ce}function k(se,X){var Q,ae,te,ce;!e.clearingMotionBlur&&(se===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||se===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(Q={x:T.x*g,y:T.y*g},ae=x*g,te=e.canvasWidth*g,ce=e.canvasHeight*g):(Q=S,ae=C,te=e.canvasWidth,ce=e.canvasHeight),se.setTransform(1,0,0,1,0,0),X==="motionBlur"?D(se,0,0,te,ce):!n&&(X===void 0||X)&&se.clearRect(0,0,te,ce),a||(se.translate(Q.x,Q.y),se.scale(ae,ae)),s&&se.translate(s.x,s.y),o&&se.scale(o,o)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var M=e.data.bufferContexts[e.TEXTURE_BUFFER];M.setTransform(1,0,0,1,0,0),M.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:M,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var _=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var N=u.contexts[e.NODE],z=e.textureCache.texture,_=e.textureCache.viewport;N.setTransform(1,0,0,1,0,0),h?D(N,0,0,_.width,_.height):N.clearRect(0,0,_.width,_.height);var $=w.core("outside-texture-bg-color").value,q=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(N,$[0],$[1],$[2],q),N.fillRect(0,0,_.width,_.height);var x=t.zoom();k(N,!1),N.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l),N.drawImage(z,_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var V=t.extent(),Z=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),K=e.hideEdgesOnViewport&&Z,j=[];if(j[e.NODE]=!c[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,j[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),j[e.DRAG]=!c[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,j[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||a||i||j[e.NODE]){var ee=h&&!j[e.NODE]&&g!==1,N=n||(ee?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),le=h&&!ee?"motionBlur":void 0;k(N,le),K?e.drawCachedNodes(N,I.nondrag,l,V):e.drawLayeredElements(N,I.nondrag,l,V),e.debug&&e.drawDebugPoints(N,I.nondrag),!a&&!h&&(c[e.NODE]=!1)}if(!i&&(c[e.DRAG]||a||j[e.DRAG])){var ee=h&&!j[e.DRAG]&&g!==1,N=n||(ee?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);k(N,h&&!ee?"motionBlur":void 0),K?e.drawCachedNodes(N,I.drag,l,V):e.drawCachedElements(N,I.drag,l,V),e.debug&&e.drawDebugPoints(N,I.drag),!a&&!h&&(c[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,k),h&&g!==1){var W=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Y=u.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],de=function(X,Q,ae){X.setTransform(1,0,0,1,0,0),ae||!b?X.clearRect(0,0,e.canvasWidth,e.canvasHeight):D(X,0,0,e.canvasWidth,e.canvasHeight);var te=g;X.drawImage(Q,0,0,e.canvasWidth*te,e.canvasHeight*te,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||j[e.NODE])&&(de(W,G,j[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||j[e.DRAG])&&(de(Y,re,j[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=_,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),h&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,c[e.NODE]=!0,c[e.DRAG]=!0,e.redraw()},n3)),n||t.emit("render")};var ko;Bt.drawSelectionRectangle=function(r,e){var t=this,n=t.cy,a=t.data,i=n.style(),o=r.drawOnlyNodeLayer,s=r.drawAllLayers,l=a.canvasNeedsRedraw,u=r.forcedContext;if(t.showFps||!o&&l[t.SELECT_BOX]&&!s){var c=u||a.contexts[t.SELECT_BOX];if(e(c),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),h=i.core("selection-box-border-width").value/d;c.lineWidth=h,c.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",c.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),h>0&&(c.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",c.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(a.bgActivePosistion&&!t.hoverData.selecting){var d=t.cy.zoom(),g=a.bgActivePosistion;c.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",c.beginPath(),c.arc(g.x,g.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),c.fill()}var p=t.lastRedrawTime;if(t.showFps&&p){p=Math.round(p);var E=Math.round(1e3/p),y="1 frame = "+p+" ms = "+E+" fps";if(c.setTransform(1,0,0,1,0,0),c.fillStyle="rgba(255, 0, 0, 0.75)",c.strokeStyle="rgba(255, 0, 0, 0.75)",c.font="30px Arial",!ko){var b=c.measureText(y);ko=b.actualBoundingBoxAscent}c.fillText(y,0,ko);var w=60;c.strokeRect(0,ko+10,250,20),c.fillRect(0,ko+10,250*Math.min(E/w,1),20)}s||(l[t.SELECT_BOX]=!1)}};function nE(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(n));return n}function a3(r,e,t){var n=nE(r,r.VERTEX_SHADER,e),a=nE(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,n),r.attachShader(i,a),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function i3(r,e,t){t===void 0&&(t=e);var n=r.makeOffscreenCanvas(e,t),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function Ym(r){var e=r.pixelRatio,t=r.cy.zoom(),n=r.cy.pan();return{zoom:t*e,pan:{x:n.x*e,y:n.y*e}}}function o3(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function s3(r,e,t,n,a){var i=n*t+e.x,o=a*t+e.y;return o=Math.round(r.canvasHeight-o),[i,o]}function u3(r){return r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function l3(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function Za(r,e,t){var n=r[0]/255,a=r[1]/255,i=r[2]/255,o=e,s=t||new Array(4);return s[0]=n*o,s[1]=a*o,s[2]=i*o,s[3]=o,s}function zi(r,e){var t=e||new Array(4);return t[0]=(r>>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function f3(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function c3(r,e){var t=r.createTexture();return t.buffer=function(n){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function IA(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function DA(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function d3(r,e,t,n,a,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*n,a);case r.INT:return new Int32Array(t.buffer,i*n,a)}}function v3(r,e,t,n){var a=IA(r,e),i=Yr(a,2),o=i[0],s=i[1],l=DA(r,s,n),u=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),s===r.FLOAT?r.vertexAttribPointer(t,o,s,!1,0,0):s===r.INT&&r.vertexAttribIPointer(t,o,s,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),u}function An(r,e,t,n){var a=IA(r,t),i=Yr(a,3),o=i[0],s=i[1],l=i[2],u=DA(r,s,e*o),c=o*l,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*c,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),s===r.FLOAT?r.vertexAttribPointer(n,o,s,!1,c,0):s===r.INT&&r.vertexAttribIPointer(n,o,s,c,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var h=new Array(e),g=0;g<e;g++)h[g]=d3(r,s,u,c,o,g);return d.dataArray=u,d.stride=c,d.size=o,d.getView=function(p){return h[p]},d.setPoint=function(p,E,y){var b=h[p];b[0]=E,b[1]=y},d.bufferSubData=function(p){r.bindBuffer(r.ARRAY_BUFFER,d),p?r.bufferSubData(r.ARRAY_BUFFER,0,u,0,p*o):r.bufferSubData(r.ARRAY_BUFFER,0,u)},d}function h3(r,e,t){for(var n=9,a=new Float32Array(e*n),i=new Array(e),o=0;o<e;o++){var s=o*n*4;i[o]=new Float32Array(a.buffer,s,n)}var l=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,a.byteLength,r.DYNAMIC_DRAW);for(var u=0;u<3;u++){var c=t+u;r.enableVertexAttribArray(c),r.vertexAttribPointer(c,3,r.FLOAT,!1,36,u*12),r.vertexAttribDivisor(c,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),l.getMatrixView=function(d){return i[d]},l.setData=function(d,h){i[h].set(d,0)},l.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferSubData(r.ARRAY_BUFFER,0,a)},l}function g3(r){var e=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,e);var t=r.createTexture();return r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),r.bindFramebuffer(r.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,a){r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,a,0,r.RGBA,r.UNSIGNED_BYTE,null)},e}var aE=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});function Dd(){var r=new aE(9);return aE!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function iE(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function p3(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=t[0],g=t[1],p=t[2],E=t[3],y=t[4],b=t[5],w=t[6],x=t[7],C=t[8];return r[0]=h*n+g*o+p*u,r[1]=h*a+g*s+p*c,r[2]=h*i+g*l+p*d,r[3]=E*n+y*o+b*u,r[4]=E*a+y*s+b*c,r[5]=E*i+y*l+b*d,r[6]=w*n+x*o+C*u,r[7]=w*a+x*s+C*c,r[8]=w*i+x*l+C*d,r}function Fu(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=t[0],g=t[1];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=s,r[5]=l,r[6]=h*n+g*o+u,r[7]=h*a+g*s+c,r[8]=h*i+g*l+d,r}function oE(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=Math.sin(t),g=Math.cos(t);return r[0]=g*n+h*o,r[1]=g*a+h*s,r[2]=g*i+h*l,r[3]=g*o-h*n,r[4]=g*s-h*a,r[5]=g*l-h*i,r[6]=u,r[7]=c,r[8]=d,r}function wm(r,e,t){var n=t[0],a=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=a*e[3],r[4]=a*e[4],r[5]=a*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function y3(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}var m3=(function(){function r(e,t,n,a){Ba(this,r),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=t,this.texRows=n,this.texHeight=Math.floor(t/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(e,t,t),this.scratch=a(e,t,this.texHeight,"scratch")}return Ma(r,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(t){var n=t.w,a=t.h,i=this.texHeight,o=this.texSize,s=i/a,l=n*s,u=a*s;return l>o&&(s=o/n,l=n*s,u=a*s),{scale:s,texW:l,texH:u}}},{key:"draw",value:function(t,n,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,l=this.texHeight,u=this.getScale(n),c=u.scale,d=u.texW,h=u.texH,g=function(x,C){if(a&&C){var T=C.context,S=x.x,_=x.row,A=S,P=l*_;T.save(),T.translate(A,P),T.scale(c,c),a(T,n),T.restore()}},p=[null,null],E=function(){g(i.freePointer,i.canvas),p[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:d,h},p[1]={x:i.freePointer.x+d,y:i.freePointer.row*l,w:0,h},i.freePointer.x+=d,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},y=function(){var x=i.scratch,C=i.canvas;x.clear(),g({x:0,row:0},x);var T=o-i.freePointer.x,S=d-T,_=l;{var A=i.freePointer.x,P=i.freePointer.row*l,I=T;C.context.drawImage(x,0,0,I,_,A,P,I,_),p[0]={x:A,y:P,w:I,h}}{var D=T,k=(i.freePointer.row+1)*l,M=S;C&&C.context.drawImage(x,D,0,M,_,0,k,M,_),p[1]={x:0,y:k,w:M,h}}i.freePointer.x=S,i.freePointer.row++},b=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+d<=o)E();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(b(),E()):this.enableWrapping?y():(b(),E())}return this.keyToLocation.set(t,p),this.needsBuffer=!0,p}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(t),o=i.texW;return this.freePointer.x+o>n?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=c3(t,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),b3=(function(){function r(e,t,n,a){Ba(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Ma(r,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new m3(t,n,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas,o=Math.floor(n/a);this.scratch=i(t,n,o,"scratch")}return this.scratch}},{key:"draw",value:function(t,n,a){var i=this.styleKeyToAtlas.get(t);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(n))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(t,n,a),this.styleKeyToAtlas.set(t,i)),i}},{key:"getAtlas",value:function(t){return this.styleKeyToAtlas.get(t)}},{key:"hasAtlas",value:function(t){return this.styleKeyToAtlas.has(t)}},{key:"markKeyForGC",value:function(t){this.markedKeys.add(t)}},{key:"gc",value:function(){var t=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,o=null,s=zt(this.atlases),l;try{var u=function(){var d=l.value,h=d.getKeys(),g=w3(n,h);if(g.size===0)return a.push(d),h.forEach(function(T){return i.set(T,d)}),1;o||(o=t._createAtlas(),a.push(o));var p=zt(h),E;try{for(p.s();!(E=p.n()).done;){var y=E.value;if(!g.has(y)){var b=d.getOffsets(y),w=Yr(b,2),x=w[0],C=w[1];o.canFit({w:x.w+C.w,h:x.h})||(o.lock(),o=t._createAtlas(),a.push(o)),d.canvas&&(t._copyTextureToNewAtlas(y,d,o),i.set(y,o))}}}catch(T){p.e(T)}finally{p.f()}d.dispose()};for(s.s();!(l=s.n()).done;)u()}catch(c){s.e(c)}finally{s.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(t,n,a){var i=n.getOffsets(t),o=Yr(i,2),s=o[0],l=o[1];if(l.w===0)a.draw(t,s,function(h){h.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,s.w,0,l.w,l.h);var c=s.w+l.w,d=s.h;a.draw(t,{w:c,h:d},function(h){h.drawImage(u,0,0,c,d,0,0,c,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function w3(r,e){return r.intersection?r.intersection(e):new Set(Gu(r).filter(function(t){return e.has(t)}))}var x3=(function(){function r(e,t){Ba(this,r),this.r=e,this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Ma(r,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var a=this.globalOptions,i=a.webglTexSize,o=a.createTextureCanvas,s=n.texRows,l=this._cacheScratchCanvas(o),u=new b3(this.r,i,s,l);this.collections.set(t,u)}},{key:"addRenderType",value:function(t,n){var a=n.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),o=Ye({type:t,atlasCollection:i},n);this.renderTypes.set(t,o)}},{key:"getRenderTypeOpts",value:function(t){return this.renderTypes.get(t)}},{key:"getAtlasCollection",value:function(t){return this.collections.get(t)}},{key:"_cacheScratchCanvas",value:function(t){var n=-1,a=-1,i=null;return function(o,s,l,u){return u?((!i||s!=n||l!=a)&&(n=s,a=l,i=t(o,s,l)),i):t(o,s,l)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,o=i===void 0?!1:i,s=a.filterEle,l=s===void 0?function(){return!0}:s,u=a.filterType,c=u===void 0?function(){return!0}:u,d=!1,h=!1,g=zt(t),p;try{for(g.s();!(p=g.n()).done;){var E=p.value;if(l(E)){var y=zt(this.renderTypes.values()),b;try{var w=function(){var C=b.value,T=C.type;if(c(T)){var S=n.collections.get(C.collection),_=C.getKey(E),A=Array.isArray(_)?_:[_];if(o)A.forEach(function(k){return S.markKeyForGC(k)}),h=!0;else{var P=C.getID?C.getID(E):E.id(),I=n._key(T,P),D=n.typeAndIdToKey.get(I);D!==void 0&&!l3(A,D)&&(d=!0,n.typeAndIdToKey.delete(I),D.forEach(function(k){return S.markKeyForGC(k)}))}}};for(y.s();!(b=y.n()).done;)w()}catch(x){y.e(x)}finally{y.f()}}}}catch(x){g.e(x)}finally{g.f()}return h&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var t=zt(this.collections.values()),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;a.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,a,i){var o=this.renderTypes.get(n),s=this.collections.get(o.collection),l=!1,u=s.draw(i,a,function(h){o.drawClipped?(h.save(),h.beginPath(),h.rect(0,0,a.w,a.h),h.clip(),o.drawElement(h,t,a,!0,!0),h.restore()):o.drawElement(h,t,a,!0,!0),l=!0});if(l){var c=o.getID?o.getID(t):t.id(),d=this._key(n,c);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(i):this.typeAndIdToKey.set(d,[i])}return u}},{key:"getAtlasInfo",value:function(t,n){var a=this,i=this.renderTypes.get(n),o=i.getKey(t),s=Array.isArray(o)?o:[o];return s.map(function(l){var u=i.getBoundingBox(t,l),c=a.getOrCreateAtlas(t,n,u,l),d=c.getOffsets(l),h=Yr(d,2),g=h[0],p=h[1];return{atlas:c,tex:g,tex1:g,tex2:p,bb:u}})}},{key:"getDebugInfo",value:function(){var t=[],n=zt(this.collections),a;try{for(n.s();!(a=n.n()).done;){var i=Yr(a.value,2),o=i[0],s=i[1],l=s.getCounts(),u=l.keyCount,c=l.atlasCount;t.push({type:o,keyCount:u,atlasCount:c})}}catch(d){n.e(d)}finally{n.f()}return t}}])})(),E3=(function(){function r(e){Ba(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ma(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var n=this.batchAtlases.indexOf(t);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),n=this.batchAtlases.length-1}return n}}])})(),C3=`
|
|
18
18
|
float circleSD(vec2 p, float r) {
|
|
19
19
|
return distance(vec2(0), p) - r; // signed distance
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,_3=`
|
|
22
22
|
float rectangleSD(vec2 p, vec2 b) {
|
|
23
23
|
vec2 d = abs(p)-b;
|
|
24
24
|
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,S3=`
|
|
27
27
|
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
28
28
|
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
29
29
|
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
30
30
|
vec2 q = abs(p) - b + cr.x;
|
|
31
31
|
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`,T3=`
|
|
34
34
|
float ellipseSD(vec2 p, vec2 ab) {
|
|
35
35
|
p = abs( p ); // symmetry
|
|
36
36
|
|
|
@@ -50,7 +50,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
50
50
|
// return signed distance
|
|
51
51
|
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
52
52
|
}
|
|
53
|
-
`,
|
|
53
|
+
`,Ko={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},rl={IGNORE:1,USE_BB:2},Bd=0,sE=1,uE=2,Md=3,$i=4,Ru=5,Oo=6,Lo=7,R3=(function(){function r(e,t,n){Ba(this,r),this.r=e,this.gl=t,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=i3,this.atlasManager=new x3(e,n),this.batchManager=new E3(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ko.SCREEN),this.pickingProgram=this._createShaderProgram(Ko.PICKING),this.vao=this._createVAO()}return Ma(r,[{key:"addAtlasCollection",value:function(t,n){this.atlasManager.addAtlasCollection(t,n)}},{key:"addTextureAtlasRenderType",value:function(t,n){this.atlasManager.addRenderType(t,n)}},{key:"addSimpleShapeRenderType",value:function(t,n){this.simpleShapeOptions.set(t,n)}},{key:"invalidate",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.type,i=this.atlasManager;return a?i.invalidate(t,{filterType:function(s){return s===a},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var n=this.gl,a=`#version 300 es
|
|
54
54
|
precision highp float;
|
|
55
55
|
|
|
56
56
|
uniform mat3 uPanZoomMatrix;
|
|
@@ -115,8 +115,8 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
115
115
|
|
|
116
116
|
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
117
117
|
}
|
|
118
|
-
else if(aVertType == `).concat(
|
|
119
|
-
|| aVertType == `).concat(
|
|
118
|
+
else if(aVertType == `).concat($i," || aVertType == ").concat(Lo,`
|
|
119
|
+
|| aVertType == `).concat(Ru," || aVertType == ").concat(Oo,`) { // simple shapes
|
|
120
120
|
|
|
121
121
|
// the bounding box is needed by the fragment shader
|
|
122
122
|
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
@@ -131,7 +131,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
131
131
|
|
|
132
132
|
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
133
133
|
}
|
|
134
|
-
else if(aVertType == `).concat(
|
|
134
|
+
else if(aVertType == `).concat(sE,`) {
|
|
135
135
|
vec2 source = aPointAPointB.xy;
|
|
136
136
|
vec2 target = aPointAPointB.zw;
|
|
137
137
|
|
|
@@ -146,7 +146,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
146
146
|
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
147
147
|
vColor = aColor;
|
|
148
148
|
}
|
|
149
|
-
else if(aVertType == `).concat(
|
|
149
|
+
else if(aVertType == `).concat(uE,`) {
|
|
150
150
|
vec2 pointA = aPointAPointB.xy;
|
|
151
151
|
vec2 pointB = aPointAPointB.zw;
|
|
152
152
|
vec2 pointC = aPointCPointD.xy;
|
|
@@ -195,7 +195,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
195
195
|
|
|
196
196
|
vColor = aColor;
|
|
197
197
|
}
|
|
198
|
-
else if(aVertType == `).concat(
|
|
198
|
+
else if(aVertType == `).concat(Md,` && vid < 3) {
|
|
199
199
|
// massage the first triangle into an edge arrow
|
|
200
200
|
if(vid == 0)
|
|
201
201
|
position = vec2(-0.15, -0.3);
|
|
@@ -219,7 +219,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
219
219
|
precision highp float;
|
|
220
220
|
|
|
221
221
|
// declare texture unit for each texture atlas in the batch
|
|
222
|
-
`.concat(i.map(function(
|
|
222
|
+
`.concat(i.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(`
|
|
223
223
|
`),`
|
|
224
224
|
|
|
225
225
|
uniform vec4 uBGColor;
|
|
@@ -240,10 +240,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
240
240
|
|
|
241
241
|
out vec4 outColor;
|
|
242
242
|
|
|
243
|
-
`).concat(
|
|
244
|
-
`).concat(
|
|
245
|
-
`).concat(
|
|
246
|
-
`).concat(
|
|
243
|
+
`).concat(C3,`
|
|
244
|
+
`).concat(_3,`
|
|
245
|
+
`).concat(S3,`
|
|
246
|
+
`).concat(T3,`
|
|
247
247
|
|
|
248
248
|
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
249
249
|
return vec4(
|
|
@@ -261,19 +261,19 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
261
261
|
void main(void) {
|
|
262
262
|
if(vVertType == `).concat(Bd,`) {
|
|
263
263
|
// look up the texel from the texture unit
|
|
264
|
-
`).concat(i.map(function(
|
|
264
|
+
`).concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`
|
|
265
265
|
else `),`
|
|
266
266
|
}
|
|
267
|
-
else if(vVertType == `).concat(
|
|
267
|
+
else if(vVertType == `).concat(Md,`) {
|
|
268
268
|
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
269
269
|
outColor = blend(vColor, uBGColor);
|
|
270
270
|
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
271
271
|
}
|
|
272
|
-
else if(vVertType == `).concat(
|
|
272
|
+
else if(vVertType == `).concat($i,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
273
273
|
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
274
274
|
}
|
|
275
|
-
else if(vVertType == `).concat(
|
|
276
|
-
|| vVertType == `).concat(
|
|
275
|
+
else if(vVertType == `).concat($i," || vVertType == ").concat(Lo,`
|
|
276
|
+
|| vVertType == `).concat(Ru," || vVertType == ").concat(Oo,`) { // use SDF
|
|
277
277
|
|
|
278
278
|
float outerBorder = vBorderWidth[0];
|
|
279
279
|
float innerBorder = vBorderWidth[1];
|
|
@@ -284,11 +284,11 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
284
284
|
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
285
285
|
|
|
286
286
|
float d; // signed distance
|
|
287
|
-
if(vVertType == `).concat(
|
|
287
|
+
if(vVertType == `).concat($i,`) {
|
|
288
288
|
d = rectangleSD(p, b);
|
|
289
|
-
} else if(vVertType == `).concat(
|
|
289
|
+
} else if(vVertType == `).concat(Lo,` && w == h) {
|
|
290
290
|
d = circleSD(p, b.x); // faster than ellipse
|
|
291
|
-
} else if(vVertType == `).concat(
|
|
291
|
+
} else if(vVertType == `).concat(Lo,`) {
|
|
292
292
|
d = ellipseSD(p, b);
|
|
293
293
|
} else {
|
|
294
294
|
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
@@ -328,31 +328,31 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
328
328
|
`).concat(t.picking?`if(outColor.a == 0.0) discard;
|
|
329
329
|
else outColor = vIndex;`:"",`
|
|
330
330
|
}
|
|
331
|
-
`),s=G$(n,a,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)s.uTextures.push(n.getUniformLocation(s,"uTexture".concat(u)));return s}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,a=this.gl,i=this.program,o=a.createVertexArray();return a.bindVertexArray(o),Q$(a,"vec2",i.aPosition,t),this.transformBuffer=J$(a,n,i.aTransform),this.indexBuffer=Rn(a,n,"vec4",i.aIndex),this.vertTypeBuffer=Rn(a,n,"int",i.aVertType),this.atlasIdBuffer=Rn(a,n,"int",i.aAtlasId),this.texBuffer=Rn(a,n,"vec4",i.aTex),this.pointAPointBBuffer=Rn(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Rn(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=Rn(a,n,"vec2",i.aLineWidth),this.colorBuffer=Rn(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=Rn(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=Rn(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),o}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return ga(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ho.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return t.visible()?n&&n.isVisible?n.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(a);if(this._isVisible(t,s)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var u=s.getTexPickingMode(t);if(u===el.IGNORE)return;if(u==el.USE_BB){this.drawPickingRectangle(t,n,a);return}}var l=i.getAtlasInfo(t,a),c=Ft(l),v;try{for(c.s();!(v=c.n()).done;){var h=v.value,g=h.atlas,p=h.tex1,E=h.tex2;o.canAddToCurrentBatch(g)||this.endBatch();for(var m=o.getAtlasIndexForBatch(g),b=0,w=[[p,!0],[E,!1]];b<w.length;b++){var x=Kr(w[b],2),_=x[0],C=x[1];if(_.w!=0){var R=this.instanceCount;this.vertTypeBuffer.getView(R)[0]=Bd;var S=this.indexBuffer.getView(R);Fi(n,S);var A=this.atlasIdBuffer.getView(R);A[0]=m;var P=this.texBuffer.getView(R);P[0]=_.x,P[1]=_.y,P[2]=_.w,P[3]=_.h;var I=this.transformBuffer.getMatrixView(R);this.setTransformMatrix(t,I,s,h,C),this.instanceCount++,C||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(D){c.e(D)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(a.shapeProps&&a.shapeProps.padding&&(s=t.pstyle(a.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,c=i.tex2,v=l.w/(l.w+c.w);o||(v=1-v);var h=this._getAdjustedBB(u,s,o,v);this._applyTransformMatrix(n,h,a,t)}else{var g=a.getBoundingBox(t),p=this._getAdjustedBB(g,s,!0,1);this._applyTransformMatrix(n,p,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var o,s;rE(t);var u=a.getRotation?a.getRotation(i):0;if(u!==0){var l=a.getRotationPoint(i),c=l.x,v=l.y;Nu(t,t,[c,v]),tE(t,t,u);var h=a.getRotationOffset(i);o=h.x+(n.xOffset||0),s=h.y+(n.yOffset||0)}else o=n.x1,s=n.y1;Nu(t,t,[o,s]),wm(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var o=t.x1,s=t.y1,u=t.w,l=t.h,c=t.yOffset;n&&(o-=n,s-=n,u+=2*n,l+=2*n);var v=0,h=u*i;return a&&i<1?u=h:!a&&i<1&&(v=u-h,o+=v,u=h),{x1:o,y1:s,w:u,h:l,xOffset:v,yOffset:c}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=zi;var s=this.indexBuffer.getView(o);Fi(n,s);var u=this.colorBuffer.getView(o);ja([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(t,i)){var o=i.shapeProps,s=this._getVertTypeForShape(t,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(t)){this.drawTexture(t,n,a);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=s,s===Tu||s===Mo){var l=i.getBoundingBox(t),c=this._getCornerRadius(t,o.radius,l),v=this.cornerRadiusBuffer.getView(u);v[0]=c,v[1]=c,v[2]=c,v[3]=c,s===Mo&&(v[0]=0,v[2]=0)}var h=this.indexBuffer.getView(u);Fi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(u);ja(g,p,E);var m=this.lineWidthBuffer.getView(u);if(m[0]=0,m[1]=0,o.border){var b=t.pstyle("border-width").value;if(b>0){var w=t.pstyle("border-color").value,x=t.pstyle("border-opacity").value,_=this.borderColorBuffer.getView(u);ja(w,x,_);var C=t.pstyle("border-position").value;if(C==="inside")m[0]=0,m[1]=-b;else if(C==="outside")m[0]=b,m[1]=0;else{var R=b/2;m[0]=R,m[1]=-R}}}var S=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(t,S,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var a=t.pstyle(n).value;switch(a){case"rectangle":return zi;case"ellipse":return ko;case"roundrectangle":case"round-rectangle":return Tu;case"bottom-round-rectangle":return Mo;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return _a(i,o);var s=t.pstyle(n).pfValue,u=i/2,l=o/2;return Math.min(s,l,u)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var i=t._private.rscratch,o,s,u;if(a==="source"?(o=i.arrowStartX,s=i.arrowStartY,u=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(u)||u==null)){var l=t.pstyle(a+"-arrow-shape").value;if(l!=="none"){var c=t.pstyle(a+"-arrow-color").value,v=t.pstyle("opacity").value,h=t.pstyle("line-opacity").value,g=v*h,p=t.pstyle("width").pfValue,E=t.pstyle("arrow-scale").value,m=this.r.getArrowWidth(p,E),b=this.instanceCount,w=this.transformBuffer.getMatrixView(b);rE(w),Nu(w,w,[o,s]),wm(w,w,[m,m]),tE(w,w,u),this.vertTypeBuffer.getView(b)[0]=Od;var x=this.indexBuffer.getView(b);Fi(n,x);var _=this.colorBuffer.getView(b);ja(c,g,_),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var a=this._getEdgePoints(t);if(a){var i=t.pstyle("opacity").value,o=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,u=t.pstyle("line-color").value,l=i*o;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=nE;var v=this.indexBuffer.getView(c);Fi(n,v);var h=this.colorBuffer.getView(c);ja(u,l,h);var g=this.lineWidthBuffer.getView(c);g[0]=s;var p=this.pointAPointBBuffer.getView(c);p[0]=a[0],p[1]=a[1],p[2]=a[2],p[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var E=0;E<a.length-2;E+=2){var m=this.instanceCount;this.vertTypeBuffer.getView(m)[0]=aE;var b=this.indexBuffer.getView(m);Fi(n,b);var w=this.colorBuffer.getView(m);ja(u,l,w);var x=this.lineWidthBuffer.getView(m);x[0]=s;var _=a[E-2],C=a[E-1],R=a[E],S=a[E+1],A=a[E+2],P=a[E+3],I=a[E+4],D=a[E+5];E==0&&(_=2*R-A+.001,C=2*S-P+.001),E==a.length-4&&(I=2*A-R+.001,D=2*P-S+.001);var M=this.pointAPointBBuffer.getView(m);M[0]=_,M[1]=C,M[2]=R,M[3]=S;var O=this.pointCPointDBuffer.getView(m);O[0]=A,O[1]=P,O[2]=I,O[3]=D,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=t[0],a[1]=t[1];else if(i==n)a[i*2]=t[t.length-2],a[i*2+1]=t[t.length-1];else{var o=i/n;this._setCurvePoint(t,o,a,i*2)}return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(t.length<=2)a[i]=t[0],a[i+1]=t[1];else{for(var o=Array(t.length-2),s=0;s<o.length;s+=2){var u=(1-n)*t[s]+n*t[s+2],l=(1-n)*t[s+1]+n*t[s+3];o[s]=u,o[s+1]=l}return this._setCurvePoint(o,n,a,i)}}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(o),t.bindVertexArray(n);var s=Ft(this.buffers),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.bufferSubData(i)}}catch(p){s.e(p)}finally{s.f()}for(var c=this.batchManager.getAtlases(),v=0;v<c.length;v++)c[v].bufferIfNeeded(t);for(var h=0;h<c.length;h++)t.activeTexture(t.TEXTURE0+h),t.bindTexture(t.TEXTURE_2D,c[h].texture),t.uniform1i(o.uTextures[h],h);t.uniform1f(o.uZoom,U$(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=ja(this.bgColor,1);t.uniform4fv(o.uBGColor,g),t.drawArraysInstanced(t.TRIANGLES,0,a,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(o,s){return o+s.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(o,s){return o+s.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),TA={};TA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=vV(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=eV(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new dV(t,n,r);var a=function(v){return function(h){return t.getTextAngle(h,v)}},i=function(v){return function(h){var g=h.pstyle(v);return g&&g.value}},o=function(v){return function(h){return h.pstyle("".concat(v,"-opacity")).value>0}},s=function(v){var h=v.pstyle("text-events").strValue==="yes";return h?el.USE_BB:el.IGNORE},u=function(v){var h=v.position(),g=h.x,p=h.y,E=v.outerWidth(),m=v.outerHeight();return{w:E,h:m,x1:g-E/2,y1:p-m/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:u,isSimple:K$,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:Md(e.getLabelKey,null),getBoundingBox:kd(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:Md(e.getSourceLabelKey,"source"),getBoundingBox:kd(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:Md(e.getTargetLabelKey,"target"),getBoundingBox:kd(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=vs(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,v){var h=!1;v&&v.length>0&&(h|=t.drawing.invalidate(v)),h&&l()}),hV(t)};function vV(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return e2(t)}function RA(r,e){var t=r._private.rscratch;return qt(t,"labelWrapCachedLines",e)||[]}var Md=function(e,t){return function(n){var a=e(n),i=RA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},kd=function(e,t){return function(n,a){var i=e(n);if(typeof a=="string"){var o=a.indexOf("_");if(o>0){var s=Number(a.substring(o+1)),u=RA(n,t),l=i.h/u.length,c=l*s,v=i.y1+c;return{x1:i.x1,w:i.w,y1:v,h:l,yOffset:c}}}return i}};function hV(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>bA?(gV(r),e.call(r,i)):(pV(r),PA(r,i,Ho.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,o,s,u){return EV(r,i,o)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var a=r.notify;r.notify=function(i,o){a.call(r,i,o),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(o,{type:"node-body"})}}}function gV(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function pV(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function yV(r){var e=r.canvasWidth,t=r.canvasHeight,n=jm(r),a=n.pan,i=n.zoom,o=Id();Nu(o,o,[a.x,a.y]),wm(o,o,[i,i]);var s=Id();tV(s,e,t);var u=Id();return rV(u,s,o),u}function AA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=jm(r),i=a.pan,o=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(o,o)}function mV(r,e){r.drawSelectionRectangle(e,function(t){return AA(r,t)})}function bV(r){var e=r.data.contexts[r.NODE];e.save(),AA(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function wV(r){var e=function(a,i,o){for(var s=a.atlasManager.getAtlasCollection(i),u=r.data.contexts[r.NODE],l=s.atlases,c=0;c<l.length;c++){var v=l[c],h=v.canvas;if(h){var g=h.width,p=h.height,E=g*c,m=h.height*o,b=.4;u.save(),u.scale(b,b),u.drawImage(h,E,m),u.strokeStyle="black",u.rect(E,m,g,p),u.stroke(),u.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function xV(r,e,t,n,a){var i,o,s,u,l=jm(r),c=l.pan,v=l.zoom;{var h=H$(r,c,v,e,t),g=Kr(h,2),p=g[0],E=g[1],m=6;i=p-m/2,o=E-m/2,s=m,u=m}if(s===0||u===0)return[];var b=r.data.contexts[r.WEBGL];b.bindFramebuffer(b.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(b.viewport(0,0,b.canvas.width,b.canvas.height),PA(r,null,Ho.PICKING),r.pickingFrameBuffer.needsDraw=!1);var w=s*u,x=new Uint8Array(w*4);b.readPixels(i,o,s,u,b.RGBA,b.UNSIGNED_BYTE,x),b.bindFramebuffer(b.FRAMEBUFFER,null);for(var _=new Set,C=0;C<w;C++){var R=x.slice(C*4,C*4+4),S=Y$(R)-1;S>=0&&_.add(S)}return _}function EV(r,e,t){var n=xV(r,e,t),a=r.getCachedZSortedEles(),i,o,s=Ft(n),u;try{for(s.s();!(u=s.n()).done;){var l=u.value,c=a[l];if(!i&&c.isNode()&&(i=c),!o&&c.isEdge()&&(o=c),i&&o)break}}catch(v){s.e(v)}finally{s.f()}return[i,o].filter(Boolean)}function Ld(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function PA(r,e,t){var n;r.webglDebug&&(n=performance.now());var a=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&mV(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var o=r.data.contexts[r.WEBGL];t.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=yV(r),u=r.getCachedZSortedEles();if(i=u.length,a.startFrame(s,t),t.screen){for(var l=0;l<u.nondrag.length;l++)Ld(r,l,u.nondrag[l]);for(var c=0;c<u.drag.length;c++)Ld(r,c,u.drag[c])}else if(t.picking)for(var v=0;v<u.length;v++)Ld(r,v,u[v]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(bV(r),wV(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var h=performance.now(),g=!1,p=Math.ceil(h-n),E=a.getDebugInfo(),m=["".concat(i," elements"),"".concat(E.totalInstances," instances"),"".concat(E.batchCount," batches"),"".concat(E.totalAtlases," atlases"),"".concat(E.wrappedCount," wrapped textures"),"".concat(E.simpleCount," simple shapes")].join(", ");if(g)console.log("WebGL (".concat(t.name,") - time ").concat(p,"ms, ").concat(m));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(m)),console.log("Texture Atlases Used:");var b=E.atlasInfo,w=Ft(b),x;try{for(w.s();!(x=w.n()).done;){var _=x.value;console.log(" ".concat(_.type,": ").concat(_.keyCount," keys, ").concat(_.atlasCount," atlases"))}}catch(C){w.e(C)}finally{w.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}var Ma={};Ma.drawPolygonPath=function(r,e,t,n,a,i){var o=n/2,s=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var u=1;u<i.length/2;u++)r.lineTo(e+o*i[u*2],t+s*i[u*2+1]);r.closePath()};Ma.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return fA(r,s)}),r.closePath()};Ma.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,u=i==="auto"?_a(n,a):Math.min(i,s,o);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+o,t-s,e+o,t,u),r.arcTo(e+o,t+s,e,t+s,u),r.arcTo(e-o,t+s,e-o,t,u),r.arcTo(e-o,t-s,e,t-s,u),r.lineTo(e,t-s),r.closePath()};Ma.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,u=i==="auto"?_a(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+o,t-s),r.lineTo(e+o,t),r.arcTo(e+o,t+s,e,t+s,u),r.arcTo(e-o,t+s,e-o,t,u),r.lineTo(e-o,t-s),r.lineTo(e,t-s),r.closePath()};Ma.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,u=a/2,l=o==="auto"?Mm():o;r.beginPath&&r.beginPath(),r.moveTo(e-s+l,t-u),r.lineTo(e+s-l,t-u),r.lineTo(e+s,t-u+l),r.lineTo(e+s,t+u-l),r.lineTo(e+s-l,t+u),r.lineTo(e-s+l,t+u),r.lineTo(e-s,t+u-l),r.lineTo(e-s,t-u+l),r.closePath()};Ma.drawBarrelPath=function(r,e,t,n,a){var i=n/2,o=a/2,s=e-i,u=e+i,l=t-o,c=t+o,v=om(n,a),h=v.widthOffset,g=v.heightOffset,p=v.ctrlPtOffsetPct*h;r.beginPath&&r.beginPath(),r.moveTo(s,l+g),r.lineTo(s,c-g),r.quadraticCurveTo(s+p,c,s+h,c),r.lineTo(u-h,c),r.quadraticCurveTo(u-p,c,u,c-g),r.lineTo(u,l+g),r.quadraticCurveTo(u-p,l,u-h,l),r.lineTo(s+h,l),r.quadraticCurveTo(s+p,l,s,l+g),r.closePath()};var iE=Math.sin(0),oE=Math.cos(0),xm={},Em={},DA=Math.PI/40;for(var $i=0*Math.PI;$i<2*Math.PI;$i+=DA)xm[$i]=Math.sin($i),Em[$i]=Math.cos($i);Ma.drawEllipsePath=function(r,e,t,n,a){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,a/2,0,0,2*Math.PI);else for(var i,o,s=n/2,u=a/2,l=0*Math.PI;l<2*Math.PI;l+=DA)i=e-s*xm[l]*iE+s*Em[l]*oE,o=t+u*Em[l]*iE+u*xm[l]*oE,l===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var bs={};bs.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};bs.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),n=t.boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],o=r.full?Math.ceil(n.h):a[3],s=De(r.maxWidth)||De(r.maxHeight),u=this.getPixelRatio(),l=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,l=r.scale;else if(s){var c=1/0,v=1/0;De(r.maxWidth)&&(c=l*r.maxWidth/i),De(r.maxHeight)&&(v=l*r.maxHeight/o),l=Math.min(c,v),i*=l,o*=l}s||(i*=u,o*=u,l*=u);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var g=h.getContext("2d");if(i>0&&o>0){g.clearRect(0,0,i,o),g.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*l,-n.y1*l),g.scale(l,l),this.drawElements(g,p),g.scale(1/l,1/l),g.translate(n.x1*l,n.y1*l);else{var E=e.pan(),m={x:E.x*l,y:E.y*l};l*=e.zoom(),g.translate(m.x,m.y),g.scale(l,l),this.drawElements(g,p),g.scale(1/l,1/l),g.translate(-m.x,-m.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function _V(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),a=new Uint8Array(n),i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return new Blob([n],{type:e})}function sE(r){var e=r.indexOf(",");return r.substr(e+1)}function IA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new to(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return _V(sE(n()),t);case"base64":return sE(n());case"base64uri":default:return n()}}bs.png=function(r){return IA(r,this.bufferCanvasImage(r),"image/png")};bs.jpg=function(r){return IA(r,this.bufferCanvasImage(r),"image/jpeg")};var BA={};BA.nodeShapeImpl=function(r,e,t,n,a,i,o,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,s);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}};var CV=OA,ur=OA.prototype;ur.CANVAS_LAYERS=3;ur.SELECT_BOX=0;ur.DRAG=1;ur.NODE=2;ur.WEBGL=3;ur.CANVAS_TYPES=["2d","2d","2d","webgl2"];ur.BUFFER_COUNT=3;ur.TEXTURE_BUFFER=0;ur.MOTIONBLUR_BUFFER_NODE=1;ur.MOTIONBLUR_BUFFER_DRAG=2;function OA(r){var e=this,t=e.cy.window(),n=t.document;r.webgl&&(ur.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(ur.CANVAS_LAYERS),contexts:new Array(ur.CANVAS_LAYERS),canvasNeedsRedraw:new Array(ur.CANVAS_LAYERS),bufferCanvases:new Array(ur.BUFFER_COUNT),bufferContexts:new Array(ur.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.style[a]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};mq()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<ur.CANVAS_LAYERS;l++){var c=e.data.canvases[l]=n.createElement("canvas"),v=ur.CANVAS_TYPES[l];e.data.contexts[l]=c.getContext(v),e.data.contexts[l]||Mr("Could not create canvas of type "+v),Object.keys(u).forEach(function(oe){c.style[oe]=u[oe]}),c.style.position="absolute",c.setAttribute("data-id","layer"+l),c.style.zIndex=String(ur.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[ur.NODE].setAttribute("data-id","layer"+ur.NODE+"-node"),e.data.canvases[ur.SELECT_BOX].setAttribute("data-id","layer"+ur.SELECT_BOX+"-selectbox"),e.data.canvases[ur.DRAG].setAttribute("data-id","layer"+ur.DRAG+"-drag"),e.data.canvases[ur.WEBGL]&&e.data.canvases[ur.WEBGL].setAttribute("data-id","layer"+ur.WEBGL+"-webgl");for(var l=0;l<ur.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=n.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var h=Dt(),g=function(Y){return{x:(Y.x1+Y.x2)/2,y:(Y.y1+Y.y2)/2}},p=function(Y){return{x:-Y.w/2,y:-Y.h/2}},E=function(Y){var X=Y[0]._private,re=X.oldBackgroundTimestamp===X.backgroundTimestamp;return!re},m=function(Y){return Y[0]._private.nodeKey},b=function(Y){return Y[0]._private.labelStyleKey},w=function(Y){return Y[0]._private.sourceLabelStyleKey},x=function(Y){return Y[0]._private.targetLabelStyleKey},_=function(Y,X,re,le,he){return e.drawElement(Y,X,re,!1,!1,he)},C=function(Y,X,re,le,he){return e.drawElementText(Y,X,re,le,"main",he)},R=function(Y,X,re,le,he){return e.drawElementText(Y,X,re,le,"source",he)},S=function(Y,X,re,le,he){return e.drawElementText(Y,X,re,le,"target",he)},A=function(Y){return Y.boundingBox(),Y[0]._private.bodyBounds},P=function(Y){return Y.boundingBox(),Y[0]._private.labelBounds.main||h},I=function(Y){return Y.boundingBox(),Y[0]._private.labelBounds.source||h},D=function(Y){return Y.boundingBox(),Y[0]._private.labelBounds.target||h},M=function(Y,X){return X},O=function(Y){return g(A(Y))},N=function(Y,X,re){var le=Y?Y+"-":"";return{x:X.x+re.pstyle(le+"text-margin-x").pfValue,y:X.y+re.pstyle(le+"text-margin-y").pfValue}},V=function(Y,X,re){var le=Y[0]._private.rscratch;return{x:le[X],y:le[re]}},$=function(Y){return N("",V(Y,"labelX","labelY"),Y)},G=function(Y){return N("source",V(Y,"sourceLabelX","sourceLabelY"),Y)},U=function(Y){return N("target",V(Y,"targetLabelX","targetLabelY"),Y)},J=function(Y){return p(A(Y))},W=function(Y){return p(I(Y))},H=function(Y){return p(D(Y))},Z=function(Y){var X=P(Y),re=p(P(Y));if(Y.isNode()){switch(Y.pstyle("text-halign").value){case"left":re.x=-X.w-(X.leftPad||0);break;case"right":re.x=-(X.rightPad||0);break}switch(Y.pstyle("text-valign").value){case"top":re.y=-X.h-(X.topPad||0);break;case"bottom":re.y=-(X.botPad||0);break}}return re},ne=e.data.eleTxrCache=new No(e,{getKey:m,doesEleInvalidateKey:E,drawElement:_,getBoundingBox:A,getRotationPoint:O,getRotationOffset:J,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),F=e.data.lblTxrCache=new No(e,{getKey:b,drawElement:C,getBoundingBox:P,getRotationPoint:$,getRotationOffset:Z,isVisible:M}),z=e.data.slbTxrCache=new No(e,{getKey:w,drawElement:R,getBoundingBox:I,getRotationPoint:G,getRotationOffset:W,isVisible:M}),j=e.data.tlbTxrCache=new No(e,{getKey:x,drawElement:S,getBoundingBox:D,getRotationPoint:U,getRotationOffset:H,isVisible:M}),ee=e.data.lyrTxrCache=new wA(e);e.onUpdateEleCalcs(function(Y,X){ne.invalidateElements(X),F.invalidateElements(X),z.invalidateElements(X),j.invalidateElements(X),ee.invalidateElements(X);for(var re=0;re<X.length;re++){var le=X[re]._private;le.oldBackgroundTimestamp=le.backgroundTimestamp}});var ie=function(Y){for(var X=0;X<Y.length;X++)ee.enqueueElementRefinement(Y[X].ele)};ne.onDequeue(ie),F.onDequeue(ie),z.onDequeue(ie),j.onDequeue(ie),r.webgl&&e.initWebgl(r,{getStyleKey:m,getLabelKey:b,getSourceLabelKey:w,getTargetLabelKey:x,drawElement:_,drawLabel:C,drawSourceLabel:R,drawTargetLabel:S,getElementBox:A,getLabelBox:P,getSourceLabelBox:I,getTargetLabelBox:D,getElementRotationPoint:O,getElementRotationOffset:J,getLabelRotationPoint:$,getSourceLabelRotationPoint:G,getTargetLabelRotationPoint:U,getLabelRotationOffset:Z,getSourceLabelRotationOffset:W,getTargetLabelRotationOffset:H})}ur.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[ur.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[ur.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[ur.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var SV=typeof Path2D<"u";ur.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};ur.usePaths=function(){return SV&&this.pathsEnabled};ur.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};ur.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};ur.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":et(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),a=n.document;t=a.createElement("canvas"),t.width=r,t.height=e}return t};[xA,On,Xn,Km,li,Oa,It,TA,Ma,bs,BA].forEach(function(r){He(ur,r)});var TV=[{name:"null",impl:sA},{name:"base",impl:yA},{name:"canvas",impl:CV}],RV=[{type:"layout",extensions:Q5},{type:"renderer",extensions:TV}],MA={},kA={};function LA(r,e,t){var n=t,a=function(A){Er("Can not register `"+e+"` for `"+r+"` since `"+A+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(ns.prototype[e])return a(e);ns.prototype[e]=t}else if(r==="collection"){if(vt.prototype[e])return a(e);vt.prototype[e]=t}else if(r==="layout"){for(var i=function(A){this.options=A,t.call(this,A),pr(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var c=t.prototype.stop;o.stop=function(){var S=this.options;if(S&&S.animate){var A=this.animations;if(A)for(var P=0;P<A.length;P++)A[P].stop()}return c?c.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var v=function(A){return A._private.cy},h={addEventFields:function(A,P){P.layout=A,P.cy=v(A),P.target=A},bubble:function(){return!0},parent:function(A){return v(A)}};He(o,{createEmitter:function(){return this._private.emitter=new hl(h,this),this},emitter:function(){return this._private.emitter},on:function(A,P){return this.emitter().on(A,P),this},one:function(A,P){return this.emitter().one(A,P),this},once:function(A,P){return this.emitter().one(A,P),this},removeListener:function(A,P){return this.emitter().removeListener(A,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(A,P){return this.emitter().emit(A,P),this}}),xr.eventAliasesOn(o),n=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var g=qA("renderer","base"),p=g.prototype,E=t,m=t.prototype,b=function(){g.apply(this,arguments),E.apply(this,arguments)},w=b.prototype;for(var x in p){var _=p[x],C=m[x]!=null;if(C)return a(x);w[x]=_}for(var R in m)w[R]=m[R];p.clientFunctions.forEach(function(S){w[S]=w[S]||function(){Mr("Renderer does not implement `renderer."+S+"()` on its prototype")}}),n=b}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Mr(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return r2({map:MA,keys:[r,e],value:n})}function qA(r,e){return t2({map:MA,keys:[r,e]})}function AV(r,e,t,n,a){return r2({map:kA,keys:[r,e,t,n],value:a})}function PV(r,e,t,n){return t2({map:kA,keys:[r,e,t,n]})}var _m=function(){if(arguments.length===2)return qA.apply(null,arguments);if(arguments.length===3)return LA.apply(null,arguments);if(arguments.length===4)return PV.apply(null,arguments);if(arguments.length===5)return AV.apply(null,arguments);Mr("Invalid extension access syntax")};ns.prototype.extension=_m;RV.forEach(function(r){r.extensions.forEach(function(e){LA(r.type,e.name,e.impl)})});var rl=function(){if(!(this instanceof rl))return new rl;this.length=0},oi=rl.prototype;oi.instanceString=function(){return"stylesheet"};oi.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};oi.css=function(r,e){var t=this.length-1;if(Ge(r))this[t].properties.push({name:r,value:e});else if(pr(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],s=n[o];if(s!=null){var u=it.properties[o]||it.properties[al(o)];if(u!=null){var l=u.name,c=s;this[t].properties.push({name:l,value:c})}}}return this};oi.style=oi.css;oi.generateStyle=function(r){var e=new it(r);return this.appendToStyle(e)};oi.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],n=t.selector,a=t.properties;r.selector(n);for(var i=0;i<a.length;i++){var o=a[i];r.css(o.name,o.value)}}return r};var DV="3.33.1",sn=function(e){if(e===void 0&&(e={}),pr(e))return new ns(e);if(Ge(e))return _m.apply(_m,arguments)};sn.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(sn),r.apply(null,e),this};sn.warnings=function(r){return l2(r)};sn.version=DV;sn.stylesheet=sn.Stylesheet=rl;var wt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function El(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Fu={exports:{}};function Ym(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qd,uE;function IV(){if(uE)return qd;uE=1;function r(){this.__data__=[],this.size=0}return qd=r,qd}var Nd,lE;function so(){if(lE)return Nd;lE=1;function r(e,t){return e===t||e!==e&&t!==t}return Nd=r,Nd}var Fd,fE;function _l(){if(fE)return Fd;fE=1;var r=so();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Fd=e,Fd}var zd,cE;function BV(){if(cE)return zd;cE=1;var r=_l(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return zd=n,zd}var $d,dE;function OV(){if(dE)return $d;dE=1;var r=_l();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return $d=e,$d}var Vd,vE;function MV(){if(vE)return Vd;vE=1;var r=_l();function e(t){return r(this.__data__,t)>-1}return Vd=e,Vd}var Gd,hE;function kV(){if(hE)return Gd;hE=1;var r=_l();function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}return Gd=e,Gd}var Wd,gE;function Cl(){if(gE)return Wd;gE=1;var r=IV(),e=BV(),t=OV(),n=MV(),a=kV();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Wd=i,Wd}var Ud,pE;function LV(){if(pE)return Ud;pE=1;var r=Cl();function e(){this.__data__=new r,this.size=0}return Ud=e,Ud}var Hd,yE;function qV(){if(yE)return Hd;yE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return Hd=r,Hd}var Kd,mE;function NV(){if(mE)return Kd;mE=1;function r(e){return this.__data__.get(e)}return Kd=r,Kd}var jd,bE;function FV(){if(bE)return jd;bE=1;function r(e){return this.__data__.has(e)}return jd=r,jd}var Yd,wE;function NA(){if(wE)return Yd;wE=1;var r=typeof wt=="object"&&wt&&wt.Object===Object&&wt;return Yd=r,Yd}var Zd,xE;function xn(){if(xE)return Zd;xE=1;var r=NA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Zd=t,Zd}var Xd,EE;function uo(){if(EE)return Xd;EE=1;var r=xn(),e=r.Symbol;return Xd=e,Xd}var Qd,_E;function zV(){if(_E)return Qd;_E=1;var r=uo(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),u=o[a];try{o[a]=void 0;var l=!0}catch{}var c=n.call(o);return l&&(s?o[a]=u:delete o[a]),c}return Qd=i,Qd}var Jd,CE;function $V(){if(CE)return Jd;CE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return Jd=t,Jd}var ev,SE;function fi(){if(SE)return ev;SE=1;var r=uo(),e=zV(),t=$V(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return ev=o,ev}var rv,TE;function ln(){if(TE)return rv;TE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return rv=r,rv}var tv,RE;function ws(){if(RE)return tv;RE=1;var r=fi(),e=ln(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=r(s);return u==n||u==a||u==t||u==i}return tv=o,tv}var nv,AE;function VV(){if(AE)return nv;AE=1;var r=xn(),e=r["__core-js_shared__"];return nv=e,nv}var av,PE;function GV(){if(PE)return av;PE=1;var r=VV(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return av=t,av}var iv,DE;function FA(){if(DE)return iv;DE=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return iv=t,iv}var ov,IE;function WV(){if(IE)return ov;IE=1;var r=ws(),e=GV(),t=ln(),n=FA(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,c=RegExp("^"+u.call(l).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return ov=v,ov}var sv,BE;function UV(){if(BE)return sv;BE=1;function r(e,t){return e==null?void 0:e[t]}return sv=r,sv}var uv,OE;function ci(){if(OE)return uv;OE=1;var r=WV(),e=UV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return uv=t,uv}var lv,ME;function Zm(){if(ME)return lv;ME=1;var r=ci(),e=xn(),t=r(e,"Map");return lv=t,lv}var fv,kE;function Sl(){if(kE)return fv;kE=1;var r=ci(),e=r(Object,"create");return fv=e,fv}var cv,LE;function HV(){if(LE)return cv;LE=1;var r=Sl();function e(){this.__data__=r?r(null):{},this.size=0}return cv=e,cv}var dv,qE;function KV(){if(qE)return dv;qE=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return dv=r,dv}var vv,NE;function jV(){if(NE)return vv;NE=1;var r=Sl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return vv=a,vv}var hv,FE;function YV(){if(FE)return hv;FE=1;var r=Sl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return hv=n,hv}var gv,zE;function ZV(){if(zE)return gv;zE=1;var r=Sl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return gv=t,gv}var pv,$E;function XV(){if($E)return pv;$E=1;var r=HV(),e=KV(),t=jV(),n=YV(),a=ZV();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,pv=i,pv}var yv,VE;function QV(){if(VE)return yv;VE=1;var r=XV(),e=Cl(),t=Zm();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return yv=n,yv}var mv,GE;function JV(){if(GE)return mv;GE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return mv=r,mv}var bv,WE;function Tl(){if(WE)return bv;WE=1;var r=JV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return bv=e,bv}var wv,UE;function e3(){if(UE)return wv;UE=1;var r=Tl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return wv=e,wv}var xv,HE;function r3(){if(HE)return xv;HE=1;var r=Tl();function e(t){return r(this,t).get(t)}return xv=e,xv}var Ev,KE;function t3(){if(KE)return Ev;KE=1;var r=Tl();function e(t){return r(this,t).has(t)}return Ev=e,Ev}var _v,jE;function n3(){if(jE)return _v;jE=1;var r=Tl();function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}return _v=e,_v}var Cv,YE;function Xm(){if(YE)return Cv;YE=1;var r=QV(),e=e3(),t=r3(),n=t3(),a=n3();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Cv=i,Cv}var Sv,ZE;function a3(){if(ZE)return Sv;ZE=1;var r=Cl(),e=Zm(),t=Xm(),n=200;function a(i,o){var s=this.__data__;if(s instanceof r){var u=s.__data__;if(!e||u.length<n-1)return u.push([i,o]),this.size=++s.size,this;s=this.__data__=new t(u)}return s.set(i,o),this.size=s.size,this}return Sv=a,Sv}var Tv,XE;function Rl(){if(XE)return Tv;XE=1;var r=Cl(),e=LV(),t=qV(),n=NV(),a=FV(),i=a3();function o(s){var u=this.__data__=new r(s);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Tv=o,Tv}var Rv,QE;function Qm(){if(QE)return Rv;QE=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e}return Rv=r,Rv}var Av,JE;function zA(){if(JE)return Av;JE=1;var r=ci(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Av=e,Av}var Pv,e_;function Al(){if(e_)return Pv;e_=1;var r=zA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Pv=e,Pv}var Dv,r_;function Pl(){if(r_)return Dv;r_=1;var r=Al(),e=so(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var u=i[o];(!(n.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&r(i,o,s)}return Dv=a,Dv}var Iv,t_;function xs(){if(t_)return Iv;t_=1;var r=Pl(),e=Al();function t(n,a,i,o){var s=!i;i||(i={});for(var u=-1,l=a.length;++u<l;){var c=a[u],v=o?o(i[c],n[c],c,i,n):void 0;v===void 0&&(v=n[c]),s?e(i,c,v):r(i,c,v)}return i}return Iv=t,Iv}var Bv,n_;function i3(){if(n_)return Bv;n_=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return Bv=r,Bv}var Ov,a_;function Mn(){if(a_)return Ov;a_=1;function r(e){return e!=null&&typeof e=="object"}return Ov=r,Ov}var Mv,i_;function o3(){if(i_)return Mv;i_=1;var r=fi(),e=Mn(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return Mv=n,Mv}var kv,o_;function Es(){if(o_)return kv;o_=1;var r=o3(),e=Mn(),t=Object.prototype,n=t.hasOwnProperty,a=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return kv=i,kv}var Lv,s_;function jr(){if(s_)return Lv;s_=1;var r=Array.isArray;return Lv=r,Lv}var Fo={exports:{}},qv,u_;function s3(){if(u_)return qv;u_=1;function r(){return!1}return qv=r,qv}Fo.exports;var l_;function lo(){return l_||(l_=1,(function(r,e){var t=xn(),n=s3(),a=e&&!e.nodeType&&e,i=a&&!0&&r&&!r.nodeType&&r,o=i&&i.exports===a,s=o?t.Buffer:void 0,u=s?s.isBuffer:void 0,l=u||n;r.exports=l})(Fo,Fo.exports)),Fo.exports}var Nv,f_;function Dl(){if(f_)return Nv;f_=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Nv=t,Nv}var Fv,c_;function Jm(){if(c_)return Fv;c_=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Fv=e,Fv}var zv,d_;function u3(){if(d_)return zv;d_=1;var r=fi(),e=Jm(),t=Mn(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",u="[object Function]",l="[object Map]",c="[object Number]",v="[object Object]",h="[object RegExp]",g="[object Set]",p="[object String]",E="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",C="[object Int16Array]",R="[object Int32Array]",S="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]",D={};D[w]=D[x]=D[_]=D[C]=D[R]=D[S]=D[A]=D[P]=D[I]=!0,D[n]=D[a]=D[m]=D[i]=D[b]=D[o]=D[s]=D[u]=D[l]=D[c]=D[v]=D[h]=D[g]=D[p]=D[E]=!1;function M(O){return t(O)&&e(O.length)&&!!D[r(O)]}return zv=M,zv}var $v,v_;function Il(){if(v_)return $v;v_=1;function r(e){return function(t){return e(t)}}return $v=r,$v}var zo={exports:{}};zo.exports;var h_;function e0(){return h_||(h_=1,(function(r,e){var t=NA(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i&&t.process,s=(function(){try{var u=a&&a.require&&a.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();r.exports=s})(zo,zo.exports)),zo.exports}var Vv,g_;function _s(){if(g_)return Vv;g_=1;var r=u3(),e=Il(),t=e0(),n=t&&t.isTypedArray,a=n?e(n):r;return Vv=a,Vv}var Gv,p_;function $A(){if(p_)return Gv;p_=1;var r=i3(),e=Es(),t=jr(),n=lo(),a=Dl(),i=_s(),o=Object.prototype,s=o.hasOwnProperty;function u(l,c){var v=t(l),h=!v&&e(l),g=!v&&!h&&n(l),p=!v&&!h&&!g&&i(l),E=v||h||g||p,m=E?r(l.length,String):[],b=m.length;for(var w in l)(c||s.call(l,w))&&!(E&&(w=="length"||g&&(w=="offset"||w=="parent")||p&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||a(w,b)))&&m.push(w);return m}return Gv=u,Gv}var Wv,y_;function Bl(){if(y_)return Wv;y_=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Wv=e,Wv}var Uv,m_;function VA(){if(m_)return Uv;m_=1;function r(e,t){return function(n){return e(t(n))}}return Uv=r,Uv}var Hv,b_;function l3(){if(b_)return Hv;b_=1;var r=VA(),e=r(Object.keys,Object);return Hv=e,Hv}var Kv,w_;function r0(){if(w_)return Kv;w_=1;var r=Bl(),e=l3(),t=Object.prototype,n=t.hasOwnProperty;function a(i){if(!r(i))return e(i);var o=[];for(var s in Object(i))n.call(i,s)&&s!="constructor"&&o.push(s);return o}return Kv=a,Kv}var jv,x_;function Qn(){if(x_)return jv;x_=1;var r=ws(),e=Jm();function t(n){return n!=null&&e(n.length)&&!r(n)}return jv=t,jv}var Yv,E_;function ka(){if(E_)return Yv;E_=1;var r=$A(),e=r0(),t=Qn();function n(a){return t(a)?r(a):e(a)}return Yv=n,Yv}var Zv,__;function f3(){if(__)return Zv;__=1;var r=xs(),e=ka();function t(n,a){return n&&r(a,e(a),n)}return Zv=t,Zv}var Xv,C_;function c3(){if(C_)return Xv;C_=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Xv=r,Xv}var Qv,S_;function d3(){if(S_)return Qv;S_=1;var r=ln(),e=Bl(),t=c3(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!r(o))return t(o);var s=e(o),u=[];for(var l in o)l=="constructor"&&(s||!a.call(o,l))||u.push(l);return u}return Qv=i,Qv}var Jv,T_;function di(){if(T_)return Jv;T_=1;var r=$A(),e=d3(),t=Qn();function n(a){return t(a)?r(a,!0):e(a)}return Jv=n,Jv}var eh,R_;function v3(){if(R_)return eh;R_=1;var r=xs(),e=di();function t(n,a){return n&&r(a,e(a),n)}return eh=t,eh}var $o={exports:{}};$o.exports;var A_;function GA(){return A_||(A_=1,(function(r,e){var t=xn(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(l,c){if(c)return l.slice();var v=l.length,h=s?s(v):new l.constructor(v);return l.copy(h),h}r.exports=u})($o,$o.exports)),$o.exports}var rh,P_;function WA(){if(P_)return rh;P_=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return rh=r,rh}var th,D_;function UA(){if(D_)return th;D_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}return th=r,th}var nh,I_;function HA(){if(I_)return nh;I_=1;function r(){return[]}return nh=r,nh}var ah,B_;function t0(){if(B_)return ah;B_=1;var r=UA(),e=HA(),t=Object.prototype,n=t.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),r(a(o),function(s){return n.call(o,s)}))}:e;return ah=i,ah}var ih,O_;function h3(){if(O_)return ih;O_=1;var r=xs(),e=t0();function t(n,a){return r(n,e(n),a)}return ih=t,ih}var oh,M_;function n0(){if(M_)return oh;M_=1;function r(e,t){for(var n=-1,a=t.length,i=e.length;++n<a;)e[i+n]=t[n];return e}return oh=r,oh}var sh,k_;function Ol(){if(k_)return sh;k_=1;var r=VA(),e=r(Object.getPrototypeOf,Object);return sh=e,sh}var uh,L_;function KA(){if(L_)return uh;L_=1;var r=n0(),e=Ol(),t=t0(),n=HA(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return uh=i,uh}var lh,q_;function g3(){if(q_)return lh;q_=1;var r=xs(),e=KA();function t(n,a){return r(n,e(n),a)}return lh=t,lh}var fh,N_;function jA(){if(N_)return fh;N_=1;var r=n0(),e=jr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return fh=t,fh}var ch,F_;function YA(){if(F_)return ch;F_=1;var r=jA(),e=t0(),t=ka();function n(a){return r(a,t,e)}return ch=n,ch}var dh,z_;function p3(){if(z_)return dh;z_=1;var r=jA(),e=KA(),t=di();function n(a){return r(a,t,e)}return dh=n,dh}var vh,$_;function y3(){if($_)return vh;$_=1;var r=ci(),e=xn(),t=r(e,"DataView");return vh=t,vh}var hh,V_;function m3(){if(V_)return hh;V_=1;var r=ci(),e=xn(),t=r(e,"Promise");return hh=t,hh}var gh,G_;function ZA(){if(G_)return gh;G_=1;var r=ci(),e=xn(),t=r(e,"Set");return gh=t,gh}var ph,W_;function b3(){if(W_)return ph;W_=1;var r=ci(),e=xn(),t=r(e,"WeakMap");return ph=t,ph}var yh,U_;function fo(){if(U_)return yh;U_=1;var r=y3(),e=Zm(),t=m3(),n=ZA(),a=b3(),i=fi(),o=FA(),s="[object Map]",u="[object Object]",l="[object Promise]",c="[object Set]",v="[object WeakMap]",h="[object DataView]",g=o(r),p=o(e),E=o(t),m=o(n),b=o(a),w=i;return(r&&w(new r(new ArrayBuffer(1)))!=h||e&&w(new e)!=s||t&&w(t.resolve())!=l||n&&w(new n)!=c||a&&w(new a)!=v)&&(w=function(x){var _=i(x),C=_==u?x.constructor:void 0,R=C?o(C):"";if(R)switch(R){case g:return h;case p:return s;case E:return l;case m:return c;case b:return v}return _}),yh=w,yh}var mh,H_;function w3(){if(H_)return mh;H_=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return mh=t,mh}var bh,K_;function XA(){if(K_)return bh;K_=1;var r=xn(),e=r.Uint8Array;return bh=e,bh}var wh,j_;function a0(){if(j_)return wh;j_=1;var r=XA();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return wh=e,wh}var xh,Y_;function x3(){if(Y_)return xh;Y_=1;var r=a0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return xh=e,xh}var Eh,Z_;function E3(){if(Z_)return Eh;Z_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Eh=e,Eh}var _h,X_;function _3(){if(X_)return _h;X_=1;var r=uo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return _h=n,_h}var Ch,Q_;function QA(){if(Q_)return Ch;Q_=1;var r=a0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return Ch=e,Ch}var Sh,J_;function C3(){if(J_)return Sh;J_=1;var r=a0(),e=x3(),t=E3(),n=_3(),a=QA(),i="[object Boolean]",o="[object Date]",s="[object Map]",u="[object Number]",l="[object RegExp]",c="[object Set]",v="[object String]",h="[object Symbol]",g="[object ArrayBuffer]",p="[object DataView]",E="[object Float32Array]",m="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",_="[object Uint8Array]",C="[object Uint8ClampedArray]",R="[object Uint16Array]",S="[object Uint32Array]";function A(P,I,D){var M=P.constructor;switch(I){case g:return r(P);case i:case o:return new M(+P);case p:return e(P,D);case E:case m:case b:case w:case x:case _:case C:case R:case S:return a(P,D);case s:return new M;case u:case v:return new M(P);case l:return t(P);case c:return new M;case h:return n(P)}}return Sh=A,Sh}var Th,eC;function JA(){if(eC)return Th;eC=1;var r=ln(),e=Object.create,t=(function(){function n(){}return function(a){if(!r(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}})();return Th=t,Th}var Rh,rC;function eP(){if(rC)return Rh;rC=1;var r=JA(),e=Ol(),t=Bl();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Rh=n,Rh}var Ah,tC;function S3(){if(tC)return Ah;tC=1;var r=fo(),e=Mn(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return Ah=n,Ah}var Ph,nC;function T3(){if(nC)return Ph;nC=1;var r=S3(),e=Il(),t=e0(),n=t&&t.isMap,a=n?e(n):r;return Ph=a,Ph}var Dh,aC;function R3(){if(aC)return Dh;aC=1;var r=fo(),e=Mn(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Dh=n,Dh}var Ih,iC;function A3(){if(iC)return Ih;iC=1;var r=R3(),e=Il(),t=e0(),n=t&&t.isSet,a=n?e(n):r;return Ih=a,Ih}var Bh,oC;function rP(){if(oC)return Bh;oC=1;var r=Rl(),e=Qm(),t=Pl(),n=f3(),a=v3(),i=GA(),o=WA(),s=h3(),u=g3(),l=YA(),c=p3(),v=fo(),h=w3(),g=C3(),p=eP(),E=jr(),m=lo(),b=T3(),w=ln(),x=A3(),_=ka(),C=di(),R=1,S=2,A=4,P="[object Arguments]",I="[object Array]",D="[object Boolean]",M="[object Date]",O="[object Error]",N="[object Function]",V="[object GeneratorFunction]",$="[object Map]",G="[object Number]",U="[object Object]",J="[object RegExp]",W="[object Set]",H="[object String]",Z="[object Symbol]",ne="[object WeakMap]",F="[object ArrayBuffer]",z="[object DataView]",j="[object Float32Array]",ee="[object Float64Array]",ie="[object Int8Array]",oe="[object Int16Array]",Y="[object Int32Array]",X="[object Uint8Array]",re="[object Uint8ClampedArray]",le="[object Uint16Array]",he="[object Uint32Array]",be={};be[P]=be[I]=be[F]=be[z]=be[D]=be[M]=be[j]=be[ee]=be[ie]=be[oe]=be[Y]=be[$]=be[G]=be[U]=be[J]=be[W]=be[H]=be[Z]=be[X]=be[re]=be[le]=be[he]=!0,be[O]=be[N]=be[ne]=!1;function fe(ue,Se,Ae,Te,Pe,Ie){var Le,Fe=Se&R,je=Se&S,lr=Se&A;if(Ae&&(Le=Pe?Ae(ue,Te,Pe,Ie):Ae(ue)),Le!==void 0)return Le;if(!w(ue))return ue;var ir=E(ue);if(ir){if(Le=h(ue),!Fe)return o(ue,Le)}else{var Xe=v(ue),fr=Xe==N||Xe==V;if(m(ue))return i(ue,Fe);if(Xe==U||Xe==P||fr&&!Pe){if(Le=je||fr?{}:p(ue),!Fe)return je?u(ue,a(Le,ue)):s(ue,n(Le,ue))}else{if(!be[Xe])return Pe?ue:{};Le=g(ue,Xe,Fe)}}Ie||(Ie=new r);var Ue=Ie.get(ue);if(Ue)return Ue;Ie.set(ue,Le),x(ue)?ue.forEach(function(L){Le.add(fe(L,Se,Ae,L,ue,Ie))}):b(ue)&&ue.forEach(function(L,se){Le.set(se,fe(L,Se,Ae,se,ue,Ie))});var Oe=lr?je?c:l:je?C:_,ge=ir?void 0:Oe(ue);return e(ge||ue,function(L,se){ge&&(se=L,L=ue[se]),t(Le,se,fe(L,Se,Ae,se,ue,Ie))}),Le}return Bh=fe,Bh}var Oh,sC;function P3(){if(sC)return Oh;sC=1;var r=rP(),e=4;function t(n){return r(n,e)}return Oh=t,Oh}var Mh,uC;function i0(){if(uC)return Mh;uC=1;function r(e){return function(){return e}}return Mh=r,Mh}var kh,lC;function D3(){if(lC)return kh;lC=1;function r(e){return function(t,n,a){for(var i=-1,o=Object(t),s=a(t),u=s.length;u--;){var l=s[e?u:++i];if(n(o[l],l,o)===!1)break}return t}}return kh=r,kh}var Lh,fC;function o0(){if(fC)return Lh;fC=1;var r=D3(),e=r();return Lh=e,Lh}var qh,cC;function s0(){if(cC)return qh;cC=1;var r=o0(),e=ka();function t(n,a){return n&&r(n,a,e)}return qh=t,qh}var Nh,dC;function I3(){if(dC)return Nh;dC=1;var r=Qn();function e(t,n){return function(a,i){if(a==null)return a;if(!r(a))return t(a,i);for(var o=a.length,s=n?o:-1,u=Object(a);(n?s--:++s<o)&&i(u[s],s,u)!==!1;);return a}}return Nh=e,Nh}var Fh,vC;function Ml(){if(vC)return Fh;vC=1;var r=s0(),e=I3(),t=e(r);return Fh=t,Fh}var zh,hC;function vi(){if(hC)return zh;hC=1;function r(e){return e}return zh=r,zh}var $h,gC;function tP(){if(gC)return $h;gC=1;var r=vi();function e(t){return typeof t=="function"?t:r}return $h=e,$h}var Vh,pC;function nP(){if(pC)return Vh;pC=1;var r=Qm(),e=Ml(),t=tP(),n=jr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Vh=a,Vh}var Gh,yC;function aP(){return yC||(yC=1,Gh=nP()),Gh}var Wh,mC;function B3(){if(mC)return Wh;mC=1;var r=Ml();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Wh=e,Wh}var Uh,bC;function O3(){if(bC)return Uh;bC=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Uh=e,Uh}var Hh,wC;function M3(){if(wC)return Hh;wC=1;function r(e){return this.__data__.has(e)}return Hh=r,Hh}var Kh,xC;function iP(){if(xC)return Kh;xC=1;var r=Xm(),e=O3(),t=M3();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new r;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,Kh=n,Kh}var jh,EC;function k3(){if(EC)return jh;EC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a;)if(t(e[n],n,e))return!0;return!1}return jh=r,jh}var Yh,_C;function oP(){if(_C)return Yh;_C=1;function r(e,t){return e.has(t)}return Yh=r,Yh}var Zh,CC;function sP(){if(CC)return Zh;CC=1;var r=iP(),e=k3(),t=oP(),n=1,a=2;function i(o,s,u,l,c,v){var h=u&n,g=o.length,p=s.length;if(g!=p&&!(h&&p>g))return!1;var E=v.get(o),m=v.get(s);if(E&&m)return E==s&&m==o;var b=-1,w=!0,x=u&a?new r:void 0;for(v.set(o,s),v.set(s,o);++b<g;){var _=o[b],C=s[b];if(l)var R=h?l(C,_,b,s,o,v):l(_,C,b,o,s,v);if(R!==void 0){if(R)continue;w=!1;break}if(x){if(!e(s,function(S,A){if(!t(x,A)&&(_===S||c(_,S,u,l,v)))return x.push(A)})){w=!1;break}}else if(!(_===C||c(_,C,u,l,v))){w=!1;break}}return v.delete(o),v.delete(s),w}return Zh=i,Zh}var Xh,SC;function L3(){if(SC)return Xh;SC=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return Xh=r,Xh}var Qh,TC;function u0(){if(TC)return Qh;TC=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return Qh=r,Qh}var Jh,RC;function q3(){if(RC)return Jh;RC=1;var r=uo(),e=XA(),t=so(),n=sP(),a=L3(),i=u0(),o=1,s=2,u="[object Boolean]",l="[object Date]",c="[object Error]",v="[object Map]",h="[object Number]",g="[object RegExp]",p="[object Set]",E="[object String]",m="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,_=x?x.valueOf:void 0;function C(R,S,A,P,I,D,M){switch(A){case w:if(R.byteLength!=S.byteLength||R.byteOffset!=S.byteOffset)return!1;R=R.buffer,S=S.buffer;case b:return!(R.byteLength!=S.byteLength||!D(new e(R),new e(S)));case u:case l:case h:return t(+R,+S);case c:return R.name==S.name&&R.message==S.message;case g:case E:return R==S+"";case v:var O=a;case p:var N=P&o;if(O||(O=i),R.size!=S.size&&!N)return!1;var V=M.get(R);if(V)return V==S;P|=s,M.set(R,S);var $=n(O(R),O(S),P,I,D,M);return M.delete(R),$;case m:if(_)return _.call(R)==_.call(S)}return!1}return Jh=C,Jh}var eg,AC;function N3(){if(AC)return eg;AC=1;var r=YA(),e=1,t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s,u,l,c){var v=s&e,h=r(i),g=h.length,p=r(o),E=p.length;if(g!=E&&!v)return!1;for(var m=g;m--;){var b=h[m];if(!(v?b in o:n.call(o,b)))return!1}var w=c.get(i),x=c.get(o);if(w&&x)return w==o&&x==i;var _=!0;c.set(i,o),c.set(o,i);for(var C=v;++m<g;){b=h[m];var R=i[b],S=o[b];if(u)var A=v?u(S,R,b,o,i,c):u(R,S,b,i,o,c);if(!(A===void 0?R===S||l(R,S,s,u,c):A)){_=!1;break}C||(C=b=="constructor")}if(_&&!C){var P=i.constructor,I=o.constructor;P!=I&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof I=="function"&&I instanceof I)&&(_=!1)}return c.delete(i),c.delete(o),_}return eg=a,eg}var rg,PC;function F3(){if(PC)return rg;PC=1;var r=Rl(),e=sP(),t=q3(),n=N3(),a=fo(),i=jr(),o=lo(),s=_s(),u=1,l="[object Arguments]",c="[object Array]",v="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(E,m,b,w,x,_){var C=i(E),R=i(m),S=C?c:a(E),A=R?c:a(m);S=S==l?v:S,A=A==l?v:A;var P=S==v,I=A==v,D=S==A;if(D&&o(E)){if(!o(m))return!1;C=!0,P=!1}if(D&&!P)return _||(_=new r),C||s(E)?e(E,m,b,w,x,_):t(E,m,S,b,w,x,_);if(!(b&u)){var M=P&&g.call(E,"__wrapped__"),O=I&&g.call(m,"__wrapped__");if(M||O){var N=M?E.value():E,V=O?m.value():m;return _||(_=new r),x(N,V,b,w,_)}}return D?(_||(_=new r),n(E,m,b,w,x,_)):!1}return rg=p,rg}var tg,DC;function uP(){if(DC)return tg;DC=1;var r=F3(),e=Mn();function t(n,a,i,o,s){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:r(n,a,i,o,t,s)}return tg=t,tg}var ng,IC;function z3(){if(IC)return ng;IC=1;var r=Rl(),e=uP(),t=1,n=2;function a(i,o,s,u){var l=s.length,c=l,v=!u;if(i==null)return!c;for(i=Object(i);l--;){var h=s[l];if(v&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++l<c;){h=s[l];var g=h[0],p=i[g],E=h[1];if(v&&h[2]){if(p===void 0&&!(g in i))return!1}else{var m=new r;if(u)var b=u(p,E,g,i,o,m);if(!(b===void 0?e(E,p,t|n,u,m):b))return!1}}return!0}return ng=a,ng}var ag,BC;function lP(){if(BC)return ag;BC=1;var r=ln();function e(t){return t===t&&!r(t)}return ag=e,ag}var ig,OC;function $3(){if(OC)return ig;OC=1;var r=lP(),e=ka();function t(n){for(var a=e(n),i=a.length;i--;){var o=a[i],s=n[o];a[i]=[o,s,r(s)]}return a}return ig=t,ig}var og,MC;function fP(){if(MC)return og;MC=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return og=r,og}var sg,kC;function V3(){if(kC)return sg;kC=1;var r=z3(),e=$3(),t=fP();function n(a){var i=e(a);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(o){return o===a||r(o,a,i)}}return sg=n,sg}var ug,LC;function co(){if(LC)return ug;LC=1;var r=fi(),e=Mn(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return ug=n,ug}var lg,qC;function l0(){if(qC)return lg;qC=1;var r=jr(),e=co(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return lg=a,lg}var fg,NC;function G3(){if(NC)return fg;NC=1;var r=Xm(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=n.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(t.Cache||r),i}return t.Cache=r,fg=t,fg}var cg,FC;function W3(){if(FC)return cg;FC=1;var r=G3(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return cg=t,cg}var dg,zC;function U3(){if(zC)return dg;zC=1;var r=W3(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,u,l){i.push(u?l.replace(t,"$1"):s||o)}),i});return dg=n,dg}var vg,$C;function kl(){if($C)return vg;$C=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return vg=r,vg}var hg,VC;function H3(){if(VC)return hg;VC=1;var r=uo(),e=kl(),t=jr(),n=co(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return hg=o,hg}var gg,GC;function cP(){if(GC)return gg;GC=1;var r=H3();function e(t){return t==null?"":r(t)}return gg=e,gg}var pg,WC;function Ll(){if(WC)return pg;WC=1;var r=jr(),e=l0(),t=U3(),n=cP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return pg=a,pg}var yg,UC;function Cs(){if(UC)return yg;UC=1;var r=co();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return yg=e,yg}var mg,HC;function ql(){if(HC)return mg;HC=1;var r=Ll(),e=Cs();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return mg=t,mg}var bg,KC;function K3(){if(KC)return bg;KC=1;var r=ql();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return bg=e,bg}var wg,jC;function j3(){if(jC)return wg;jC=1;function r(e,t){return e!=null&&t in Object(e)}return wg=r,wg}var xg,YC;function dP(){if(YC)return xg;YC=1;var r=Ll(),e=Es(),t=jr(),n=Dl(),a=Jm(),i=Cs();function o(s,u,l){u=r(u,s);for(var c=-1,v=u.length,h=!1;++c<v;){var g=i(u[c]);if(!(h=s!=null&&l(s,g)))break;s=s[g]}return h||++c!=v?h:(v=s==null?0:s.length,!!v&&a(v)&&n(g,v)&&(t(s)||e(s)))}return xg=o,xg}var Eg,ZC;function vP(){if(ZC)return Eg;ZC=1;var r=j3(),e=dP();function t(n,a){return n!=null&&e(n,a,r)}return Eg=t,Eg}var _g,XC;function Y3(){if(XC)return _g;XC=1;var r=uP(),e=K3(),t=vP(),n=l0(),a=lP(),i=fP(),o=Cs(),s=1,u=2;function l(c,v){return n(c)&&a(v)?i(o(c),v):function(h){var g=e(h,c);return g===void 0&&g===v?t(h,c):r(v,g,s|u)}}return _g=l,_g}var Cg,QC;function hP(){if(QC)return Cg;QC=1;function r(e){return function(t){return t==null?void 0:t[e]}}return Cg=r,Cg}var Sg,JC;function Z3(){if(JC)return Sg;JC=1;var r=ql();function e(t){return function(n){return r(n,t)}}return Sg=e,Sg}var Tg,eS;function X3(){if(eS)return Tg;eS=1;var r=hP(),e=Z3(),t=l0(),n=Cs();function a(i){return t(i)?r(n(i)):e(i)}return Tg=a,Tg}var Rg,rS;function Jn(){if(rS)return Rg;rS=1;var r=V3(),e=Y3(),t=vi(),n=jr(),a=X3();function i(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?n(o)?e(o[0],o[1]):r(o):a(o)}return Rg=i,Rg}var Ag,tS;function gP(){if(tS)return Ag;tS=1;var r=UA(),e=B3(),t=Jn(),n=jr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return Ag=a,Ag}var Pg,nS;function Q3(){if(nS)return Pg;nS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Pg=t,Pg}var Dg,aS;function pP(){if(aS)return Dg;aS=1;var r=Q3(),e=dP();function t(n,a){return n!=null&&e(n,a,r)}return Dg=t,Dg}var Ig,iS;function J3(){if(iS)return Ig;iS=1;var r=r0(),e=fo(),t=Es(),n=jr(),a=Qn(),i=lo(),o=Bl(),s=_s(),u="[object Map]",l="[object Set]",c=Object.prototype,v=c.hasOwnProperty;function h(g){if(g==null)return!0;if(a(g)&&(n(g)||typeof g=="string"||typeof g.splice=="function"||i(g)||s(g)||t(g)))return!g.length;var p=e(g);if(p==u||p==l)return!g.size;if(o(g))return!r(g).length;for(var E in g)if(v.call(g,E))return!1;return!0}return Ig=h,Ig}var Bg,oS;function yP(){if(oS)return Bg;oS=1;function r(e){return e===void 0}return Bg=r,Bg}var Og,sS;function mP(){if(sS)return Og;sS=1;var r=Ml(),e=Qn();function t(n,a){var i=-1,o=e(n)?Array(n.length):[];return r(n,function(s,u,l){o[++i]=a(s,u,l)}),o}return Og=t,Og}var Mg,uS;function bP(){if(uS)return Mg;uS=1;var r=kl(),e=Jn(),t=mP(),n=jr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return Mg=a,Mg}var kg,lS;function eG(){if(lS)return kg;lS=1;function r(e,t,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}return kg=r,kg}var Lg,fS;function rG(){if(fS)return Lg;fS=1;function r(e,t,n,a,i){return i(e,function(o,s,u){n=a?(a=!1,o):t(n,o,s,u)}),n}return Lg=r,Lg}var qg,cS;function wP(){if(cS)return qg;cS=1;var r=eG(),e=Ml(),t=Jn(),n=rG(),a=jr();function i(o,s,u){var l=a(o)?r:n,c=arguments.length<3;return l(o,t(s,4),u,c,e)}return qg=i,qg}var Ng,dS;function tG(){if(dS)return Ng;dS=1;var r=fi(),e=jr(),t=Mn(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return Ng=a,Ng}var Fg,vS;function nG(){if(vS)return Fg;vS=1;var r=hP(),e=r("length");return Fg=e,Fg}var zg,hS;function aG(){if(hS)return zg;hS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+r+a+i+"]");function u(l){return s.test(l)}return zg=u,zg}var $g,gS;function iG(){if(gS)return $g;gS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="["+r+"]",s="["+a+"]",u="\\ud83c[\\udffb-\\udfff]",l="(?:"+s+"|"+u+")",c="[^"+r+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",p=l+"?",E="["+i+"]?",m="(?:"+g+"(?:"+[c,v,h].join("|")+")"+E+p+")*",b=E+p+m,w="(?:"+[c+s+"?",s,v,h,o].join("|")+")",x=RegExp(u+"(?="+u+")|"+w+b,"g");function _(C){for(var R=x.lastIndex=0;x.test(C);)++R;return R}return $g=_,$g}var Vg,pS;function oG(){if(pS)return Vg;pS=1;var r=nG(),e=aG(),t=iG();function n(a){return e(a)?t(a):r(a)}return Vg=n,Vg}var Gg,yS;function sG(){if(yS)return Gg;yS=1;var r=r0(),e=fo(),t=Qn(),n=tG(),a=oG(),i="[object Map]",o="[object Set]";function s(u){if(u==null)return 0;if(t(u))return n(u)?a(u):u.length;var l=e(u);return l==i||l==o?u.size:r(u).length}return Gg=s,Gg}var Wg,mS;function uG(){if(mS)return Wg;mS=1;var r=Qm(),e=JA(),t=s0(),n=Jn(),a=Ol(),i=jr(),o=lo(),s=ws(),u=ln(),l=_s();function c(v,h,g){var p=i(v),E=p||o(v)||l(v);if(h=n(h,4),g==null){var m=v&&v.constructor;E?g=p?new m:[]:u(v)?g=s(m)?e(a(v)):{}:g={}}return(E?r:t)(v,function(b,w,x){return h(g,b,w,x)}),g}return Wg=c,Wg}var Ug,bS;function lG(){if(bS)return Ug;bS=1;var r=uo(),e=Es(),t=jr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Ug=a,Ug}var Hg,wS;function f0(){if(wS)return Hg;wS=1;var r=n0(),e=lG();function t(n,a,i,o,s){var u=-1,l=n.length;for(i||(i=e),s||(s=[]);++u<l;){var c=n[u];a>0&&i(c)?a>1?t(c,a-1,i,o,s):r(s,c):o||(s[s.length]=c)}return s}return Hg=t,Hg}var Kg,xS;function fG(){if(xS)return Kg;xS=1;function r(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)}return Kg=r,Kg}var jg,ES;function xP(){if(ES)return jg;ES=1;var r=fG(),e=Math.max;function t(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,u=e(o.length-a,0),l=Array(u);++s<u;)l[s]=o[a+s];s=-1;for(var c=Array(a+1);++s<a;)c[s]=o[s];return c[a]=i(l),r(n,this,c)}}return jg=t,jg}var Yg,_S;function cG(){if(_S)return Yg;_S=1;var r=i0(),e=zA(),t=vi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return Yg=n,Yg}var Zg,CS;function dG(){if(CS)return Zg;CS=1;var r=800,e=16,t=Date.now;function n(a){var i=0,o=0;return function(){var s=t(),u=e-(s-o);if(o=s,u>0){if(++i>=r)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Zg=n,Zg}var Xg,SS;function EP(){if(SS)return Xg;SS=1;var r=cG(),e=dG(),t=e(r);return Xg=t,Xg}var Qg,TS;function Nl(){if(TS)return Qg;TS=1;var r=vi(),e=xP(),t=EP();function n(a,i){return t(e(a,i,r),a+"")}return Qg=n,Qg}var Jg,RS;function _P(){if(RS)return Jg;RS=1;function r(e,t,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return Jg=r,Jg}var ep,AS;function vG(){if(AS)return ep;AS=1;function r(e){return e!==e}return ep=r,ep}var rp,PS;function hG(){if(PS)return rp;PS=1;function r(e,t,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===t)return a;return-1}return rp=r,rp}var tp,DS;function gG(){if(DS)return tp;DS=1;var r=_P(),e=vG(),t=hG();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return tp=n,tp}var np,IS;function pG(){if(IS)return np;IS=1;var r=gG();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return np=e,np}var ap,BS;function yG(){if(BS)return ap;BS=1;function r(e,t,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(t,e[a]))return!0;return!1}return ap=r,ap}var ip,OS;function mG(){if(OS)return ip;OS=1;function r(){}return ip=r,ip}var op,MS;function bG(){if(MS)return op;MS=1;var r=ZA(),e=mG(),t=u0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return op=a,op}var sp,kS;function wG(){if(kS)return sp;kS=1;var r=iP(),e=pG(),t=yG(),n=oP(),a=bG(),i=u0(),o=200;function s(u,l,c){var v=-1,h=e,g=u.length,p=!0,E=[],m=E;if(c)p=!1,h=t;else if(g>=o){var b=l?null:a(u);if(b)return i(b);p=!1,h=n,m=new r}else m=l?[]:E;e:for(;++v<g;){var w=u[v],x=l?l(w):w;if(w=c||w!==0?w:0,p&&x===x){for(var _=m.length;_--;)if(m[_]===x)continue e;l&&m.push(x),E.push(w)}else h(m,x,c)||(m!==E&&m.push(x),E.push(w))}return E}return sp=s,sp}var up,LS;function CP(){if(LS)return up;LS=1;var r=Qn(),e=Mn();function t(n){return e(n)&&r(n)}return up=t,up}var lp,qS;function xG(){if(qS)return lp;qS=1;var r=f0(),e=Nl(),t=wG(),n=CP(),a=e(function(i){return t(r(i,1,n,!0))});return lp=a,lp}var fp,NS;function EG(){if(NS)return fp;NS=1;var r=kl();function e(t,n){return r(n,function(a){return t[a]})}return fp=e,fp}var cp,FS;function SP(){if(FS)return cp;FS=1;var r=EG(),e=ka();function t(n){return n==null?[]:r(n,e(n))}return cp=t,cp}var dp,zS;function fn(){if(zS)return dp;zS=1;var r;if(typeof Ym=="function")try{r={clone:P3(),constant:i0(),each:aP(),filter:gP(),has:pP(),isArray:jr(),isEmpty:J3(),isFunction:ws(),isUndefined:yP(),keys:ka(),map:bP(),reduce:wP(),size:sG(),transform:uG(),union:xG(),values:SP()}}catch{}return r||(r=window._),dp=r,dp}var vp,$S;function c0(){if($S)return vp;$S=1;var r=fn();vp=a;var e="\0",t="\0",n="";function a(c){this._isDirected=r.has(c,"directed")?c.directed:!0,this._isMultigraph=r.has(c,"multigraph")?c.multigraph:!1,this._isCompound=r.has(c,"compound")?c.compound:!1,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[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(c){return this._label=c,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultNodeLabelFn=c,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var c=this;return r.filter(this.nodes(),function(v){return r.isEmpty(c._in[v])})},a.prototype.sinks=function(){var c=this;return r.filter(this.nodes(),function(v){return r.isEmpty(c._out[v])})},a.prototype.setNodes=function(c,v){var h=arguments,g=this;return r.each(c,function(p){h.length>1?g.setNode(p,v):g.setNode(p)}),this},a.prototype.setNode=function(c,v){return r.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=v),this):(this._nodes[c]=arguments.length>1?v:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=t,this._children[c]={},this._children[t][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},a.prototype.node=function(c){return this._nodes[c]},a.prototype.hasNode=function(c){return r.has(this._nodes,c)},a.prototype.removeNode=function(c){var v=this;if(r.has(this._nodes,c)){var h=function(g){v.removeEdge(v._edgeObjs[g])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],r.each(this.children(c),function(g){v.setParent(g)}),delete this._children[c]),r.each(r.keys(this._in[c]),h),delete this._in[c],delete this._preds[c],r.each(r.keys(this._out[c]),h),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},a.prototype.setParent=function(c,v){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(v))v=t;else{v+="";for(var h=v;!r.isUndefined(h);h=this.parent(h))if(h===c)throw new Error("Setting "+v+" as parent of "+c+" would create a cycle");this.setNode(v)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=v,this._children[v][c]=!0,this},a.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},a.prototype.parent=function(c){if(this._isCompound){var v=this._parent[c];if(v!==t)return v}},a.prototype.children=function(c){if(r.isUndefined(c)&&(c=t),this._isCompound){var v=this._children[c];if(v)return r.keys(v)}else{if(c===t)return this.nodes();if(this.hasNode(c))return[]}},a.prototype.predecessors=function(c){var v=this._preds[c];if(v)return r.keys(v)},a.prototype.successors=function(c){var v=this._sucs[c];if(v)return r.keys(v)},a.prototype.neighbors=function(c){var v=this.predecessors(c);if(v)return r.union(v,this.successors(c))},a.prototype.isLeaf=function(c){var v;return this.isDirected()?v=this.successors(c):v=this.neighbors(c),v.length===0},a.prototype.filterNodes=function(c){var v=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});v.setGraph(this.graph());var h=this;r.each(this._nodes,function(E,m){c(m)&&v.setNode(m,E)}),r.each(this._edgeObjs,function(E){v.hasNode(E.v)&&v.hasNode(E.w)&&v.setEdge(E,h.edge(E))});var g={};function p(E){var m=h.parent(E);return m===void 0||v.hasNode(m)?(g[E]=m,m):m in g?g[m]:p(m)}return this._isCompound&&r.each(v.nodes(),function(E){v.setParent(E,p(E))}),v},a.prototype.setDefaultEdgeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultEdgeLabelFn=c,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(c,v){var h=this,g=arguments;return r.reduce(c,function(p,E){return g.length>1?h.setEdge(p,E,v):h.setEdge(p,E),E}),this},a.prototype.setEdge=function(){var c,v,h,g,p=!1,E=arguments[0];typeof E=="object"&&E!==null&&"v"in E?(c=E.v,v=E.w,h=E.name,arguments.length===2&&(g=arguments[1],p=!0)):(c=E,v=arguments[1],h=arguments[3],arguments.length>2&&(g=arguments[2],p=!0)),c=""+c,v=""+v,r.isUndefined(h)||(h=""+h);var m=s(this._isDirected,c,v,h);if(r.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=g),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(v),this._edgeLabels[m]=p?g:this._defaultEdgeLabelFn(c,v,h);var b=u(this._isDirected,c,v,h);return c=b.v,v=b.w,Object.freeze(b),this._edgeObjs[m]=b,i(this._preds[v],c),i(this._sucs[c],v),this._in[v][m]=b,this._out[c][m]=b,this._edgeCount++,this},a.prototype.edge=function(c,v,h){var g=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,c,v,h);return this._edgeLabels[g]},a.prototype.hasEdge=function(c,v,h){var g=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,c,v,h);return r.has(this._edgeLabels,g)},a.prototype.removeEdge=function(c,v,h){var g=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,c,v,h),p=this._edgeObjs[g];return p&&(c=p.v,v=p.w,delete this._edgeLabels[g],delete this._edgeObjs[g],o(this._preds[v],c),o(this._sucs[c],v),delete this._in[v][g],delete this._out[c][g],this._edgeCount--),this},a.prototype.inEdges=function(c,v){var h=this._in[c];if(h){var g=r.values(h);return v?r.filter(g,function(p){return p.v===v}):g}},a.prototype.outEdges=function(c,v){var h=this._out[c];if(h){var g=r.values(h);return v?r.filter(g,function(p){return p.w===v}):g}},a.prototype.nodeEdges=function(c,v){var h=this.inEdges(c,v);if(h)return h.concat(this.outEdges(c,v))};function i(c,v){c[v]?c[v]++:c[v]=1}function o(c,v){--c[v]||delete c[v]}function s(c,v,h,g){var p=""+v,E=""+h;if(!c&&p>E){var m=p;p=E,E=m}return p+n+E+n+(r.isUndefined(g)?e:g)}function u(c,v,h,g){var p=""+v,E=""+h;if(!c&&p>E){var m=p;p=E,E=m}var b={v:p,w:E};return g&&(b.name=g),b}function l(c,v){return s(c,v.v,v.w,v.name)}return vp}var hp,VS;function _G(){return VS||(VS=1,hp="2.1.8"),hp}var gp,GS;function CG(){return GS||(GS=1,gp={Graph:c0(),version:_G()}),gp}var pp,WS;function SG(){if(WS)return pp;WS=1;var r=fn(),e=c0();pp={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return r.isUndefined(o.graph())||(s.value=r.clone(o.graph())),s}function n(o){return r.map(o.nodes(),function(s){var u=o.node(s),l=o.parent(s),c={v:s};return r.isUndefined(u)||(c.value=u),r.isUndefined(l)||(c.parent=l),c})}function a(o){return r.map(o.edges(),function(s){var u=o.edge(s),l={v:s.v,w:s.w};return r.isUndefined(s.name)||(l.name=s.name),r.isUndefined(u)||(l.value=u),l})}function i(o){var s=new e(o.options).setGraph(o.value);return r.each(o.nodes,function(u){s.setNode(u.v,u.value),u.parent&&s.setParent(u.v,u.parent)}),r.each(o.edges,function(u){s.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),s}return pp}var yp,US;function TG(){if(US)return yp;US=1;var r=fn();yp=e;function e(t){var n={},a=[],i;function o(s){r.has(n,s)||(n[s]=!0,i.push(s),r.each(t.successors(s),o),r.each(t.predecessors(s),o))}return r.each(t.nodes(),function(s){i=[],o(s),i.length&&a.push(i)}),a}return yp}var mp,HS;function TP(){if(HS)return mp;HS=1;var r=fn();mp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,n){var a=this._keyIndices;if(t=String(t),!r.has(a,t)){var i=this._arr,o=i.length;return a[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,n){var a=this._keyIndices[t];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(t){var n=this._arr,a=2*t,i=a+1,o=t;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var n=this._arr,a=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<a));)this._swap(t,i),t=i},e.prototype._swap=function(t,n){var a=this._arr,i=this._keyIndices,o=a[t],s=a[n];a[t]=s,a[n]=o,i[s.key]=t,i[o.key]=n},mp}var bp,KS;function RP(){if(KS)return bp;KS=1;var r=fn(),e=TP();bp=n;var t=r.constant(1);function n(i,o,s,u){return a(i,String(o),s||t,u||function(l){return i.outEdges(l)})}function a(i,o,s,u){var l={},c=new e,v,h,g=function(p){var E=p.v!==v?p.v:p.w,m=l[E],b=s(p),w=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+b);w<m.distance&&(m.distance=w,m.predecessor=v,c.decrease(E,w))};for(i.nodes().forEach(function(p){var E=p===o?0:Number.POSITIVE_INFINITY;l[p]={distance:E},c.add(p,E)});c.size()>0&&(v=c.removeMin(),h=l[v],h.distance!==Number.POSITIVE_INFINITY);)u(v).forEach(g);return l}return bp}var wp,jS;function RG(){if(jS)return wp;jS=1;var r=RP(),e=fn();wp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return wp}var xp,YS;function AP(){if(YS)return xp;YS=1;var r=fn();xp=e;function e(t){var n=0,a=[],i={},o=[];function s(u){var l=i[u]={onStack:!0,lowlink:n,index:n++};if(a.push(u),t.successors(u).forEach(function(h){r.has(i,h)?i[h].onStack&&(l.lowlink=Math.min(l.lowlink,i[h].index)):(s(h),l.lowlink=Math.min(l.lowlink,i[h].lowlink))}),l.lowlink===l.index){var c=[],v;do v=a.pop(),i[v].onStack=!1,c.push(v);while(u!==v);o.push(c)}}return t.nodes().forEach(function(u){r.has(i,u)||s(u)}),o}return xp}var Ep,ZS;function AG(){if(ZS)return Ep;ZS=1;var r=fn(),e=AP();Ep=t;function t(n){return r.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Ep}var _p,XS;function PG(){if(XS)return _p;XS=1;var r=fn();_p=t;var e=r.constant(1);function t(a,i,o){return n(a,i||e,o||function(s){return a.outEdges(s)})}function n(a,i,o){var s={},u=a.nodes();return u.forEach(function(l){s[l]={},s[l][l]={distance:0},u.forEach(function(c){l!==c&&(s[l][c]={distance:Number.POSITIVE_INFINITY})}),o(l).forEach(function(c){var v=c.v===l?c.w:c.v,h=i(c);s[l][v]={distance:h,predecessor:l}})}),u.forEach(function(l){var c=s[l];u.forEach(function(v){var h=s[v];u.forEach(function(g){var p=h[l],E=c[g],m=h[g],b=p.distance+E.distance;b<m.distance&&(m.distance=b,m.predecessor=E.predecessor)})})}),s}return _p}var Cp,QS;function PP(){if(QS)return Cp;QS=1;var r=fn();Cp=e,e.CycleException=t;function e(n){var a={},i={},o=[];function s(u){if(r.has(i,u))throw new t;r.has(a,u)||(i[u]=!0,a[u]=!0,r.each(n.predecessors(u),s),delete i[u],o.push(u))}if(r.each(n.sinks(),s),r.size(a)!==n.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,Cp}var Sp,JS;function DG(){if(JS)return Sp;JS=1;var r=PP();Sp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Sp}var Tp,eT;function DP(){if(eT)return Tp;eT=1;var r=fn();Tp=e;function e(n,a,i){r.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],u={};return r.each(a,function(l){if(!n.hasNode(l))throw new Error("Graph does not have node: "+l);t(n,l,i==="post",u,o,s)}),s}function t(n,a,i,o,s,u){r.has(o,a)||(o[a]=!0,i||u.push(a),r.each(s(a),function(l){t(n,l,i,o,s,u)}),i&&u.push(a))}return Tp}var Rp,rT;function IG(){if(rT)return Rp;rT=1;var r=DP();Rp=e;function e(t,n){return r(t,n,"post")}return Rp}var Ap,tT;function BG(){if(tT)return Ap;tT=1;var r=DP();Ap=e;function e(t,n){return r(t,n,"pre")}return Ap}var Pp,nT;function OG(){if(nT)return Pp;nT=1;var r=fn(),e=c0(),t=TP();Pp=n;function n(a,i){var o=new e,s={},u=new t,l;function c(h){var g=h.v===l?h.w:h.v,p=u.priority(g);if(p!==void 0){var E=i(h);E<p&&(s[g]=l,u.decrease(g,E))}}if(a.nodeCount()===0)return o;r.each(a.nodes(),function(h){u.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),u.decrease(a.nodes()[0],0);for(var v=!1;u.size()>0;){if(l=u.removeMin(),r.has(s,l))o.setEdge(l,s[l]);else{if(v)throw new Error("Input graph is not connected: "+a);v=!0}a.nodeEdges(l).forEach(c)}return o}return Pp}var Dp,aT;function MG(){return aT||(aT=1,Dp={components:TG(),dijkstra:RP(),dijkstraAll:RG(),findCycles:AG(),floydWarshall:PG(),isAcyclic:DG(),postorder:IG(),preorder:BG(),prim:OG(),tarjan:AP(),topsort:PP()}),Dp}var Ip,iT;function kG(){if(iT)return Ip;iT=1;var r=CG();return Ip={Graph:r.Graph,json:SG(),alg:MG(),version:r.version},Ip}var Bp,oT;function wn(){if(oT)return Bp;oT=1;var r;if(typeof Ym=="function")try{r=kG()}catch{}return r||(r=window.graphlib),Bp=r,Bp}var Op,sT;function LG(){if(sT)return Op;sT=1;var r=rP(),e=1,t=4;function n(a){return r(a,e|t)}return Op=n,Op}var Mp,uT;function Fl(){if(uT)return Mp;uT=1;var r=so(),e=Qn(),t=Dl(),n=ln();function a(i,o,s){if(!n(s))return!1;var u=typeof o;return(u=="number"?e(s)&&t(o,s.length):u=="string"&&o in s)?r(s[o],i):!1}return Mp=a,Mp}var kp,lT;function qG(){if(lT)return kp;lT=1;var r=Nl(),e=so(),t=Fl(),n=di(),a=Object.prototype,i=a.hasOwnProperty,o=r(function(s,u){s=Object(s);var l=-1,c=u.length,v=c>2?u[2]:void 0;for(v&&t(u[0],u[1],v)&&(c=1);++l<c;)for(var h=u[l],g=n(h),p=-1,E=g.length;++p<E;){var m=g[p],b=s[m];(b===void 0||e(b,a[m])&&!i.call(s,m))&&(s[m]=h[m])}return s});return kp=o,kp}var Lp,fT;function NG(){if(fT)return Lp;fT=1;var r=Jn(),e=Qn(),t=ka();function n(a){return function(i,o,s){var u=Object(i);if(!e(i)){var l=r(o,3);i=t(i),o=function(v){return l(u[v],v,u)}}var c=a(i,o,s);return c>-1?u[l?i[c]:c]:void 0}}return Lp=n,Lp}var qp,cT;function FG(){if(cT)return qp;cT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return qp=e,qp}var Np,dT;function zG(){if(dT)return Np;dT=1;var r=FG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Np=t,Np}var Fp,vT;function $G(){if(vT)return Fp;vT=1;var r=zG(),e=ln(),t=co(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(t(l))return n;if(e(l)){var c=typeof l.valueOf=="function"?l.valueOf():l;l=e(c)?c+"":c}if(typeof l!="string")return l===0?l:+l;l=r(l);var v=i.test(l);return v||o.test(l)?s(l.slice(2),v?2:8):a.test(l)?n:+l}return Fp=u,Fp}var zp,hT;function IP(){if(hT)return zp;hT=1;var r=$G(),e=1/0,t=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=r(a),a===e||a===-e){var i=a<0?-1:1;return i*t}return a===a?a:0}return zp=n,zp}var $p,gT;function VG(){if(gT)return $p;gT=1;var r=IP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return $p=e,$p}var Vp,pT;function GG(){if(pT)return Vp;pT=1;var r=_P(),e=Jn(),t=VG(),n=Math.max;function a(i,o,s){var u=i==null?0:i.length;if(!u)return-1;var l=s==null?0:t(s);return l<0&&(l=n(u+l,0)),r(i,e(o,3),l)}return Vp=a,Vp}var Gp,yT;function WG(){if(yT)return Gp;yT=1;var r=NG(),e=GG(),t=r(e);return Gp=t,Gp}var Wp,mT;function BP(){if(mT)return Wp;mT=1;var r=f0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Wp=e,Wp}var Up,bT;function UG(){if(bT)return Up;bT=1;var r=o0(),e=tP(),t=di();function n(a,i){return a==null?a:r(a,e(i),t)}return Up=n,Up}var Hp,wT;function HG(){if(wT)return Hp;wT=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Hp=r,Hp}var Kp,xT;function KG(){if(xT)return Kp;xT=1;var r=Al(),e=s0(),t=Jn();function n(a,i){var o={};return i=t(i,3),e(a,function(s,u,l){r(o,u,i(s,u,l))}),o}return Kp=n,Kp}var jp,ET;function d0(){if(ET)return jp;ET=1;var r=co();function e(t,n,a){for(var i=-1,o=t.length;++i<o;){var s=t[i],u=n(s);if(u!=null&&(l===void 0?u===u&&!r(u):a(u,l)))var l=u,c=s}return c}return jp=e,jp}var Yp,_T;function jG(){if(_T)return Yp;_T=1;function r(e,t){return e>t}return Yp=r,Yp}var Zp,CT;function YG(){if(CT)return Zp;CT=1;var r=d0(),e=jG(),t=vi();function n(a){return a&&a.length?r(a,t,e):void 0}return Zp=n,Zp}var Xp,ST;function OP(){if(ST)return Xp;ST=1;var r=Al(),e=so();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return Xp=t,Xp}var Qp,TT;function ZG(){if(TT)return Qp;TT=1;var r=fi(),e=Ol(),t=Mn(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,s=i.hasOwnProperty,u=o.call(Object);function l(c){if(!t(c)||r(c)!=n)return!1;var v=e(c);if(v===null)return!0;var h=s.call(v,"constructor")&&v.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==u}return Qp=l,Qp}var Jp,RT;function MP(){if(RT)return Jp;RT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return Jp=r,Jp}var ey,AT;function XG(){if(AT)return ey;AT=1;var r=xs(),e=di();function t(n){return r(n,e(n))}return ey=t,ey}var ry,PT;function QG(){if(PT)return ry;PT=1;var r=OP(),e=GA(),t=QA(),n=WA(),a=eP(),i=Es(),o=jr(),s=CP(),u=lo(),l=ws(),c=ln(),v=ZG(),h=_s(),g=MP(),p=XG();function E(m,b,w,x,_,C,R){var S=g(m,w),A=g(b,w),P=R.get(A);if(P){r(m,w,P);return}var I=C?C(S,A,w+"",m,b,R):void 0,D=I===void 0;if(D){var M=o(A),O=!M&&u(A),N=!M&&!O&&h(A);I=A,M||O||N?o(S)?I=S:s(S)?I=n(S):O?(D=!1,I=e(A,!0)):N?(D=!1,I=t(A,!0)):I=[]:v(A)||i(A)?(I=S,i(S)?I=p(S):(!c(S)||l(S))&&(I=a(A))):D=!1}D&&(R.set(A,I),_(I,A,x,C,R),R.delete(A)),r(m,w,I)}return ry=E,ry}var ty,DT;function JG(){if(DT)return ty;DT=1;var r=Rl(),e=OP(),t=o0(),n=QG(),a=ln(),i=di(),o=MP();function s(u,l,c,v,h){u!==l&&t(l,function(g,p){if(h||(h=new r),a(g))n(u,l,p,c,s,v,h);else{var E=v?v(o(u,p),g,p+"",u,l,h):void 0;E===void 0&&(E=g),e(u,p,E)}},i)}return ty=s,ty}var ny,IT;function e4(){if(IT)return ny;IT=1;var r=Nl(),e=Fl();function t(n){return r(function(a,i){var o=-1,s=i.length,u=s>1?i[s-1]:void 0,l=s>2?i[2]:void 0;for(u=n.length>3&&typeof u=="function"?(s--,u):void 0,l&&e(i[0],i[1],l)&&(u=s<3?void 0:u,s=1),a=Object(a);++o<s;){var c=i[o];c&&n(a,c,o,u)}return a})}return ny=t,ny}var ay,BT;function r4(){if(BT)return ay;BT=1;var r=JG(),e=e4(),t=e(function(n,a,i){r(n,a,i)});return ay=t,ay}var iy,OT;function kP(){if(OT)return iy;OT=1;function r(e,t){return e<t}return iy=r,iy}var oy,MT;function t4(){if(MT)return oy;MT=1;var r=d0(),e=kP(),t=vi();function n(a){return a&&a.length?r(a,t,e):void 0}return oy=n,oy}var sy,kT;function n4(){if(kT)return sy;kT=1;var r=d0(),e=Jn(),t=kP();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return sy=n,sy}var uy,LT;function a4(){if(LT)return uy;LT=1;var r=xn(),e=function(){return r.Date.now()};return uy=e,uy}var ly,qT;function i4(){if(qT)return ly;qT=1;var r=Pl(),e=Ll(),t=Dl(),n=ln(),a=Cs();function i(o,s,u,l){if(!n(o))return o;s=e(s,o);for(var c=-1,v=s.length,h=v-1,g=o;g!=null&&++c<v;){var p=a(s[c]),E=u;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var m=g[p];E=l?l(m,p,g):void 0,E===void 0&&(E=n(m)?m:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return ly=i,ly}var fy,NT;function o4(){if(NT)return fy;NT=1;var r=ql(),e=i4(),t=Ll();function n(a,i,o){for(var s=-1,u=i.length,l={};++s<u;){var c=i[s],v=r(a,c);o(v,c)&&e(l,t(c,a),v)}return l}return fy=n,fy}var cy,FT;function s4(){if(FT)return cy;FT=1;var r=o4(),e=vP();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return cy=t,cy}var dy,zT;function u4(){if(zT)return dy;zT=1;var r=BP(),e=xP(),t=EP();function n(a){return t(e(a,void 0,r),a+"")}return dy=n,dy}var vy,$T;function l4(){if($T)return vy;$T=1;var r=s4(),e=u4(),t=e(function(n,a){return n==null?{}:r(n,a)});return vy=t,vy}var hy,VT;function f4(){if(VT)return hy;VT=1;var r=Math.ceil,e=Math.max;function t(n,a,i,o){for(var s=-1,u=e(r((a-n)/(i||1)),0),l=Array(u);u--;)l[o?u:++s]=n,n+=i;return l}return hy=t,hy}var gy,GT;function c4(){if(GT)return gy;GT=1;var r=f4(),e=Fl(),t=IP();function n(a){return function(i,o,s){return s&&typeof s!="number"&&e(i,o,s)&&(o=s=void 0),i=t(i),o===void 0?(o=i,i=0):o=t(o),s=s===void 0?i<o?1:-1:t(s),r(i,o,s,a)}}return gy=n,gy}var py,WT;function d4(){if(WT)return py;WT=1;var r=c4(),e=r();return py=e,py}var yy,UT;function v4(){if(UT)return yy;UT=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return yy=r,yy}var my,HT;function h4(){if(HT)return my;HT=1;var r=co();function e(t,n){if(t!==n){var a=t!==void 0,i=t===null,o=t===t,s=r(t),u=n!==void 0,l=n===null,c=n===n,v=r(n);if(!l&&!v&&!s&&t>n||s&&u&&c&&!l&&!v||i&&u&&c||!a&&c||!o)return 1;if(!i&&!s&&!v&&t<n||v&&a&&o&&!i&&!s||l&&a&&o||!u&&o||!c)return-1}return 0}return my=e,my}var by,KT;function g4(){if(KT)return by;KT=1;var r=h4();function e(t,n,a){for(var i=-1,o=t.criteria,s=n.criteria,u=o.length,l=a.length;++i<u;){var c=r(o[i],s[i]);if(c){if(i>=l)return c;var v=a[i];return c*(v=="desc"?-1:1)}}return t.index-n.index}return by=e,by}var wy,jT;function p4(){if(jT)return wy;jT=1;var r=kl(),e=ql(),t=Jn(),n=mP(),a=v4(),i=Il(),o=g4(),s=vi(),u=jr();function l(c,v,h){v.length?v=r(v,function(E){return u(E)?function(m){return e(m,E.length===1?E[0]:E)}:E}):v=[s];var g=-1;v=r(v,i(t));var p=n(c,function(E,m,b){var w=r(v,function(x){return x(E)});return{criteria:w,index:++g,value:E}});return a(p,function(E,m){return o(E,m,h)})}return wy=l,wy}var xy,YT;function y4(){if(YT)return xy;YT=1;var r=f0(),e=p4(),t=Nl(),n=Fl(),a=t(function(i,o){if(i==null)return[];var s=o.length;return s>1&&n(i,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,r(o,1),[])});return xy=a,xy}var Ey,ZT;function m4(){if(ZT)return Ey;ZT=1;var r=cP(),e=0;function t(n){var a=++e;return r(n)+a}return Ey=t,Ey}var _y,XT;function b4(){if(XT)return _y;XT=1;function r(e,t,n){for(var a=-1,i=e.length,o=t.length,s={};++a<i;){var u=a<o?t[a]:void 0;n(s,e[a],u)}return s}return _y=r,_y}var Cy,QT;function w4(){if(QT)return Cy;QT=1;var r=Pl(),e=b4();function t(n,a){return e(n||[],a||[],r)}return Cy=t,Cy}var Sy,JT;function kr(){if(JT)return Sy;JT=1;var r;if(typeof Ym=="function")try{r={cloneDeep:LG(),constant:i0(),defaults:qG(),each:aP(),filter:gP(),find:WG(),flatten:BP(),forEach:nP(),forIn:UG(),has:pP(),isUndefined:yP(),last:HG(),map:bP(),mapValues:KG(),max:YG(),merge:r4(),min:t4(),minBy:n4(),now:a4(),pick:l4(),range:d4(),reduce:wP(),sortBy:y4(),uniqueId:m4(),values:SP(),zipObject:w4()}}catch{}return r||(r=window._),Sy=r,Sy}var Ty,eR;function x4(){if(eR)return Ty;eR=1,Ty=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},r.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},r.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,a){if(n!=="_next"&&n!=="_prev")return a}return Ty}var Ry,rR;function E4(){if(rR)return Ry;rR=1;var r=kr(),e=wn().Graph,t=x4();Ry=a;var n=r.constant(1);function a(l,c){if(l.nodeCount()<=1)return[];var v=s(l,c||n),h=i(v.graph,v.buckets,v.zeroIdx);return r.flatten(r.map(h,function(g){return l.outEdges(g.v,g.w)}),!0)}function i(l,c,v){for(var h=[],g=c[c.length-1],p=c[0],E;l.nodeCount();){for(;E=p.dequeue();)o(l,c,v,E);for(;E=g.dequeue();)o(l,c,v,E);if(l.nodeCount()){for(var m=c.length-2;m>0;--m)if(E=c[m].dequeue(),E){h=h.concat(o(l,c,v,E,!0));break}}}return h}function o(l,c,v,h,g){var p=g?[]:void 0;return r.forEach(l.inEdges(h.v),function(E){var m=l.edge(E),b=l.node(E.v);g&&p.push({v:E.v,w:E.w}),b.out-=m,u(c,v,b)}),r.forEach(l.outEdges(h.v),function(E){var m=l.edge(E),b=E.w,w=l.node(b);w.in-=m,u(c,v,w)}),l.removeNode(h.v),p}function s(l,c){var v=new e,h=0,g=0;r.forEach(l.nodes(),function(m){v.setNode(m,{v:m,in:0,out:0})}),r.forEach(l.edges(),function(m){var b=v.edge(m.v,m.w)||0,w=c(m),x=b+w;v.setEdge(m.v,m.w,x),g=Math.max(g,v.node(m.v).out+=w),h=Math.max(h,v.node(m.w).in+=w)});var p=r.range(g+h+3).map(function(){return new t}),E=h+1;return r.forEach(v.nodes(),function(m){u(p,E,v.node(m))}),{graph:v,buckets:p,zeroIdx:E}}function u(l,c,v){v.out?v.in?l[v.out-v.in+c].enqueue(v):l[l.length-1].enqueue(v):l[0].enqueue(v)}return Ry}var Ay,tR;function _4(){if(tR)return Ay;tR=1;var r=kr(),e=E4();Ay={run:t,undo:a};function t(i){var o=i.graph().acyclicer==="greedy"?e(i,s(i)):n(i);r.forEach(o,function(u){var l=i.edge(u);i.removeEdge(u),l.forwardName=u.name,l.reversed=!0,i.setEdge(u.w,u.v,l,r.uniqueId("rev"))});function s(u){return function(l){return u.edge(l).weight}}}function n(i){var o=[],s={},u={};function l(c){r.has(u,c)||(u[c]=!0,s[c]=!0,r.forEach(i.outEdges(c),function(v){r.has(s,v.w)?o.push(v):l(v.w)}),delete s[c])}return r.forEach(i.nodes(),l),o}function a(i){r.forEach(i.edges(),function(o){var s=i.edge(o);if(s.reversed){i.removeEdge(o);var u=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(o.w,o.v,s,u)}})}return Ay}var Py,nR;function zt(){if(nR)return Py;nR=1;var r=kr(),e=wn().Graph;Py={addDummyNode:t,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:s,buildLayerMatrix:u,normalizeRanks:l,removeEmptyRanks:c,addBorderNode:v,maxRank:h,partition:g,time:p,notime:E};function t(m,b,w,x){var _;do _=r.uniqueId(x);while(m.hasNode(_));return w.dummy=b,m.setNode(_,w),_}function n(m){var b=new e().setGraph(m.graph());return r.forEach(m.nodes(),function(w){b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){var x=b.edge(w.v,w.w)||{weight:0,minlen:1},_=m.edge(w);b.setEdge(w.v,w.w,{weight:x.weight+_.weight,minlen:Math.max(x.minlen,_.minlen)})}),b}function a(m){var b=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return r.forEach(m.nodes(),function(w){m.children(w).length||b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){b.setEdge(w,m.edge(w))}),b}function i(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.outEdges(w),function(_){x[_.w]=(x[_.w]||0)+m.edge(_).weight}),x});return r.zipObject(m.nodes(),b)}function o(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.inEdges(w),function(_){x[_.v]=(x[_.v]||0)+m.edge(_).weight}),x});return r.zipObject(m.nodes(),b)}function s(m,b){var w=m.x,x=m.y,_=b.x-w,C=b.y-x,R=m.width/2,S=m.height/2;if(!_&&!C)throw new Error("Not possible to find intersection inside of the rectangle");var A,P;return Math.abs(C)*R>Math.abs(_)*S?(C<0&&(S=-S),A=S*_/C,P=S):(_<0&&(R=-R),A=R,P=R*C/_),{x:w+A,y:x+P}}function u(m){var b=r.map(r.range(h(m)+1),function(){return[]});return r.forEach(m.nodes(),function(w){var x=m.node(w),_=x.rank;r.isUndefined(_)||(b[_][x.order]=w)}),b}function l(m){var b=r.min(r.map(m.nodes(),function(w){return m.node(w).rank}));r.forEach(m.nodes(),function(w){var x=m.node(w);r.has(x,"rank")&&(x.rank-=b)})}function c(m){var b=r.min(r.map(m.nodes(),function(C){return m.node(C).rank})),w=[];r.forEach(m.nodes(),function(C){var R=m.node(C).rank-b;w[R]||(w[R]=[]),w[R].push(C)});var x=0,_=m.graph().nodeRankFactor;r.forEach(w,function(C,R){r.isUndefined(C)&&R%_!==0?--x:x&&r.forEach(C,function(S){m.node(S).rank+=x})})}function v(m,b,w,x){var _={width:0,height:0};return arguments.length>=4&&(_.rank=w,_.order=x),t(m,"border",_,b)}function h(m){return r.max(r.map(m.nodes(),function(b){var w=m.node(b).rank;if(!r.isUndefined(w))return w}))}function g(m,b){var w={lhs:[],rhs:[]};return r.forEach(m,function(x){b(x)?w.lhs.push(x):w.rhs.push(x)}),w}function p(m,b){var w=r.now();try{return b()}finally{console.log(m+" time: "+(r.now()-w)+"ms")}}function E(m,b){return b()}return Py}var Dy,aR;function C4(){if(aR)return Dy;aR=1;var r=kr(),e=zt();Dy={run:t,undo:a};function t(i){i.graph().dummyChains=[],r.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var s=o.v,u=i.node(s).rank,l=o.w,c=i.node(l).rank,v=o.name,h=i.edge(o),g=h.labelRank;if(c!==u+1){i.removeEdge(o);var p,E,m;for(m=0,++u;u<c;++m,++u)h.points=[],E={width:0,height:0,edgeLabel:h,edgeObj:o,rank:u},p=e.addDummyNode(i,"edge",E,"_d"),u===g&&(E.width=h.width,E.height=h.height,E.dummy="edge-label",E.labelpos=h.labelpos),i.setEdge(s,p,{weight:h.weight},v),m===0&&i.graph().dummyChains.push(p),s=p;i.setEdge(s,l,{weight:h.weight},v)}}function a(i){r.forEach(i.graph().dummyChains,function(o){var s=i.node(o),u=s.edgeLabel,l;for(i.setEdge(s.edgeObj,u);s.dummy;)l=i.successors(o)[0],i.removeNode(o),u.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(u.x=s.x,u.y=s.y,u.width=s.width,u.height=s.height),o=l,s=i.node(o)})}return Dy}var Iy,iR;function tl(){if(iR)return Iy;iR=1;var r=kr();Iy={longestPath:e,slack:t};function e(n){var a={};function i(o){var s=n.node(o);if(r.has(a,o))return s.rank;a[o]=!0;var u=r.min(r.map(n.outEdges(o),function(l){return i(l.w)-n.edge(l).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),s.rank=u}r.forEach(n.sources(),i)}function t(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Iy}var By,oR;function LP(){if(oR)return By;oR=1;var r=kr(),e=wn().Graph,t=tl().slack;By=n;function n(s){var u=new e({directed:!1}),l=s.nodes()[0],c=s.nodeCount();u.setNode(l,{});for(var v,h;a(u,s)<c;)v=i(u,s),h=u.hasNode(v.v)?t(s,v):-t(s,v),o(u,s,h);return u}function a(s,u){function l(c){r.forEach(u.nodeEdges(c),function(v){var h=v.v,g=c===h?v.w:h;!s.hasNode(g)&&!t(u,v)&&(s.setNode(g,{}),s.setEdge(c,g,{}),l(g))})}return r.forEach(s.nodes(),l),s.nodeCount()}function i(s,u){return r.minBy(u.edges(),function(l){if(s.hasNode(l.v)!==s.hasNode(l.w))return t(u,l)})}function o(s,u,l){r.forEach(s.nodes(),function(c){u.node(c).rank+=l})}return By}var Oy,sR;function S4(){if(sR)return Oy;sR=1;var r=kr(),e=LP(),t=tl().slack,n=tl().longestPath,a=wn().alg.preorder,i=wn().alg.postorder,o=zt().simplify;Oy=s,s.initLowLimValues=v,s.initCutValues=u,s.calcCutValue=c,s.leaveEdge=g,s.enterEdge=p,s.exchangeEdges=E;function s(x){x=o(x),n(x);var _=e(x);v(_),u(_,x);for(var C,R;C=g(_);)R=p(_,x,C),E(_,x,C,R)}function u(x,_){var C=i(x,x.nodes());C=C.slice(0,C.length-1),r.forEach(C,function(R){l(x,_,R)})}function l(x,_,C){var R=x.node(C),S=R.parent;x.edge(C,S).cutvalue=c(x,_,C)}function c(x,_,C){var R=x.node(C),S=R.parent,A=!0,P=_.edge(C,S),I=0;return P||(A=!1,P=_.edge(S,C)),I=P.weight,r.forEach(_.nodeEdges(C),function(D){var M=D.v===C,O=M?D.w:D.v;if(O!==S){var N=M===A,V=_.edge(D).weight;if(I+=N?V:-V,b(x,C,O)){var $=x.edge(C,O).cutvalue;I+=N?-$:$}}}),I}function v(x,_){arguments.length<2&&(_=x.nodes()[0]),h(x,{},1,_)}function h(x,_,C,R,S){var A=C,P=x.node(R);return _[R]=!0,r.forEach(x.neighbors(R),function(I){r.has(_,I)||(C=h(x,_,C,I,R))}),P.low=A,P.lim=C++,S?P.parent=S:delete P.parent,C}function g(x){return r.find(x.edges(),function(_){return x.edge(_).cutvalue<0})}function p(x,_,C){var R=C.v,S=C.w;_.hasEdge(R,S)||(R=C.w,S=C.v);var A=x.node(R),P=x.node(S),I=A,D=!1;A.lim>P.lim&&(I=P,D=!0);var M=r.filter(_.edges(),function(O){return D===w(x,x.node(O.v),I)&&D!==w(x,x.node(O.w),I)});return r.minBy(M,function(O){return t(_,O)})}function E(x,_,C,R){var S=C.v,A=C.w;x.removeEdge(S,A),x.setEdge(R.v,R.w,{}),v(x),u(x,_),m(x,_)}function m(x,_){var C=r.find(x.nodes(),function(S){return!_.node(S).parent}),R=a(x,C);R=R.slice(1),r.forEach(R,function(S){var A=x.node(S).parent,P=_.edge(S,A),I=!1;P||(P=_.edge(A,S),I=!0),_.node(S).rank=_.node(A).rank+(I?P.minlen:-P.minlen)})}function b(x,_,C){return x.hasEdge(_,C)}function w(x,_,C){return C.low<=_.lim&&_.lim<=C.lim}return Oy}var My,uR;function T4(){if(uR)return My;uR=1;var r=tl(),e=r.longestPath,t=LP(),n=S4();My=a;function a(u){switch(u.graph().ranker){case"network-simplex":s(u);break;case"tight-tree":o(u);break;case"longest-path":i(u);break;default:s(u)}}var i=e;function o(u){e(u),t(u)}function s(u){n(u)}return My}var ky,lR;function R4(){if(lR)return ky;lR=1;var r=kr();ky=e;function e(a){var i=n(a);r.forEach(a.graph().dummyChains,function(o){for(var s=a.node(o),u=s.edgeObj,l=t(a,i,u.v,u.w),c=l.path,v=l.lca,h=0,g=c[h],p=!0;o!==u.w;){if(s=a.node(o),p){for(;(g=c[h])!==v&&a.node(g).maxRank<s.rank;)h++;g===v&&(p=!1)}if(!p){for(;h<c.length-1&&a.node(g=c[h+1]).minRank<=s.rank;)h++;g=c[h]}a.setParent(o,g),o=a.successors(o)[0]}})}function t(a,i,o,s){var u=[],l=[],c=Math.min(i[o].low,i[s].low),v=Math.max(i[o].lim,i[s].lim),h,g;h=o;do h=a.parent(h),u.push(h);while(h&&(i[h].low>c||v>i[h].lim));for(g=h,h=s;(h=a.parent(h))!==g;)l.push(h);return{path:u.concat(l.reverse()),lca:g}}function n(a){var i={},o=0;function s(u){var l=o;r.forEach(a.children(u),s),i[u]={low:l,lim:o++}}return r.forEach(a.children(),s),i}return ky}var Ly,fR;function A4(){if(fR)return Ly;fR=1;var r=kr(),e=zt();Ly={run:t,cleanup:o};function t(s){var u=e.addDummyNode(s,"root",{},"_root"),l=a(s),c=r.max(r.values(l))-1,v=2*c+1;s.graph().nestingRoot=u,r.forEach(s.edges(),function(g){s.edge(g).minlen*=v});var h=i(s)+1;r.forEach(s.children(),function(g){n(s,u,v,h,c,l,g)}),s.graph().nodeRankFactor=v}function n(s,u,l,c,v,h,g){var p=s.children(g);if(!p.length){g!==u&&s.setEdge(u,g,{weight:0,minlen:l});return}var E=e.addBorderNode(s,"_bt"),m=e.addBorderNode(s,"_bb"),b=s.node(g);s.setParent(E,g),b.borderTop=E,s.setParent(m,g),b.borderBottom=m,r.forEach(p,function(w){n(s,u,l,c,v,h,w);var x=s.node(w),_=x.borderTop?x.borderTop:w,C=x.borderBottom?x.borderBottom:w,R=x.borderTop?c:2*c,S=_!==C?1:v-h[g]+1;s.setEdge(E,_,{weight:R,minlen:S,nestingEdge:!0}),s.setEdge(C,m,{weight:R,minlen:S,nestingEdge:!0})}),s.parent(g)||s.setEdge(u,E,{weight:0,minlen:v+h[g]})}function a(s){var u={};function l(c,v){var h=s.children(c);h&&h.length&&r.forEach(h,function(g){l(g,v+1)}),u[c]=v}return r.forEach(s.children(),function(c){l(c,1)}),u}function i(s){return r.reduce(s.edges(),function(u,l){return u+s.edge(l).weight},0)}function o(s){var u=s.graph();s.removeNode(u.nestingRoot),delete u.nestingRoot,r.forEach(s.edges(),function(l){var c=s.edge(l);c.nestingEdge&&s.removeEdge(l)})}return Ly}var qy,cR;function P4(){if(cR)return qy;cR=1;var r=kr(),e=zt();qy=t;function t(a){function i(o){var s=a.children(o),u=a.node(o);if(s.length&&r.forEach(s,i),r.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var l=u.minRank,c=u.maxRank+1;l<c;++l)n(a,"borderLeft","_bl",o,u,l),n(a,"borderRight","_br",o,u,l)}}r.forEach(a.children(),i)}function n(a,i,o,s,u,l){var c={width:0,height:0,rank:l,borderType:i},v=u[i][l-1],h=e.addDummyNode(a,"border",c,o);u[i][l]=h,a.setParent(h,s),v&&a.setEdge(v,h,{weight:1})}return qy}var Ny,dR;function D4(){if(dR)return Ny;dR=1;var r=kr();Ny={adjust:e,undo:t};function e(l){var c=l.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(l)}function t(l){var c=l.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(l),(c==="lr"||c==="rl")&&(s(l),n(l))}function n(l){r.forEach(l.nodes(),function(c){a(l.node(c))}),r.forEach(l.edges(),function(c){a(l.edge(c))})}function a(l){var c=l.width;l.width=l.height,l.height=c}function i(l){r.forEach(l.nodes(),function(c){o(l.node(c))}),r.forEach(l.edges(),function(c){var v=l.edge(c);r.forEach(v.points,o),r.has(v,"y")&&o(v)})}function o(l){l.y=-l.y}function s(l){r.forEach(l.nodes(),function(c){u(l.node(c))}),r.forEach(l.edges(),function(c){var v=l.edge(c);r.forEach(v.points,u),r.has(v,"x")&&u(v)})}function u(l){var c=l.x;l.x=l.y,l.y=c}return Ny}var Fy,vR;function I4(){if(vR)return Fy;vR=1;var r=kr();Fy=e;function e(t){var n={},a=r.filter(t.nodes(),function(l){return!t.children(l).length}),i=r.max(r.map(a,function(l){return t.node(l).rank})),o=r.map(r.range(i+1),function(){return[]});function s(l){if(!r.has(n,l)){n[l]=!0;var c=t.node(l);o[c.rank].push(l),r.forEach(t.successors(l),s)}}var u=r.sortBy(a,function(l){return t.node(l).rank});return r.forEach(u,s),o}return Fy}var zy,hR;function B4(){if(hR)return zy;hR=1;var r=kr();zy=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=t(n,a[o-1],a[o]);return i}function t(n,a,i){for(var o=r.zipObject(i,r.map(i,function(h,g){return g})),s=r.flatten(r.map(a,function(h){return r.sortBy(r.map(n.outEdges(h),function(g){return{pos:o[g.w],weight:n.edge(g).weight}}),"pos")}),!0),u=1;u<i.length;)u<<=1;var l=2*u-1;u-=1;var c=r.map(new Array(l),function(){return 0}),v=0;return r.forEach(s.forEach(function(h){var g=h.pos+u;c[g]+=h.weight;for(var p=0;g>0;)g%2&&(p+=c[g+1]),g=g-1>>1,c[g]+=h.weight;v+=h.weight*p})),v}return zy}var $y,gR;function O4(){if(gR)return $y;gR=1;var r=kr();$y=e;function e(t,n){return r.map(n,function(a){var i=t.inEdges(a);if(i.length){var o=r.reduce(i,function(s,u){var l=t.edge(u),c=t.node(u.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return $y}var Vy,pR;function M4(){if(pR)return Vy;pR=1;var r=kr();Vy=e;function e(a,i){var o={};r.forEach(a,function(u,l){var c=o[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:l};r.isUndefined(u.barycenter)||(c.barycenter=u.barycenter,c.weight=u.weight)}),r.forEach(i.edges(),function(u){var l=o[u.v],c=o[u.w];!r.isUndefined(l)&&!r.isUndefined(c)&&(c.indegree++,l.out.push(o[u.w]))});var s=r.filter(o,function(u){return!u.indegree});return t(s)}function t(a){var i=[];function o(l){return function(c){c.merged||(r.isUndefined(c.barycenter)||r.isUndefined(l.barycenter)||c.barycenter>=l.barycenter)&&n(l,c)}}function s(l){return function(c){c.in.push(l),--c.indegree===0&&a.push(c)}}for(;a.length;){var u=a.pop();i.push(u),r.forEach(u.in.reverse(),o(u)),r.forEach(u.out,s(u))}return r.map(r.filter(i,function(l){return!l.merged}),function(l){return r.pick(l,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,s=0;a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/s,a.weight=s,a.i=Math.min(i.i,a.i),i.merged=!0}return Vy}var Gy,yR;function k4(){if(yR)return Gy;yR=1;var r=kr(),e=zt();Gy=t;function t(i,o){var s=e.partition(i,function(E){return r.has(E,"barycenter")}),u=s.lhs,l=r.sortBy(s.rhs,function(E){return-E.i}),c=[],v=0,h=0,g=0;u.sort(a(!!o)),g=n(c,l,g),r.forEach(u,function(E){g+=E.vs.length,c.push(E.vs),v+=E.barycenter*E.weight,h+=E.weight,g=n(c,l,g)});var p={vs:r.flatten(c,!0)};return h&&(p.barycenter=v/h,p.weight=h),p}function n(i,o,s){for(var u;o.length&&(u=r.last(o)).i<=s;)o.pop(),i.push(u.vs),s++;return s}function a(i){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}}return Gy}var Wy,mR;function L4(){if(mR)return Wy;mR=1;var r=kr(),e=O4(),t=M4(),n=k4();Wy=a;function a(s,u,l,c){var v=s.children(u),h=s.node(u),g=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,E={};g&&(v=r.filter(v,function(C){return C!==g&&C!==p}));var m=e(s,v);r.forEach(m,function(C){if(s.children(C.v).length){var R=a(s,C.v,l,c);E[C.v]=R,r.has(R,"barycenter")&&o(C,R)}});var b=t(m,l);i(b,E);var w=n(b,c);if(g&&(w.vs=r.flatten([g,w.vs,p],!0),s.predecessors(g).length)){var x=s.node(s.predecessors(g)[0]),_=s.node(s.predecessors(p)[0]);r.has(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+x.order+_.order)/(w.weight+2),w.weight+=2}return w}function i(s,u){r.forEach(s,function(l){l.vs=r.flatten(l.vs.map(function(c){return u[c]?u[c].vs:c}),!0)})}function o(s,u){r.isUndefined(s.barycenter)?(s.barycenter=u.barycenter,s.weight=u.weight):(s.barycenter=(s.barycenter*s.weight+u.barycenter*u.weight)/(s.weight+u.weight),s.weight+=u.weight)}return Wy}var Uy,bR;function q4(){if(bR)return Uy;bR=1;var r=kr(),e=wn().Graph;Uy=t;function t(a,i,o){var s=n(a),u=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(l){return a.node(l)});return r.forEach(a.nodes(),function(l){var c=a.node(l),v=a.parent(l);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(u.setNode(l),u.setParent(l,v||s),r.forEach(a[o](l),function(h){var g=h.v===l?h.w:h.v,p=u.edge(g,l),E=r.isUndefined(p)?0:p.weight;u.setEdge(g,l,{weight:a.edge(h).weight+E})}),r.has(c,"minRank")&&u.setNode(l,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),u}function n(a){for(var i;a.hasNode(i=r.uniqueId("_root")););return i}return Uy}var Hy,wR;function N4(){if(wR)return Hy;wR=1;var r=kr();Hy=e;function e(t,n,a){var i={},o;r.forEach(a,function(s){for(var u=t.parent(s),l,c;u;){if(l=t.parent(u),l?(c=i[l],i[l]=u):(c=o,o=u),c&&c!==u){n.setEdge(c,u);return}u=l}})}return Hy}var Ky,xR;function F4(){if(xR)return Ky;xR=1;var r=kr(),e=I4(),t=B4(),n=L4(),a=q4(),i=N4(),o=wn().Graph,s=zt();Ky=u;function u(h){var g=s.maxRank(h),p=l(h,r.range(1,g+1),"inEdges"),E=l(h,r.range(g-1,-1,-1),"outEdges"),m=e(h);v(h,m);for(var b=Number.POSITIVE_INFINITY,w,x=0,_=0;_<4;++x,++_){c(x%2?p:E,x%4>=2),m=s.buildLayerMatrix(h);var C=t(h,m);C<b&&(_=0,w=r.cloneDeep(m),b=C)}v(h,w)}function l(h,g,p){return r.map(g,function(E){return a(h,E,p)})}function c(h,g){var p=new o;r.forEach(h,function(E){var m=E.graph().root,b=n(E,m,p,g);r.forEach(b.vs,function(w,x){E.node(w).order=x}),i(E,p,b.vs)})}function v(h,g){r.forEach(g,function(p){r.forEach(p,function(E,m){h.node(E).order=m})})}return Ky}var jy,ER;function z4(){if(ER)return jy;ER=1;var r=kr(),e=wn().Graph,t=zt();jy={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:s,verticalAlignment:u,horizontalCompaction:l,alignCoordinates:h,findSmallestWidthAlignment:v,balance:g};function n(b,w){var x={};function _(C,R){var S=0,A=0,P=C.length,I=r.last(R);return r.forEach(R,function(D,M){var O=i(b,D),N=O?b.node(O).order:P;(O||D===I)&&(r.forEach(R.slice(A,M+1),function(V){r.forEach(b.predecessors(V),function($){var G=b.node($),U=G.order;(U<S||N<U)&&!(G.dummy&&b.node(V).dummy)&&o(x,$,V)})}),A=M+1,S=N)}),R}return r.reduce(w,_),x}function a(b,w){var x={};function _(R,S,A,P,I){var D;r.forEach(r.range(S,A),function(M){D=R[M],b.node(D).dummy&&r.forEach(b.predecessors(D),function(O){var N=b.node(O);N.dummy&&(N.order<P||N.order>I)&&o(x,O,D)})})}function C(R,S){var A=-1,P,I=0;return r.forEach(S,function(D,M){if(b.node(D).dummy==="border"){var O=b.predecessors(D);O.length&&(P=b.node(O[0]).order,_(S,I,M,A,P),I=M,A=P)}_(S,I,S.length,P,R.length)}),S}return r.reduce(w,C),x}function i(b,w){if(b.node(w).dummy)return r.find(b.predecessors(w),function(x){return b.node(x).dummy})}function o(b,w,x){if(w>x){var _=w;w=x,x=_}var C=b[w];C||(b[w]=C={}),C[x]=!0}function s(b,w,x){if(w>x){var _=w;w=x,x=_}return r.has(b[w],x)}function u(b,w,x,_){var C={},R={},S={};return r.forEach(w,function(A){r.forEach(A,function(P,I){C[P]=P,R[P]=P,S[P]=I})}),r.forEach(w,function(A){var P=-1;r.forEach(A,function(I){var D=_(I);if(D.length){D=r.sortBy(D,function($){return S[$]});for(var M=(D.length-1)/2,O=Math.floor(M),N=Math.ceil(M);O<=N;++O){var V=D[O];R[I]===I&&P<S[V]&&!s(x,I,V)&&(R[V]=I,R[I]=C[I]=C[V],P=S[V])}}})}),{root:C,align:R}}function l(b,w,x,_,C){var R={},S=c(b,w,x,C),A=C?"borderLeft":"borderRight";function P(M,O){for(var N=S.nodes(),V=N.pop(),$={};V;)$[V]?M(V):($[V]=!0,N.push(V),N=N.concat(O(V))),V=N.pop()}function I(M){R[M]=S.inEdges(M).reduce(function(O,N){return Math.max(O,R[N.v]+S.edge(N))},0)}function D(M){var O=S.outEdges(M).reduce(function(V,$){return Math.min(V,R[$.w]-S.edge($))},Number.POSITIVE_INFINITY),N=b.node(M);O!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(R[M]=Math.max(R[M],O))}return P(I,S.predecessors.bind(S)),P(D,S.successors.bind(S)),r.forEach(_,function(M){R[M]=R[x[M]]}),R}function c(b,w,x,_){var C=new e,R=b.graph(),S=E(R.nodesep,R.edgesep,_);return r.forEach(w,function(A){var P;r.forEach(A,function(I){var D=x[I];if(C.setNode(D),P){var M=x[P],O=C.edge(M,D);C.setEdge(M,D,Math.max(S(b,I,P),O||0))}P=I})}),C}function v(b,w){return r.minBy(r.values(w),function(x){var _=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY;return r.forIn(x,function(R,S){var A=m(b,S)/2;_=Math.max(R+A,_),C=Math.min(R-A,C)}),_-C})}function h(b,w){var x=r.values(w),_=r.min(x),C=r.max(x);r.forEach(["u","d"],function(R){r.forEach(["l","r"],function(S){var A=R+S,P=b[A],I;if(P!==w){var D=r.values(P);I=S==="l"?_-r.min(D):C-r.max(D),I&&(b[A]=r.mapValues(P,function(M){return M+I}))}})})}function g(b,w){return r.mapValues(b.ul,function(x,_){if(w)return b[w.toLowerCase()][_];var C=r.sortBy(r.map(b,_));return(C[1]+C[2])/2})}function p(b){var w=t.buildLayerMatrix(b),x=r.merge(n(b,w),a(b,w)),_={},C;r.forEach(["u","d"],function(S){C=S==="u"?w:r.values(w).reverse(),r.forEach(["l","r"],function(A){A==="r"&&(C=r.map(C,function(M){return r.values(M).reverse()}));var P=(S==="u"?b.predecessors:b.successors).bind(b),I=u(b,C,x,P),D=l(b,C,I.root,I.align,A==="r");A==="r"&&(D=r.mapValues(D,function(M){return-M})),_[S+A]=D})});var R=v(b,_);return h(_,R),g(_,b.graph().align)}function E(b,w,x){return function(_,C,R){var S=_.node(C),A=_.node(R),P=0,I;if(P+=S.width/2,r.has(S,"labelpos"))switch(S.labelpos.toLowerCase()){case"l":I=-S.width/2;break;case"r":I=S.width/2;break}if(I&&(P+=x?I:-I),I=0,P+=(S.dummy?w:b)/2,P+=(A.dummy?w:b)/2,P+=A.width/2,r.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(P+=x?I:-I),I=0,P}}function m(b,w){return b.node(w).width}return jy}var Yy,_R;function $4(){if(_R)return Yy;_R=1;var r=kr(),e=zt(),t=z4().positionX;Yy=n;function n(i){i=e.asNonCompoundGraph(i),a(i),r.forEach(t(i),function(o,s){i.node(s).x=o})}function a(i){var o=e.buildLayerMatrix(i),s=i.graph().ranksep,u=0;r.forEach(o,function(l){var c=r.max(r.map(l,function(v){return i.node(v).height}));r.forEach(l,function(v){i.node(v).y=u+c/2}),u+=c+s})}return Yy}var Zy,CR;function V4(){if(CR)return Zy;CR=1;var r=kr(),e=_4(),t=C4(),n=T4(),a=zt().normalizeRanks,i=R4(),o=zt().removeEmptyRanks,s=A4(),u=P4(),l=D4(),c=F4(),v=$4(),h=zt(),g=wn().Graph;Zy=p;function p(F,z){var j=z&&z.debugTiming?h.time:h.notime;j("layout",function(){var ee=j(" buildLayoutGraph",function(){return P(F)});j(" runLayout",function(){E(ee,j)}),j(" updateInputGraph",function(){m(F,ee)})})}function E(F,z){z(" makeSpaceForEdgeLabels",function(){I(F)}),z(" removeSelfEdges",function(){J(F)}),z(" acyclic",function(){e.run(F)}),z(" nestingGraph.run",function(){s.run(F)}),z(" rank",function(){n(h.asNonCompoundGraph(F))}),z(" injectEdgeLabelProxies",function(){D(F)}),z(" removeEmptyRanks",function(){o(F)}),z(" nestingGraph.cleanup",function(){s.cleanup(F)}),z(" normalizeRanks",function(){a(F)}),z(" assignRankMinMax",function(){M(F)}),z(" removeEdgeLabelProxies",function(){O(F)}),z(" normalize.run",function(){t.run(F)}),z(" parentDummyChains",function(){i(F)}),z(" addBorderSegments",function(){u(F)}),z(" order",function(){c(F)}),z(" insertSelfEdges",function(){W(F)}),z(" adjustCoordinateSystem",function(){l.adjust(F)}),z(" position",function(){v(F)}),z(" positionSelfEdges",function(){H(F)}),z(" removeBorderNodes",function(){U(F)}),z(" normalize.undo",function(){t.undo(F)}),z(" fixupEdgeLabelCoords",function(){$(F)}),z(" undoCoordinateSystem",function(){l.undo(F)}),z(" translateGraph",function(){N(F)}),z(" assignNodeIntersects",function(){V(F)}),z(" reversePoints",function(){G(F)}),z(" acyclic.undo",function(){e.undo(F)})}function m(F,z){r.forEach(F.nodes(),function(j){var ee=F.node(j),ie=z.node(j);ee&&(ee.x=ie.x,ee.y=ie.y,z.children(j).length&&(ee.width=ie.width,ee.height=ie.height))}),r.forEach(F.edges(),function(j){var ee=F.edge(j),ie=z.edge(j);ee.points=ie.points,r.has(ie,"x")&&(ee.x=ie.x,ee.y=ie.y)}),F.graph().width=z.graph().width,F.graph().height=z.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],_=["width","height"],C={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function P(F){var z=new g({multigraph:!0,compound:!0}),j=ne(F.graph());return z.setGraph(r.merge({},w,Z(j,b),r.pick(j,x))),r.forEach(F.nodes(),function(ee){var ie=ne(F.node(ee));z.setNode(ee,r.defaults(Z(ie,_),C)),z.setParent(ee,F.parent(ee))}),r.forEach(F.edges(),function(ee){var ie=ne(F.edge(ee));z.setEdge(ee,r.merge({},S,Z(ie,R),r.pick(ie,A)))}),z}function I(F){var z=F.graph();z.ranksep/=2,r.forEach(F.edges(),function(j){var ee=F.edge(j);ee.minlen*=2,ee.labelpos.toLowerCase()!=="c"&&(z.rankdir==="TB"||z.rankdir==="BT"?ee.width+=ee.labeloffset:ee.height+=ee.labeloffset)})}function D(F){r.forEach(F.edges(),function(z){var j=F.edge(z);if(j.width&&j.height){var ee=F.node(z.v),ie=F.node(z.w),oe={rank:(ie.rank-ee.rank)/2+ee.rank,e:z};h.addDummyNode(F,"edge-proxy",oe,"_ep")}})}function M(F){var z=0;r.forEach(F.nodes(),function(j){var ee=F.node(j);ee.borderTop&&(ee.minRank=F.node(ee.borderTop).rank,ee.maxRank=F.node(ee.borderBottom).rank,z=r.max(z,ee.maxRank))}),F.graph().maxRank=z}function O(F){r.forEach(F.nodes(),function(z){var j=F.node(z);j.dummy==="edge-proxy"&&(F.edge(j.e).labelRank=j.rank,F.removeNode(z))})}function N(F){var z=Number.POSITIVE_INFINITY,j=0,ee=Number.POSITIVE_INFINITY,ie=0,oe=F.graph(),Y=oe.marginx||0,X=oe.marginy||0;function re(le){var he=le.x,be=le.y,fe=le.width,ue=le.height;z=Math.min(z,he-fe/2),j=Math.max(j,he+fe/2),ee=Math.min(ee,be-ue/2),ie=Math.max(ie,be+ue/2)}r.forEach(F.nodes(),function(le){re(F.node(le))}),r.forEach(F.edges(),function(le){var he=F.edge(le);r.has(he,"x")&&re(he)}),z-=Y,ee-=X,r.forEach(F.nodes(),function(le){var he=F.node(le);he.x-=z,he.y-=ee}),r.forEach(F.edges(),function(le){var he=F.edge(le);r.forEach(he.points,function(be){be.x-=z,be.y-=ee}),r.has(he,"x")&&(he.x-=z),r.has(he,"y")&&(he.y-=ee)}),oe.width=j-z+Y,oe.height=ie-ee+X}function V(F){r.forEach(F.edges(),function(z){var j=F.edge(z),ee=F.node(z.v),ie=F.node(z.w),oe,Y;j.points?(oe=j.points[0],Y=j.points[j.points.length-1]):(j.points=[],oe=ie,Y=ee),j.points.unshift(h.intersectRect(ee,oe)),j.points.push(h.intersectRect(ie,Y))})}function $(F){r.forEach(F.edges(),function(z){var j=F.edge(z);if(r.has(j,"x"))switch((j.labelpos==="l"||j.labelpos==="r")&&(j.width-=j.labeloffset),j.labelpos){case"l":j.x-=j.width/2+j.labeloffset;break;case"r":j.x+=j.width/2+j.labeloffset;break}})}function G(F){r.forEach(F.edges(),function(z){var j=F.edge(z);j.reversed&&j.points.reverse()})}function U(F){r.forEach(F.nodes(),function(z){if(F.children(z).length){var j=F.node(z),ee=F.node(j.borderTop),ie=F.node(j.borderBottom),oe=F.node(r.last(j.borderLeft)),Y=F.node(r.last(j.borderRight));j.width=Math.abs(Y.x-oe.x),j.height=Math.abs(ie.y-ee.y),j.x=oe.x+j.width/2,j.y=ee.y+j.height/2}}),r.forEach(F.nodes(),function(z){F.node(z).dummy==="border"&&F.removeNode(z)})}function J(F){r.forEach(F.edges(),function(z){if(z.v===z.w){var j=F.node(z.v);j.selfEdges||(j.selfEdges=[]),j.selfEdges.push({e:z,label:F.edge(z)}),F.removeEdge(z)}})}function W(F){var z=h.buildLayerMatrix(F);r.forEach(z,function(j){var ee=0;r.forEach(j,function(ie,oe){var Y=F.node(ie);Y.order=oe+ee,r.forEach(Y.selfEdges,function(X){h.addDummyNode(F,"selfedge",{width:X.label.width,height:X.label.height,rank:Y.rank,order:oe+ ++ee,e:X.e,label:X.label},"_se")}),delete Y.selfEdges})})}function H(F){r.forEach(F.nodes(),function(z){var j=F.node(z);if(j.dummy==="selfedge"){var ee=F.node(j.e.v),ie=ee.x+ee.width/2,oe=ee.y,Y=j.x-ie,X=ee.height/2;F.setEdge(j.e,j.label),F.removeNode(z),j.label.points=[{x:ie+2*Y/3,y:oe-X},{x:ie+5*Y/6,y:oe-X},{x:ie+Y,y:oe},{x:ie+5*Y/6,y:oe+X},{x:ie+2*Y/3,y:oe+X}],j.label.x=j.x,j.label.y=j.y}})}function Z(F,z){return r.mapValues(r.pick(F,z),Number)}function ne(F){var z={};return r.forEach(F,function(j,ee){z[ee.toLowerCase()]=j}),z}return Zy}var Xy,SR;function G4(){if(SR)return Xy;SR=1;var r=kr(),e=zt(),t=wn().Graph;Xy={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(a.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+a.node(s).rank)}),r.forEach(a.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),r.forEach(i,function(s,u){var l="layer"+u;o.setNode(l,{rank:"same"}),r.reduce(s,function(c,v){return o.setEdge(c,v,{style:"invis"}),v})}),o}return Xy}var Qy,TR;function W4(){return TR||(TR=1,Qy="0.8.5"),Qy}var Jy,RR;function U4(){return RR||(RR=1,Jy={graphlib:wn(),layout:V4(),debug:G4(),util:{time:zt().time,notime:zt().notime},version:W4()}),Jy}var H4=Fu.exports,AR;function K4(){return AR||(AR=1,(function(r,e){(function(n,a){r.exports=a(U4())})(H4,function(t){return(function(n){var a={};function i(o){if(a[o])return a[o].exports;var s=a[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=n,i.c=a,i.d=function(o,s,u){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:u})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(i.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var l in o)i.d(u,l,(function(c){return o[c]}).bind(null,l));return u},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=0)})([(function(n,a,i){var o=i(1),s=function(l){l&&l("layout","dagre",o)};typeof cytoscape<"u"&&s(cytoscape),n.exports=s}),(function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var s=function(g){return typeof g=="function"},u=i(2),l=i(3),c=i(4);function v(h){this.options=l({},u,h)}v.prototype.run=function(){var h=this.options,g=this,p=h.cy,E=h.eles,m=function(H,Z){return s(Z)?Z.apply(H,[H]):Z},b=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};b.x2===void 0&&(b.x2=b.x1+b.w),b.w===void 0&&(b.w=b.x2-b.x1),b.y2===void 0&&(b.y2=b.y1+b.h),b.h===void 0&&(b.h=b.y2-b.y1);var w=new c.graphlib.Graph({multigraph:!0,compound:!0}),x={},_=function(H,Z){Z!=null&&(x[H]=Z)};_("nodesep",h.nodeSep),_("edgesep",h.edgeSep),_("ranksep",h.rankSep),_("rankdir",h.rankDir),_("align",h.align),_("ranker",h.ranker),_("acyclicer",h.acyclicer),w.setGraph(x),w.setDefaultEdgeLabel(function(){return{}}),w.setDefaultNodeLabel(function(){return{}});var C=E.nodes();s(h.sort)&&(C=C.sort(h.sort));for(var R=0;R<C.length;R++){var S=C[R],A=S.layoutDimensions(h);w.setNode(S.id(),{width:A.w,height:A.h,name:S.id()})}for(var P=0;P<C.length;P++){var I=C[P];I.isChild()&&w.setParent(I.id(),I.parent().id())}var D=E.edges().stdFilter(function(W){return!W.source().isParent()&&!W.target().isParent()});s(h.sort)&&(D=D.sort(h.sort));for(var M=0;M<D.length;M++){var O=D[M];w.setEdge(O.source().id(),O.target().id(),{minlen:m(O,h.minLen),weight:m(O,h.edgeWeight),name:O.id()},O.id())}c.layout(w);for(var N=w.nodes(),V=0;V<N.length;V++){var $=N[V],G=w.node($);p.getElementById($).scratch().dagre=G}var U;h.boundingBox?(U={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},C.forEach(function(W){var H=W.scratch().dagre;U.x1=Math.min(U.x1,H.x),U.x2=Math.max(U.x2,H.x),U.y1=Math.min(U.y1,H.y),U.y2=Math.max(U.y2,H.y)}),U.w=U.x2-U.x1,U.h=U.y2-U.y1):U=b;var J=function(H){if(h.boundingBox){var Z=U.w===0?0:(H.x-U.x1)/U.w,ne=U.h===0?0:(H.y-U.y1)/U.h;return{x:b.x1+Z*b.w,y:b.y1+ne*b.h}}else return H};return C.layoutPositions(g,h,function(W){W=o(W)==="object"?W:this;var H=W.scratch().dagre;return J({x:H.x,y:H.y})}),this},n.exports=v}),(function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(s){return 1},edgeWeight:function(s){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(s,u){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(s,u){return u},ready:function(){},sort:void 0,stop:function(){}};n.exports=i}),(function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return s.forEach(function(l){Object.keys(l).forEach(function(c){return i[c]=l[c]})}),i}}),(function(n,a){n.exports=t})])})})(Fu)),Fu.exports}var j4=K4();const Y4=El(j4);var zu={exports:{}},em,PR;function Z4(){if(PR)return em;PR=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof wt=="object"&&wt&&wt.Object===Object&&wt,s=typeof self=="object"&&self&&self.Object===Object&&self,u=o||s||Function("return this")();function l(fe,ue){return fe==null?void 0:fe[ue]}function c(fe){var ue=!1;if(fe!=null&&typeof fe.toString!="function")try{ue=!!(fe+"")}catch{}return ue}var v=Array.prototype,h=Function.prototype,g=Object.prototype,p=u["__core-js_shared__"],E=(function(){var fe=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return fe?"Symbol(src)_1."+fe:""})(),m=h.toString,b=g.hasOwnProperty,w=g.toString,x=RegExp("^"+m.call(b).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=v.splice,C=ie(u,"Map"),R=ie(Object,"create");function S(fe){var ue=-1,Se=fe?fe.length:0;for(this.clear();++ue<Se;){var Ae=fe[ue];this.set(Ae[0],Ae[1])}}function A(){this.__data__=R?R(null):{}}function P(fe){return this.has(fe)&&delete this.__data__[fe]}function I(fe){var ue=this.__data__;if(R){var Se=ue[fe];return Se===e?void 0:Se}return b.call(ue,fe)?ue[fe]:void 0}function D(fe){var ue=this.__data__;return R?ue[fe]!==void 0:b.call(ue,fe)}function M(fe,ue){var Se=this.__data__;return Se[fe]=R&&ue===void 0?e:ue,this}S.prototype.clear=A,S.prototype.delete=P,S.prototype.get=I,S.prototype.has=D,S.prototype.set=M;function O(fe){var ue=-1,Se=fe?fe.length:0;for(this.clear();++ue<Se;){var Ae=fe[ue];this.set(Ae[0],Ae[1])}}function N(){this.__data__=[]}function V(fe){var ue=this.__data__,Se=z(ue,fe);if(Se<0)return!1;var Ae=ue.length-1;return Se==Ae?ue.pop():_.call(ue,Se,1),!0}function $(fe){var ue=this.__data__,Se=z(ue,fe);return Se<0?void 0:ue[Se][1]}function G(fe){return z(this.__data__,fe)>-1}function U(fe,ue){var Se=this.__data__,Ae=z(Se,fe);return Ae<0?Se.push([fe,ue]):Se[Ae][1]=ue,this}O.prototype.clear=N,O.prototype.delete=V,O.prototype.get=$,O.prototype.has=G,O.prototype.set=U;function J(fe){var ue=-1,Se=fe?fe.length:0;for(this.clear();++ue<Se;){var Ae=fe[ue];this.set(Ae[0],Ae[1])}}function W(){this.__data__={hash:new S,map:new(C||O),string:new S}}function H(fe){return ee(this,fe).delete(fe)}function Z(fe){return ee(this,fe).get(fe)}function ne(fe){return ee(this,fe).has(fe)}function F(fe,ue){return ee(this,fe).set(fe,ue),this}J.prototype.clear=W,J.prototype.delete=H,J.prototype.get=Z,J.prototype.has=ne,J.prototype.set=F;function z(fe,ue){for(var Se=fe.length;Se--;)if(le(fe[Se][0],ue))return Se;return-1}function j(fe){if(!be(fe)||Y(fe))return!1;var ue=he(fe)||c(fe)?x:i;return ue.test(X(fe))}function ee(fe,ue){var Se=fe.__data__;return oe(ue)?Se[typeof ue=="string"?"string":"hash"]:Se.map}function ie(fe,ue){var Se=l(fe,ue);return j(Se)?Se:void 0}function oe(fe){var ue=typeof fe;return ue=="string"||ue=="number"||ue=="symbol"||ue=="boolean"?fe!=="__proto__":fe===null}function Y(fe){return!!E&&E in fe}function X(fe){if(fe!=null){try{return m.call(fe)}catch{}try{return fe+""}catch{}}return""}function re(fe,ue){if(typeof fe!="function"||ue&&typeof ue!="function")throw new TypeError(r);var Se=function(){var Ae=arguments,Te=ue?ue.apply(this,Ae):Ae[0],Pe=Se.cache;if(Pe.has(Te))return Pe.get(Te);var Ie=fe.apply(this,Ae);return Se.cache=Pe.set(Te,Ie),Ie};return Se.cache=new(re.Cache||J),Se}re.Cache=J;function le(fe,ue){return fe===ue||fe!==fe&&ue!==ue}function he(fe){var ue=be(fe)?w.call(fe):"";return ue==t||ue==n}function be(fe){var ue=typeof fe;return!!fe&&(ue=="object"||ue=="function")}return em=re,em}var rm,DR;function X4(){if(DR)return rm;DR=1;var r="Expected a function",e=NaN,t="[object Symbol]",n=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,u=typeof wt=="object"&&wt&&wt.Object===Object&&wt,l=typeof self=="object"&&self&&self.Object===Object&&self,c=u||l||Function("return this")(),v=Object.prototype,h=v.toString,g=Math.max,p=Math.min,E=function(){return c.Date.now()};function m(R,S,A){var P,I,D,M,O,N,V=0,$=!1,G=!1,U=!0;if(typeof R!="function")throw new TypeError(r);S=C(S)||0,w(A)&&($=!!A.leading,G="maxWait"in A,D=G?g(C(A.maxWait)||0,S):D,U="trailing"in A?!!A.trailing:U);function J(ie){var oe=P,Y=I;return P=I=void 0,V=ie,M=R.apply(Y,oe),M}function W(ie){return V=ie,O=setTimeout(ne,S),$?J(ie):M}function H(ie){var oe=ie-N,Y=ie-V,X=S-oe;return G?p(X,D-Y):X}function Z(ie){var oe=ie-N,Y=ie-V;return N===void 0||oe>=S||oe<0||G&&Y>=D}function ne(){var ie=E();if(Z(ie))return F(ie);O=setTimeout(ne,H(ie))}function F(ie){return O=void 0,U&&P?J(ie):(P=I=void 0,M)}function z(){O!==void 0&&clearTimeout(O),V=0,P=N=I=O=void 0}function j(){return O===void 0?M:F(E())}function ee(){var ie=E(),oe=Z(ie);if(P=arguments,I=this,N=ie,oe){if(O===void 0)return W(N);if(G)return O=setTimeout(ne,S),J(N)}return O===void 0&&(O=setTimeout(ne,S)),M}return ee.cancel=z,ee.flush=j,ee}function b(R,S,A){var P=!0,I=!0;if(typeof R!="function")throw new TypeError(r);return w(A)&&(P="leading"in A?!!A.leading:P,I="trailing"in A?!!A.trailing:I),m(R,S,{leading:P,maxWait:S,trailing:I})}function w(R){var S=typeof R;return!!R&&(S=="object"||S=="function")}function x(R){return!!R&&typeof R=="object"}function _(R){return typeof R=="symbol"||x(R)&&h.call(R)==t}function C(R){if(typeof R=="number")return R;if(_(R))return e;if(w(R)){var S=typeof R.valueOf=="function"?R.valueOf():R;R=w(S)?S+"":S}if(typeof R!="string")return R===0?R:+R;R=R.replace(n,"");var A=i.test(R);return A||o.test(R)?s(R.slice(2),A?2:8):a.test(R)?e:+R}return rm=b,rm}var Q4=zu.exports,IR;function J4(){return IR||(IR=1,(function(r,e){(function(n,a){r.exports=a(Z4(),X4())})(Q4,function(t,n){return(function(a){var i={};function o(s){if(i[s])return i[s].exports;var u=i[s]={i:s,l:!1,exports:{}};return a[s].call(u.exports,u,u.exports,o),u.l=!0,u.exports}return o.m=a,o.c=i,o.i=function(s){return s},o.d=function(s,u,l){o.o(s,u)||Object.defineProperty(s,u,{configurable:!1,enumerable:!0,get:l})},o.n=function(s){var u=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(u,"a",u),u},o.o=function(s,u){return Object.prototype.hasOwnProperty.call(s,u)},o.p="",o(o.s=12)})([(function(a,i,o){a.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var u=arguments.length,l=Array(u>1?u-1:0),c=1;c<u;c++)l[c-1]=arguments[c];return l.filter(function(v){return v!=null}).forEach(function(v){Object.keys(v).forEach(function(h){return s[h]=v[h]})}),s}}),(function(a,i,o){var s=o(10),u=o(0);a.exports=function(l){var c=this;return new s(u({cy:c},l))}}),(function(a,i,o){function s(){if(this.saveGestureState(),this.cy.zoomingEnabled(!1).panningEnabled(!1).boxSelectionEnabled(!1),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.addEventListener("touchstart",this.preventDefault,c),window.addEventListener("touchmove",this.preventDefault,c),window.addEventListener("wheel",this.preventDefault,c)}return this}function u(){if(this.cy.zoomingEnabled(this.lastZoomingEnabled).panningEnabled(this.lastPanningEnabled).boxSelectionEnabled(this.lastBoxSelectionEnabled),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.removeEventListener("touchstart",this.preventDefault,c),window.removeEventListener("touchmove",this.preventDefault,c),window.removeEventListener("wheel",this.preventDefault,c)}return this}function l(){var c=this.cy;return this.lastPanningEnabled=c.panningEnabled(),this.lastZoomingEnabled=c.zoomingEnabled(),this.lastBoxSelectionEnabled=c.boxSelectionEnabled(),this}a.exports={disableGestures:s,resetGestures:u,saveGestureState:l}}),(function(a,i,o){function s(){var u=this,l=this.cy,c=this.options;return this.addListener(l,"drag",function(){return u.grabbingNode=!0}),this.addListener(l,"free",function(){return u.grabbingNode=!1}),this.addListener(l,"tapstart","node",function(v){var h=v.target;u.drawMode&&u.start(h)}),this.addListener(l,"tapdrag",function(v){u.update(v.position)}),this.addListener(l,"tapdragover","node",function(v){c.snap||u.preview(v.target)}),this.addListener(l,"tapdragout","node",function(v){c.snap||u.unpreview(v.target)}),this.addListener(l,"tapend",function(){u.stop()}),this}a.exports={addCytoscapeListeners:s}}),(function(a,i,o){var s={canConnect:function(l,c){return!l.same(c)},edgeParams:function(l,c){return{}},hoverDelay:150,snap:!0,snapThreshold:50,snapFrequency:15,noEdgeEventsInDraw:!0,disableBrowserGestures:!0};a.exports=s}),(function(a,i,o){function s(c){var v=this.cy;return this.drawMode=c??!this.drawMode,this.drawMode?(this.prevUngrabifyState=v.autoungrabify(),v.autoungrabify(!0),this.emit("drawon")):(v.autoungrabify(this.prevUngrabifyState),this.emit("drawoff")),this}function u(){return this.toggleDrawMode(!0)}function l(){return this.toggleDrawMode(!1)}a.exports={toggleDrawMode:s,enableDrawMode:u,disableDrawMode:l}}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},u=o(0),l=function(w){return(typeof w>"u"?"undefined":s(w))===s("")},c=function(w){return(typeof w>"u"?"undefined":s(w))===s([])&&w.length!=null};function v(b,w,x){var _={};return u(_,w,b),u(_.data,w.data,b.data),l(w.classes)?_.classes=w.classes+" "+x:c(w.classes)?_.classes=w.classes.join(" ")+" "+x:_.classes=x,_}function h(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=this.cy;this.options;var x=this.presumptiveTargets,_=this.previewEles,C=this.active,R=this.sourceNode,S=this.targetNode,A=b?"eh-preview":"",P=w.collection(),I=this.canConnect(S);if(C&&I){if(!S||S.size()===0){_.remove(),this.emit("cancel",this.mp(),R,x);return}if(!b){_.removeClass("eh-preview").style("events",""),this.emit("complete",this.mp(),R,S,_);return}var D=w.add(v({group:"edges",data:{source:R.id(),target:S.id()}},this.edgeParams(S),A));return P=P.merge(D),b?(this.previewEles=P,P.style("events","no")):(P.style("events",""),this.emit("complete",this.mp(),R,S,P)),this}}function g(){return this.makeEdges(!0),this}function p(){return this.previewEles.nonempty()&&this.previewEles.inside()}function E(){return this.previewShown()&&this.previewEles.remove(),this}function m(){var b=this,w=this.sourceNode,x=this.ghostNode,_=this.cy,C=this.mx,R=this.my,S=C,A=R,P=void 0,I=void 0;if(w)return(!x||x.length===0||x.removed())&&(I=this.ghostEles=_.collection(),_.batch(function(){x=b.ghostNode=_.add({group:"nodes",classes:"eh-ghost eh-ghost-node",position:{x:0,y:0}}),x.style({"background-color":"blue",width:1e-4,height:1e-4,opacity:0,events:"no"});var D={};P=_.add(u({},D,{group:"edges",data:u({},D.data,{source:w.id(),target:x.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),I.merge(x).merge(P)),x.position({x:S,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:E,previewShown:p,updateEdge:m}}),(function(a,i,o){function s(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events","no"),this}function u(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events",""),this}a.exports={disableEdgeEvents:s,enableEdgeEvents:u}}),(function(a,i,o){function s(){return this.enabled=!0,this.emit("enable"),this}function u(){return this.enabled=!1,this.emit("disable"),this}a.exports={enable:s,disable:u}}),(function(a,i,o){var s=o(13),u=Math.sqrt(2);function l(w){var x=this.previewEles,_=this.ghostEles,C=function(M){return x.anySame(M)},R=function(M){return _.anySame(M)},S=function(M){return C(M)||R(M)},A=this.enabled,P=this.active,I=this.grabbingNode;return A&&!P&&!I&&w!=null&&w.nonempty()&&!S(w)}function c(w){return this.canStartOn(w)&&this.drawMode}function v(w){return this.canStartOn(w)&&!this.drawMode}function h(w){var x=this;if(this.canStartOn(w)){this.active=!0,this.sourceNode=w,this.sourceNode.addClass("eh-source"),this.disableGestures(),this.disableEdgeEvents();var _=function(R){return R.id()};this.canConnect=s(function(C){return x.options.canConnect(x.sourceNode,C)},_),this.edgeParams=s(function(C){return x.options.edgeParams(x.sourceNode,C)},_),this.emit("start",this.hp(),w)}}function g(w){if(this.active){var x=w;return this.mx=x.x,this.my=x.y,this.updateEdge(),this.throttledSnap(),this}}function p(){if(!this.active||!this.options.snap)return!1;var w=this.cy,x=this.targetNode,_=this.options.snapThreshold,C=this.mp(),R=this.previewEles,S=this.ghostNode,A=function(z){return u*Math.max(z.outerWidth(),z.outerHeight())/2},P=function(z,j,ee,ie){var oe=ee-z,Y=ie-j;return oe*oe+Y*Y},I=function(z,j){return P(z.x,z.y,j.x,j.y)},D=function(z){return I(z.position(),C)},M=function(z){var j=A(z),ee=j+_;return ee*ee},O=function(z){return D(z)<=M(z)},N=function(z){var j=z.position(),ee=z.outerWidth()/2,ie=z.outerHeight()/2,oe=j.x,Y=j.y,X=C.x,re=C.y,le=oe-ee,he=oe+ee,be=Y-ie,fe=Y+ie,ue=le<=X&&X<=he,Se=be<=re&&re<=fe;if(ue&&Se)return 0;if(ue){var Ae=re-be,Te=re-fe;return Math.min(Ae*Ae,Te*Te)}else if(Se){var Pe=X-le,Ie=X-he;return Math.min(Pe*Pe,Ie*Ie)}else return X<le&&re<be?P(X,re,le,be):X>he&&re<be?P(X,re,he,be):X<le&&re>fe?P(X,re,le,fe):P(X,re,he,fe)},V=function(z,j){return N(z)-N(j)},$=V,G=!1,U=function(z){var j=C,ee=z.outerWidth(),ie=ee/2,oe=z.outerHeight(),Y=oe/2,X=z.position(),re=X.x-ie,le=X.x+ie,he=X.y-Y,be=X.y+Y;return re<=j.x&&j.x<=le&&he<=j.y&&j.y<=be},J=function(z){return z.same(R)||z.same(S)},W=w.nodes(function(F){return!J(F)&&O(F)}).sort($),H=!1;x.nonempty()&&!O(x)&&this.unpreview(x);for(var Z=0;Z<W.length;Z++){var ne=W[Z];if(!(ne.isParent()&&U(ne))&&!(ne.isChild()&&!U(ne.parent()))&&(ne.same(x)||this.preview(ne,G))){H=!0;break}}return H}function E(w){var x=this,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,C=this.options,R=this.sourceNode,S=this.ghostNode,A=this.ghostEles,P=this.presumptiveTargets,I=this.previewEles,D=this.active,M=R,O=w.same(S),N=!this.canConnect(w),V=w.same(this.targetNode);if(!D||O||N||V)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var $=function(){x.targetNode=w,P.merge(w),w.addClass("eh-presumptive-target"),w.addClass("eh-target"),x.emit("hoverover",x.mp(),M,w),w.addClass("eh-preview"),A.addClass("eh-preview-active"),R.addClass("eh-preview-active"),w.addClass("eh-preview-active"),x.makePreview(),x.emit("previewon",x.mp(),M,w,I)};return _&&C.hoverDelay>0?this.previewTimeout=setTimeout($,C.hoverDelay):$(),!0}function m(w){if(this.active){var x=this.previewTimeout,_=this.sourceNode,C=this.previewEles,R=this.ghostEles,S=this.cy;clearTimeout(x),this.previewTimeout=null;var A=_;return w.removeClass("eh-preview eh-target eh-presumptive-target eh-preview-active"),R.removeClass("eh-preview-active"),_.removeClass("eh-preview-active"),this.targetNode=S.collection(),this.removePreview(A,w),this.emit("hoverout",this.mp(),A,w),this.emit("previewoff",this.mp(),A,w,C),this}}function b(){if(this.active){var w=this.sourceNode,x=this.targetNode,_=this.ghostEles,C=this.presumptiveTargets;return clearTimeout(this.previewTimeout),w.removeClass("eh-source eh-preview-active"),x.removeClass("eh-target eh-preview eh-hover eh-preview-active"),C.removeClass("eh-presumptive-target"),this.makeEdges(),_.remove(),this.clearCollections(),this.resetGestures(),this.enableEdgeEvents(),this.active=!1,this.emit("stop",this.mp(),w),this}}a.exports={start:h,update:g,preview:E,unpreview:m,stop:b,snap:p,canStartOn:l,canStartDrawModeOn:c,canStartNonDrawModeOn:v}}),(function(a,i,o){var s=o(4),u=o(0),l=o(14),c=o(2),v=o(3),h=o(5),g=o(6),p=o(8),E=o(9),m=o(11),b=o(7);function w(C){var R=C.cy;this.cy=R,this.listeners=[],this.enabled=!0,this.drawMode=!1,this.active=!1,this.grabbingNode=!1,this.clearCollections(),this.mx=0,this.my=0,this.options=u({},s,C),this.saveGestureState(),this.addListeners(),this.throttledSnap=l(this.snap.bind(this),1e3/C.snapFrequency),this.preventDefault=function(P){return P.preventDefault()},this.canConnect=function(){return!1};var S=!1;try{var A=Object.defineProperty({},"passive",{get:function(){S=!0}});window.addEventListener("test",null,A)}catch{}S?this.windowListenerOptions={capture:!0,passive:!1}:this.windowListenerOptions=!0}var x=w.prototype={},_=function(R){return u(x,R)};x.destroy=function(){this.removeListeners()},x.setOptions=function(C){u(this.options,C)},x.mp=function(){return{x:this.mx,y:this.my}},x.hp=function(){return{x:this.hx,y:this.hy}},x.clearCollections=function(){var C=this.cy;this.previewEles=C.collection(),this.ghostEles=C.collection(),this.ghostNode=C.collection(),this.sourceNode=C.collection(),this.targetNode=C.collection(),this.presumptiveTargets=C.collection()},[c,v,h,g,p,E,m,b].forEach(_),a.exports=w}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function u(){var E=this;return this.addCytoscapeListeners(),this.addListener(this.cy,"destroy",function(){return E.destroy()}),this}function l(){for(var E=this.listeners.length-1;E>=0;E--){var m=this.listeners[E];this.removeListener(m.target,m.event,m.selector,m.callback,m.options)}return this}function c(E,m,b,w,x){return(typeof b>"u"?"undefined":s(b))!==s("")&&(w=b,x=w,b=null),x==null&&(x=!1),{target:E,event:m,selector:b,callback:w,options:x}}function v(E){return E instanceof Element}function h(E,m,b,w,x){var _=c(E,m,b,w,x);return this.listeners.push(_),v(_.target)?_.target.addEventListener(_.event,_.callback,_.options):_.selector?_.target.addListener(_.event,_.selector,_.callback,_.options):_.target.addListener(_.event,_.callback,_.options),this}function g(E,m,b,w,x){for(var _=c(E,m,b,w,x),C=this.listeners.length-1;C>=0;C--){var R=this.listeners[C];if(_.target===R.target&&_.event===R.event&&(_.selector==null||_.selector===R.selector)&&(_.callback==null||_.callback===R.callback)){this.listeners.splice(C,1),v(_.target)?_.target.removeEventListener(_.event,_.callback,_.options):_.selector?_.target.removeListener(_.event,_.selector,_.callback,_.options):_.target.removeListener(_.event,_.callback,_.options);break}}return this}function p(E,m){for(var b=this.cy,w=arguments.length,x=Array(w>2?w-2:0),_=2;_<w;_++)x[_-2]=arguments[_];return b.emit({type:"eh"+E,position:m},x),this}a.exports={addListener:h,addListeners:u,removeListener:g,removeListeners:l,emit:p}}),(function(a,i,o){var s=o(1),u=function(c){c&&c("core","edgehandles",s)};typeof cytoscape<"u"&&u(cytoscape),a.exports=u}),(function(a,i){a.exports=t}),(function(a,i){a.exports=n})])})})(zu)),zu.exports}var eW=J4();const rW=El(eW);var tm,BR;function tW(){if(BR)return tm;BR=1;class r{constructor(n,a={}){this._cy=n,this._params=a,this._node_dom={};let i=n.container();if(a.dom_container)this._nodes_dom_container=a.dom_container;else{let s=document.createElement("div");s.style.position="absolute",s.style.zIndex=10,i.querySelector("canvas").parentNode.appendChild(s),this._nodes_dom_container=s}this._resize_observer=new ResizeObserver(s=>{for(let u of s){let l=u.target,c=l.__cy_id;n.getElementById(c).style({width:l.offsetWidth,height:l.offsetHeight,shape:"rectangle"})}}),n.on("add","node",s=>{this._add_node(s.target)}),n.on("remove","node",s=>{this._remove_node(s.target)});for(let s of n.nodes())this._add_node(s);this._nodes_dom_container.style.willChange="transform",this._nodes_dom_container.style.backfaceVisibility="hidden";let o=null;n.on("pan zoom",()=>{o===null&&(o=requestAnimationFrame(()=>{o=null;let s=n.pan(),u=n.zoom(),l="translate3d("+s.x+"px,"+s.y+"px,0) scale("+u+")";this._nodes_dom_container.style.transform=l}))}),this._panZoomRafId=o,n.on("position bounds","node",s=>{let u=s.target,l=u.id();if(!this._node_dom[l])return;let c=this._node_dom[l],v=`translate(-50%, -50%) translate3d(${u.position("x").toFixed(2)}px, ${u.position("y").toFixed(2)}px, 0)`;c.style.transform=v,c.style.display="inline",c.style.position="absolute",c.style["z-index"]=10})}_add_node(n){let a=n.data();a.dom&&(a.skip_node_append!==!0&&this._nodes_dom_container.appendChild(a.dom),a.dom.__cy_id=n.id(),a.dom.style.willChange="transform",a.dom.style.backfaceVisibility="hidden",this._node_dom[n.id()]=a.dom,this._resize_observer.observe(a.dom))}_remove_node(n){let a=n.id(),i=this._node_dom[a];i&&(this._resize_observer.unobserve(i),i.parentNode===this._nodes_dom_container&&this._nodes_dom_container.removeChild(i),delete this._node_dom[a])}node_dom(n){return this._node_dom[n]}update(n,a){let i=this._cy.getElementById(n);if(!i){console.warn(`Node with id ${n} not found`);return}let o=this._node_dom[n];if(!o){console.warn(`DOM element for node ${n} not found`);return}a(o),i.data("dom",o),this._cy.trigger("position",["node",i])}remove(){for(let n in this._node_dom)this._resize_observer.unobserve(this._node_dom[n]);for(;this._nodes_dom_container.firstChild;)this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);this._node_dom={},this._cy.removeListener("add","node"),this._cy.removeListener("remove","node"),this._cy.removeListener("pan zoom"),this._cy.removeListener("position bounds","node"),this._params.dom_container||this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container),this._panZoomRafId!==null&&cancelAnimationFrame(this._panZoomRafId),this._cy=null,this._params=null,this._nodes_dom_container=null,this._resize_observer=null}}function e(t){t&&t("core","domNode",function(n,a){return new r(this,n,a)})}return typeof cytoscape<"u"&&e(cytoscape),tm=e,tm}var nW=tW();const aW=El(nW);sn.prototype.hasInitialised||(sn.use(Y4),sn.use(rW),sn.use(aW),sn.prototype.hasInitialised=!0);var Vo={exports:{}};/**
|
|
331
|
+
`),s=a3(n,a,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)s.uTextures.push(n.getUniformLocation(s,"uTexture".concat(l)));return s}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,a=this.gl,i=this.program,o=a.createVertexArray();return a.bindVertexArray(o),v3(a,"vec2",i.aPosition,t),this.transformBuffer=h3(a,n,i.aTransform),this.indexBuffer=An(a,n,"vec4",i.aIndex),this.vertTypeBuffer=An(a,n,"int",i.aVertType),this.atlasIdBuffer=An(a,n,"int",i.aAtlasId),this.texBuffer=An(a,n,"vec4",i.aTex),this.pointAPointBBuffer=An(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=An(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=An(a,n,"vec2",i.aLineWidth),this.colorBuffer=An(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=An(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=An(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),o}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return ya(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ko.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return t.visible()?n&&n.isVisible?n.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(a);if(this._isVisible(t,s)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(t);if(l===rl.IGNORE)return;if(l==rl.USE_BB){this.drawPickingRectangle(t,n,a);return}}var u=i.getAtlasInfo(t,a),c=zt(u),d;try{for(c.s();!(d=c.n()).done;){var h=d.value,g=h.atlas,p=h.tex1,E=h.tex2;o.canAddToCurrentBatch(g)||this.endBatch();for(var y=o.getAtlasIndexForBatch(g),b=0,w=[[p,!0],[E,!1]];b<w.length;b++){var x=Yr(w[b],2),C=x[0],T=x[1];if(C.w!=0){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=Bd;var _=this.indexBuffer.getView(S);zi(n,_);var A=this.atlasIdBuffer.getView(S);A[0]=y;var P=this.texBuffer.getView(S);P[0]=C.x,P[1]=C.y,P[2]=C.w,P[3]=C.h;var I=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(t,I,s,h,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(D){c.e(D)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(a.shapeProps&&a.shapeProps.padding&&(s=t.pstyle(a.shapeProps.padding).pfValue),i){var l=i.bb,u=i.tex1,c=i.tex2,d=u.w/(u.w+c.w);o||(d=1-d);var h=this._getAdjustedBB(l,s,o,d);this._applyTransformMatrix(n,h,a,t)}else{var g=a.getBoundingBox(t),p=this._getAdjustedBB(g,s,!0,1);this._applyTransformMatrix(n,p,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var o,s;iE(t);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;Fu(t,t,[c,d]),oE(t,t,l);var h=a.getRotationOffset(i);o=h.x+(n.xOffset||0),s=h.y+(n.yOffset||0)}else o=n.x1,s=n.y1;Fu(t,t,[o,s]),wm(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var o=t.x1,s=t.y1,l=t.w,u=t.h,c=t.yOffset;n&&(o-=n,s-=n,l+=2*n,u+=2*n);var d=0,h=l*i;return a&&i<1?l=h:!a&&i<1&&(d=l-h,o+=d,l=h),{x1:o,y1:s,w:l,h:u,xOffset:d,yOffset:c}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=$i;var s=this.indexBuffer.getView(o);zi(n,s);var l=this.colorBuffer.getView(o);Za([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(t,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(t,i)){var o=i.shapeProps,s=this._getVertTypeForShape(t,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(t)){this.drawTexture(t,n,a);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=s,s===Ru||s===Oo){var u=i.getBoundingBox(t),c=this._getCornerRadius(t,o.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,s===Oo&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(l);zi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(l);Za(g,p,E);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,o.border){var b=t.pstyle("border-width").value;if(b>0){var w=t.pstyle("border-color").value,x=t.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Za(w,x,C);var T=t.pstyle("border-position").value;if(T==="inside")y[0]=0,y[1]=-b;else if(T==="outside")y[0]=b,y[1]=0;else{var S=b/2;y[0]=S,y[1]=-S}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,_,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var a=t.pstyle(n).value;switch(a){case"rectangle":return $i;case"ellipse":return Lo;case"roundrectangle":case"round-rectangle":return Ru;case"bottom-round-rectangle":return Oo;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return Sa(i,o);var s=t.pstyle(n).pfValue,l=i/2,u=o/2;return Math.min(s,u,l)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var i=t._private.rscratch,o,s,l;if(a==="source"?(o=i.arrowStartX,s=i.arrowStartY,l=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,l=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(l)||l==null)){var u=t.pstyle(a+"-arrow-shape").value;if(u!=="none"){var c=t.pstyle(a+"-arrow-color").value,d=t.pstyle("opacity").value,h=t.pstyle("line-opacity").value,g=d*h,p=t.pstyle("width").pfValue,E=t.pstyle("arrow-scale").value,y=this.r.getArrowWidth(p,E),b=this.instanceCount,w=this.transformBuffer.getMatrixView(b);iE(w),Fu(w,w,[o,s]),wm(w,w,[y,y]),oE(w,w,l),this.vertTypeBuffer.getView(b)[0]=Md;var x=this.indexBuffer.getView(b);zi(n,x);var C=this.colorBuffer.getView(b);Za(c,g,C),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var a=this._getEdgePoints(t);if(a){var i=t.pstyle("opacity").value,o=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=i*o;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=sE;var d=this.indexBuffer.getView(c);zi(n,d);var h=this.colorBuffer.getView(c);Za(l,u,h);var g=this.lineWidthBuffer.getView(c);g[0]=s;var p=this.pointAPointBBuffer.getView(c);p[0]=a[0],p[1]=a[1],p[2]=a[2],p[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var E=0;E<a.length-2;E+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=uE;var b=this.indexBuffer.getView(y);zi(n,b);var w=this.colorBuffer.getView(y);Za(l,u,w);var x=this.lineWidthBuffer.getView(y);x[0]=s;var C=a[E-2],T=a[E-1],S=a[E],_=a[E+1],A=a[E+2],P=a[E+3],I=a[E+4],D=a[E+5];E==0&&(C=2*S-A+.001,T=2*_-P+.001),E==a.length-4&&(I=2*A-S+.001,D=2*P-_+.001);var k=this.pointAPointBBuffer.getView(y);k[0]=C,k[1]=T,k[2]=S,k[3]=_;var M=this.pointCPointDBuffer.getView(y);M[0]=A,M[1]=P,M[2]=I,M[3]=D,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=t[0],a[1]=t[1];else if(i==n)a[i*2]=t[t.length-2],a[i*2+1]=t[t.length-1];else{var o=i/n;this._setCurvePoint(t,o,a,i*2)}return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(t.length<=2)a[i]=t[0],a[i+1]=t[1];else{for(var o=Array(t.length-2),s=0;s<o.length;s+=2){var l=(1-n)*t[s]+n*t[s+2],u=(1-n)*t[s+1]+n*t[s+3];o[s]=l,o[s+1]=u}return this._setCurvePoint(o,n,a,i)}}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(o),t.bindVertexArray(n);var s=zt(this.buffers),l;try{for(s.s();!(l=s.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(p){s.e(p)}finally{s.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(t);for(var h=0;h<c.length;h++)t.activeTexture(t.TEXTURE0+h),t.bindTexture(t.TEXTURE_2D,c[h].texture),t.uniform1i(o.uTextures[h],h);t.uniform1f(o.uZoom,o3(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=Za(this.bgColor,1);t.uniform4fv(o.uBGColor,g),t.drawArraysInstanced(t.TRIANGLES,0,a,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(o,s){return o+s.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(o,s){return o+s.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),BA={};BA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=A3(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=g3(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new R3(t,n,r);var a=function(d){return function(h){return t.getTextAngle(h,d)}},i=function(d){return function(h){var g=h.pstyle(d);return g&&g.value}},o=function(d){return function(h){return h.pstyle("".concat(d,"-opacity")).value>0}},s=function(d){var h=d.pstyle("text-events").strValue==="yes";return h?rl.USE_BB:rl.IGNORE},l=function(d){var h=d.position(),g=h.x,p=h.y,E=d.outerWidth(),y=d.outerHeight();return{w:E,h:y,x1:g-E/2,y1:p-y/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:u3,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getLabelKey,null),getBoundingBox:Od(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getSourceLabelKey,"source"),getBoundingBox:Od(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getTargetLabelKey,"target"),getBoundingBox:Od(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=hs(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,d){var h=!1;d&&d.length>0&&(h|=t.drawing.invalidate(d)),h&&u()}),P3(t)};function A3(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return oR(t)}function MA(r,e){var t=r._private.rscratch;return Nt(t,"labelWrapCachedLines",e)||[]}var kd=function(e,t){return function(n){var a=e(n),i=MA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},Od=function(e,t){return function(n,a){var i=e(n);if(typeof a=="string"){var o=a.indexOf("_");if(o>0){var s=Number(a.substring(o+1)),l=MA(n,t),u=i.h/l.length,c=u*s,d=i.y1+c;return{x1:i.x1,w:i.w,y1:d,h:u,yOffset:c}}}return i}};function P3(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>SA?(I3(r),e.call(r,i)):(D3(r),OA(r,i,Ko.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,o,s,l){return q3(r,i,o)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var a=r.notify;r.notify=function(i,o){a.call(r,i,o),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(o,{type:"node-body"})}}}function I3(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function D3(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function B3(r){var e=r.canvasWidth,t=r.canvasHeight,n=Ym(r),a=n.pan,i=n.zoom,o=Dd();Fu(o,o,[a.x,a.y]),wm(o,o,[i,i]);var s=Dd();y3(s,e,t);var l=Dd();return p3(l,s,o),l}function kA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=Ym(r),i=a.pan,o=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(o,o)}function M3(r,e){r.drawSelectionRectangle(e,function(t){return kA(r,t)})}function k3(r){var e=r.data.contexts[r.NODE];e.save(),kA(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function O3(r){var e=function(a,i,o){for(var s=a.atlasManager.getAtlasCollection(i),l=r.data.contexts[r.NODE],u=s.atlases,c=0;c<u.length;c++){var d=u[c],h=d.canvas;if(h){var g=h.width,p=h.height,E=g*c,y=h.height*o,b=.4;l.save(),l.scale(b,b),l.drawImage(h,E,y),l.strokeStyle="black",l.rect(E,y,g,p),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function L3(r,e,t,n,a){var i,o,s,l,u=Ym(r),c=u.pan,d=u.zoom;{var h=s3(r,c,d,e,t),g=Yr(h,2),p=g[0],E=g[1],y=6;i=p-y/2,o=E-y/2,s=y,l=y}if(s===0||l===0)return[];var b=r.data.contexts[r.WEBGL];b.bindFramebuffer(b.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(b.viewport(0,0,b.canvas.width,b.canvas.height),OA(r,null,Ko.PICKING),r.pickingFrameBuffer.needsDraw=!1);var w=s*l,x=new Uint8Array(w*4);b.readPixels(i,o,s,l,b.RGBA,b.UNSIGNED_BYTE,x),b.bindFramebuffer(b.FRAMEBUFFER,null);for(var C=new Set,T=0;T<w;T++){var S=x.slice(T*4,T*4+4),_=f3(S)-1;_>=0&&C.add(_)}return C}function q3(r,e,t){var n=L3(r,e,t),a=r.getCachedZSortedEles(),i,o,s=zt(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,c=a[u];if(!i&&c.isNode()&&(i=c),!o&&c.isEdge()&&(o=c),i&&o)break}}catch(d){s.e(d)}finally{s.f()}return[i,o].filter(Boolean)}function Ld(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function OA(r,e,t){var n;r.webglDebug&&(n=performance.now());var a=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&M3(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var o=r.data.contexts[r.WEBGL];t.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=B3(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)Ld(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)Ld(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)Ld(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(k3(r),O3(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var h=performance.now(),g=!1,p=Math.ceil(h-n),E=a.getDebugInfo(),y=["".concat(i," elements"),"".concat(E.totalInstances," instances"),"".concat(E.batchCount," batches"),"".concat(E.totalAtlases," atlases"),"".concat(E.wrappedCount," wrapped textures"),"".concat(E.simpleCount," simple shapes")].join(", ");if(g)console.log("WebGL (".concat(t.name,") - time ").concat(p,"ms, ").concat(y));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var b=E.atlasInfo,w=zt(b),x;try{for(w.s();!(x=w.n()).done;){var C=x.value;console.log(" ".concat(C.type,": ").concat(C.keyCount," keys, ").concat(C.atlasCount," atlases"))}}catch(T){w.e(T)}finally{w.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}var La={};La.drawPolygonPath=function(r,e,t,n,a,i){var o=n/2,s=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var l=1;l<i.length/2;l++)r.lineTo(e+o*i[l*2],t+s*i[l*2+1]);r.closePath()};La.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return pA(r,s)}),r.closePath()};La.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Sa(n,a):Math.min(i,s,o);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+o,t-s,e+o,t,l),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.arcTo(e-o,t-s,e,t-s,l),r.lineTo(e,t-s),r.closePath()};La.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Sa(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+o,t-s),r.lineTo(e+o,t),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.lineTo(e-o,t-s),r.lineTo(e,t-s),r.closePath()};La.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?Om():o;r.beginPath&&r.beginPath(),r.moveTo(e-s+u,t-l),r.lineTo(e+s-u,t-l),r.lineTo(e+s,t-l+u),r.lineTo(e+s,t+l-u),r.lineTo(e+s-u,t+l),r.lineTo(e-s+u,t+l),r.lineTo(e-s,t+l-u),r.lineTo(e-s,t-l+u),r.closePath()};La.drawBarrelPath=function(r,e,t,n,a){var i=n/2,o=a/2,s=e-i,l=e+i,u=t-o,c=t+o,d=om(n,a),h=d.widthOffset,g=d.heightOffset,p=d.ctrlPtOffsetPct*h;r.beginPath&&r.beginPath(),r.moveTo(s,u+g),r.lineTo(s,c-g),r.quadraticCurveTo(s+p,c,s+h,c),r.lineTo(l-h,c),r.quadraticCurveTo(l-p,c,l,c-g),r.lineTo(l,u+g),r.quadraticCurveTo(l-p,u,l-h,u),r.lineTo(s+h,u),r.quadraticCurveTo(s+p,u,s,u+g),r.closePath()};var lE=Math.sin(0),fE=Math.cos(0),xm={},Em={},LA=Math.PI/40;for(var Vi=0*Math.PI;Vi<2*Math.PI;Vi+=LA)xm[Vi]=Math.sin(Vi),Em[Vi]=Math.cos(Vi);La.drawEllipsePath=function(r,e,t,n,a){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,a/2,0,0,2*Math.PI);else for(var i,o,s=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=LA)i=e-s*xm[u]*lE+s*Em[u]*fE,o=t+l*Em[u]*lE+l*xm[u]*fE,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var ws={};ws.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};ws.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),n=t.boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],o=r.full?Math.ceil(n.h):a[3],s=Me(r.maxWidth)||Me(r.maxHeight),l=this.getPixelRatio(),u=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,u=r.scale;else if(s){var c=1/0,d=1/0;Me(r.maxWidth)&&(c=u*r.maxWidth/i),Me(r.maxHeight)&&(d=u*r.maxHeight/o),u=Math.min(c,d),i*=u,o*=u}s||(i*=l,o*=l,u*=l);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var g=h.getContext("2d");if(i>0&&o>0){g.clearRect(0,0,i,o),g.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*u,-n.y1*u),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(n.x1*u,n.y1*u);else{var E=e.pan(),y={x:E.x*u,y:E.y*u};u*=e.zoom(),g.translate(y.x,y.y),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(-y.x,-y.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function N3(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),a=new Uint8Array(n),i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return new Blob([n],{type:e})}function cE(r){var e=r.indexOf(",");return r.substr(e+1)}function qA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new no(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return N3(cE(n()),t);case"base64":return cE(n());case"base64uri":default:return n()}}ws.png=function(r){return qA(r,this.bufferCanvasImage(r),"image/png")};ws.jpg=function(r){return qA(r,this.bufferCanvasImage(r),"image/jpeg")};var NA={};NA.nodeShapeImpl=function(r,e,t,n,a,i,o,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,s);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}};var F3=FA,fr=FA.prototype;fr.CANVAS_LAYERS=3;fr.SELECT_BOX=0;fr.DRAG=1;fr.NODE=2;fr.WEBGL=3;fr.CANVAS_TYPES=["2d","2d","2d","webgl2"];fr.BUFFER_COUNT=3;fr.TEXTURE_BUFFER=0;fr.MOTIONBLUR_BUFFER_NODE=1;fr.MOTIONBLUR_BUFFER_DRAG=2;function FA(r){var e=this,t=e.cy.window(),n=t.document;r.webgl&&(fr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(fr.CANVAS_LAYERS),contexts:new Array(fr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(fr.CANVAS_LAYERS),bufferCanvases:new Array(fr.BUFFER_COUNT),bufferContexts:new Array(fr.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Mq()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<fr.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=fr.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||Lr("Could not create canvas of type "+d),Object.keys(l).forEach(function(se){c.style[se]=l[se]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(fr.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[fr.NODE].setAttribute("data-id","layer"+fr.NODE+"-node"),e.data.canvases[fr.SELECT_BOX].setAttribute("data-id","layer"+fr.SELECT_BOX+"-selectbox"),e.data.canvases[fr.DRAG].setAttribute("data-id","layer"+fr.DRAG+"-drag"),e.data.canvases[fr.WEBGL]&&e.data.canvases[fr.WEBGL].setAttribute("data-id","layer"+fr.WEBGL+"-webgl");for(var u=0;u<fr.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var h=Dt(),g=function(X){return{x:(X.x1+X.x2)/2,y:(X.y1+X.y2)/2}},p=function(X){return{x:-X.w/2,y:-X.h/2}},E=function(X){var Q=X[0]._private,ae=Q.oldBackgroundTimestamp===Q.backgroundTimestamp;return!ae},y=function(X){return X[0]._private.nodeKey},b=function(X){return X[0]._private.labelStyleKey},w=function(X){return X[0]._private.sourceLabelStyleKey},x=function(X){return X[0]._private.targetLabelStyleKey},C=function(X,Q,ae,te,ce){return e.drawElement(X,Q,ae,!1,!1,ce)},T=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"main",ce)},S=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"source",ce)},_=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"target",ce)},A=function(X){return X.boundingBox(),X[0]._private.bodyBounds},P=function(X){return X.boundingBox(),X[0]._private.labelBounds.main||h},I=function(X){return X.boundingBox(),X[0]._private.labelBounds.source||h},D=function(X){return X.boundingBox(),X[0]._private.labelBounds.target||h},k=function(X,Q){return Q},M=function(X){return g(A(X))},N=function(X,Q,ae){var te=X?X+"-":"";return{x:Q.x+ae.pstyle(te+"text-margin-x").pfValue,y:Q.y+ae.pstyle(te+"text-margin-y").pfValue}},z=function(X,Q,ae){var te=X[0]._private.rscratch;return{x:te[Q],y:te[ae]}},$=function(X){return N("",z(X,"labelX","labelY"),X)},q=function(X){return N("source",z(X,"sourceLabelX","sourceLabelY"),X)},V=function(X){return N("target",z(X,"targetLabelX","targetLabelY"),X)},Z=function(X){return p(A(X))},K=function(X){return p(I(X))},j=function(X){return p(D(X))},ee=function(X){var Q=P(X),ae=p(P(X));if(X.isNode()){switch(X.pstyle("text-halign").value){case"left":ae.x=-Q.w-(Q.leftPad||0);break;case"right":ae.x=-(Q.rightPad||0);break}switch(X.pstyle("text-valign").value){case"top":ae.y=-Q.h-(Q.topPad||0);break;case"bottom":ae.y=-(Q.botPad||0);break}}return ae},le=e.data.eleTxrCache=new Fo(e,{getKey:y,doesEleInvalidateKey:E,drawElement:C,getBoundingBox:A,getRotationPoint:M,getRotationOffset:Z,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),W=e.data.lblTxrCache=new Fo(e,{getKey:b,drawElement:T,getBoundingBox:P,getRotationPoint:$,getRotationOffset:ee,isVisible:k}),G=e.data.slbTxrCache=new Fo(e,{getKey:w,drawElement:S,getBoundingBox:I,getRotationPoint:q,getRotationOffset:K,isVisible:k}),Y=e.data.tlbTxrCache=new Fo(e,{getKey:x,drawElement:_,getBoundingBox:D,getRotationPoint:V,getRotationOffset:j,isVisible:k}),re=e.data.lyrTxrCache=new TA(e);e.onUpdateEleCalcs(function(X,Q){le.invalidateElements(Q),W.invalidateElements(Q),G.invalidateElements(Q),Y.invalidateElements(Q),re.invalidateElements(Q);for(var ae=0;ae<Q.length;ae++){var te=Q[ae]._private;te.oldBackgroundTimestamp=te.backgroundTimestamp}});var de=function(X){for(var Q=0;Q<X.length;Q++)re.enqueueElementRefinement(X[Q].ele)};le.onDequeue(de),W.onDequeue(de),G.onDequeue(de),Y.onDequeue(de),r.webgl&&e.initWebgl(r,{getStyleKey:y,getLabelKey:b,getSourceLabelKey:w,getTargetLabelKey:x,drawElement:C,drawLabel:T,drawSourceLabel:S,drawTargetLabel:_,getElementBox:A,getLabelBox:P,getSourceLabelBox:I,getTargetLabelBox:D,getElementRotationPoint:M,getElementRotationOffset:Z,getLabelRotationPoint:$,getSourceLabelRotationPoint:q,getTargetLabelRotationPoint:V,getLabelRotationOffset:ee,getSourceLabelRotationOffset:K,getTargetLabelRotationOffset:j})}fr.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[fr.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[fr.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[fr.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var z3=typeof Path2D<"u";fr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};fr.usePaths=function(){return z3&&this.pathsEnabled};fr.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};fr.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};fr.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":tt(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),a=n.document;t=a.createElement("canvas"),t.width=r,t.height=e}return t};[RA,kn,Jn,jm,fi,Oa,Bt,BA,La,ws,NA].forEach(function(r){Ye(fr,r)});var $3=[{name:"null",impl:vA},{name:"base",impl:CA},{name:"canvas",impl:F3}],V3=[{type:"layout",extensions:v$},{type:"renderer",extensions:$3}],zA={},$A={};function VA(r,e,t){var n=t,a=function(A){Er("Can not register `"+e+"` for `"+r+"` since `"+A+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(as.prototype[e])return a(e);as.prototype[e]=t}else if(r==="collection"){if(pt.prototype[e])return a(e);pt.prototype[e]=t}else if(r==="layout"){for(var i=function(A){this.options=A,t.call(this,A),pr(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var c=t.prototype.stop;o.stop=function(){var _=this.options;if(_&&_.animate){var A=this.animations;if(A)for(var P=0;P<A.length;P++)A[P].stop()}return c?c.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var d=function(A){return A._private.cy},h={addEventFields:function(A,P){P.layout=A,P.cy=d(A),P.target=A},bubble:function(){return!0},parent:function(A){return d(A)}};Ye(o,{createEmitter:function(){return this._private.emitter=new gl(h,this),this},emitter:function(){return this._private.emitter},on:function(A,P){return this.emitter().on(A,P),this},one:function(A,P){return this.emitter().one(A,P),this},once:function(A,P){return this.emitter().one(A,P),this},removeListener:function(A,P){return this.emitter().removeListener(A,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(A,P){return this.emitter().emit(A,P),this}}),xr.eventAliasesOn(o),n=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var g=GA("renderer","base"),p=g.prototype,E=t,y=t.prototype,b=function(){g.apply(this,arguments),E.apply(this,arguments)},w=b.prototype;for(var x in p){var C=p[x],T=y[x]!=null;if(T)return a(x);w[x]=C}for(var S in y)w[S]=y[S];p.clientFunctions.forEach(function(_){w[_]=w[_]||function(){Lr("Renderer does not implement `renderer."+_+"()` on its prototype")}}),n=b}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Lr(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return sR({map:zA,keys:[r,e],value:n})}function GA(r,e){return uR({map:zA,keys:[r,e]})}function G3(r,e,t,n,a){return sR({map:$A,keys:[r,e,t,n],value:a})}function W3(r,e,t,n){return uR({map:$A,keys:[r,e,t,n]})}var Cm=function(){if(arguments.length===2)return GA.apply(null,arguments);if(arguments.length===3)return VA.apply(null,arguments);if(arguments.length===4)return W3.apply(null,arguments);if(arguments.length===5)return G3.apply(null,arguments);Lr("Invalid extension access syntax")};as.prototype.extension=Cm;V3.forEach(function(r){r.extensions.forEach(function(e){VA(r.type,e.name,e.impl)})});var tl=function(){if(!(this instanceof tl))return new tl;this.length=0},ui=tl.prototype;ui.instanceString=function(){return"stylesheet"};ui.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};ui.css=function(r,e){var t=this.length-1;if(Ke(r))this[t].properties.push({name:r,value:e});else if(pr(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],s=n[o];if(s!=null){var l=st.properties[o]||st.properties[il(o)];if(l!=null){var u=l.name,c=s;this[t].properties.push({name:u,value:c})}}}return this};ui.style=ui.css;ui.generateStyle=function(r){var e=new st(r);return this.appendToStyle(e)};ui.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],n=t.selector,a=t.properties;r.selector(n);for(var i=0;i<a.length;i++){var o=a[i];r.css(o.name,o.value)}}return r};var U3="3.33.1",un=function(e){if(e===void 0&&(e={}),pr(e))return new as(e);if(Ke(e))return Cm.apply(Cm,arguments)};un.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(un),r.apply(null,e),this};un.warnings=function(r){return gR(r)};un.version=U3;un.stylesheet=un.Stylesheet=tl;var Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var zu={exports:{}};function Zm(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qd,dE;function H3(){if(dE)return qd;dE=1;function r(){this.__data__=[],this.size=0}return qd=r,qd}var Nd,vE;function uo(){if(vE)return Nd;vE=1;function r(e,t){return e===t||e!==e&&t!==t}return Nd=r,Nd}var Fd,hE;function _l(){if(hE)return Fd;hE=1;var r=uo();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Fd=e,Fd}var zd,gE;function K3(){if(gE)return zd;gE=1;var r=_l(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return zd=n,zd}var $d,pE;function j3(){if(pE)return $d;pE=1;var r=_l();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return $d=e,$d}var Vd,yE;function Y3(){if(yE)return Vd;yE=1;var r=_l();function e(t){return r(this.__data__,t)>-1}return Vd=e,Vd}var Gd,mE;function Z3(){if(mE)return Gd;mE=1;var r=_l();function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}return Gd=e,Gd}var Wd,bE;function Sl(){if(bE)return Wd;bE=1;var r=H3(),e=K3(),t=j3(),n=Y3(),a=Z3();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Wd=i,Wd}var Ud,wE;function X3(){if(wE)return Ud;wE=1;var r=Sl();function e(){this.__data__=new r,this.size=0}return Ud=e,Ud}var Hd,xE;function Q3(){if(xE)return Hd;xE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return Hd=r,Hd}var Kd,EE;function J3(){if(EE)return Kd;EE=1;function r(e){return this.__data__.get(e)}return Kd=r,Kd}var jd,CE;function eV(){if(CE)return jd;CE=1;function r(e){return this.__data__.has(e)}return jd=r,jd}var Yd,_E;function WA(){if(_E)return Yd;_E=1;var r=typeof Et=="object"&&Et&&Et.Object===Object&&Et;return Yd=r,Yd}var Zd,SE;function En(){if(SE)return Zd;SE=1;var r=WA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Zd=t,Zd}var Xd,TE;function lo(){if(TE)return Xd;TE=1;var r=En(),e=r.Symbol;return Xd=e,Xd}var Qd,RE;function rV(){if(RE)return Qd;RE=1;var r=lo(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[a]=l:delete o[a]),c}return Qd=i,Qd}var Jd,AE;function tV(){if(AE)return Jd;AE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return Jd=t,Jd}var ev,PE;function ci(){if(PE)return ev;PE=1;var r=lo(),e=rV(),t=tV(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return ev=o,ev}var rv,IE;function fn(){if(IE)return rv;IE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return rv=r,rv}var tv,DE;function xs(){if(DE)return tv;DE=1;var r=ci(),e=fn(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var l=r(s);return l==n||l==a||l==t||l==i}return tv=o,tv}var nv,BE;function nV(){if(BE)return nv;BE=1;var r=En(),e=r["__core-js_shared__"];return nv=e,nv}var av,ME;function aV(){if(ME)return av;ME=1;var r=nV(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return av=t,av}var iv,kE;function UA(){if(kE)return iv;kE=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return iv=t,iv}var ov,OE;function iV(){if(OE)return ov;OE=1;var r=xs(),e=aV(),t=fn(),n=UA(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return ov=d,ov}var sv,LE;function oV(){if(LE)return sv;LE=1;function r(e,t){return e==null?void 0:e[t]}return sv=r,sv}var uv,qE;function di(){if(qE)return uv;qE=1;var r=iV(),e=oV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return uv=t,uv}var lv,NE;function Xm(){if(NE)return lv;NE=1;var r=di(),e=En(),t=r(e,"Map");return lv=t,lv}var fv,FE;function Tl(){if(FE)return fv;FE=1;var r=di(),e=r(Object,"create");return fv=e,fv}var cv,zE;function sV(){if(zE)return cv;zE=1;var r=Tl();function e(){this.__data__=r?r(null):{},this.size=0}return cv=e,cv}var dv,$E;function uV(){if($E)return dv;$E=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return dv=r,dv}var vv,VE;function lV(){if(VE)return vv;VE=1;var r=Tl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return vv=a,vv}var hv,GE;function fV(){if(GE)return hv;GE=1;var r=Tl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return hv=n,hv}var gv,WE;function cV(){if(WE)return gv;WE=1;var r=Tl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return gv=t,gv}var pv,UE;function dV(){if(UE)return pv;UE=1;var r=sV(),e=uV(),t=lV(),n=fV(),a=cV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,pv=i,pv}var yv,HE;function vV(){if(HE)return yv;HE=1;var r=dV(),e=Sl(),t=Xm();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return yv=n,yv}var mv,KE;function hV(){if(KE)return mv;KE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return mv=r,mv}var bv,jE;function Rl(){if(jE)return bv;jE=1;var r=hV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return bv=e,bv}var wv,YE;function gV(){if(YE)return wv;YE=1;var r=Rl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return wv=e,wv}var xv,ZE;function pV(){if(ZE)return xv;ZE=1;var r=Rl();function e(t){return r(this,t).get(t)}return xv=e,xv}var Ev,XE;function yV(){if(XE)return Ev;XE=1;var r=Rl();function e(t){return r(this,t).has(t)}return Ev=e,Ev}var Cv,QE;function mV(){if(QE)return Cv;QE=1;var r=Rl();function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}return Cv=e,Cv}var _v,JE;function Qm(){if(JE)return _v;JE=1;var r=vV(),e=gV(),t=pV(),n=yV(),a=mV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,_v=i,_v}var Sv,eC;function bV(){if(eC)return Sv;eC=1;var r=Sl(),e=Xm(),t=Qm(),n=200;function a(i,o){var s=this.__data__;if(s instanceof r){var l=s.__data__;if(!e||l.length<n-1)return l.push([i,o]),this.size=++s.size,this;s=this.__data__=new t(l)}return s.set(i,o),this.size=s.size,this}return Sv=a,Sv}var Tv,rC;function Al(){if(rC)return Tv;rC=1;var r=Sl(),e=X3(),t=Q3(),n=J3(),a=eV(),i=bV();function o(s){var l=this.__data__=new r(s);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Tv=o,Tv}var Rv,tC;function Jm(){if(tC)return Rv;tC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e}return Rv=r,Rv}var Av,nC;function HA(){if(nC)return Av;nC=1;var r=di(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Av=e,Av}var Pv,aC;function Pl(){if(aC)return Pv;aC=1;var r=HA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Pv=e,Pv}var Iv,iC;function Il(){if(iC)return Iv;iC=1;var r=Pl(),e=uo(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var l=i[o];(!(n.call(i,o)&&e(l,s))||s===void 0&&!(o in i))&&r(i,o,s)}return Iv=a,Iv}var Dv,oC;function Es(){if(oC)return Dv;oC=1;var r=Il(),e=Pl();function t(n,a,i,o){var s=!i;i||(i={});for(var l=-1,u=a.length;++l<u;){var c=a[l],d=o?o(i[c],n[c],c,i,n):void 0;d===void 0&&(d=n[c]),s?e(i,c,d):r(i,c,d)}return i}return Dv=t,Dv}var Bv,sC;function wV(){if(sC)return Bv;sC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return Bv=r,Bv}var Mv,uC;function On(){if(uC)return Mv;uC=1;function r(e){return e!=null&&typeof e=="object"}return Mv=r,Mv}var kv,lC;function xV(){if(lC)return kv;lC=1;var r=ci(),e=On(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return kv=n,kv}var Ov,fC;function Cs(){if(fC)return Ov;fC=1;var r=xV(),e=On(),t=Object.prototype,n=t.hasOwnProperty,a=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return Ov=i,Ov}var Lv,cC;function Zr(){if(cC)return Lv;cC=1;var r=Array.isArray;return Lv=r,Lv}var zo={exports:{}},qv,dC;function EV(){if(dC)return qv;dC=1;function r(){return!1}return qv=r,qv}zo.exports;var vC;function fo(){return vC||(vC=1,(function(r,e){var t=En(),n=EV(),a=e&&!e.nodeType&&e,i=a&&!0&&r&&!r.nodeType&&r,o=i&&i.exports===a,s=o?t.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;r.exports=u})(zo,zo.exports)),zo.exports}var Nv,hC;function Dl(){if(hC)return Nv;hC=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Nv=t,Nv}var Fv,gC;function e0(){if(gC)return Fv;gC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Fv=e,Fv}var zv,pC;function CV(){if(pC)return zv;pC=1;var r=ci(),e=e0(),t=On(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",d="[object Object]",h="[object RegExp]",g="[object Set]",p="[object String]",E="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",S="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]",D={};D[w]=D[x]=D[C]=D[T]=D[S]=D[_]=D[A]=D[P]=D[I]=!0,D[n]=D[a]=D[y]=D[i]=D[b]=D[o]=D[s]=D[l]=D[u]=D[c]=D[d]=D[h]=D[g]=D[p]=D[E]=!1;function k(M){return t(M)&&e(M.length)&&!!D[r(M)]}return zv=k,zv}var $v,yC;function Bl(){if(yC)return $v;yC=1;function r(e){return function(t){return e(t)}}return $v=r,$v}var $o={exports:{}};$o.exports;var mC;function r0(){return mC||(mC=1,(function(r,e){var t=WA(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i&&t.process,s=(function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();r.exports=s})($o,$o.exports)),$o.exports}var Vv,bC;function _s(){if(bC)return Vv;bC=1;var r=CV(),e=Bl(),t=r0(),n=t&&t.isTypedArray,a=n?e(n):r;return Vv=a,Vv}var Gv,wC;function KA(){if(wC)return Gv;wC=1;var r=wV(),e=Cs(),t=Zr(),n=fo(),a=Dl(),i=_s(),o=Object.prototype,s=o.hasOwnProperty;function l(u,c){var d=t(u),h=!d&&e(u),g=!d&&!h&&n(u),p=!d&&!h&&!g&&i(u),E=d||h||g||p,y=E?r(u.length,String):[],b=y.length;for(var w in u)(c||s.call(u,w))&&!(E&&(w=="length"||g&&(w=="offset"||w=="parent")||p&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||a(w,b)))&&y.push(w);return y}return Gv=l,Gv}var Wv,xC;function Ml(){if(xC)return Wv;xC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Wv=e,Wv}var Uv,EC;function jA(){if(EC)return Uv;EC=1;function r(e,t){return function(n){return e(t(n))}}return Uv=r,Uv}var Hv,CC;function _V(){if(CC)return Hv;CC=1;var r=jA(),e=r(Object.keys,Object);return Hv=e,Hv}var Kv,_C;function t0(){if(_C)return Kv;_C=1;var r=Ml(),e=_V(),t=Object.prototype,n=t.hasOwnProperty;function a(i){if(!r(i))return e(i);var o=[];for(var s in Object(i))n.call(i,s)&&s!="constructor"&&o.push(s);return o}return Kv=a,Kv}var jv,SC;function ea(){if(SC)return jv;SC=1;var r=xs(),e=e0();function t(n){return n!=null&&e(n.length)&&!r(n)}return jv=t,jv}var Yv,TC;function qa(){if(TC)return Yv;TC=1;var r=KA(),e=t0(),t=ea();function n(a){return t(a)?r(a):e(a)}return Yv=n,Yv}var Zv,RC;function SV(){if(RC)return Zv;RC=1;var r=Es(),e=qa();function t(n,a){return n&&r(a,e(a),n)}return Zv=t,Zv}var Xv,AC;function TV(){if(AC)return Xv;AC=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Xv=r,Xv}var Qv,PC;function RV(){if(PC)return Qv;PC=1;var r=fn(),e=Ml(),t=TV(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!r(o))return t(o);var s=e(o),l=[];for(var u in o)u=="constructor"&&(s||!a.call(o,u))||l.push(u);return l}return Qv=i,Qv}var Jv,IC;function vi(){if(IC)return Jv;IC=1;var r=KA(),e=RV(),t=ea();function n(a){return t(a)?r(a,!0):e(a)}return Jv=n,Jv}var eh,DC;function AV(){if(DC)return eh;DC=1;var r=Es(),e=vi();function t(n,a){return n&&r(a,e(a),n)}return eh=t,eh}var Vo={exports:{}};Vo.exports;var BC;function YA(){return BC||(BC=1,(function(r,e){var t=En(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,h=s?s(d):new u.constructor(d);return u.copy(h),h}r.exports=l})(Vo,Vo.exports)),Vo.exports}var rh,MC;function ZA(){if(MC)return rh;MC=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return rh=r,rh}var th,kC;function XA(){if(kC)return th;kC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}return th=r,th}var nh,OC;function QA(){if(OC)return nh;OC=1;function r(){return[]}return nh=r,nh}var ah,LC;function n0(){if(LC)return ah;LC=1;var r=XA(),e=QA(),t=Object.prototype,n=t.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),r(a(o),function(s){return n.call(o,s)}))}:e;return ah=i,ah}var ih,qC;function PV(){if(qC)return ih;qC=1;var r=Es(),e=n0();function t(n,a){return r(n,e(n),a)}return ih=t,ih}var oh,NC;function a0(){if(NC)return oh;NC=1;function r(e,t){for(var n=-1,a=t.length,i=e.length;++n<a;)e[i+n]=t[n];return e}return oh=r,oh}var sh,FC;function kl(){if(FC)return sh;FC=1;var r=jA(),e=r(Object.getPrototypeOf,Object);return sh=e,sh}var uh,zC;function JA(){if(zC)return uh;zC=1;var r=a0(),e=kl(),t=n0(),n=QA(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return uh=i,uh}var lh,$C;function IV(){if($C)return lh;$C=1;var r=Es(),e=JA();function t(n,a){return r(n,e(n),a)}return lh=t,lh}var fh,VC;function eP(){if(VC)return fh;VC=1;var r=a0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return fh=t,fh}var ch,GC;function rP(){if(GC)return ch;GC=1;var r=eP(),e=n0(),t=qa();function n(a){return r(a,t,e)}return ch=n,ch}var dh,WC;function DV(){if(WC)return dh;WC=1;var r=eP(),e=JA(),t=vi();function n(a){return r(a,t,e)}return dh=n,dh}var vh,UC;function BV(){if(UC)return vh;UC=1;var r=di(),e=En(),t=r(e,"DataView");return vh=t,vh}var hh,HC;function MV(){if(HC)return hh;HC=1;var r=di(),e=En(),t=r(e,"Promise");return hh=t,hh}var gh,KC;function tP(){if(KC)return gh;KC=1;var r=di(),e=En(),t=r(e,"Set");return gh=t,gh}var ph,jC;function kV(){if(jC)return ph;jC=1;var r=di(),e=En(),t=r(e,"WeakMap");return ph=t,ph}var yh,YC;function co(){if(YC)return yh;YC=1;var r=BV(),e=Xm(),t=MV(),n=tP(),a=kV(),i=ci(),o=UA(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",d="[object WeakMap]",h="[object DataView]",g=o(r),p=o(e),E=o(t),y=o(n),b=o(a),w=i;return(r&&w(new r(new ArrayBuffer(1)))!=h||e&&w(new e)!=s||t&&w(t.resolve())!=u||n&&w(new n)!=c||a&&w(new a)!=d)&&(w=function(x){var C=i(x),T=C==l?x.constructor:void 0,S=T?o(T):"";if(S)switch(S){case g:return h;case p:return s;case E:return u;case y:return c;case b:return d}return C}),yh=w,yh}var mh,ZC;function OV(){if(ZC)return mh;ZC=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return mh=t,mh}var bh,XC;function nP(){if(XC)return bh;XC=1;var r=En(),e=r.Uint8Array;return bh=e,bh}var wh,QC;function i0(){if(QC)return wh;QC=1;var r=nP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return wh=e,wh}var xh,JC;function LV(){if(JC)return xh;JC=1;var r=i0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return xh=e,xh}var Eh,e_;function qV(){if(e_)return Eh;e_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Eh=e,Eh}var Ch,r_;function NV(){if(r_)return Ch;r_=1;var r=lo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Ch=n,Ch}var _h,t_;function aP(){if(t_)return _h;t_=1;var r=i0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return _h=e,_h}var Sh,n_;function FV(){if(n_)return Sh;n_=1;var r=i0(),e=LV(),t=qV(),n=NV(),a=aP(),i="[object Boolean]",o="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",d="[object String]",h="[object Symbol]",g="[object ArrayBuffer]",p="[object DataView]",E="[object Float32Array]",y="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",C="[object Uint8Array]",T="[object Uint8ClampedArray]",S="[object Uint16Array]",_="[object Uint32Array]";function A(P,I,D){var k=P.constructor;switch(I){case g:return r(P);case i:case o:return new k(+P);case p:return e(P,D);case E:case y:case b:case w:case x:case C:case T:case S:case _:return a(P,D);case s:return new k;case l:case d:return new k(P);case u:return t(P);case c:return new k;case h:return n(P)}}return Sh=A,Sh}var Th,a_;function iP(){if(a_)return Th;a_=1;var r=fn(),e=Object.create,t=(function(){function n(){}return function(a){if(!r(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}})();return Th=t,Th}var Rh,i_;function oP(){if(i_)return Rh;i_=1;var r=iP(),e=kl(),t=Ml();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Rh=n,Rh}var Ah,o_;function zV(){if(o_)return Ah;o_=1;var r=co(),e=On(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return Ah=n,Ah}var Ph,s_;function $V(){if(s_)return Ph;s_=1;var r=zV(),e=Bl(),t=r0(),n=t&&t.isMap,a=n?e(n):r;return Ph=a,Ph}var Ih,u_;function VV(){if(u_)return Ih;u_=1;var r=co(),e=On(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Ih=n,Ih}var Dh,l_;function GV(){if(l_)return Dh;l_=1;var r=VV(),e=Bl(),t=r0(),n=t&&t.isSet,a=n?e(n):r;return Dh=a,Dh}var Bh,f_;function sP(){if(f_)return Bh;f_=1;var r=Al(),e=Jm(),t=Il(),n=SV(),a=AV(),i=YA(),o=ZA(),s=PV(),l=IV(),u=rP(),c=DV(),d=co(),h=OV(),g=FV(),p=oP(),E=Zr(),y=fo(),b=$V(),w=fn(),x=GV(),C=qa(),T=vi(),S=1,_=2,A=4,P="[object Arguments]",I="[object Array]",D="[object Boolean]",k="[object Date]",M="[object Error]",N="[object Function]",z="[object GeneratorFunction]",$="[object Map]",q="[object Number]",V="[object Object]",Z="[object RegExp]",K="[object Set]",j="[object String]",ee="[object Symbol]",le="[object WeakMap]",W="[object ArrayBuffer]",G="[object DataView]",Y="[object Float32Array]",re="[object Float64Array]",de="[object Int8Array]",se="[object Int16Array]",X="[object Int32Array]",Q="[object Uint8Array]",ae="[object Uint8ClampedArray]",te="[object Uint16Array]",ce="[object Uint32Array]",_e={};_e[P]=_e[I]=_e[W]=_e[G]=_e[D]=_e[k]=_e[Y]=_e[re]=_e[de]=_e[se]=_e[X]=_e[$]=_e[q]=_e[V]=_e[Z]=_e[K]=_e[j]=_e[ee]=_e[Q]=_e[ae]=_e[te]=_e[ce]=!0,_e[M]=_e[N]=_e[le]=!1;function ve(U,fe,xe,ge,be,Ae){var De,Be=fe&S,Le=fe&_,He=fe&A;if(xe&&(De=be?xe(U,ge,be,Ae):xe(U)),De!==void 0)return De;if(!w(U))return U;var Ve=E(U);if(Ve){if(De=h(U),!Be)return o(U,De)}else{var Xe=d(U),er=Xe==N||Xe==z;if(y(U))return i(U,Be);if(Xe==V||Xe==P||er&&!be){if(De=Le||er?{}:p(U),!Be)return Le?l(U,a(De,U)):s(U,n(De,U))}else{if(!_e[Xe])return be?U:{};De=g(U,Xe,Be)}}Ae||(Ae=new r);var $e=Ae.get(U);if($e)return $e;Ae.set(U,De),x(U)?U.forEach(function(O){De.add(ve(O,fe,xe,O,U,Ae))}):b(U)&&U.forEach(function(O,oe){De.set(oe,ve(O,fe,xe,oe,U,Ae))});var ke=He?Le?c:u:Le?T:C,ye=Ve?void 0:ke(U);return e(ye||U,function(O,oe){ye&&(oe=O,O=U[oe]),t(De,oe,ve(O,fe,xe,oe,U,Ae))}),De}return Bh=ve,Bh}var Mh,c_;function WV(){if(c_)return Mh;c_=1;var r=sP(),e=4;function t(n){return r(n,e)}return Mh=t,Mh}var kh,d_;function o0(){if(d_)return kh;d_=1;function r(e){return function(){return e}}return kh=r,kh}var Oh,v_;function UV(){if(v_)return Oh;v_=1;function r(e){return function(t,n,a){for(var i=-1,o=Object(t),s=a(t),l=s.length;l--;){var u=s[e?l:++i];if(n(o[u],u,o)===!1)break}return t}}return Oh=r,Oh}var Lh,h_;function s0(){if(h_)return Lh;h_=1;var r=UV(),e=r();return Lh=e,Lh}var qh,g_;function u0(){if(g_)return qh;g_=1;var r=s0(),e=qa();function t(n,a){return n&&r(n,a,e)}return qh=t,qh}var Nh,p_;function HV(){if(p_)return Nh;p_=1;var r=ea();function e(t,n){return function(a,i){if(a==null)return a;if(!r(a))return t(a,i);for(var o=a.length,s=n?o:-1,l=Object(a);(n?s--:++s<o)&&i(l[s],s,l)!==!1;);return a}}return Nh=e,Nh}var Fh,y_;function Ol(){if(y_)return Fh;y_=1;var r=u0(),e=HV(),t=e(r);return Fh=t,Fh}var zh,m_;function hi(){if(m_)return zh;m_=1;function r(e){return e}return zh=r,zh}var $h,b_;function uP(){if(b_)return $h;b_=1;var r=hi();function e(t){return typeof t=="function"?t:r}return $h=e,$h}var Vh,w_;function lP(){if(w_)return Vh;w_=1;var r=Jm(),e=Ol(),t=uP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Vh=a,Vh}var Gh,x_;function fP(){return x_||(x_=1,Gh=lP()),Gh}var Wh,E_;function KV(){if(E_)return Wh;E_=1;var r=Ol();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Wh=e,Wh}var Uh,C_;function jV(){if(C_)return Uh;C_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Uh=e,Uh}var Hh,__;function YV(){if(__)return Hh;__=1;function r(e){return this.__data__.has(e)}return Hh=r,Hh}var Kh,S_;function cP(){if(S_)return Kh;S_=1;var r=Qm(),e=jV(),t=YV();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new r;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,Kh=n,Kh}var jh,T_;function ZV(){if(T_)return jh;T_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a;)if(t(e[n],n,e))return!0;return!1}return jh=r,jh}var Yh,R_;function dP(){if(R_)return Yh;R_=1;function r(e,t){return e.has(t)}return Yh=r,Yh}var Zh,A_;function vP(){if(A_)return Zh;A_=1;var r=cP(),e=ZV(),t=dP(),n=1,a=2;function i(o,s,l,u,c,d){var h=l&n,g=o.length,p=s.length;if(g!=p&&!(h&&p>g))return!1;var E=d.get(o),y=d.get(s);if(E&&y)return E==s&&y==o;var b=-1,w=!0,x=l&a?new r:void 0;for(d.set(o,s),d.set(s,o);++b<g;){var C=o[b],T=s[b];if(u)var S=h?u(T,C,b,s,o,d):u(C,T,b,o,s,d);if(S!==void 0){if(S)continue;w=!1;break}if(x){if(!e(s,function(_,A){if(!t(x,A)&&(C===_||c(C,_,l,u,d)))return x.push(A)})){w=!1;break}}else if(!(C===T||c(C,T,l,u,d))){w=!1;break}}return d.delete(o),d.delete(s),w}return Zh=i,Zh}var Xh,P_;function XV(){if(P_)return Xh;P_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return Xh=r,Xh}var Qh,I_;function l0(){if(I_)return Qh;I_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return Qh=r,Qh}var Jh,D_;function QV(){if(D_)return Jh;D_=1;var r=lo(),e=nP(),t=uo(),n=vP(),a=XV(),i=l0(),o=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Map]",h="[object Number]",g="[object RegExp]",p="[object Set]",E="[object String]",y="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,C=x?x.valueOf:void 0;function T(S,_,A,P,I,D,k){switch(A){case w:if(S.byteLength!=_.byteLength||S.byteOffset!=_.byteOffset)return!1;S=S.buffer,_=_.buffer;case b:return!(S.byteLength!=_.byteLength||!D(new e(S),new e(_)));case l:case u:case h:return t(+S,+_);case c:return S.name==_.name&&S.message==_.message;case g:case E:return S==_+"";case d:var M=a;case p:var N=P&o;if(M||(M=i),S.size!=_.size&&!N)return!1;var z=k.get(S);if(z)return z==_;P|=s,k.set(S,_);var $=n(M(S),M(_),P,I,D,k);return k.delete(S),$;case y:if(C)return C.call(S)==C.call(_)}return!1}return Jh=T,Jh}var eg,B_;function JV(){if(B_)return eg;B_=1;var r=rP(),e=1,t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s,l,u,c){var d=s&e,h=r(i),g=h.length,p=r(o),E=p.length;if(g!=E&&!d)return!1;for(var y=g;y--;){var b=h[y];if(!(d?b in o:n.call(o,b)))return!1}var w=c.get(i),x=c.get(o);if(w&&x)return w==o&&x==i;var C=!0;c.set(i,o),c.set(o,i);for(var T=d;++y<g;){b=h[y];var S=i[b],_=o[b];if(l)var A=d?l(_,S,b,o,i,c):l(S,_,b,i,o,c);if(!(A===void 0?S===_||u(S,_,s,l,c):A)){C=!1;break}T||(T=b=="constructor")}if(C&&!T){var P=i.constructor,I=o.constructor;P!=I&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof I=="function"&&I instanceof I)&&(C=!1)}return c.delete(i),c.delete(o),C}return eg=a,eg}var rg,M_;function e4(){if(M_)return rg;M_=1;var r=Al(),e=vP(),t=QV(),n=JV(),a=co(),i=Zr(),o=fo(),s=_s(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(E,y,b,w,x,C){var T=i(E),S=i(y),_=T?c:a(E),A=S?c:a(y);_=_==u?d:_,A=A==u?d:A;var P=_==d,I=A==d,D=_==A;if(D&&o(E)){if(!o(y))return!1;T=!0,P=!1}if(D&&!P)return C||(C=new r),T||s(E)?e(E,y,b,w,x,C):t(E,y,_,b,w,x,C);if(!(b&l)){var k=P&&g.call(E,"__wrapped__"),M=I&&g.call(y,"__wrapped__");if(k||M){var N=k?E.value():E,z=M?y.value():y;return C||(C=new r),x(N,z,b,w,C)}}return D?(C||(C=new r),n(E,y,b,w,x,C)):!1}return rg=p,rg}var tg,k_;function hP(){if(k_)return tg;k_=1;var r=e4(),e=On();function t(n,a,i,o,s){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:r(n,a,i,o,t,s)}return tg=t,tg}var ng,O_;function r4(){if(O_)return ng;O_=1;var r=Al(),e=hP(),t=1,n=2;function a(i,o,s,l){var u=s.length,c=u,d=!l;if(i==null)return!c;for(i=Object(i);u--;){var h=s[u];if(d&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<c;){h=s[u];var g=h[0],p=i[g],E=h[1];if(d&&h[2]){if(p===void 0&&!(g in i))return!1}else{var y=new r;if(l)var b=l(p,E,g,i,o,y);if(!(b===void 0?e(E,p,t|n,l,y):b))return!1}}return!0}return ng=a,ng}var ag,L_;function gP(){if(L_)return ag;L_=1;var r=fn();function e(t){return t===t&&!r(t)}return ag=e,ag}var ig,q_;function t4(){if(q_)return ig;q_=1;var r=gP(),e=qa();function t(n){for(var a=e(n),i=a.length;i--;){var o=a[i],s=n[o];a[i]=[o,s,r(s)]}return a}return ig=t,ig}var og,N_;function pP(){if(N_)return og;N_=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return og=r,og}var sg,F_;function n4(){if(F_)return sg;F_=1;var r=r4(),e=t4(),t=pP();function n(a){var i=e(a);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(o){return o===a||r(o,a,i)}}return sg=n,sg}var ug,z_;function vo(){if(z_)return ug;z_=1;var r=ci(),e=On(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return ug=n,ug}var lg,$_;function f0(){if($_)return lg;$_=1;var r=Zr(),e=vo(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return lg=a,lg}var fg,V_;function a4(){if(V_)return fg;V_=1;var r=Qm(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],l=i.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return i.cache=l.set(s,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,fg=t,fg}var cg,G_;function i4(){if(G_)return cg;G_=1;var r=a4(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return cg=t,cg}var dg,W_;function o4(){if(W_)return dg;W_=1;var r=i4(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,l,u){i.push(l?u.replace(t,"$1"):s||o)}),i});return dg=n,dg}var vg,U_;function Ll(){if(U_)return vg;U_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return vg=r,vg}var hg,H_;function s4(){if(H_)return hg;H_=1;var r=lo(),e=Ll(),t=Zr(),n=vo(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return hg=o,hg}var gg,K_;function yP(){if(K_)return gg;K_=1;var r=s4();function e(t){return t==null?"":r(t)}return gg=e,gg}var pg,j_;function ql(){if(j_)return pg;j_=1;var r=Zr(),e=f0(),t=o4(),n=yP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return pg=a,pg}var yg,Y_;function Ss(){if(Y_)return yg;Y_=1;var r=vo();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return yg=e,yg}var mg,Z_;function Nl(){if(Z_)return mg;Z_=1;var r=ql(),e=Ss();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return mg=t,mg}var bg,X_;function u4(){if(X_)return bg;X_=1;var r=Nl();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return bg=e,bg}var wg,Q_;function l4(){if(Q_)return wg;Q_=1;function r(e,t){return e!=null&&t in Object(e)}return wg=r,wg}var xg,J_;function mP(){if(J_)return xg;J_=1;var r=ql(),e=Cs(),t=Zr(),n=Dl(),a=e0(),i=Ss();function o(s,l,u){l=r(l,s);for(var c=-1,d=l.length,h=!1;++c<d;){var g=i(l[c]);if(!(h=s!=null&&u(s,g)))break;s=s[g]}return h||++c!=d?h:(d=s==null?0:s.length,!!d&&a(d)&&n(g,d)&&(t(s)||e(s)))}return xg=o,xg}var Eg,eS;function bP(){if(eS)return Eg;eS=1;var r=l4(),e=mP();function t(n,a){return n!=null&&e(n,a,r)}return Eg=t,Eg}var Cg,rS;function f4(){if(rS)return Cg;rS=1;var r=hP(),e=u4(),t=bP(),n=f0(),a=gP(),i=pP(),o=Ss(),s=1,l=2;function u(c,d){return n(c)&&a(d)?i(o(c),d):function(h){var g=e(h,c);return g===void 0&&g===d?t(h,c):r(d,g,s|l)}}return Cg=u,Cg}var _g,tS;function wP(){if(tS)return _g;tS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return _g=r,_g}var Sg,nS;function c4(){if(nS)return Sg;nS=1;var r=Nl();function e(t){return function(n){return r(n,t)}}return Sg=e,Sg}var Tg,aS;function d4(){if(aS)return Tg;aS=1;var r=wP(),e=c4(),t=f0(),n=Ss();function a(i){return t(i)?r(n(i)):e(i)}return Tg=a,Tg}var Rg,iS;function ra(){if(iS)return Rg;iS=1;var r=n4(),e=f4(),t=hi(),n=Zr(),a=d4();function i(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?n(o)?e(o[0],o[1]):r(o):a(o)}return Rg=i,Rg}var Ag,oS;function xP(){if(oS)return Ag;oS=1;var r=XA(),e=KV(),t=ra(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return Ag=a,Ag}var Pg,sS;function v4(){if(sS)return Pg;sS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Pg=t,Pg}var Ig,uS;function EP(){if(uS)return Ig;uS=1;var r=v4(),e=mP();function t(n,a){return n!=null&&e(n,a,r)}return Ig=t,Ig}var Dg,lS;function h4(){if(lS)return Dg;lS=1;var r=t0(),e=co(),t=Cs(),n=Zr(),a=ea(),i=fo(),o=Ml(),s=_s(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function h(g){if(g==null)return!0;if(a(g)&&(n(g)||typeof g=="string"||typeof g.splice=="function"||i(g)||s(g)||t(g)))return!g.length;var p=e(g);if(p==l||p==u)return!g.size;if(o(g))return!r(g).length;for(var E in g)if(d.call(g,E))return!1;return!0}return Dg=h,Dg}var Bg,fS;function CP(){if(fS)return Bg;fS=1;function r(e){return e===void 0}return Bg=r,Bg}var Mg,cS;function _P(){if(cS)return Mg;cS=1;var r=Ol(),e=ea();function t(n,a){var i=-1,o=e(n)?Array(n.length):[];return r(n,function(s,l,u){o[++i]=a(s,l,u)}),o}return Mg=t,Mg}var kg,dS;function SP(){if(dS)return kg;dS=1;var r=Ll(),e=ra(),t=_P(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return kg=a,kg}var Og,vS;function g4(){if(vS)return Og;vS=1;function r(e,t,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}return Og=r,Og}var Lg,hS;function p4(){if(hS)return Lg;hS=1;function r(e,t,n,a,i){return i(e,function(o,s,l){n=a?(a=!1,o):t(n,o,s,l)}),n}return Lg=r,Lg}var qg,gS;function TP(){if(gS)return qg;gS=1;var r=g4(),e=Ol(),t=ra(),n=p4(),a=Zr();function i(o,s,l){var u=a(o)?r:n,c=arguments.length<3;return u(o,t(s,4),l,c,e)}return qg=i,qg}var Ng,pS;function y4(){if(pS)return Ng;pS=1;var r=ci(),e=Zr(),t=On(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return Ng=a,Ng}var Fg,yS;function m4(){if(yS)return Fg;yS=1;var r=wP(),e=r("length");return Fg=e,Fg}var zg,mS;function b4(){if(mS)return zg;mS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+r+a+i+"]");function l(u){return s.test(u)}return zg=l,zg}var $g,bS;function w4(){if(bS)return $g;bS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="["+r+"]",s="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+s+"|"+l+")",c="[^"+r+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",p=u+"?",E="["+i+"]?",y="(?:"+g+"(?:"+[c,d,h].join("|")+")"+E+p+")*",b=E+p+y,w="(?:"+[c+s+"?",s,d,h,o].join("|")+")",x=RegExp(l+"(?="+l+")|"+w+b,"g");function C(T){for(var S=x.lastIndex=0;x.test(T);)++S;return S}return $g=C,$g}var Vg,wS;function x4(){if(wS)return Vg;wS=1;var r=m4(),e=b4(),t=w4();function n(a){return e(a)?t(a):r(a)}return Vg=n,Vg}var Gg,xS;function E4(){if(xS)return Gg;xS=1;var r=t0(),e=co(),t=ea(),n=y4(),a=x4(),i="[object Map]",o="[object Set]";function s(l){if(l==null)return 0;if(t(l))return n(l)?a(l):l.length;var u=e(l);return u==i||u==o?l.size:r(l).length}return Gg=s,Gg}var Wg,ES;function C4(){if(ES)return Wg;ES=1;var r=Jm(),e=iP(),t=u0(),n=ra(),a=kl(),i=Zr(),o=fo(),s=xs(),l=fn(),u=_s();function c(d,h,g){var p=i(d),E=p||o(d)||u(d);if(h=n(h,4),g==null){var y=d&&d.constructor;E?g=p?new y:[]:l(d)?g=s(y)?e(a(d)):{}:g={}}return(E?r:t)(d,function(b,w,x){return h(g,b,w,x)}),g}return Wg=c,Wg}var Ug,CS;function _4(){if(CS)return Ug;CS=1;var r=lo(),e=Cs(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Ug=a,Ug}var Hg,_S;function c0(){if(_S)return Hg;_S=1;var r=a0(),e=_4();function t(n,a,i,o,s){var l=-1,u=n.length;for(i||(i=e),s||(s=[]);++l<u;){var c=n[l];a>0&&i(c)?a>1?t(c,a-1,i,o,s):r(s,c):o||(s[s.length]=c)}return s}return Hg=t,Hg}var Kg,SS;function S4(){if(SS)return Kg;SS=1;function r(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)}return Kg=r,Kg}var jg,TS;function RP(){if(TS)return jg;TS=1;var r=S4(),e=Math.max;function t(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,l=e(o.length-a,0),u=Array(l);++s<l;)u[s]=o[a+s];s=-1;for(var c=Array(a+1);++s<a;)c[s]=o[s];return c[a]=i(u),r(n,this,c)}}return jg=t,jg}var Yg,RS;function T4(){if(RS)return Yg;RS=1;var r=o0(),e=HA(),t=hi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return Yg=n,Yg}var Zg,AS;function R4(){if(AS)return Zg;AS=1;var r=800,e=16,t=Date.now;function n(a){var i=0,o=0;return function(){var s=t(),l=e-(s-o);if(o=s,l>0){if(++i>=r)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Zg=n,Zg}var Xg,PS;function AP(){if(PS)return Xg;PS=1;var r=T4(),e=R4(),t=e(r);return Xg=t,Xg}var Qg,IS;function Fl(){if(IS)return Qg;IS=1;var r=hi(),e=RP(),t=AP();function n(a,i){return t(e(a,i,r),a+"")}return Qg=n,Qg}var Jg,DS;function PP(){if(DS)return Jg;DS=1;function r(e,t,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return Jg=r,Jg}var ep,BS;function A4(){if(BS)return ep;BS=1;function r(e){return e!==e}return ep=r,ep}var rp,MS;function P4(){if(MS)return rp;MS=1;function r(e,t,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===t)return a;return-1}return rp=r,rp}var tp,kS;function I4(){if(kS)return tp;kS=1;var r=PP(),e=A4(),t=P4();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return tp=n,tp}var np,OS;function D4(){if(OS)return np;OS=1;var r=I4();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return np=e,np}var ap,LS;function B4(){if(LS)return ap;LS=1;function r(e,t,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(t,e[a]))return!0;return!1}return ap=r,ap}var ip,qS;function M4(){if(qS)return ip;qS=1;function r(){}return ip=r,ip}var op,NS;function k4(){if(NS)return op;NS=1;var r=tP(),e=M4(),t=l0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return op=a,op}var sp,FS;function O4(){if(FS)return sp;FS=1;var r=cP(),e=D4(),t=B4(),n=dP(),a=k4(),i=l0(),o=200;function s(l,u,c){var d=-1,h=e,g=l.length,p=!0,E=[],y=E;if(c)p=!1,h=t;else if(g>=o){var b=u?null:a(l);if(b)return i(b);p=!1,h=n,y=new r}else y=u?[]:E;e:for(;++d<g;){var w=l[d],x=u?u(w):w;if(w=c||w!==0?w:0,p&&x===x){for(var C=y.length;C--;)if(y[C]===x)continue e;u&&y.push(x),E.push(w)}else h(y,x,c)||(y!==E&&y.push(x),E.push(w))}return E}return sp=s,sp}var up,zS;function IP(){if(zS)return up;zS=1;var r=ea(),e=On();function t(n){return e(n)&&r(n)}return up=t,up}var lp,$S;function L4(){if($S)return lp;$S=1;var r=c0(),e=Fl(),t=O4(),n=IP(),a=e(function(i){return t(r(i,1,n,!0))});return lp=a,lp}var fp,VS;function q4(){if(VS)return fp;VS=1;var r=Ll();function e(t,n){return r(n,function(a){return t[a]})}return fp=e,fp}var cp,GS;function DP(){if(GS)return cp;GS=1;var r=q4(),e=qa();function t(n){return n==null?[]:r(n,e(n))}return cp=t,cp}var dp,WS;function cn(){if(WS)return dp;WS=1;var r;if(typeof Zm=="function")try{r={clone:WV(),constant:o0(),each:fP(),filter:xP(),has:EP(),isArray:Zr(),isEmpty:h4(),isFunction:xs(),isUndefined:CP(),keys:qa(),map:SP(),reduce:TP(),size:E4(),transform:C4(),union:L4(),values:DP()}}catch{}return r||(r=window._),dp=r,dp}var vp,US;function d0(){if(US)return vp;US=1;var r=cn();vp=a;var e="\0",t="\0",n="";function a(c){this._isDirected=r.has(c,"directed")?c.directed:!0,this._isMultigraph=r.has(c,"multigraph")?c.multigraph:!1,this._isCompound=r.has(c,"compound")?c.compound:!1,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[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(c){return this._label=c,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultNodeLabelFn=c,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._in[d])})},a.prototype.sinks=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._out[d])})},a.prototype.setNodes=function(c,d){var h=arguments,g=this;return r.each(c,function(p){h.length>1?g.setNode(p,d):g.setNode(p)}),this},a.prototype.setNode=function(c,d){return r.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=t,this._children[c]={},this._children[t][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},a.prototype.node=function(c){return this._nodes[c]},a.prototype.hasNode=function(c){return r.has(this._nodes,c)},a.prototype.removeNode=function(c){var d=this;if(r.has(this._nodes,c)){var h=function(g){d.removeEdge(d._edgeObjs[g])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],r.each(this.children(c),function(g){d.setParent(g)}),delete this._children[c]),r.each(r.keys(this._in[c]),h),delete this._in[c],delete this._preds[c],r.each(r.keys(this._out[c]),h),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},a.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(d))d=t;else{d+="";for(var h=d;!r.isUndefined(h);h=this.parent(h))if(h===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},a.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},a.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==t)return d}},a.prototype.children=function(c){if(r.isUndefined(c)&&(c=t),this._isCompound){var d=this._children[c];if(d)return r.keys(d)}else{if(c===t)return this.nodes();if(this.hasNode(c))return[]}},a.prototype.predecessors=function(c){var d=this._preds[c];if(d)return r.keys(d)},a.prototype.successors=function(c){var d=this._sucs[c];if(d)return r.keys(d)},a.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return r.union(d,this.successors(c))},a.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},a.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;r.each(this._nodes,function(E,y){c(y)&&d.setNode(y,E)}),r.each(this._edgeObjs,function(E){d.hasNode(E.v)&&d.hasNode(E.w)&&d.setEdge(E,h.edge(E))});var g={};function p(E){var y=h.parent(E);return y===void 0||d.hasNode(y)?(g[E]=y,y):y in g?g[y]:p(y)}return this._isCompound&&r.each(d.nodes(),function(E){d.setParent(E,p(E))}),d},a.prototype.setDefaultEdgeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultEdgeLabelFn=c,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(c,d){var h=this,g=arguments;return r.reduce(c,function(p,E){return g.length>1?h.setEdge(p,E,d):h.setEdge(p,E),E}),this},a.prototype.setEdge=function(){var c,d,h,g,p=!1,E=arguments[0];typeof E=="object"&&E!==null&&"v"in E?(c=E.v,d=E.w,h=E.name,arguments.length===2&&(g=arguments[1],p=!0)):(c=E,d=arguments[1],h=arguments[3],arguments.length>2&&(g=arguments[2],p=!0)),c=""+c,d=""+d,r.isUndefined(h)||(h=""+h);var y=s(this._isDirected,c,d,h);if(r.has(this._edgeLabels,y))return p&&(this._edgeLabels[y]=g),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[y]=p?g:this._defaultEdgeLabelFn(c,d,h);var b=l(this._isDirected,c,d,h);return c=b.v,d=b.w,Object.freeze(b),this._edgeObjs[y]=b,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][y]=b,this._out[c][y]=b,this._edgeCount++,this},a.prototype.edge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return this._edgeLabels[g]},a.prototype.hasEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return r.has(this._edgeLabels,g)},a.prototype.removeEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h),p=this._edgeObjs[g];return p&&(c=p.v,d=p.w,delete this._edgeLabels[g],delete this._edgeObjs[g],o(this._preds[d],c),o(this._sucs[c],d),delete this._in[d][g],delete this._out[c][g],this._edgeCount--),this},a.prototype.inEdges=function(c,d){var h=this._in[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.v===d}):g}},a.prototype.outEdges=function(c,d){var h=this._out[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.w===d}):g}},a.prototype.nodeEdges=function(c,d){var h=this.inEdges(c,d);if(h)return h.concat(this.outEdges(c,d))};function i(c,d){c[d]?c[d]++:c[d]=1}function o(c,d){--c[d]||delete c[d]}function s(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var y=p;p=E,E=y}return p+n+E+n+(r.isUndefined(g)?e:g)}function l(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var y=p;p=E,E=y}var b={v:p,w:E};return g&&(b.name=g),b}function u(c,d){return s(c,d.v,d.w,d.name)}return vp}var hp,HS;function N4(){return HS||(HS=1,hp="2.1.8"),hp}var gp,KS;function F4(){return KS||(KS=1,gp={Graph:d0(),version:N4()}),gp}var pp,jS;function z4(){if(jS)return pp;jS=1;var r=cn(),e=d0();pp={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return r.isUndefined(o.graph())||(s.value=r.clone(o.graph())),s}function n(o){return r.map(o.nodes(),function(s){var l=o.node(s),u=o.parent(s),c={v:s};return r.isUndefined(l)||(c.value=l),r.isUndefined(u)||(c.parent=u),c})}function a(o){return r.map(o.edges(),function(s){var l=o.edge(s),u={v:s.v,w:s.w};return r.isUndefined(s.name)||(u.name=s.name),r.isUndefined(l)||(u.value=l),u})}function i(o){var s=new e(o.options).setGraph(o.value);return r.each(o.nodes,function(l){s.setNode(l.v,l.value),l.parent&&s.setParent(l.v,l.parent)}),r.each(o.edges,function(l){s.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),s}return pp}var yp,YS;function $4(){if(YS)return yp;YS=1;var r=cn();yp=e;function e(t){var n={},a=[],i;function o(s){r.has(n,s)||(n[s]=!0,i.push(s),r.each(t.successors(s),o),r.each(t.predecessors(s),o))}return r.each(t.nodes(),function(s){i=[],o(s),i.length&&a.push(i)}),a}return yp}var mp,ZS;function BP(){if(ZS)return mp;ZS=1;var r=cn();mp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,n){var a=this._keyIndices;if(t=String(t),!r.has(a,t)){var i=this._arr,o=i.length;return a[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,n){var a=this._keyIndices[t];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(t){var n=this._arr,a=2*t,i=a+1,o=t;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var n=this._arr,a=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<a));)this._swap(t,i),t=i},e.prototype._swap=function(t,n){var a=this._arr,i=this._keyIndices,o=a[t],s=a[n];a[t]=s,a[n]=o,i[s.key]=t,i[o.key]=n},mp}var bp,XS;function MP(){if(XS)return bp;XS=1;var r=cn(),e=BP();bp=n;var t=r.constant(1);function n(i,o,s,l){return a(i,String(o),s||t,l||function(u){return i.outEdges(u)})}function a(i,o,s,l){var u={},c=new e,d,h,g=function(p){var E=p.v!==d?p.v:p.w,y=u[E],b=s(p),w=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+b);w<y.distance&&(y.distance=w,y.predecessor=d,c.decrease(E,w))};for(i.nodes().forEach(function(p){var E=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:E},c.add(p,E)});c.size()>0&&(d=c.removeMin(),h=u[d],h.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(g);return u}return bp}var wp,QS;function V4(){if(QS)return wp;QS=1;var r=MP(),e=cn();wp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return wp}var xp,JS;function kP(){if(JS)return xp;JS=1;var r=cn();xp=e;function e(t){var n=0,a=[],i={},o=[];function s(l){var u=i[l]={onStack:!0,lowlink:n,index:n++};if(a.push(l),t.successors(l).forEach(function(h){r.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(s(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var c=[],d;do d=a.pop(),i[d].onStack=!1,c.push(d);while(l!==d);o.push(c)}}return t.nodes().forEach(function(l){r.has(i,l)||s(l)}),o}return xp}var Ep,eT;function G4(){if(eT)return Ep;eT=1;var r=cn(),e=kP();Ep=t;function t(n){return r.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Ep}var Cp,rT;function W4(){if(rT)return Cp;rT=1;var r=cn();Cp=t;var e=r.constant(1);function t(a,i,o){return n(a,i||e,o||function(s){return a.outEdges(s)})}function n(a,i,o){var s={},l=a.nodes();return l.forEach(function(u){s[u]={},s[u][u]={distance:0},l.forEach(function(c){u!==c&&(s[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var d=c.v===u?c.w:c.v,h=i(c);s[u][d]={distance:h,predecessor:u}})}),l.forEach(function(u){var c=s[u];l.forEach(function(d){var h=s[d];l.forEach(function(g){var p=h[u],E=c[g],y=h[g],b=p.distance+E.distance;b<y.distance&&(y.distance=b,y.predecessor=E.predecessor)})})}),s}return Cp}var _p,tT;function OP(){if(tT)return _p;tT=1;var r=cn();_p=e,e.CycleException=t;function e(n){var a={},i={},o=[];function s(l){if(r.has(i,l))throw new t;r.has(a,l)||(i[l]=!0,a[l]=!0,r.each(n.predecessors(l),s),delete i[l],o.push(l))}if(r.each(n.sinks(),s),r.size(a)!==n.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,_p}var Sp,nT;function U4(){if(nT)return Sp;nT=1;var r=OP();Sp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Sp}var Tp,aT;function LP(){if(aT)return Tp;aT=1;var r=cn();Tp=e;function e(n,a,i){r.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],l={};return r.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);t(n,u,i==="post",l,o,s)}),s}function t(n,a,i,o,s,l){r.has(o,a)||(o[a]=!0,i||l.push(a),r.each(s(a),function(u){t(n,u,i,o,s,l)}),i&&l.push(a))}return Tp}var Rp,iT;function H4(){if(iT)return Rp;iT=1;var r=LP();Rp=e;function e(t,n){return r(t,n,"post")}return Rp}var Ap,oT;function K4(){if(oT)return Ap;oT=1;var r=LP();Ap=e;function e(t,n){return r(t,n,"pre")}return Ap}var Pp,sT;function j4(){if(sT)return Pp;sT=1;var r=cn(),e=d0(),t=BP();Pp=n;function n(a,i){var o=new e,s={},l=new t,u;function c(h){var g=h.v===u?h.w:h.v,p=l.priority(g);if(p!==void 0){var E=i(h);E<p&&(s[g]=u,l.decrease(g,E))}}if(a.nodeCount()===0)return o;r.each(a.nodes(),function(h){l.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),l.decrease(a.nodes()[0],0);for(var d=!1;l.size()>0;){if(u=l.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(u).forEach(c)}return o}return Pp}var Ip,uT;function Y4(){return uT||(uT=1,Ip={components:$4(),dijkstra:MP(),dijkstraAll:V4(),findCycles:G4(),floydWarshall:W4(),isAcyclic:U4(),postorder:H4(),preorder:K4(),prim:j4(),tarjan:kP(),topsort:OP()}),Ip}var Dp,lT;function Z4(){if(lT)return Dp;lT=1;var r=F4();return Dp={Graph:r.Graph,json:z4(),alg:Y4(),version:r.version},Dp}var Bp,fT;function xn(){if(fT)return Bp;fT=1;var r;if(typeof Zm=="function")try{r=Z4()}catch{}return r||(r=window.graphlib),Bp=r,Bp}var Mp,cT;function X4(){if(cT)return Mp;cT=1;var r=sP(),e=1,t=4;function n(a){return r(a,e|t)}return Mp=n,Mp}var kp,dT;function zl(){if(dT)return kp;dT=1;var r=uo(),e=ea(),t=Dl(),n=fn();function a(i,o,s){if(!n(s))return!1;var l=typeof o;return(l=="number"?e(s)&&t(o,s.length):l=="string"&&o in s)?r(s[o],i):!1}return kp=a,kp}var Op,vT;function Q4(){if(vT)return Op;vT=1;var r=Fl(),e=uo(),t=zl(),n=vi(),a=Object.prototype,i=a.hasOwnProperty,o=r(function(s,l){s=Object(s);var u=-1,c=l.length,d=c>2?l[2]:void 0;for(d&&t(l[0],l[1],d)&&(c=1);++u<c;)for(var h=l[u],g=n(h),p=-1,E=g.length;++p<E;){var y=g[p],b=s[y];(b===void 0||e(b,a[y])&&!i.call(s,y))&&(s[y]=h[y])}return s});return Op=o,Op}var Lp,hT;function J4(){if(hT)return Lp;hT=1;var r=ra(),e=ea(),t=qa();function n(a){return function(i,o,s){var l=Object(i);if(!e(i)){var u=r(o,3);i=t(i),o=function(d){return u(l[d],d,l)}}var c=a(i,o,s);return c>-1?l[u?i[c]:c]:void 0}}return Lp=n,Lp}var qp,gT;function eG(){if(gT)return qp;gT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return qp=e,qp}var Np,pT;function rG(){if(pT)return Np;pT=1;var r=eG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Np=t,Np}var Fp,yT;function tG(){if(yT)return Fp;yT=1;var r=rG(),e=fn(),t=vo(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=r(u);var d=i.test(u);return d||o.test(u)?s(u.slice(2),d?2:8):a.test(u)?n:+u}return Fp=l,Fp}var zp,mT;function qP(){if(mT)return zp;mT=1;var r=tG(),e=1/0,t=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=r(a),a===e||a===-e){var i=a<0?-1:1;return i*t}return a===a?a:0}return zp=n,zp}var $p,bT;function nG(){if(bT)return $p;bT=1;var r=qP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return $p=e,$p}var Vp,wT;function aG(){if(wT)return Vp;wT=1;var r=PP(),e=ra(),t=nG(),n=Math.max;function a(i,o,s){var l=i==null?0:i.length;if(!l)return-1;var u=s==null?0:t(s);return u<0&&(u=n(l+u,0)),r(i,e(o,3),u)}return Vp=a,Vp}var Gp,xT;function iG(){if(xT)return Gp;xT=1;var r=J4(),e=aG(),t=r(e);return Gp=t,Gp}var Wp,ET;function NP(){if(ET)return Wp;ET=1;var r=c0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Wp=e,Wp}var Up,CT;function oG(){if(CT)return Up;CT=1;var r=s0(),e=uP(),t=vi();function n(a,i){return a==null?a:r(a,e(i),t)}return Up=n,Up}var Hp,_T;function sG(){if(_T)return Hp;_T=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Hp=r,Hp}var Kp,ST;function uG(){if(ST)return Kp;ST=1;var r=Pl(),e=u0(),t=ra();function n(a,i){var o={};return i=t(i,3),e(a,function(s,l,u){r(o,l,i(s,l,u))}),o}return Kp=n,Kp}var jp,TT;function v0(){if(TT)return jp;TT=1;var r=vo();function e(t,n,a){for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n(s);if(l!=null&&(u===void 0?l===l&&!r(l):a(l,u)))var u=l,c=s}return c}return jp=e,jp}var Yp,RT;function lG(){if(RT)return Yp;RT=1;function r(e,t){return e>t}return Yp=r,Yp}var Zp,AT;function fG(){if(AT)return Zp;AT=1;var r=v0(),e=lG(),t=hi();function n(a){return a&&a.length?r(a,t,e):void 0}return Zp=n,Zp}var Xp,PT;function FP(){if(PT)return Xp;PT=1;var r=Pl(),e=uo();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return Xp=t,Xp}var Qp,IT;function cG(){if(IT)return Qp;IT=1;var r=ci(),e=kl(),t=On(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,s=i.hasOwnProperty,l=o.call(Object);function u(c){if(!t(c)||r(c)!=n)return!1;var d=e(c);if(d===null)return!0;var h=s.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==l}return Qp=u,Qp}var Jp,DT;function zP(){if(DT)return Jp;DT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return Jp=r,Jp}var ey,BT;function dG(){if(BT)return ey;BT=1;var r=Es(),e=vi();function t(n){return r(n,e(n))}return ey=t,ey}var ry,MT;function vG(){if(MT)return ry;MT=1;var r=FP(),e=YA(),t=aP(),n=ZA(),a=oP(),i=Cs(),o=Zr(),s=IP(),l=fo(),u=xs(),c=fn(),d=cG(),h=_s(),g=zP(),p=dG();function E(y,b,w,x,C,T,S){var _=g(y,w),A=g(b,w),P=S.get(A);if(P){r(y,w,P);return}var I=T?T(_,A,w+"",y,b,S):void 0,D=I===void 0;if(D){var k=o(A),M=!k&&l(A),N=!k&&!M&&h(A);I=A,k||M||N?o(_)?I=_:s(_)?I=n(_):M?(D=!1,I=e(A,!0)):N?(D=!1,I=t(A,!0)):I=[]:d(A)||i(A)?(I=_,i(_)?I=p(_):(!c(_)||u(_))&&(I=a(A))):D=!1}D&&(S.set(A,I),C(I,A,x,T,S),S.delete(A)),r(y,w,I)}return ry=E,ry}var ty,kT;function hG(){if(kT)return ty;kT=1;var r=Al(),e=FP(),t=s0(),n=vG(),a=fn(),i=vi(),o=zP();function s(l,u,c,d,h){l!==u&&t(u,function(g,p){if(h||(h=new r),a(g))n(l,u,p,c,s,d,h);else{var E=d?d(o(l,p),g,p+"",l,u,h):void 0;E===void 0&&(E=g),e(l,p,E)}},i)}return ty=s,ty}var ny,OT;function gG(){if(OT)return ny;OT=1;var r=Fl(),e=zl();function t(n){return r(function(a,i){var o=-1,s=i.length,l=s>1?i[s-1]:void 0,u=s>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(s--,l):void 0,u&&e(i[0],i[1],u)&&(l=s<3?void 0:l,s=1),a=Object(a);++o<s;){var c=i[o];c&&n(a,c,o,l)}return a})}return ny=t,ny}var ay,LT;function pG(){if(LT)return ay;LT=1;var r=hG(),e=gG(),t=e(function(n,a,i){r(n,a,i)});return ay=t,ay}var iy,qT;function $P(){if(qT)return iy;qT=1;function r(e,t){return e<t}return iy=r,iy}var oy,NT;function yG(){if(NT)return oy;NT=1;var r=v0(),e=$P(),t=hi();function n(a){return a&&a.length?r(a,t,e):void 0}return oy=n,oy}var sy,FT;function mG(){if(FT)return sy;FT=1;var r=v0(),e=ra(),t=$P();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return sy=n,sy}var uy,zT;function bG(){if(zT)return uy;zT=1;var r=En(),e=function(){return r.Date.now()};return uy=e,uy}var ly,$T;function wG(){if($T)return ly;$T=1;var r=Il(),e=ql(),t=Dl(),n=fn(),a=Ss();function i(o,s,l,u){if(!n(o))return o;s=e(s,o);for(var c=-1,d=s.length,h=d-1,g=o;g!=null&&++c<d;){var p=a(s[c]),E=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var y=g[p];E=u?u(y,p,g):void 0,E===void 0&&(E=n(y)?y:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return ly=i,ly}var fy,VT;function xG(){if(VT)return fy;VT=1;var r=Nl(),e=wG(),t=ql();function n(a,i,o){for(var s=-1,l=i.length,u={};++s<l;){var c=i[s],d=r(a,c);o(d,c)&&e(u,t(c,a),d)}return u}return fy=n,fy}var cy,GT;function EG(){if(GT)return cy;GT=1;var r=xG(),e=bP();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return cy=t,cy}var dy,WT;function CG(){if(WT)return dy;WT=1;var r=NP(),e=RP(),t=AP();function n(a){return t(e(a,void 0,r),a+"")}return dy=n,dy}var vy,UT;function _G(){if(UT)return vy;UT=1;var r=EG(),e=CG(),t=e(function(n,a){return n==null?{}:r(n,a)});return vy=t,vy}var hy,HT;function SG(){if(HT)return hy;HT=1;var r=Math.ceil,e=Math.max;function t(n,a,i,o){for(var s=-1,l=e(r((a-n)/(i||1)),0),u=Array(l);l--;)u[o?l:++s]=n,n+=i;return u}return hy=t,hy}var gy,KT;function TG(){if(KT)return gy;KT=1;var r=SG(),e=zl(),t=qP();function n(a){return function(i,o,s){return s&&typeof s!="number"&&e(i,o,s)&&(o=s=void 0),i=t(i),o===void 0?(o=i,i=0):o=t(o),s=s===void 0?i<o?1:-1:t(s),r(i,o,s,a)}}return gy=n,gy}var py,jT;function RG(){if(jT)return py;jT=1;var r=TG(),e=r();return py=e,py}var yy,YT;function AG(){if(YT)return yy;YT=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return yy=r,yy}var my,ZT;function PG(){if(ZT)return my;ZT=1;var r=vo();function e(t,n){if(t!==n){var a=t!==void 0,i=t===null,o=t===t,s=r(t),l=n!==void 0,u=n===null,c=n===n,d=r(n);if(!u&&!d&&!s&&t>n||s&&l&&c&&!u&&!d||i&&l&&c||!a&&c||!o)return 1;if(!i&&!s&&!d&&t<n||d&&a&&o&&!i&&!s||u&&a&&o||!l&&o||!c)return-1}return 0}return my=e,my}var by,XT;function IG(){if(XT)return by;XT=1;var r=PG();function e(t,n,a){for(var i=-1,o=t.criteria,s=n.criteria,l=o.length,u=a.length;++i<l;){var c=r(o[i],s[i]);if(c){if(i>=u)return c;var d=a[i];return c*(d=="desc"?-1:1)}}return t.index-n.index}return by=e,by}var wy,QT;function DG(){if(QT)return wy;QT=1;var r=Ll(),e=Nl(),t=ra(),n=_P(),a=AG(),i=Bl(),o=IG(),s=hi(),l=Zr();function u(c,d,h){d.length?d=r(d,function(E){return l(E)?function(y){return e(y,E.length===1?E[0]:E)}:E}):d=[s];var g=-1;d=r(d,i(t));var p=n(c,function(E,y,b){var w=r(d,function(x){return x(E)});return{criteria:w,index:++g,value:E}});return a(p,function(E,y){return o(E,y,h)})}return wy=u,wy}var xy,JT;function BG(){if(JT)return xy;JT=1;var r=c0(),e=DG(),t=Fl(),n=zl(),a=t(function(i,o){if(i==null)return[];var s=o.length;return s>1&&n(i,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,r(o,1),[])});return xy=a,xy}var Ey,e2;function MG(){if(e2)return Ey;e2=1;var r=yP(),e=0;function t(n){var a=++e;return r(n)+a}return Ey=t,Ey}var Cy,r2;function kG(){if(r2)return Cy;r2=1;function r(e,t,n){for(var a=-1,i=e.length,o=t.length,s={};++a<i;){var l=a<o?t[a]:void 0;n(s,e[a],l)}return s}return Cy=r,Cy}var _y,t2;function OG(){if(t2)return _y;t2=1;var r=Il(),e=kG();function t(n,a){return e(n||[],a||[],r)}return _y=t,_y}var Sy,n2;function qr(){if(n2)return Sy;n2=1;var r;if(typeof Zm=="function")try{r={cloneDeep:X4(),constant:o0(),defaults:Q4(),each:fP(),filter:xP(),find:iG(),flatten:NP(),forEach:lP(),forIn:oG(),has:EP(),isUndefined:CP(),last:sG(),map:SP(),mapValues:uG(),max:fG(),merge:pG(),min:yG(),minBy:mG(),now:bG(),pick:_G(),range:RG(),reduce:TP(),sortBy:BG(),uniqueId:MG(),values:DP(),zipObject:OG()}}catch{}return r||(r=window._),Sy=r,Sy}var Ty,a2;function LG(){if(a2)return Ty;a2=1,Ty=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},r.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},r.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,a){if(n!=="_next"&&n!=="_prev")return a}return Ty}var Ry,i2;function qG(){if(i2)return Ry;i2=1;var r=qr(),e=xn().Graph,t=LG();Ry=a;var n=r.constant(1);function a(u,c){if(u.nodeCount()<=1)return[];var d=s(u,c||n),h=i(d.graph,d.buckets,d.zeroIdx);return r.flatten(r.map(h,function(g){return u.outEdges(g.v,g.w)}),!0)}function i(u,c,d){for(var h=[],g=c[c.length-1],p=c[0],E;u.nodeCount();){for(;E=p.dequeue();)o(u,c,d,E);for(;E=g.dequeue();)o(u,c,d,E);if(u.nodeCount()){for(var y=c.length-2;y>0;--y)if(E=c[y].dequeue(),E){h=h.concat(o(u,c,d,E,!0));break}}}return h}function o(u,c,d,h,g){var p=g?[]:void 0;return r.forEach(u.inEdges(h.v),function(E){var y=u.edge(E),b=u.node(E.v);g&&p.push({v:E.v,w:E.w}),b.out-=y,l(c,d,b)}),r.forEach(u.outEdges(h.v),function(E){var y=u.edge(E),b=E.w,w=u.node(b);w.in-=y,l(c,d,w)}),u.removeNode(h.v),p}function s(u,c){var d=new e,h=0,g=0;r.forEach(u.nodes(),function(y){d.setNode(y,{v:y,in:0,out:0})}),r.forEach(u.edges(),function(y){var b=d.edge(y.v,y.w)||0,w=c(y),x=b+w;d.setEdge(y.v,y.w,x),g=Math.max(g,d.node(y.v).out+=w),h=Math.max(h,d.node(y.w).in+=w)});var p=r.range(g+h+3).map(function(){return new t}),E=h+1;return r.forEach(d.nodes(),function(y){l(p,E,d.node(y))}),{graph:d,buckets:p,zeroIdx:E}}function l(u,c,d){d.out?d.in?u[d.out-d.in+c].enqueue(d):u[u.length-1].enqueue(d):u[0].enqueue(d)}return Ry}var Ay,o2;function NG(){if(o2)return Ay;o2=1;var r=qr(),e=qG();Ay={run:t,undo:a};function t(i){var o=i.graph().acyclicer==="greedy"?e(i,s(i)):n(i);r.forEach(o,function(l){var u=i.edge(l);i.removeEdge(l),u.forwardName=l.name,u.reversed=!0,i.setEdge(l.w,l.v,u,r.uniqueId("rev"))});function s(l){return function(u){return l.edge(u).weight}}}function n(i){var o=[],s={},l={};function u(c){r.has(l,c)||(l[c]=!0,s[c]=!0,r.forEach(i.outEdges(c),function(d){r.has(s,d.w)?o.push(d):u(d.w)}),delete s[c])}return r.forEach(i.nodes(),u),o}function a(i){r.forEach(i.edges(),function(o){var s=i.edge(o);if(s.reversed){i.removeEdge(o);var l=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(o.w,o.v,s,l)}})}return Ay}var Py,s2;function $t(){if(s2)return Py;s2=1;var r=qr(),e=xn().Graph;Py={addDummyNode:t,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:s,buildLayerMatrix:l,normalizeRanks:u,removeEmptyRanks:c,addBorderNode:d,maxRank:h,partition:g,time:p,notime:E};function t(y,b,w,x){var C;do C=r.uniqueId(x);while(y.hasNode(C));return w.dummy=b,y.setNode(C,w),C}function n(y){var b=new e().setGraph(y.graph());return r.forEach(y.nodes(),function(w){b.setNode(w,y.node(w))}),r.forEach(y.edges(),function(w){var x=b.edge(w.v,w.w)||{weight:0,minlen:1},C=y.edge(w);b.setEdge(w.v,w.w,{weight:x.weight+C.weight,minlen:Math.max(x.minlen,C.minlen)})}),b}function a(y){var b=new e({multigraph:y.isMultigraph()}).setGraph(y.graph());return r.forEach(y.nodes(),function(w){y.children(w).length||b.setNode(w,y.node(w))}),r.forEach(y.edges(),function(w){b.setEdge(w,y.edge(w))}),b}function i(y){var b=r.map(y.nodes(),function(w){var x={};return r.forEach(y.outEdges(w),function(C){x[C.w]=(x[C.w]||0)+y.edge(C).weight}),x});return r.zipObject(y.nodes(),b)}function o(y){var b=r.map(y.nodes(),function(w){var x={};return r.forEach(y.inEdges(w),function(C){x[C.v]=(x[C.v]||0)+y.edge(C).weight}),x});return r.zipObject(y.nodes(),b)}function s(y,b){var w=y.x,x=y.y,C=b.x-w,T=b.y-x,S=y.width/2,_=y.height/2;if(!C&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var A,P;return Math.abs(T)*S>Math.abs(C)*_?(T<0&&(_=-_),A=_*C/T,P=_):(C<0&&(S=-S),A=S,P=S*T/C),{x:w+A,y:x+P}}function l(y){var b=r.map(r.range(h(y)+1),function(){return[]});return r.forEach(y.nodes(),function(w){var x=y.node(w),C=x.rank;r.isUndefined(C)||(b[C][x.order]=w)}),b}function u(y){var b=r.min(r.map(y.nodes(),function(w){return y.node(w).rank}));r.forEach(y.nodes(),function(w){var x=y.node(w);r.has(x,"rank")&&(x.rank-=b)})}function c(y){var b=r.min(r.map(y.nodes(),function(T){return y.node(T).rank})),w=[];r.forEach(y.nodes(),function(T){var S=y.node(T).rank-b;w[S]||(w[S]=[]),w[S].push(T)});var x=0,C=y.graph().nodeRankFactor;r.forEach(w,function(T,S){r.isUndefined(T)&&S%C!==0?--x:x&&r.forEach(T,function(_){y.node(_).rank+=x})})}function d(y,b,w,x){var C={width:0,height:0};return arguments.length>=4&&(C.rank=w,C.order=x),t(y,"border",C,b)}function h(y){return r.max(r.map(y.nodes(),function(b){var w=y.node(b).rank;if(!r.isUndefined(w))return w}))}function g(y,b){var w={lhs:[],rhs:[]};return r.forEach(y,function(x){b(x)?w.lhs.push(x):w.rhs.push(x)}),w}function p(y,b){var w=r.now();try{return b()}finally{console.log(y+" time: "+(r.now()-w)+"ms")}}function E(y,b){return b()}return Py}var Iy,u2;function FG(){if(u2)return Iy;u2=1;var r=qr(),e=$t();Iy={run:t,undo:a};function t(i){i.graph().dummyChains=[],r.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var s=o.v,l=i.node(s).rank,u=o.w,c=i.node(u).rank,d=o.name,h=i.edge(o),g=h.labelRank;if(c!==l+1){i.removeEdge(o);var p,E,y;for(y=0,++l;l<c;++y,++l)h.points=[],E={width:0,height:0,edgeLabel:h,edgeObj:o,rank:l},p=e.addDummyNode(i,"edge",E,"_d"),l===g&&(E.width=h.width,E.height=h.height,E.dummy="edge-label",E.labelpos=h.labelpos),i.setEdge(s,p,{weight:h.weight},d),y===0&&i.graph().dummyChains.push(p),s=p;i.setEdge(s,u,{weight:h.weight},d)}}function a(i){r.forEach(i.graph().dummyChains,function(o){var s=i.node(o),l=s.edgeLabel,u;for(i.setEdge(s.edgeObj,l);s.dummy;)u=i.successors(o)[0],i.removeNode(o),l.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(l.x=s.x,l.y=s.y,l.width=s.width,l.height=s.height),o=u,s=i.node(o)})}return Iy}var Dy,l2;function nl(){if(l2)return Dy;l2=1;var r=qr();Dy={longestPath:e,slack:t};function e(n){var a={};function i(o){var s=n.node(o);if(r.has(a,o))return s.rank;a[o]=!0;var l=r.min(r.map(n.outEdges(o),function(u){return i(u.w)-n.edge(u).minlen}));return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),s.rank=l}r.forEach(n.sources(),i)}function t(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Dy}var By,f2;function VP(){if(f2)return By;f2=1;var r=qr(),e=xn().Graph,t=nl().slack;By=n;function n(s){var l=new e({directed:!1}),u=s.nodes()[0],c=s.nodeCount();l.setNode(u,{});for(var d,h;a(l,s)<c;)d=i(l,s),h=l.hasNode(d.v)?t(s,d):-t(s,d),o(l,s,h);return l}function a(s,l){function u(c){r.forEach(l.nodeEdges(c),function(d){var h=d.v,g=c===h?d.w:h;!s.hasNode(g)&&!t(l,d)&&(s.setNode(g,{}),s.setEdge(c,g,{}),u(g))})}return r.forEach(s.nodes(),u),s.nodeCount()}function i(s,l){return r.minBy(l.edges(),function(u){if(s.hasNode(u.v)!==s.hasNode(u.w))return t(l,u)})}function o(s,l,u){r.forEach(s.nodes(),function(c){l.node(c).rank+=u})}return By}var My,c2;function zG(){if(c2)return My;c2=1;var r=qr(),e=VP(),t=nl().slack,n=nl().longestPath,a=xn().alg.preorder,i=xn().alg.postorder,o=$t().simplify;My=s,s.initLowLimValues=d,s.initCutValues=l,s.calcCutValue=c,s.leaveEdge=g,s.enterEdge=p,s.exchangeEdges=E;function s(x){x=o(x),n(x);var C=e(x);d(C),l(C,x);for(var T,S;T=g(C);)S=p(C,x,T),E(C,x,T,S)}function l(x,C){var T=i(x,x.nodes());T=T.slice(0,T.length-1),r.forEach(T,function(S){u(x,C,S)})}function u(x,C,T){var S=x.node(T),_=S.parent;x.edge(T,_).cutvalue=c(x,C,T)}function c(x,C,T){var S=x.node(T),_=S.parent,A=!0,P=C.edge(T,_),I=0;return P||(A=!1,P=C.edge(_,T)),I=P.weight,r.forEach(C.nodeEdges(T),function(D){var k=D.v===T,M=k?D.w:D.v;if(M!==_){var N=k===A,z=C.edge(D).weight;if(I+=N?z:-z,b(x,T,M)){var $=x.edge(T,M).cutvalue;I+=N?-$:$}}}),I}function d(x,C){arguments.length<2&&(C=x.nodes()[0]),h(x,{},1,C)}function h(x,C,T,S,_){var A=T,P=x.node(S);return C[S]=!0,r.forEach(x.neighbors(S),function(I){r.has(C,I)||(T=h(x,C,T,I,S))}),P.low=A,P.lim=T++,_?P.parent=_:delete P.parent,T}function g(x){return r.find(x.edges(),function(C){return x.edge(C).cutvalue<0})}function p(x,C,T){var S=T.v,_=T.w;C.hasEdge(S,_)||(S=T.w,_=T.v);var A=x.node(S),P=x.node(_),I=A,D=!1;A.lim>P.lim&&(I=P,D=!0);var k=r.filter(C.edges(),function(M){return D===w(x,x.node(M.v),I)&&D!==w(x,x.node(M.w),I)});return r.minBy(k,function(M){return t(C,M)})}function E(x,C,T,S){var _=T.v,A=T.w;x.removeEdge(_,A),x.setEdge(S.v,S.w,{}),d(x),l(x,C),y(x,C)}function y(x,C){var T=r.find(x.nodes(),function(_){return!C.node(_).parent}),S=a(x,T);S=S.slice(1),r.forEach(S,function(_){var A=x.node(_).parent,P=C.edge(_,A),I=!1;P||(P=C.edge(A,_),I=!0),C.node(_).rank=C.node(A).rank+(I?P.minlen:-P.minlen)})}function b(x,C,T){return x.hasEdge(C,T)}function w(x,C,T){return T.low<=C.lim&&C.lim<=T.lim}return My}var ky,d2;function $G(){if(d2)return ky;d2=1;var r=nl(),e=r.longestPath,t=VP(),n=zG();ky=a;function a(l){switch(l.graph().ranker){case"network-simplex":s(l);break;case"tight-tree":o(l);break;case"longest-path":i(l);break;default:s(l)}}var i=e;function o(l){e(l),t(l)}function s(l){n(l)}return ky}var Oy,v2;function VG(){if(v2)return Oy;v2=1;var r=qr();Oy=e;function e(a){var i=n(a);r.forEach(a.graph().dummyChains,function(o){for(var s=a.node(o),l=s.edgeObj,u=t(a,i,l.v,l.w),c=u.path,d=u.lca,h=0,g=c[h],p=!0;o!==l.w;){if(s=a.node(o),p){for(;(g=c[h])!==d&&a.node(g).maxRank<s.rank;)h++;g===d&&(p=!1)}if(!p){for(;h<c.length-1&&a.node(g=c[h+1]).minRank<=s.rank;)h++;g=c[h]}a.setParent(o,g),o=a.successors(o)[0]}})}function t(a,i,o,s){var l=[],u=[],c=Math.min(i[o].low,i[s].low),d=Math.max(i[o].lim,i[s].lim),h,g;h=o;do h=a.parent(h),l.push(h);while(h&&(i[h].low>c||d>i[h].lim));for(g=h,h=s;(h=a.parent(h))!==g;)u.push(h);return{path:l.concat(u.reverse()),lca:g}}function n(a){var i={},o=0;function s(l){var u=o;r.forEach(a.children(l),s),i[l]={low:u,lim:o++}}return r.forEach(a.children(),s),i}return Oy}var Ly,h2;function GG(){if(h2)return Ly;h2=1;var r=qr(),e=$t();Ly={run:t,cleanup:o};function t(s){var l=e.addDummyNode(s,"root",{},"_root"),u=a(s),c=r.max(r.values(u))-1,d=2*c+1;s.graph().nestingRoot=l,r.forEach(s.edges(),function(g){s.edge(g).minlen*=d});var h=i(s)+1;r.forEach(s.children(),function(g){n(s,l,d,h,c,u,g)}),s.graph().nodeRankFactor=d}function n(s,l,u,c,d,h,g){var p=s.children(g);if(!p.length){g!==l&&s.setEdge(l,g,{weight:0,minlen:u});return}var E=e.addBorderNode(s,"_bt"),y=e.addBorderNode(s,"_bb"),b=s.node(g);s.setParent(E,g),b.borderTop=E,s.setParent(y,g),b.borderBottom=y,r.forEach(p,function(w){n(s,l,u,c,d,h,w);var x=s.node(w),C=x.borderTop?x.borderTop:w,T=x.borderBottom?x.borderBottom:w,S=x.borderTop?c:2*c,_=C!==T?1:d-h[g]+1;s.setEdge(E,C,{weight:S,minlen:_,nestingEdge:!0}),s.setEdge(T,y,{weight:S,minlen:_,nestingEdge:!0})}),s.parent(g)||s.setEdge(l,E,{weight:0,minlen:d+h[g]})}function a(s){var l={};function u(c,d){var h=s.children(c);h&&h.length&&r.forEach(h,function(g){u(g,d+1)}),l[c]=d}return r.forEach(s.children(),function(c){u(c,1)}),l}function i(s){return r.reduce(s.edges(),function(l,u){return l+s.edge(u).weight},0)}function o(s){var l=s.graph();s.removeNode(l.nestingRoot),delete l.nestingRoot,r.forEach(s.edges(),function(u){var c=s.edge(u);c.nestingEdge&&s.removeEdge(u)})}return Ly}var qy,g2;function WG(){if(g2)return qy;g2=1;var r=qr(),e=$t();qy=t;function t(a){function i(o){var s=a.children(o),l=a.node(o);if(s.length&&r.forEach(s,i),r.has(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(var u=l.minRank,c=l.maxRank+1;u<c;++u)n(a,"borderLeft","_bl",o,l,u),n(a,"borderRight","_br",o,l,u)}}r.forEach(a.children(),i)}function n(a,i,o,s,l,u){var c={width:0,height:0,rank:u,borderType:i},d=l[i][u-1],h=e.addDummyNode(a,"border",c,o);l[i][u]=h,a.setParent(h,s),d&&a.setEdge(d,h,{weight:1})}return qy}var Ny,p2;function UG(){if(p2)return Ny;p2=1;var r=qr();Ny={adjust:e,undo:t};function e(u){var c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function t(u){var c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(s(u),n(u))}function n(u){r.forEach(u.nodes(),function(c){a(u.node(c))}),r.forEach(u.edges(),function(c){a(u.edge(c))})}function a(u){var c=u.width;u.width=u.height,u.height=c}function i(u){r.forEach(u.nodes(),function(c){o(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,o),r.has(d,"y")&&o(d)})}function o(u){u.y=-u.y}function s(u){r.forEach(u.nodes(),function(c){l(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,l),r.has(d,"x")&&l(d)})}function l(u){var c=u.x;u.x=u.y,u.y=c}return Ny}var Fy,y2;function HG(){if(y2)return Fy;y2=1;var r=qr();Fy=e;function e(t){var n={},a=r.filter(t.nodes(),function(u){return!t.children(u).length}),i=r.max(r.map(a,function(u){return t.node(u).rank})),o=r.map(r.range(i+1),function(){return[]});function s(u){if(!r.has(n,u)){n[u]=!0;var c=t.node(u);o[c.rank].push(u),r.forEach(t.successors(u),s)}}var l=r.sortBy(a,function(u){return t.node(u).rank});return r.forEach(l,s),o}return Fy}var zy,m2;function KG(){if(m2)return zy;m2=1;var r=qr();zy=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=t(n,a[o-1],a[o]);return i}function t(n,a,i){for(var o=r.zipObject(i,r.map(i,function(h,g){return g})),s=r.flatten(r.map(a,function(h){return r.sortBy(r.map(n.outEdges(h),function(g){return{pos:o[g.w],weight:n.edge(g).weight}}),"pos")}),!0),l=1;l<i.length;)l<<=1;var u=2*l-1;l-=1;var c=r.map(new Array(u),function(){return 0}),d=0;return r.forEach(s.forEach(function(h){var g=h.pos+l;c[g]+=h.weight;for(var p=0;g>0;)g%2&&(p+=c[g+1]),g=g-1>>1,c[g]+=h.weight;d+=h.weight*p})),d}return zy}var $y,b2;function jG(){if(b2)return $y;b2=1;var r=qr();$y=e;function e(t,n){return r.map(n,function(a){var i=t.inEdges(a);if(i.length){var o=r.reduce(i,function(s,l){var u=t.edge(l),c=t.node(l.v);return{sum:s.sum+u.weight*c.order,weight:s.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return $y}var Vy,w2;function YG(){if(w2)return Vy;w2=1;var r=qr();Vy=e;function e(a,i){var o={};r.forEach(a,function(l,u){var c=o[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:u};r.isUndefined(l.barycenter)||(c.barycenter=l.barycenter,c.weight=l.weight)}),r.forEach(i.edges(),function(l){var u=o[l.v],c=o[l.w];!r.isUndefined(u)&&!r.isUndefined(c)&&(c.indegree++,u.out.push(o[l.w]))});var s=r.filter(o,function(l){return!l.indegree});return t(s)}function t(a){var i=[];function o(u){return function(c){c.merged||(r.isUndefined(c.barycenter)||r.isUndefined(u.barycenter)||c.barycenter>=u.barycenter)&&n(u,c)}}function s(u){return function(c){c.in.push(u),--c.indegree===0&&a.push(c)}}for(;a.length;){var l=a.pop();i.push(l),r.forEach(l.in.reverse(),o(l)),r.forEach(l.out,s(l))}return r.map(r.filter(i,function(u){return!u.merged}),function(u){return r.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,s=0;a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/s,a.weight=s,a.i=Math.min(i.i,a.i),i.merged=!0}return Vy}var Gy,x2;function ZG(){if(x2)return Gy;x2=1;var r=qr(),e=$t();Gy=t;function t(i,o){var s=e.partition(i,function(E){return r.has(E,"barycenter")}),l=s.lhs,u=r.sortBy(s.rhs,function(E){return-E.i}),c=[],d=0,h=0,g=0;l.sort(a(!!o)),g=n(c,u,g),r.forEach(l,function(E){g+=E.vs.length,c.push(E.vs),d+=E.barycenter*E.weight,h+=E.weight,g=n(c,u,g)});var p={vs:r.flatten(c,!0)};return h&&(p.barycenter=d/h,p.weight=h),p}function n(i,o,s){for(var l;o.length&&(l=r.last(o)).i<=s;)o.pop(),i.push(l.vs),s++;return s}function a(i){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}}return Gy}var Wy,E2;function XG(){if(E2)return Wy;E2=1;var r=qr(),e=jG(),t=YG(),n=ZG();Wy=a;function a(s,l,u,c){var d=s.children(l),h=s.node(l),g=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,E={};g&&(d=r.filter(d,function(T){return T!==g&&T!==p}));var y=e(s,d);r.forEach(y,function(T){if(s.children(T.v).length){var S=a(s,T.v,u,c);E[T.v]=S,r.has(S,"barycenter")&&o(T,S)}});var b=t(y,u);i(b,E);var w=n(b,c);if(g&&(w.vs=r.flatten([g,w.vs,p],!0),s.predecessors(g).length)){var x=s.node(s.predecessors(g)[0]),C=s.node(s.predecessors(p)[0]);r.has(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+x.order+C.order)/(w.weight+2),w.weight+=2}return w}function i(s,l){r.forEach(s,function(u){u.vs=r.flatten(u.vs.map(function(c){return l[c]?l[c].vs:c}),!0)})}function o(s,l){r.isUndefined(s.barycenter)?(s.barycenter=l.barycenter,s.weight=l.weight):(s.barycenter=(s.barycenter*s.weight+l.barycenter*l.weight)/(s.weight+l.weight),s.weight+=l.weight)}return Wy}var Uy,C2;function QG(){if(C2)return Uy;C2=1;var r=qr(),e=xn().Graph;Uy=t;function t(a,i,o){var s=n(a),l=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(u){return a.node(u)});return r.forEach(a.nodes(),function(u){var c=a.node(u),d=a.parent(u);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(l.setNode(u),l.setParent(u,d||s),r.forEach(a[o](u),function(h){var g=h.v===u?h.w:h.v,p=l.edge(g,u),E=r.isUndefined(p)?0:p.weight;l.setEdge(g,u,{weight:a.edge(h).weight+E})}),r.has(c,"minRank")&&l.setNode(u,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),l}function n(a){for(var i;a.hasNode(i=r.uniqueId("_root")););return i}return Uy}var Hy,_2;function JG(){if(_2)return Hy;_2=1;var r=qr();Hy=e;function e(t,n,a){var i={},o;r.forEach(a,function(s){for(var l=t.parent(s),u,c;l;){if(u=t.parent(l),u?(c=i[u],i[u]=l):(c=o,o=l),c&&c!==l){n.setEdge(c,l);return}l=u}})}return Hy}var Ky,S2;function eW(){if(S2)return Ky;S2=1;var r=qr(),e=HG(),t=KG(),n=XG(),a=QG(),i=JG(),o=xn().Graph,s=$t();Ky=l;function l(h){var g=s.maxRank(h),p=u(h,r.range(1,g+1),"inEdges"),E=u(h,r.range(g-1,-1,-1),"outEdges"),y=e(h);d(h,y);for(var b=Number.POSITIVE_INFINITY,w,x=0,C=0;C<4;++x,++C){c(x%2?p:E,x%4>=2),y=s.buildLayerMatrix(h);var T=t(h,y);T<b&&(C=0,w=r.cloneDeep(y),b=T)}d(h,w)}function u(h,g,p){return r.map(g,function(E){return a(h,E,p)})}function c(h,g){var p=new o;r.forEach(h,function(E){var y=E.graph().root,b=n(E,y,p,g);r.forEach(b.vs,function(w,x){E.node(w).order=x}),i(E,p,b.vs)})}function d(h,g){r.forEach(g,function(p){r.forEach(p,function(E,y){h.node(E).order=y})})}return Ky}var jy,T2;function rW(){if(T2)return jy;T2=1;var r=qr(),e=xn().Graph,t=$t();jy={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:s,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:d,balance:g};function n(b,w){var x={};function C(T,S){var _=0,A=0,P=T.length,I=r.last(S);return r.forEach(S,function(D,k){var M=i(b,D),N=M?b.node(M).order:P;(M||D===I)&&(r.forEach(S.slice(A,k+1),function(z){r.forEach(b.predecessors(z),function($){var q=b.node($),V=q.order;(V<_||N<V)&&!(q.dummy&&b.node(z).dummy)&&o(x,$,z)})}),A=k+1,_=N)}),S}return r.reduce(w,C),x}function a(b,w){var x={};function C(S,_,A,P,I){var D;r.forEach(r.range(_,A),function(k){D=S[k],b.node(D).dummy&&r.forEach(b.predecessors(D),function(M){var N=b.node(M);N.dummy&&(N.order<P||N.order>I)&&o(x,M,D)})})}function T(S,_){var A=-1,P,I=0;return r.forEach(_,function(D,k){if(b.node(D).dummy==="border"){var M=b.predecessors(D);M.length&&(P=b.node(M[0]).order,C(_,I,k,A,P),I=k,A=P)}C(_,I,_.length,P,S.length)}),_}return r.reduce(w,T),x}function i(b,w){if(b.node(w).dummy)return r.find(b.predecessors(w),function(x){return b.node(x).dummy})}function o(b,w,x){if(w>x){var C=w;w=x,x=C}var T=b[w];T||(b[w]=T={}),T[x]=!0}function s(b,w,x){if(w>x){var C=w;w=x,x=C}return r.has(b[w],x)}function l(b,w,x,C){var T={},S={},_={};return r.forEach(w,function(A){r.forEach(A,function(P,I){T[P]=P,S[P]=P,_[P]=I})}),r.forEach(w,function(A){var P=-1;r.forEach(A,function(I){var D=C(I);if(D.length){D=r.sortBy(D,function($){return _[$]});for(var k=(D.length-1)/2,M=Math.floor(k),N=Math.ceil(k);M<=N;++M){var z=D[M];S[I]===I&&P<_[z]&&!s(x,I,z)&&(S[z]=I,S[I]=T[I]=T[z],P=_[z])}}})}),{root:T,align:S}}function u(b,w,x,C,T){var S={},_=c(b,w,x,T),A=T?"borderLeft":"borderRight";function P(k,M){for(var N=_.nodes(),z=N.pop(),$={};z;)$[z]?k(z):($[z]=!0,N.push(z),N=N.concat(M(z))),z=N.pop()}function I(k){S[k]=_.inEdges(k).reduce(function(M,N){return Math.max(M,S[N.v]+_.edge(N))},0)}function D(k){var M=_.outEdges(k).reduce(function(z,$){return Math.min(z,S[$.w]-_.edge($))},Number.POSITIVE_INFINITY),N=b.node(k);M!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(S[k]=Math.max(S[k],M))}return P(I,_.predecessors.bind(_)),P(D,_.successors.bind(_)),r.forEach(C,function(k){S[k]=S[x[k]]}),S}function c(b,w,x,C){var T=new e,S=b.graph(),_=E(S.nodesep,S.edgesep,C);return r.forEach(w,function(A){var P;r.forEach(A,function(I){var D=x[I];if(T.setNode(D),P){var k=x[P],M=T.edge(k,D);T.setEdge(k,D,Math.max(_(b,I,P),M||0))}P=I})}),T}function d(b,w){return r.minBy(r.values(w),function(x){var C=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return r.forIn(x,function(S,_){var A=y(b,_)/2;C=Math.max(S+A,C),T=Math.min(S-A,T)}),C-T})}function h(b,w){var x=r.values(w),C=r.min(x),T=r.max(x);r.forEach(["u","d"],function(S){r.forEach(["l","r"],function(_){var A=S+_,P=b[A],I;if(P!==w){var D=r.values(P);I=_==="l"?C-r.min(D):T-r.max(D),I&&(b[A]=r.mapValues(P,function(k){return k+I}))}})})}function g(b,w){return r.mapValues(b.ul,function(x,C){if(w)return b[w.toLowerCase()][C];var T=r.sortBy(r.map(b,C));return(T[1]+T[2])/2})}function p(b){var w=t.buildLayerMatrix(b),x=r.merge(n(b,w),a(b,w)),C={},T;r.forEach(["u","d"],function(_){T=_==="u"?w:r.values(w).reverse(),r.forEach(["l","r"],function(A){A==="r"&&(T=r.map(T,function(k){return r.values(k).reverse()}));var P=(_==="u"?b.predecessors:b.successors).bind(b),I=l(b,T,x,P),D=u(b,T,I.root,I.align,A==="r");A==="r"&&(D=r.mapValues(D,function(k){return-k})),C[_+A]=D})});var S=d(b,C);return h(C,S),g(C,b.graph().align)}function E(b,w,x){return function(C,T,S){var _=C.node(T),A=C.node(S),P=0,I;if(P+=_.width/2,r.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":I=-_.width/2;break;case"r":I=_.width/2;break}if(I&&(P+=x?I:-I),I=0,P+=(_.dummy?w:b)/2,P+=(A.dummy?w:b)/2,P+=A.width/2,r.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(P+=x?I:-I),I=0,P}}function y(b,w){return b.node(w).width}return jy}var Yy,R2;function tW(){if(R2)return Yy;R2=1;var r=qr(),e=$t(),t=rW().positionX;Yy=n;function n(i){i=e.asNonCompoundGraph(i),a(i),r.forEach(t(i),function(o,s){i.node(s).x=o})}function a(i){var o=e.buildLayerMatrix(i),s=i.graph().ranksep,l=0;r.forEach(o,function(u){var c=r.max(r.map(u,function(d){return i.node(d).height}));r.forEach(u,function(d){i.node(d).y=l+c/2}),l+=c+s})}return Yy}var Zy,A2;function nW(){if(A2)return Zy;A2=1;var r=qr(),e=NG(),t=FG(),n=$G(),a=$t().normalizeRanks,i=VG(),o=$t().removeEmptyRanks,s=GG(),l=WG(),u=UG(),c=eW(),d=tW(),h=$t(),g=xn().Graph;Zy=p;function p(W,G){var Y=G&&G.debugTiming?h.time:h.notime;Y("layout",function(){var re=Y(" buildLayoutGraph",function(){return P(W)});Y(" runLayout",function(){E(re,Y)}),Y(" updateInputGraph",function(){y(W,re)})})}function E(W,G){G(" makeSpaceForEdgeLabels",function(){I(W)}),G(" removeSelfEdges",function(){Z(W)}),G(" acyclic",function(){e.run(W)}),G(" nestingGraph.run",function(){s.run(W)}),G(" rank",function(){n(h.asNonCompoundGraph(W))}),G(" injectEdgeLabelProxies",function(){D(W)}),G(" removeEmptyRanks",function(){o(W)}),G(" nestingGraph.cleanup",function(){s.cleanup(W)}),G(" normalizeRanks",function(){a(W)}),G(" assignRankMinMax",function(){k(W)}),G(" removeEdgeLabelProxies",function(){M(W)}),G(" normalize.run",function(){t.run(W)}),G(" parentDummyChains",function(){i(W)}),G(" addBorderSegments",function(){l(W)}),G(" order",function(){c(W)}),G(" insertSelfEdges",function(){K(W)}),G(" adjustCoordinateSystem",function(){u.adjust(W)}),G(" position",function(){d(W)}),G(" positionSelfEdges",function(){j(W)}),G(" removeBorderNodes",function(){V(W)}),G(" normalize.undo",function(){t.undo(W)}),G(" fixupEdgeLabelCoords",function(){$(W)}),G(" undoCoordinateSystem",function(){u.undo(W)}),G(" translateGraph",function(){N(W)}),G(" assignNodeIntersects",function(){z(W)}),G(" reversePoints",function(){q(W)}),G(" acyclic.undo",function(){e.undo(W)})}function y(W,G){r.forEach(W.nodes(),function(Y){var re=W.node(Y),de=G.node(Y);re&&(re.x=de.x,re.y=de.y,G.children(Y).length&&(re.width=de.width,re.height=de.height))}),r.forEach(W.edges(),function(Y){var re=W.edge(Y),de=G.edge(Y);re.points=de.points,r.has(de,"x")&&(re.x=de.x,re.y=de.y)}),W.graph().width=G.graph().width,W.graph().height=G.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],C=["width","height"],T={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function P(W){var G=new g({multigraph:!0,compound:!0}),Y=le(W.graph());return G.setGraph(r.merge({},w,ee(Y,b),r.pick(Y,x))),r.forEach(W.nodes(),function(re){var de=le(W.node(re));G.setNode(re,r.defaults(ee(de,C),T)),G.setParent(re,W.parent(re))}),r.forEach(W.edges(),function(re){var de=le(W.edge(re));G.setEdge(re,r.merge({},_,ee(de,S),r.pick(de,A)))}),G}function I(W){var G=W.graph();G.ranksep/=2,r.forEach(W.edges(),function(Y){var re=W.edge(Y);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function D(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);if(Y.width&&Y.height){var re=W.node(G.v),de=W.node(G.w),se={rank:(de.rank-re.rank)/2+re.rank,e:G};h.addDummyNode(W,"edge-proxy",se,"_ep")}})}function k(W){var G=0;r.forEach(W.nodes(),function(Y){var re=W.node(Y);re.borderTop&&(re.minRank=W.node(re.borderTop).rank,re.maxRank=W.node(re.borderBottom).rank,G=r.max(G,re.maxRank))}),W.graph().maxRank=G}function M(W){r.forEach(W.nodes(),function(G){var Y=W.node(G);Y.dummy==="edge-proxy"&&(W.edge(Y.e).labelRank=Y.rank,W.removeNode(G))})}function N(W){var G=Number.POSITIVE_INFINITY,Y=0,re=Number.POSITIVE_INFINITY,de=0,se=W.graph(),X=se.marginx||0,Q=se.marginy||0;function ae(te){var ce=te.x,_e=te.y,ve=te.width,U=te.height;G=Math.min(G,ce-ve/2),Y=Math.max(Y,ce+ve/2),re=Math.min(re,_e-U/2),de=Math.max(de,_e+U/2)}r.forEach(W.nodes(),function(te){ae(W.node(te))}),r.forEach(W.edges(),function(te){var ce=W.edge(te);r.has(ce,"x")&&ae(ce)}),G-=X,re-=Q,r.forEach(W.nodes(),function(te){var ce=W.node(te);ce.x-=G,ce.y-=re}),r.forEach(W.edges(),function(te){var ce=W.edge(te);r.forEach(ce.points,function(_e){_e.x-=G,_e.y-=re}),r.has(ce,"x")&&(ce.x-=G),r.has(ce,"y")&&(ce.y-=re)}),se.width=Y-G+X,se.height=de-re+Q}function z(W){r.forEach(W.edges(),function(G){var Y=W.edge(G),re=W.node(G.v),de=W.node(G.w),se,X;Y.points?(se=Y.points[0],X=Y.points[Y.points.length-1]):(Y.points=[],se=de,X=re),Y.points.unshift(h.intersectRect(re,se)),Y.points.push(h.intersectRect(de,X))})}function $(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);if(r.has(Y,"x"))switch((Y.labelpos==="l"||Y.labelpos==="r")&&(Y.width-=Y.labeloffset),Y.labelpos){case"l":Y.x-=Y.width/2+Y.labeloffset;break;case"r":Y.x+=Y.width/2+Y.labeloffset;break}})}function q(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);Y.reversed&&Y.points.reverse()})}function V(W){r.forEach(W.nodes(),function(G){if(W.children(G).length){var Y=W.node(G),re=W.node(Y.borderTop),de=W.node(Y.borderBottom),se=W.node(r.last(Y.borderLeft)),X=W.node(r.last(Y.borderRight));Y.width=Math.abs(X.x-se.x),Y.height=Math.abs(de.y-re.y),Y.x=se.x+Y.width/2,Y.y=re.y+Y.height/2}}),r.forEach(W.nodes(),function(G){W.node(G).dummy==="border"&&W.removeNode(G)})}function Z(W){r.forEach(W.edges(),function(G){if(G.v===G.w){var Y=W.node(G.v);Y.selfEdges||(Y.selfEdges=[]),Y.selfEdges.push({e:G,label:W.edge(G)}),W.removeEdge(G)}})}function K(W){var G=h.buildLayerMatrix(W);r.forEach(G,function(Y){var re=0;r.forEach(Y,function(de,se){var X=W.node(de);X.order=se+re,r.forEach(X.selfEdges,function(Q){h.addDummyNode(W,"selfedge",{width:Q.label.width,height:Q.label.height,rank:X.rank,order:se+ ++re,e:Q.e,label:Q.label},"_se")}),delete X.selfEdges})})}function j(W){r.forEach(W.nodes(),function(G){var Y=W.node(G);if(Y.dummy==="selfedge"){var re=W.node(Y.e.v),de=re.x+re.width/2,se=re.y,X=Y.x-de,Q=re.height/2;W.setEdge(Y.e,Y.label),W.removeNode(G),Y.label.points=[{x:de+2*X/3,y:se-Q},{x:de+5*X/6,y:se-Q},{x:de+X,y:se},{x:de+5*X/6,y:se+Q},{x:de+2*X/3,y:se+Q}],Y.label.x=Y.x,Y.label.y=Y.y}})}function ee(W,G){return r.mapValues(r.pick(W,G),Number)}function le(W){var G={};return r.forEach(W,function(Y,re){G[re.toLowerCase()]=Y}),G}return Zy}var Xy,P2;function aW(){if(P2)return Xy;P2=1;var r=qr(),e=$t(),t=xn().Graph;Xy={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(a.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+a.node(s).rank)}),r.forEach(a.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),r.forEach(i,function(s,l){var u="layer"+l;o.setNode(u,{rank:"same"}),r.reduce(s,function(c,d){return o.setEdge(c,d,{style:"invis"}),d})}),o}return Xy}var Qy,I2;function iW(){return I2||(I2=1,Qy="0.8.5"),Qy}var Jy,D2;function oW(){return D2||(D2=1,Jy={graphlib:xn(),layout:nW(),debug:aW(),util:{time:$t().time,notime:$t().notime},version:iW()}),Jy}var sW=zu.exports,B2;function uW(){return B2||(B2=1,(function(r,e){(function(n,a){r.exports=a(oW())})(sW,function(t){return(function(n){var a={};function i(o){if(a[o])return a[o].exports;var s=a[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=n,i.c=a,i.d=function(o,s,l){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:l})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var u in o)i.d(l,u,(function(c){return o[c]}).bind(null,u));return l},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=0)})([(function(n,a,i){var o=i(1),s=function(u){u&&u("layout","dagre",o)};typeof cytoscape<"u"&&s(cytoscape),n.exports=s}),(function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var s=function(g){return typeof g=="function"},l=i(2),u=i(3),c=i(4);function d(h){this.options=u({},l,h)}d.prototype.run=function(){var h=this.options,g=this,p=h.cy,E=h.eles,y=function(j,ee){return s(ee)?ee.apply(j,[j]):ee},b=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};b.x2===void 0&&(b.x2=b.x1+b.w),b.w===void 0&&(b.w=b.x2-b.x1),b.y2===void 0&&(b.y2=b.y1+b.h),b.h===void 0&&(b.h=b.y2-b.y1);var w=new c.graphlib.Graph({multigraph:!0,compound:!0}),x={},C=function(j,ee){ee!=null&&(x[j]=ee)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),w.setGraph(x),w.setDefaultEdgeLabel(function(){return{}}),w.setDefaultNodeLabel(function(){return{}});var T=E.nodes();s(h.sort)&&(T=T.sort(h.sort));for(var S=0;S<T.length;S++){var _=T[S],A=_.layoutDimensions(h);w.setNode(_.id(),{width:A.w,height:A.h,name:_.id()})}for(var P=0;P<T.length;P++){var I=T[P];I.isChild()&&w.setParent(I.id(),I.parent().id())}var D=E.edges().stdFilter(function(K){return!K.source().isParent()&&!K.target().isParent()});s(h.sort)&&(D=D.sort(h.sort));for(var k=0;k<D.length;k++){var M=D[k];w.setEdge(M.source().id(),M.target().id(),{minlen:y(M,h.minLen),weight:y(M,h.edgeWeight),name:M.id()},M.id())}c.layout(w);for(var N=w.nodes(),z=0;z<N.length;z++){var $=N[z],q=w.node($);p.getElementById($).scratch().dagre=q}var V;h.boundingBox?(V={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},T.forEach(function(K){var j=K.scratch().dagre;V.x1=Math.min(V.x1,j.x),V.x2=Math.max(V.x2,j.x),V.y1=Math.min(V.y1,j.y),V.y2=Math.max(V.y2,j.y)}),V.w=V.x2-V.x1,V.h=V.y2-V.y1):V=b;var Z=function(j){if(h.boundingBox){var ee=V.w===0?0:(j.x-V.x1)/V.w,le=V.h===0?0:(j.y-V.y1)/V.h;return{x:b.x1+ee*b.w,y:b.y1+le*b.h}}else return j};return T.layoutPositions(g,h,function(K){K=o(K)==="object"?K:this;var j=K.scratch().dagre;return Z({x:j.x,y:j.y})}),this},n.exports=d}),(function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(s){return 1},edgeWeight:function(s){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(s,l){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(s,l){return l},ready:function(){},sort:void 0,stop:function(){}};n.exports=i}),(function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return s.forEach(function(u){Object.keys(u).forEach(function(c){return i[c]=u[c]})}),i}}),(function(n,a){n.exports=t})])})})(zu)),zu.exports}var lW=uW();const fW=Cl(lW);var $u={exports:{}},em,M2;function cW(){if(M2)return em;M2=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof Et=="object"&&Et&&Et.Object===Object&&Et,s=typeof self=="object"&&self&&self.Object===Object&&self,l=o||s||Function("return this")();function u(ve,U){return ve==null?void 0:ve[U]}function c(ve){var U=!1;if(ve!=null&&typeof ve.toString!="function")try{U=!!(ve+"")}catch{}return U}var d=Array.prototype,h=Function.prototype,g=Object.prototype,p=l["__core-js_shared__"],E=(function(){var ve=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return ve?"Symbol(src)_1."+ve:""})(),y=h.toString,b=g.hasOwnProperty,w=g.toString,x=RegExp("^"+y.call(b).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=d.splice,T=de(l,"Map"),S=de(Object,"create");function _(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function A(){this.__data__=S?S(null):{}}function P(ve){return this.has(ve)&&delete this.__data__[ve]}function I(ve){var U=this.__data__;if(S){var fe=U[ve];return fe===e?void 0:fe}return b.call(U,ve)?U[ve]:void 0}function D(ve){var U=this.__data__;return S?U[ve]!==void 0:b.call(U,ve)}function k(ve,U){var fe=this.__data__;return fe[ve]=S&&U===void 0?e:U,this}_.prototype.clear=A,_.prototype.delete=P,_.prototype.get=I,_.prototype.has=D,_.prototype.set=k;function M(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function N(){this.__data__=[]}function z(ve){var U=this.__data__,fe=G(U,ve);if(fe<0)return!1;var xe=U.length-1;return fe==xe?U.pop():C.call(U,fe,1),!0}function $(ve){var U=this.__data__,fe=G(U,ve);return fe<0?void 0:U[fe][1]}function q(ve){return G(this.__data__,ve)>-1}function V(ve,U){var fe=this.__data__,xe=G(fe,ve);return xe<0?fe.push([ve,U]):fe[xe][1]=U,this}M.prototype.clear=N,M.prototype.delete=z,M.prototype.get=$,M.prototype.has=q,M.prototype.set=V;function Z(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function K(){this.__data__={hash:new _,map:new(T||M),string:new _}}function j(ve){return re(this,ve).delete(ve)}function ee(ve){return re(this,ve).get(ve)}function le(ve){return re(this,ve).has(ve)}function W(ve,U){return re(this,ve).set(ve,U),this}Z.prototype.clear=K,Z.prototype.delete=j,Z.prototype.get=ee,Z.prototype.has=le,Z.prototype.set=W;function G(ve,U){for(var fe=ve.length;fe--;)if(te(ve[fe][0],U))return fe;return-1}function Y(ve){if(!_e(ve)||X(ve))return!1;var U=ce(ve)||c(ve)?x:i;return U.test(Q(ve))}function re(ve,U){var fe=ve.__data__;return se(U)?fe[typeof U=="string"?"string":"hash"]:fe.map}function de(ve,U){var fe=u(ve,U);return Y(fe)?fe:void 0}function se(ve){var U=typeof ve;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?ve!=="__proto__":ve===null}function X(ve){return!!E&&E in ve}function Q(ve){if(ve!=null){try{return y.call(ve)}catch{}try{return ve+""}catch{}}return""}function ae(ve,U){if(typeof ve!="function"||U&&typeof U!="function")throw new TypeError(r);var fe=function(){var xe=arguments,ge=U?U.apply(this,xe):xe[0],be=fe.cache;if(be.has(ge))return be.get(ge);var Ae=ve.apply(this,xe);return fe.cache=be.set(ge,Ae),Ae};return fe.cache=new(ae.Cache||Z),fe}ae.Cache=Z;function te(ve,U){return ve===U||ve!==ve&&U!==U}function ce(ve){var U=_e(ve)?w.call(ve):"";return U==t||U==n}function _e(ve){var U=typeof ve;return!!ve&&(U=="object"||U=="function")}return em=ae,em}var rm,k2;function dW(){if(k2)return rm;k2=1;var r="Expected a function",e=NaN,t="[object Symbol]",n=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,l=typeof Et=="object"&&Et&&Et.Object===Object&&Et,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),d=Object.prototype,h=d.toString,g=Math.max,p=Math.min,E=function(){return c.Date.now()};function y(S,_,A){var P,I,D,k,M,N,z=0,$=!1,q=!1,V=!0;if(typeof S!="function")throw new TypeError(r);_=T(_)||0,w(A)&&($=!!A.leading,q="maxWait"in A,D=q?g(T(A.maxWait)||0,_):D,V="trailing"in A?!!A.trailing:V);function Z(de){var se=P,X=I;return P=I=void 0,z=de,k=S.apply(X,se),k}function K(de){return z=de,M=setTimeout(le,_),$?Z(de):k}function j(de){var se=de-N,X=de-z,Q=_-se;return q?p(Q,D-X):Q}function ee(de){var se=de-N,X=de-z;return N===void 0||se>=_||se<0||q&&X>=D}function le(){var de=E();if(ee(de))return W(de);M=setTimeout(le,j(de))}function W(de){return M=void 0,V&&P?Z(de):(P=I=void 0,k)}function G(){M!==void 0&&clearTimeout(M),z=0,P=N=I=M=void 0}function Y(){return M===void 0?k:W(E())}function re(){var de=E(),se=ee(de);if(P=arguments,I=this,N=de,se){if(M===void 0)return K(N);if(q)return M=setTimeout(le,_),Z(N)}return M===void 0&&(M=setTimeout(le,_)),k}return re.cancel=G,re.flush=Y,re}function b(S,_,A){var P=!0,I=!0;if(typeof S!="function")throw new TypeError(r);return w(A)&&(P="leading"in A?!!A.leading:P,I="trailing"in A?!!A.trailing:I),y(S,_,{leading:P,maxWait:_,trailing:I})}function w(S){var _=typeof S;return!!S&&(_=="object"||_=="function")}function x(S){return!!S&&typeof S=="object"}function C(S){return typeof S=="symbol"||x(S)&&h.call(S)==t}function T(S){if(typeof S=="number")return S;if(C(S))return e;if(w(S)){var _=typeof S.valueOf=="function"?S.valueOf():S;S=w(_)?_+"":_}if(typeof S!="string")return S===0?S:+S;S=S.replace(n,"");var A=i.test(S);return A||o.test(S)?s(S.slice(2),A?2:8):a.test(S)?e:+S}return rm=b,rm}var vW=$u.exports,O2;function hW(){return O2||(O2=1,(function(r,e){(function(n,a){r.exports=a(cW(),dW())})(vW,function(t,n){return(function(a){var i={};function o(s){if(i[s])return i[s].exports;var l=i[s]={i:s,l:!1,exports:{}};return a[s].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=a,o.c=i,o.i=function(s){return s},o.d=function(s,l,u){o.o(s,l)||Object.defineProperty(s,l,{configurable:!1,enumerable:!0,get:u})},o.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(l,"a",l),l},o.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},o.p="",o(o.s=12)})([(function(a,i,o){a.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var l=arguments.length,u=Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];return u.filter(function(d){return d!=null}).forEach(function(d){Object.keys(d).forEach(function(h){return s[h]=d[h]})}),s}}),(function(a,i,o){var s=o(10),l=o(0);a.exports=function(u){var c=this;return new s(l({cy:c},u))}}),(function(a,i,o){function s(){if(this.saveGestureState(),this.cy.zoomingEnabled(!1).panningEnabled(!1).boxSelectionEnabled(!1),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.addEventListener("touchstart",this.preventDefault,c),window.addEventListener("touchmove",this.preventDefault,c),window.addEventListener("wheel",this.preventDefault,c)}return this}function l(){if(this.cy.zoomingEnabled(this.lastZoomingEnabled).panningEnabled(this.lastPanningEnabled).boxSelectionEnabled(this.lastBoxSelectionEnabled),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.removeEventListener("touchstart",this.preventDefault,c),window.removeEventListener("touchmove",this.preventDefault,c),window.removeEventListener("wheel",this.preventDefault,c)}return this}function u(){var c=this.cy;return this.lastPanningEnabled=c.panningEnabled(),this.lastZoomingEnabled=c.zoomingEnabled(),this.lastBoxSelectionEnabled=c.boxSelectionEnabled(),this}a.exports={disableGestures:s,resetGestures:l,saveGestureState:u}}),(function(a,i,o){function s(){var l=this,u=this.cy,c=this.options;return this.addListener(u,"drag",function(){return l.grabbingNode=!0}),this.addListener(u,"free",function(){return l.grabbingNode=!1}),this.addListener(u,"tapstart","node",function(d){var h=d.target;l.drawMode&&l.start(h)}),this.addListener(u,"tapdrag",function(d){l.update(d.position)}),this.addListener(u,"tapdragover","node",function(d){c.snap||l.preview(d.target)}),this.addListener(u,"tapdragout","node",function(d){c.snap||l.unpreview(d.target)}),this.addListener(u,"tapend",function(){l.stop()}),this}a.exports={addCytoscapeListeners:s}}),(function(a,i,o){var s={canConnect:function(u,c){return!u.same(c)},edgeParams:function(u,c){return{}},hoverDelay:150,snap:!0,snapThreshold:50,snapFrequency:15,noEdgeEventsInDraw:!0,disableBrowserGestures:!0};a.exports=s}),(function(a,i,o){function s(c){var d=this.cy;return this.drawMode=c??!this.drawMode,this.drawMode?(this.prevUngrabifyState=d.autoungrabify(),d.autoungrabify(!0),this.emit("drawon")):(d.autoungrabify(this.prevUngrabifyState),this.emit("drawoff")),this}function l(){return this.toggleDrawMode(!0)}function u(){return this.toggleDrawMode(!1)}a.exports={toggleDrawMode:s,enableDrawMode:l,disableDrawMode:u}}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},l=o(0),u=function(w){return(typeof w>"u"?"undefined":s(w))===s("")},c=function(w){return(typeof w>"u"?"undefined":s(w))===s([])&&w.length!=null};function d(b,w,x){var C={};return l(C,w,b),l(C.data,w.data,b.data),u(w.classes)?C.classes=w.classes+" "+x:c(w.classes)?C.classes=w.classes.join(" ")+" "+x:C.classes=x,C}function h(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=this.cy;this.options;var x=this.presumptiveTargets,C=this.previewEles,T=this.active,S=this.sourceNode,_=this.targetNode,A=b?"eh-preview":"",P=w.collection(),I=this.canConnect(_);if(T&&I){if(!_||_.size()===0){C.remove(),this.emit("cancel",this.mp(),S,x);return}if(!b){C.removeClass("eh-preview").style("events",""),this.emit("complete",this.mp(),S,_,C);return}var D=w.add(d({group:"edges",data:{source:S.id(),target:_.id()}},this.edgeParams(_),A));return P=P.merge(D),b?(this.previewEles=P,P.style("events","no")):(P.style("events",""),this.emit("complete",this.mp(),S,_,P)),this}}function g(){return this.makeEdges(!0),this}function p(){return this.previewEles.nonempty()&&this.previewEles.inside()}function E(){return this.previewShown()&&this.previewEles.remove(),this}function y(){var b=this,w=this.sourceNode,x=this.ghostNode,C=this.cy,T=this.mx,S=this.my,_=T,A=S,P=void 0,I=void 0;if(w)return(!x||x.length===0||x.removed())&&(I=this.ghostEles=C.collection(),C.batch(function(){x=b.ghostNode=C.add({group:"nodes",classes:"eh-ghost eh-ghost-node",position:{x:0,y:0}}),x.style({"background-color":"blue",width:1e-4,height:1e-4,opacity:0,events:"no"});var D={};P=C.add(l({},D,{group:"edges",data:l({},D.data,{source:w.id(),target:x.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),I.merge(x).merge(P)),x.position({x:_,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:E,previewShown:p,updateEdge:y}}),(function(a,i,o){function s(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events","no"),this}function l(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events",""),this}a.exports={disableEdgeEvents:s,enableEdgeEvents:l}}),(function(a,i,o){function s(){return this.enabled=!0,this.emit("enable"),this}function l(){return this.enabled=!1,this.emit("disable"),this}a.exports={enable:s,disable:l}}),(function(a,i,o){var s=o(13),l=Math.sqrt(2);function u(w){var x=this.previewEles,C=this.ghostEles,T=function(k){return x.anySame(k)},S=function(k){return C.anySame(k)},_=function(k){return T(k)||S(k)},A=this.enabled,P=this.active,I=this.grabbingNode;return A&&!P&&!I&&w!=null&&w.nonempty()&&!_(w)}function c(w){return this.canStartOn(w)&&this.drawMode}function d(w){return this.canStartOn(w)&&!this.drawMode}function h(w){var x=this;if(this.canStartOn(w)){this.active=!0,this.sourceNode=w,this.sourceNode.addClass("eh-source"),this.disableGestures(),this.disableEdgeEvents();var C=function(S){return S.id()};this.canConnect=s(function(T){return x.options.canConnect(x.sourceNode,T)},C),this.edgeParams=s(function(T){return x.options.edgeParams(x.sourceNode,T)},C),this.emit("start",this.hp(),w)}}function g(w){if(this.active){var x=w;return this.mx=x.x,this.my=x.y,this.updateEdge(),this.throttledSnap(),this}}function p(){if(!this.active||!this.options.snap)return!1;var w=this.cy,x=this.targetNode,C=this.options.snapThreshold,T=this.mp(),S=this.previewEles,_=this.ghostNode,A=function(G){return l*Math.max(G.outerWidth(),G.outerHeight())/2},P=function(G,Y,re,de){var se=re-G,X=de-Y;return se*se+X*X},I=function(G,Y){return P(G.x,G.y,Y.x,Y.y)},D=function(G){return I(G.position(),T)},k=function(G){var Y=A(G),re=Y+C;return re*re},M=function(G){return D(G)<=k(G)},N=function(G){var Y=G.position(),re=G.outerWidth()/2,de=G.outerHeight()/2,se=Y.x,X=Y.y,Q=T.x,ae=T.y,te=se-re,ce=se+re,_e=X-de,ve=X+de,U=te<=Q&&Q<=ce,fe=_e<=ae&&ae<=ve;if(U&&fe)return 0;if(U){var xe=ae-_e,ge=ae-ve;return Math.min(xe*xe,ge*ge)}else if(fe){var be=Q-te,Ae=Q-ce;return Math.min(be*be,Ae*Ae)}else return Q<te&&ae<_e?P(Q,ae,te,_e):Q>ce&&ae<_e?P(Q,ae,ce,_e):Q<te&&ae>ve?P(Q,ae,te,ve):P(Q,ae,ce,ve)},z=function(G,Y){return N(G)-N(Y)},$=z,q=!1,V=function(G){var Y=T,re=G.outerWidth(),de=re/2,se=G.outerHeight(),X=se/2,Q=G.position(),ae=Q.x-de,te=Q.x+de,ce=Q.y-X,_e=Q.y+X;return ae<=Y.x&&Y.x<=te&&ce<=Y.y&&Y.y<=_e},Z=function(G){return G.same(S)||G.same(_)},K=w.nodes(function(W){return!Z(W)&&M(W)}).sort($),j=!1;x.nonempty()&&!M(x)&&this.unpreview(x);for(var ee=0;ee<K.length;ee++){var le=K[ee];if(!(le.isParent()&&V(le))&&!(le.isChild()&&!V(le.parent()))&&(le.same(x)||this.preview(le,q))){j=!0;break}}return j}function E(w){var x=this,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,T=this.options,S=this.sourceNode,_=this.ghostNode,A=this.ghostEles,P=this.presumptiveTargets,I=this.previewEles,D=this.active,k=S,M=w.same(_),N=!this.canConnect(w),z=w.same(this.targetNode);if(!D||M||N||z)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var $=function(){x.targetNode=w,P.merge(w),w.addClass("eh-presumptive-target"),w.addClass("eh-target"),x.emit("hoverover",x.mp(),k,w),w.addClass("eh-preview"),A.addClass("eh-preview-active"),S.addClass("eh-preview-active"),w.addClass("eh-preview-active"),x.makePreview(),x.emit("previewon",x.mp(),k,w,I)};return C&&T.hoverDelay>0?this.previewTimeout=setTimeout($,T.hoverDelay):$(),!0}function y(w){if(this.active){var x=this.previewTimeout,C=this.sourceNode,T=this.previewEles,S=this.ghostEles,_=this.cy;clearTimeout(x),this.previewTimeout=null;var A=C;return w.removeClass("eh-preview eh-target eh-presumptive-target eh-preview-active"),S.removeClass("eh-preview-active"),C.removeClass("eh-preview-active"),this.targetNode=_.collection(),this.removePreview(A,w),this.emit("hoverout",this.mp(),A,w),this.emit("previewoff",this.mp(),A,w,T),this}}function b(){if(this.active){var w=this.sourceNode,x=this.targetNode,C=this.ghostEles,T=this.presumptiveTargets;return clearTimeout(this.previewTimeout),w.removeClass("eh-source eh-preview-active"),x.removeClass("eh-target eh-preview eh-hover eh-preview-active"),T.removeClass("eh-presumptive-target"),this.makeEdges(),C.remove(),this.clearCollections(),this.resetGestures(),this.enableEdgeEvents(),this.active=!1,this.emit("stop",this.mp(),w),this}}a.exports={start:h,update:g,preview:E,unpreview:y,stop:b,snap:p,canStartOn:u,canStartDrawModeOn:c,canStartNonDrawModeOn:d}}),(function(a,i,o){var s=o(4),l=o(0),u=o(14),c=o(2),d=o(3),h=o(5),g=o(6),p=o(8),E=o(9),y=o(11),b=o(7);function w(T){var S=T.cy;this.cy=S,this.listeners=[],this.enabled=!0,this.drawMode=!1,this.active=!1,this.grabbingNode=!1,this.clearCollections(),this.mx=0,this.my=0,this.options=l({},s,T),this.saveGestureState(),this.addListeners(),this.throttledSnap=u(this.snap.bind(this),1e3/T.snapFrequency),this.preventDefault=function(P){return P.preventDefault()},this.canConnect=function(){return!1};var _=!1;try{var A=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("test",null,A)}catch{}_?this.windowListenerOptions={capture:!0,passive:!1}:this.windowListenerOptions=!0}var x=w.prototype={},C=function(S){return l(x,S)};x.destroy=function(){this.removeListeners()},x.setOptions=function(T){l(this.options,T)},x.mp=function(){return{x:this.mx,y:this.my}},x.hp=function(){return{x:this.hx,y:this.hy}},x.clearCollections=function(){var T=this.cy;this.previewEles=T.collection(),this.ghostEles=T.collection(),this.ghostNode=T.collection(),this.sourceNode=T.collection(),this.targetNode=T.collection(),this.presumptiveTargets=T.collection()},[c,d,h,g,p,E,y,b].forEach(C),a.exports=w}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function l(){var E=this;return this.addCytoscapeListeners(),this.addListener(this.cy,"destroy",function(){return E.destroy()}),this}function u(){for(var E=this.listeners.length-1;E>=0;E--){var y=this.listeners[E];this.removeListener(y.target,y.event,y.selector,y.callback,y.options)}return this}function c(E,y,b,w,x){return(typeof b>"u"?"undefined":s(b))!==s("")&&(w=b,x=w,b=null),x==null&&(x=!1),{target:E,event:y,selector:b,callback:w,options:x}}function d(E){return E instanceof Element}function h(E,y,b,w,x){var C=c(E,y,b,w,x);return this.listeners.push(C),d(C.target)?C.target.addEventListener(C.event,C.callback,C.options):C.selector?C.target.addListener(C.event,C.selector,C.callback,C.options):C.target.addListener(C.event,C.callback,C.options),this}function g(E,y,b,w,x){for(var C=c(E,y,b,w,x),T=this.listeners.length-1;T>=0;T--){var S=this.listeners[T];if(C.target===S.target&&C.event===S.event&&(C.selector==null||C.selector===S.selector)&&(C.callback==null||C.callback===S.callback)){this.listeners.splice(T,1),d(C.target)?C.target.removeEventListener(C.event,C.callback,C.options):C.selector?C.target.removeListener(C.event,C.selector,C.callback,C.options):C.target.removeListener(C.event,C.callback,C.options);break}}return this}function p(E,y){for(var b=this.cy,w=arguments.length,x=Array(w>2?w-2:0),C=2;C<w;C++)x[C-2]=arguments[C];return b.emit({type:"eh"+E,position:y},x),this}a.exports={addListener:h,addListeners:l,removeListener:g,removeListeners:u,emit:p}}),(function(a,i,o){var s=o(1),l=function(c){c&&c("core","edgehandles",s)};typeof cytoscape<"u"&&l(cytoscape),a.exports=l}),(function(a,i){a.exports=t}),(function(a,i){a.exports=n})])})})($u)),$u.exports}var gW=hW();const pW=Cl(gW);var tm,L2;function yW(){if(L2)return tm;L2=1;class r{constructor(n,a={}){this._cy=n,this._params=a,this._node_dom={};let i=n.container();if(a.dom_container)this._nodes_dom_container=a.dom_container;else{let s=document.createElement("div");s.style.position="absolute",s.style.zIndex=10,i.querySelector("canvas").parentNode.appendChild(s),this._nodes_dom_container=s}this._resize_observer=new ResizeObserver(s=>{for(let l of s){let u=l.target,c=u.__cy_id;n.getElementById(c).style({width:u.offsetWidth,height:u.offsetHeight,shape:"rectangle"})}}),n.on("add","node",s=>{this._add_node(s.target)}),n.on("remove","node",s=>{this._remove_node(s.target)});for(let s of n.nodes())this._add_node(s);this._nodes_dom_container.style.willChange="transform",this._nodes_dom_container.style.backfaceVisibility="hidden";let o=null;n.on("pan zoom",()=>{o===null&&(o=requestAnimationFrame(()=>{o=null;let s=n.pan(),l=n.zoom(),u="translate3d("+s.x+"px,"+s.y+"px,0) scale("+l+")";this._nodes_dom_container.style.transform=u}))}),this._panZoomRafId=o,n.on("position bounds","node",s=>{let l=s.target,u=l.id();if(!this._node_dom[u])return;let c=this._node_dom[u],d=`translate(-50%, -50%) translate3d(${l.position("x").toFixed(2)}px, ${l.position("y").toFixed(2)}px, 0)`;c.style.transform=d,c.style.display="inline",c.style.position="absolute",c.style["z-index"]=10})}_add_node(n){let a=n.data();a.dom&&(a.skip_node_append!==!0&&this._nodes_dom_container.appendChild(a.dom),a.dom.__cy_id=n.id(),a.dom.style.willChange="transform",a.dom.style.backfaceVisibility="hidden",this._node_dom[n.id()]=a.dom,this._resize_observer.observe(a.dom))}_remove_node(n){let a=n.id(),i=this._node_dom[a];i&&(this._resize_observer.unobserve(i),i.parentNode===this._nodes_dom_container&&this._nodes_dom_container.removeChild(i),delete this._node_dom[a])}node_dom(n){return this._node_dom[n]}update(n,a){let i=this._cy.getElementById(n);if(!i){console.warn(`Node with id ${n} not found`);return}let o=this._node_dom[n];if(!o){console.warn(`DOM element for node ${n} not found`);return}a(o),i.data("dom",o),this._cy.trigger("position",["node",i])}remove(){for(let n in this._node_dom)this._resize_observer.unobserve(this._node_dom[n]);for(;this._nodes_dom_container.firstChild;)this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);this._node_dom={},this._cy.removeListener("add","node"),this._cy.removeListener("remove","node"),this._cy.removeListener("pan zoom"),this._cy.removeListener("position bounds","node"),this._params.dom_container||this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container),this._panZoomRafId!==null&&cancelAnimationFrame(this._panZoomRafId),this._cy=null,this._params=null,this._nodes_dom_container=null,this._resize_observer=null}}function e(t){t&&t("core","domNode",function(n,a){return new r(this,n,a)})}return typeof cytoscape<"u"&&e(cytoscape),tm=e,tm}var mW=yW();const bW=Cl(mW);un.prototype.hasInitialised||(un.use(fW),un.use(pW),un.use(bW),un.prototype.hasInitialised=!0);var Go={exports:{}};/**
|
|
332
332
|
* @license
|
|
333
333
|
* Lodash <https://lodash.com/>
|
|
334
334
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
335
335
|
* Released under MIT license <https://lodash.com/license>
|
|
336
336
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
337
337
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
338
|
-
*/var iW=Vo.exports,OR;function oW(){return OR||(OR=1,(function(r,e){(function(){var t,n="4.17.23",a=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",v=1,h=2,g=4,p=1,E=2,m=1,b=2,w=4,x=8,_=16,C=32,R=64,S=128,A=256,P=512,I=30,D="...",M=800,O=16,N=1,V=2,$=3,G=1/0,U=9007199254740991,J=17976931348623157e292,W=NaN,H=4294967295,Z=H-1,ne=H>>>1,F=[["ary",S],["bind",m],["bindKey",b],["curry",x],["curryRight",_],["flip",P],["partial",C],["partialRight",R],["rearg",A]],z="[object Arguments]",j="[object Array]",ee="[object AsyncFunction]",ie="[object Boolean]",oe="[object Date]",Y="[object DOMException]",X="[object Error]",re="[object Function]",le="[object GeneratorFunction]",he="[object Map]",be="[object Number]",fe="[object Null]",ue="[object Object]",Se="[object Promise]",Ae="[object Proxy]",Te="[object RegExp]",Pe="[object Set]",Ie="[object String]",Le="[object Symbol]",Fe="[object Undefined]",je="[object WeakMap]",lr="[object WeakSet]",ir="[object ArrayBuffer]",Xe="[object DataView]",fr="[object Float32Array]",Ue="[object Float64Array]",Oe="[object Int8Array]",ge="[object Int16Array]",L="[object Int32Array]",se="[object Uint8Array]",de="[object Uint8ClampedArray]",ve="[object Uint16Array]",ye="[object Uint32Array]",Me=/\b__p \+= '';/g,_e=/\b(__p \+=) '' \+/g,ze=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qe=/&(?:amp|lt|gt|quot|#39);/g,We=/[&<>"']/g,nr=RegExp(qe.source),er=RegExp(We.source),$e=/<%-([\s\S]+?)%>/g,or=/<%([\s\S]+?)%>/g,rr=/<%=([\s\S]+?)%>/g,Vr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/,st=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Br=/[\\^$.*+?()[\]{}|]/g,Ur=RegExp(Br.source),Lr=/^\s+/,Yr=/\s/,En=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fr=/\{\n\/\* \[wrapped with (.+)\] \*/,cn=/,? & /,dn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ea=/[()=,{}\[\]\/\s]/,hi=/\\(\\)?/g,kn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ut=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,La=/^\[object .+?Constructor\]$/,Bt=/^0o[0-7]+$/i,Ss=/^(?:0|[1-9]\d*)$/,$l=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gi=/($^)/,Vl=/['\n\r\u2028\u2029\\]/g,pi="\\ud800-\\udfff",Gl="\\u0300-\\u036f",Wl="\\ufe20-\\ufe2f",Ul="\\u20d0-\\u20ff",ra=Gl+Wl+Ul,yi="\\u2700-\\u27bf",qa="a-z\\xdf-\\xf6\\xf8-\\xff",Ts="\\xac\\xb1\\xd7\\xf7",Rs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Hl="\\u2000-\\u206f",$t=" \\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",mi="A-Z\\xc0-\\xd6\\xd8-\\xde",vo="\\ufe0e\\ufe0f",ta=Ts+Rs+Hl+$t,Ct="['’]",Kl="["+pi+"]",jl="["+ta+"]",bi="["+ra+"]",g0="\\d+",VP="["+yi+"]",p0="["+qa+"]",y0="[^"+pi+ta+g0+yi+qa+mi+"]",Yl="\\ud83c[\\udffb-\\udfff]",GP="(?:"+bi+"|"+Yl+")",m0="[^"+pi+"]",Zl="(?:\\ud83c[\\udde6-\\uddff]){2}",Xl="[\\ud800-\\udbff][\\udc00-\\udfff]",wi="["+mi+"]",b0="\\u200d",w0="(?:"+p0+"|"+y0+")",WP="(?:"+wi+"|"+y0+")",x0="(?:"+Ct+"(?:d|ll|m|re|s|t|ve))?",E0="(?:"+Ct+"(?:D|LL|M|RE|S|T|VE))?",_0=GP+"?",C0="["+vo+"]?",UP="(?:"+b0+"(?:"+[m0,Zl,Xl].join("|")+")"+C0+_0+")*",HP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",KP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",S0=C0+_0+UP,jP="(?:"+[VP,Zl,Xl].join("|")+")"+S0,YP="(?:"+[m0+bi+"?",bi,Zl,Xl,Kl].join("|")+")",ZP=RegExp(Ct,"g"),XP=RegExp(bi,"g"),Ql=RegExp(Yl+"(?="+Yl+")|"+YP+S0,"g"),QP=RegExp([wi+"?"+p0+"+"+x0+"(?="+[jl,wi,"$"].join("|")+")",WP+"+"+E0+"(?="+[jl,wi+w0,"$"].join("|")+")",wi+"?"+w0+"+"+x0,wi+"+"+E0,KP,HP,g0,jP].join("|"),"g"),JP=RegExp("["+b0+pi+ra+vo+"]"),eD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rD=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tD=-1,Pr={};Pr[fr]=Pr[Ue]=Pr[Oe]=Pr[ge]=Pr[L]=Pr[se]=Pr[de]=Pr[ve]=Pr[ye]=!0,Pr[z]=Pr[j]=Pr[ir]=Pr[ie]=Pr[Xe]=Pr[oe]=Pr[X]=Pr[re]=Pr[he]=Pr[be]=Pr[ue]=Pr[Te]=Pr[Pe]=Pr[Ie]=Pr[je]=!1;var Tr={};Tr[z]=Tr[j]=Tr[ir]=Tr[Xe]=Tr[ie]=Tr[oe]=Tr[fr]=Tr[Ue]=Tr[Oe]=Tr[ge]=Tr[L]=Tr[he]=Tr[be]=Tr[ue]=Tr[Te]=Tr[Pe]=Tr[Ie]=Tr[Le]=Tr[se]=Tr[de]=Tr[ve]=Tr[ye]=!0,Tr[X]=Tr[re]=Tr[je]=!1;var nD={À:"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"},aD={"&":"&","<":"<",">":">",'"':""","'":"'"},iD={"&":"&","<":"<",">":">",""":'"',"'":"'"},oD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},sD=parseFloat,uD=parseInt,T0=typeof wt=="object"&&wt&&wt.Object===Object&&wt,lD=typeof self=="object"&&self&&self.Object===Object&&self,lt=T0||lD||Function("return this")(),Jl=e&&!e.nodeType&&e,Na=Jl&&!0&&r&&!r.nodeType&&r,R0=Na&&Na.exports===Jl,ef=R0&&T0.process,Zt=(function(){try{var te=Na&&Na.require&&Na.require("util").types;return te||ef&&ef.binding&&ef.binding("util")}catch{}})(),A0=Zt&&Zt.isArrayBuffer,P0=Zt&&Zt.isDate,D0=Zt&&Zt.isMap,I0=Zt&&Zt.isRegExp,B0=Zt&&Zt.isSet,O0=Zt&&Zt.isTypedArray;function Vt(te,pe,ce){switch(ce.length){case 0:return te.call(pe);case 1:return te.call(pe,ce[0]);case 2:return te.call(pe,ce[0],ce[1]);case 3:return te.call(pe,ce[0],ce[1],ce[2])}return te.apply(pe,ce)}function fD(te,pe,ce,ke){for(var Qe=-1,mr=te==null?0:te.length;++Qe<mr;){var Zr=te[Qe];pe(ke,Zr,ce(Zr),te)}return ke}function Xt(te,pe){for(var ce=-1,ke=te==null?0:te.length;++ce<ke&&pe(te[ce],ce,te)!==!1;);return te}function cD(te,pe){for(var ce=te==null?0:te.length;ce--&&pe(te[ce],ce,te)!==!1;);return te}function M0(te,pe){for(var ce=-1,ke=te==null?0:te.length;++ce<ke;)if(!pe(te[ce],ce,te))return!1;return!0}function na(te,pe){for(var ce=-1,ke=te==null?0:te.length,Qe=0,mr=[];++ce<ke;){var Zr=te[ce];pe(Zr,ce,te)&&(mr[Qe++]=Zr)}return mr}function As(te,pe){var ce=te==null?0:te.length;return!!ce&&xi(te,pe,0)>-1}function rf(te,pe,ce){for(var ke=-1,Qe=te==null?0:te.length;++ke<Qe;)if(ce(pe,te[ke]))return!0;return!1}function Or(te,pe){for(var ce=-1,ke=te==null?0:te.length,Qe=Array(ke);++ce<ke;)Qe[ce]=pe(te[ce],ce,te);return Qe}function aa(te,pe){for(var ce=-1,ke=pe.length,Qe=te.length;++ce<ke;)te[Qe+ce]=pe[ce];return te}function tf(te,pe,ce,ke){var Qe=-1,mr=te==null?0:te.length;for(ke&&mr&&(ce=te[++Qe]);++Qe<mr;)ce=pe(ce,te[Qe],Qe,te);return ce}function dD(te,pe,ce,ke){var Qe=te==null?0:te.length;for(ke&&Qe&&(ce=te[--Qe]);Qe--;)ce=pe(ce,te[Qe],Qe,te);return ce}function nf(te,pe){for(var ce=-1,ke=te==null?0:te.length;++ce<ke;)if(pe(te[ce],ce,te))return!0;return!1}var vD=af("length");function hD(te){return te.split("")}function gD(te){return te.match(dn)||[]}function k0(te,pe,ce){var ke;return ce(te,function(Qe,mr,Zr){if(pe(Qe,mr,Zr))return ke=mr,!1}),ke}function Ps(te,pe,ce,ke){for(var Qe=te.length,mr=ce+(ke?1:-1);ke?mr--:++mr<Qe;)if(pe(te[mr],mr,te))return mr;return-1}function xi(te,pe,ce){return pe===pe?RD(te,pe,ce):Ps(te,L0,ce)}function pD(te,pe,ce,ke){for(var Qe=ce-1,mr=te.length;++Qe<mr;)if(ke(te[Qe],pe))return Qe;return-1}function L0(te){return te!==te}function q0(te,pe){var ce=te==null?0:te.length;return ce?sf(te,pe)/ce:W}function af(te){return function(pe){return pe==null?t:pe[te]}}function of(te){return function(pe){return te==null?t:te[pe]}}function N0(te,pe,ce,ke,Qe){return Qe(te,function(mr,Zr,Cr){ce=ke?(ke=!1,mr):pe(ce,mr,Zr,Cr)}),ce}function yD(te,pe){var ce=te.length;for(te.sort(pe);ce--;)te[ce]=te[ce].value;return te}function sf(te,pe){for(var ce,ke=-1,Qe=te.length;++ke<Qe;){var mr=pe(te[ke]);mr!==t&&(ce=ce===t?mr:ce+mr)}return ce}function uf(te,pe){for(var ce=-1,ke=Array(te);++ce<te;)ke[ce]=pe(ce);return ke}function mD(te,pe){return Or(pe,function(ce){return[ce,te[ce]]})}function F0(te){return te&&te.slice(0,G0(te)+1).replace(Lr,"")}function Gt(te){return function(pe){return te(pe)}}function lf(te,pe){return Or(pe,function(ce){return te[ce]})}function ho(te,pe){return te.has(pe)}function z0(te,pe){for(var ce=-1,ke=te.length;++ce<ke&&xi(pe,te[ce],0)>-1;);return ce}function $0(te,pe){for(var ce=te.length;ce--&&xi(pe,te[ce],0)>-1;);return ce}function bD(te,pe){for(var ce=te.length,ke=0;ce--;)te[ce]===pe&&++ke;return ke}var wD=of(nD),xD=of(aD);function ED(te){return"\\"+oD[te]}function _D(te,pe){return te==null?t:te[pe]}function Ei(te){return JP.test(te)}function CD(te){return eD.test(te)}function SD(te){for(var pe,ce=[];!(pe=te.next()).done;)ce.push(pe.value);return ce}function ff(te){var pe=-1,ce=Array(te.size);return te.forEach(function(ke,Qe){ce[++pe]=[Qe,ke]}),ce}function V0(te,pe){return function(ce){return te(pe(ce))}}function ia(te,pe){for(var ce=-1,ke=te.length,Qe=0,mr=[];++ce<ke;){var Zr=te[ce];(Zr===pe||Zr===c)&&(te[ce]=c,mr[Qe++]=ce)}return mr}function Ds(te){var pe=-1,ce=Array(te.size);return te.forEach(function(ke){ce[++pe]=ke}),ce}function TD(te){var pe=-1,ce=Array(te.size);return te.forEach(function(ke){ce[++pe]=[ke,ke]}),ce}function RD(te,pe,ce){for(var ke=ce-1,Qe=te.length;++ke<Qe;)if(te[ke]===pe)return ke;return-1}function AD(te,pe,ce){for(var ke=ce+1;ke--;)if(te[ke]===pe)return ke;return ke}function _i(te){return Ei(te)?DD(te):vD(te)}function vn(te){return Ei(te)?ID(te):hD(te)}function G0(te){for(var pe=te.length;pe--&&Yr.test(te.charAt(pe)););return pe}var PD=of(iD);function DD(te){for(var pe=Ql.lastIndex=0;Ql.test(te);)++pe;return pe}function ID(te){return te.match(Ql)||[]}function BD(te){return te.match(QP)||[]}var OD=(function te(pe){pe=pe==null?lt:Ci.defaults(lt.Object(),pe,Ci.pick(lt,rD));var ce=pe.Array,ke=pe.Date,Qe=pe.Error,mr=pe.Function,Zr=pe.Math,Cr=pe.Object,cf=pe.RegExp,MD=pe.String,Qt=pe.TypeError,Is=ce.prototype,kD=mr.prototype,Si=Cr.prototype,Bs=pe["__core-js_shared__"],Os=kD.toString,br=Si.hasOwnProperty,LD=0,W0=(function(){var f=/[^.]+$/.exec(Bs&&Bs.keys&&Bs.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""})(),Ms=Si.toString,qD=Os.call(Cr),ND=lt._,FD=cf("^"+Os.call(br).replace(Br,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ks=R0?pe.Buffer:t,oa=pe.Symbol,Ls=pe.Uint8Array,U0=ks?ks.allocUnsafe:t,qs=V0(Cr.getPrototypeOf,Cr),H0=Cr.create,K0=Si.propertyIsEnumerable,Ns=Is.splice,j0=oa?oa.isConcatSpreadable:t,go=oa?oa.iterator:t,Fa=oa?oa.toStringTag:t,Fs=(function(){try{var f=Wa(Cr,"defineProperty");return f({},"",{}),f}catch{}})(),zD=pe.clearTimeout!==lt.clearTimeout&&pe.clearTimeout,$D=ke&&ke.now!==lt.Date.now&&ke.now,VD=pe.setTimeout!==lt.setTimeout&&pe.setTimeout,zs=Zr.ceil,$s=Zr.floor,df=Cr.getOwnPropertySymbols,GD=ks?ks.isBuffer:t,Y0=pe.isFinite,WD=Is.join,UD=V0(Cr.keys,Cr),Xr=Zr.max,yt=Zr.min,HD=ke.now,KD=pe.parseInt,Z0=Zr.random,jD=Is.reverse,vf=Wa(pe,"DataView"),po=Wa(pe,"Map"),hf=Wa(pe,"Promise"),Ti=Wa(pe,"Set"),yo=Wa(pe,"WeakMap"),mo=Wa(Cr,"create"),Vs=yo&&new yo,Ri={},YD=Ua(vf),ZD=Ua(po),XD=Ua(hf),QD=Ua(Ti),JD=Ua(yo),Gs=oa?oa.prototype:t,bo=Gs?Gs.valueOf:t,X0=Gs?Gs.toString:t;function k(f){if(zr(f)&&!Je(f)&&!(f instanceof dr)){if(f instanceof Jt)return f;if(br.call(f,"__wrapped__"))return Qb(f)}return new Jt(f)}var Ai=(function(){function f(){}return function(d){if(!qr(d))return{};if(H0)return H0(d);f.prototype=d;var y=new f;return f.prototype=t,y}})();function Ws(){}function Jt(f,d){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=t}k.templateSettings={escape:$e,evaluate:or,interpolate:rr,variable:"",imports:{_:k}},k.prototype=Ws.prototype,k.prototype.constructor=k,Jt.prototype=Ai(Ws.prototype),Jt.prototype.constructor=Jt;function dr(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function eI(){var f=new dr(this.__wrapped__);return f.__actions__=Ot(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=Ot(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=Ot(this.__views__),f}function rI(){if(this.__filtered__){var f=new dr(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function tI(){var f=this.__wrapped__.value(),d=this.__dir__,y=Je(f),T=d<0,B=y?f.length:0,q=hB(0,B,this.__views__),K=q.start,Q=q.end,ae=Q-K,we=T?Q:K-1,xe=this.__iteratees__,Ce=xe.length,Be=0,Ve=yt(ae,this.__takeCount__);if(!y||!T&&B==ae&&Ve==ae)return xb(f,this.__actions__);var Ye=[];e:for(;ae--&&Be<Ve;){we+=d;for(var ar=-1,Ze=f[we];++ar<Ce;){var cr=xe[ar],vr=cr.iteratee,Ht=cr.type,Rt=vr(Ze);if(Ht==V)Ze=Rt;else if(!Rt){if(Ht==N)continue e;break e}}Ye[Be++]=Ze}return Ye}dr.prototype=Ai(Ws.prototype),dr.prototype.constructor=dr;function za(f){var d=-1,y=f==null?0:f.length;for(this.clear();++d<y;){var T=f[d];this.set(T[0],T[1])}}function nI(){this.__data__=mo?mo(null):{},this.size=0}function aI(f){var d=this.has(f)&&delete this.__data__[f];return this.size-=d?1:0,d}function iI(f){var d=this.__data__;if(mo){var y=d[f];return y===u?t:y}return br.call(d,f)?d[f]:t}function oI(f){var d=this.__data__;return mo?d[f]!==t:br.call(d,f)}function sI(f,d){var y=this.__data__;return this.size+=this.has(f)?0:1,y[f]=mo&&d===t?u:d,this}za.prototype.clear=nI,za.prototype.delete=aI,za.prototype.get=iI,za.prototype.has=oI,za.prototype.set=sI;function Ln(f){var d=-1,y=f==null?0:f.length;for(this.clear();++d<y;){var T=f[d];this.set(T[0],T[1])}}function uI(){this.__data__=[],this.size=0}function lI(f){var d=this.__data__,y=Us(d,f);if(y<0)return!1;var T=d.length-1;return y==T?d.pop():Ns.call(d,y,1),--this.size,!0}function fI(f){var d=this.__data__,y=Us(d,f);return y<0?t:d[y][1]}function cI(f){return Us(this.__data__,f)>-1}function dI(f,d){var y=this.__data__,T=Us(y,f);return T<0?(++this.size,y.push([f,d])):y[T][1]=d,this}Ln.prototype.clear=uI,Ln.prototype.delete=lI,Ln.prototype.get=fI,Ln.prototype.has=cI,Ln.prototype.set=dI;function qn(f){var d=-1,y=f==null?0:f.length;for(this.clear();++d<y;){var T=f[d];this.set(T[0],T[1])}}function vI(){this.size=0,this.__data__={hash:new za,map:new(po||Ln),string:new za}}function hI(f){var d=nu(this,f).delete(f);return this.size-=d?1:0,d}function gI(f){return nu(this,f).get(f)}function pI(f){return nu(this,f).has(f)}function yI(f,d){var y=nu(this,f),T=y.size;return y.set(f,d),this.size+=y.size==T?0:1,this}qn.prototype.clear=vI,qn.prototype.delete=hI,qn.prototype.get=gI,qn.prototype.has=pI,qn.prototype.set=yI;function $a(f){var d=-1,y=f==null?0:f.length;for(this.__data__=new qn;++d<y;)this.add(f[d])}function mI(f){return this.__data__.set(f,u),this}function bI(f){return this.__data__.has(f)}$a.prototype.add=$a.prototype.push=mI,$a.prototype.has=bI;function hn(f){var d=this.__data__=new Ln(f);this.size=d.size}function wI(){this.__data__=new Ln,this.size=0}function xI(f){var d=this.__data__,y=d.delete(f);return this.size=d.size,y}function EI(f){return this.__data__.get(f)}function _I(f){return this.__data__.has(f)}function CI(f,d){var y=this.__data__;if(y instanceof Ln){var T=y.__data__;if(!po||T.length<a-1)return T.push([f,d]),this.size=++y.size,this;y=this.__data__=new qn(T)}return y.set(f,d),this.size=y.size,this}hn.prototype.clear=wI,hn.prototype.delete=xI,hn.prototype.get=EI,hn.prototype.has=_I,hn.prototype.set=CI;function Q0(f,d){var y=Je(f),T=!y&&Ha(f),B=!y&&!T&&ca(f),q=!y&&!T&&!B&&Bi(f),K=y||T||B||q,Q=K?uf(f.length,MD):[],ae=Q.length;for(var we in f)(d||br.call(f,we))&&!(K&&(we=="length"||B&&(we=="offset"||we=="parent")||q&&(we=="buffer"||we=="byteLength"||we=="byteOffset")||$n(we,ae)))&&Q.push(we);return Q}function J0(f){var d=f.length;return d?f[Sf(0,d-1)]:t}function SI(f,d){return au(Ot(f),Va(d,0,f.length))}function TI(f){return au(Ot(f))}function gf(f,d,y){(y!==t&&!gn(f[d],y)||y===t&&!(d in f))&&Nn(f,d,y)}function wo(f,d,y){var T=f[d];(!(br.call(f,d)&&gn(T,y))||y===t&&!(d in f))&&Nn(f,d,y)}function Us(f,d){for(var y=f.length;y--;)if(gn(f[y][0],d))return y;return-1}function RI(f,d,y,T){return sa(f,function(B,q,K){d(T,B,y(B),K)}),T}function eb(f,d){return f&&Cn(d,nt(d),f)}function AI(f,d){return f&&Cn(d,kt(d),f)}function Nn(f,d,y){d=="__proto__"&&Fs?Fs(f,d,{configurable:!0,enumerable:!0,value:y,writable:!0}):f[d]=y}function pf(f,d){for(var y=-1,T=d.length,B=ce(T),q=f==null;++y<T;)B[y]=q?t:Zf(f,d[y]);return B}function Va(f,d,y){return f===f&&(y!==t&&(f=f<=y?f:y),d!==t&&(f=f>=d?f:d)),f}function en(f,d,y,T,B,q){var K,Q=d&v,ae=d&h,we=d&g;if(y&&(K=B?y(f,T,B,q):y(f)),K!==t)return K;if(!qr(f))return f;var xe=Je(f);if(xe){if(K=pB(f),!Q)return Ot(f,K)}else{var Ce=mt(f),Be=Ce==re||Ce==le;if(ca(f))return Cb(f,Q);if(Ce==ue||Ce==z||Be&&!B){if(K=ae||Be?{}:Gb(f),!Q)return ae?iB(f,AI(K,f)):aB(f,eb(K,f))}else{if(!Tr[Ce])return B?f:{};K=yB(f,Ce,Q)}}q||(q=new hn);var Ve=q.get(f);if(Ve)return Ve;q.set(f,K),m1(f)?f.forEach(function(Ze){K.add(en(Ze,d,y,Ze,f,q))}):p1(f)&&f.forEach(function(Ze,cr){K.set(cr,en(Ze,d,y,cr,f,q))});var Ye=we?ae?Lf:kf:ae?kt:nt,ar=xe?t:Ye(f);return Xt(ar||f,function(Ze,cr){ar&&(cr=Ze,Ze=f[cr]),wo(K,cr,en(Ze,d,y,cr,f,q))}),K}function PI(f){var d=nt(f);return function(y){return rb(y,f,d)}}function rb(f,d,y){var T=y.length;if(f==null)return!T;for(f=Cr(f);T--;){var B=y[T],q=d[B],K=f[B];if(K===t&&!(B in f)||!q(K))return!1}return!0}function tb(f,d,y){if(typeof f!="function")throw new Qt(o);return Ro(function(){f.apply(t,y)},d)}function xo(f,d,y,T){var B=-1,q=As,K=!0,Q=f.length,ae=[],we=d.length;if(!Q)return ae;y&&(d=Or(d,Gt(y))),T?(q=rf,K=!1):d.length>=a&&(q=ho,K=!1,d=new $a(d));e:for(;++B<Q;){var xe=f[B],Ce=y==null?xe:y(xe);if(xe=T||xe!==0?xe:0,K&&Ce===Ce){for(var Be=we;Be--;)if(d[Be]===Ce)continue e;ae.push(xe)}else q(d,Ce,T)||ae.push(xe)}return ae}var sa=Pb(_n),nb=Pb(mf,!0);function DI(f,d){var y=!0;return sa(f,function(T,B,q){return y=!!d(T,B,q),y}),y}function Hs(f,d,y){for(var T=-1,B=f.length;++T<B;){var q=f[T],K=d(q);if(K!=null&&(Q===t?K===K&&!Ut(K):y(K,Q)))var Q=K,ae=q}return ae}function II(f,d,y,T){var B=f.length;for(y=tr(y),y<0&&(y=-y>B?0:B+y),T=T===t||T>B?B:tr(T),T<0&&(T+=B),T=y>T?0:w1(T);y<T;)f[y++]=d;return f}function ab(f,d){var y=[];return sa(f,function(T,B,q){d(T,B,q)&&y.push(T)}),y}function ft(f,d,y,T,B){var q=-1,K=f.length;for(y||(y=bB),B||(B=[]);++q<K;){var Q=f[q];d>0&&y(Q)?d>1?ft(Q,d-1,y,T,B):aa(B,Q):T||(B[B.length]=Q)}return B}var yf=Db(),ib=Db(!0);function _n(f,d){return f&&yf(f,d,nt)}function mf(f,d){return f&&ib(f,d,nt)}function Ks(f,d){return na(d,function(y){return Vn(f[y])})}function Ga(f,d){d=la(d,f);for(var y=0,T=d.length;f!=null&&y<T;)f=f[Sn(d[y++])];return y&&y==T?f:t}function ob(f,d,y){var T=d(f);return Je(f)?T:aa(T,y(f))}function St(f){return f==null?f===t?Fe:fe:Fa&&Fa in Cr(f)?vB(f):TB(f)}function bf(f,d){return f>d}function BI(f,d){return f!=null&&br.call(f,d)}function OI(f,d){return f!=null&&d in Cr(f)}function MI(f,d,y){return f>=yt(d,y)&&f<Xr(d,y)}function wf(f,d,y){for(var T=y?rf:As,B=f[0].length,q=f.length,K=q,Q=ce(q),ae=1/0,we=[];K--;){var xe=f[K];K&&d&&(xe=Or(xe,Gt(d))),ae=yt(xe.length,ae),Q[K]=!y&&(d||B>=120&&xe.length>=120)?new $a(K&&xe):t}xe=f[0];var Ce=-1,Be=Q[0];e:for(;++Ce<B&&we.length<ae;){var Ve=xe[Ce],Ye=d?d(Ve):Ve;if(Ve=y||Ve!==0?Ve:0,!(Be?ho(Be,Ye):T(we,Ye,y))){for(K=q;--K;){var ar=Q[K];if(!(ar?ho(ar,Ye):T(f[K],Ye,y)))continue e}Be&&Be.push(Ye),we.push(Ve)}}return we}function kI(f,d,y,T){return _n(f,function(B,q,K){d(T,y(B),q,K)}),T}function Eo(f,d,y){d=la(d,f),f=Kb(f,d);var T=f==null?f:f[Sn(tn(d))];return T==null?t:Vt(T,f,y)}function sb(f){return zr(f)&&St(f)==z}function LI(f){return zr(f)&&St(f)==ir}function qI(f){return zr(f)&&St(f)==oe}function _o(f,d,y,T,B){return f===d?!0:f==null||d==null||!zr(f)&&!zr(d)?f!==f&&d!==d:NI(f,d,y,T,_o,B)}function NI(f,d,y,T,B,q){var K=Je(f),Q=Je(d),ae=K?j:mt(f),we=Q?j:mt(d);ae=ae==z?ue:ae,we=we==z?ue:we;var xe=ae==ue,Ce=we==ue,Be=ae==we;if(Be&&ca(f)){if(!ca(d))return!1;K=!0,xe=!1}if(Be&&!xe)return q||(q=new hn),K||Bi(f)?zb(f,d,y,T,B,q):cB(f,d,ae,y,T,B,q);if(!(y&p)){var Ve=xe&&br.call(f,"__wrapped__"),Ye=Ce&&br.call(d,"__wrapped__");if(Ve||Ye){var ar=Ve?f.value():f,Ze=Ye?d.value():d;return q||(q=new hn),B(ar,Ze,y,T,q)}}return Be?(q||(q=new hn),dB(f,d,y,T,B,q)):!1}function FI(f){return zr(f)&&mt(f)==he}function xf(f,d,y,T){var B=y.length,q=B,K=!T;if(f==null)return!q;for(f=Cr(f);B--;){var Q=y[B];if(K&&Q[2]?Q[1]!==f[Q[0]]:!(Q[0]in f))return!1}for(;++B<q;){Q=y[B];var ae=Q[0],we=f[ae],xe=Q[1];if(K&&Q[2]){if(we===t&&!(ae in f))return!1}else{var Ce=new hn;if(T)var Be=T(we,xe,ae,f,d,Ce);if(!(Be===t?_o(xe,we,p|E,T,Ce):Be))return!1}}return!0}function ub(f){if(!qr(f)||xB(f))return!1;var d=Vn(f)?FD:La;return d.test(Ua(f))}function zI(f){return zr(f)&&St(f)==Te}function $I(f){return zr(f)&&mt(f)==Pe}function VI(f){return zr(f)&&fu(f.length)&&!!Pr[St(f)]}function lb(f){return typeof f=="function"?f:f==null?Lt:typeof f=="object"?Je(f)?db(f[0],f[1]):cb(f):I1(f)}function Ef(f){if(!To(f))return UD(f);var d=[];for(var y in Cr(f))br.call(f,y)&&y!="constructor"&&d.push(y);return d}function GI(f){if(!qr(f))return SB(f);var d=To(f),y=[];for(var T in f)T=="constructor"&&(d||!br.call(f,T))||y.push(T);return y}function _f(f,d){return f<d}function fb(f,d){var y=-1,T=Mt(f)?ce(f.length):[];return sa(f,function(B,q,K){T[++y]=d(B,q,K)}),T}function cb(f){var d=Nf(f);return d.length==1&&d[0][2]?Ub(d[0][0],d[0][1]):function(y){return y===f||xf(y,f,d)}}function db(f,d){return zf(f)&&Wb(d)?Ub(Sn(f),d):function(y){var T=Zf(y,f);return T===t&&T===d?Xf(y,f):_o(d,T,p|E)}}function js(f,d,y,T,B){f!==d&&yf(d,function(q,K){if(B||(B=new hn),qr(q))WI(f,d,K,y,js,T,B);else{var Q=T?T(Vf(f,K),q,K+"",f,d,B):t;Q===t&&(Q=q),gf(f,K,Q)}},kt)}function WI(f,d,y,T,B,q,K){var Q=Vf(f,y),ae=Vf(d,y),we=K.get(ae);if(we){gf(f,y,we);return}var xe=q?q(Q,ae,y+"",f,d,K):t,Ce=xe===t;if(Ce){var Be=Je(ae),Ve=!Be&&ca(ae),Ye=!Be&&!Ve&&Bi(ae);xe=ae,Be||Ve||Ye?Je(Q)?xe=Q:Gr(Q)?xe=Ot(Q):Ve?(Ce=!1,xe=Cb(ae,!0)):Ye?(Ce=!1,xe=Sb(ae,!0)):xe=[]:Ao(ae)||Ha(ae)?(xe=Q,Ha(Q)?xe=x1(Q):(!qr(Q)||Vn(Q))&&(xe=Gb(ae))):Ce=!1}Ce&&(K.set(ae,xe),B(xe,ae,T,q,K),K.delete(ae)),gf(f,y,xe)}function vb(f,d){var y=f.length;if(y)return d+=d<0?y:0,$n(d,y)?f[d]:t}function hb(f,d,y){d.length?d=Or(d,function(q){return Je(q)?function(K){return Ga(K,q.length===1?q[0]:q)}:q}):d=[Lt];var T=-1;d=Or(d,Gt(Ke()));var B=fb(f,function(q,K,Q){var ae=Or(d,function(we){return we(q)});return{criteria:ae,index:++T,value:q}});return yD(B,function(q,K){return nB(q,K,y)})}function UI(f,d){return gb(f,d,function(y,T){return Xf(f,T)})}function gb(f,d,y){for(var T=-1,B=d.length,q={};++T<B;){var K=d[T],Q=Ga(f,K);y(Q,K)&&Co(q,la(K,f),Q)}return q}function HI(f){return function(d){return Ga(d,f)}}function Cf(f,d,y,T){var B=T?pD:xi,q=-1,K=d.length,Q=f;for(f===d&&(d=Ot(d)),y&&(Q=Or(f,Gt(y)));++q<K;)for(var ae=0,we=d[q],xe=y?y(we):we;(ae=B(Q,xe,ae,T))>-1;)Q!==f&&Ns.call(Q,ae,1),Ns.call(f,ae,1);return f}function pb(f,d){for(var y=f?d.length:0,T=y-1;y--;){var B=d[y];if(y==T||B!==q){var q=B;$n(B)?Ns.call(f,B,1):Af(f,B)}}return f}function Sf(f,d){return f+$s(Z0()*(d-f+1))}function KI(f,d,y,T){for(var B=-1,q=Xr(zs((d-f)/(y||1)),0),K=ce(q);q--;)K[T?q:++B]=f,f+=y;return K}function Tf(f,d){var y="";if(!f||d<1||d>U)return y;do d%2&&(y+=f),d=$s(d/2),d&&(f+=f);while(d);return y}function sr(f,d){return Gf(Hb(f,d,Lt),f+"")}function jI(f){return J0(Oi(f))}function YI(f,d){var y=Oi(f);return au(y,Va(d,0,y.length))}function Co(f,d,y,T){if(!qr(f))return f;d=la(d,f);for(var B=-1,q=d.length,K=q-1,Q=f;Q!=null&&++B<q;){var ae=Sn(d[B]),we=y;if(ae==="__proto__"||ae==="constructor"||ae==="prototype")return f;if(B!=K){var xe=Q[ae];we=T?T(xe,ae,Q):t,we===t&&(we=qr(xe)?xe:$n(d[B+1])?[]:{})}wo(Q,ae,we),Q=Q[ae]}return f}var yb=Vs?function(f,d){return Vs.set(f,d),f}:Lt,ZI=Fs?function(f,d){return Fs(f,"toString",{configurable:!0,enumerable:!1,value:Jf(d),writable:!0})}:Lt;function XI(f){return au(Oi(f))}function rn(f,d,y){var T=-1,B=f.length;d<0&&(d=-d>B?0:B+d),y=y>B?B:y,y<0&&(y+=B),B=d>y?0:y-d>>>0,d>>>=0;for(var q=ce(B);++T<B;)q[T]=f[T+d];return q}function QI(f,d){var y;return sa(f,function(T,B,q){return y=d(T,B,q),!y}),!!y}function Ys(f,d,y){var T=0,B=f==null?T:f.length;if(typeof d=="number"&&d===d&&B<=ne){for(;T<B;){var q=T+B>>>1,K=f[q];K!==null&&!Ut(K)&&(y?K<=d:K<d)?T=q+1:B=q}return B}return Rf(f,d,Lt,y)}function Rf(f,d,y,T){var B=0,q=f==null?0:f.length;if(q===0)return 0;d=y(d);for(var K=d!==d,Q=d===null,ae=Ut(d),we=d===t;B<q;){var xe=$s((B+q)/2),Ce=y(f[xe]),Be=Ce!==t,Ve=Ce===null,Ye=Ce===Ce,ar=Ut(Ce);if(K)var Ze=T||Ye;else we?Ze=Ye&&(T||Be):Q?Ze=Ye&&Be&&(T||!Ve):ae?Ze=Ye&&Be&&!Ve&&(T||!ar):Ve||ar?Ze=!1:Ze=T?Ce<=d:Ce<d;Ze?B=xe+1:q=xe}return yt(q,Z)}function mb(f,d){for(var y=-1,T=f.length,B=0,q=[];++y<T;){var K=f[y],Q=d?d(K):K;if(!y||!gn(Q,ae)){var ae=Q;q[B++]=K===0?0:K}}return q}function bb(f){return typeof f=="number"?f:Ut(f)?W:+f}function Wt(f){if(typeof f=="string")return f;if(Je(f))return Or(f,Wt)+"";if(Ut(f))return X0?X0.call(f):"";var d=f+"";return d=="0"&&1/f==-G?"-0":d}function ua(f,d,y){var T=-1,B=As,q=f.length,K=!0,Q=[],ae=Q;if(y)K=!1,B=rf;else if(q>=a){var we=d?null:lB(f);if(we)return Ds(we);K=!1,B=ho,ae=new $a}else ae=d?[]:Q;e:for(;++T<q;){var xe=f[T],Ce=d?d(xe):xe;if(xe=y||xe!==0?xe:0,K&&Ce===Ce){for(var Be=ae.length;Be--;)if(ae[Be]===Ce)continue e;d&&ae.push(Ce),Q.push(xe)}else B(ae,Ce,y)||(ae!==Q&&ae.push(Ce),Q.push(xe))}return Q}function Af(f,d){d=la(d,f);var y=-1,T=d.length;if(!T)return!0;for(var B=f==null||typeof f!="object"&&typeof f!="function";++y<T;){var q=d[y];if(typeof q=="string"){if(q==="__proto__"&&!br.call(f,"__proto__"))return!1;if(q==="constructor"&&y+1<T&&typeof d[y+1]=="string"&&d[y+1]==="prototype"){if(B&&y===0)continue;return!1}}}var K=Kb(f,d);return K==null||delete K[Sn(tn(d))]}function wb(f,d,y,T){return Co(f,d,y(Ga(f,d)),T)}function Zs(f,d,y,T){for(var B=f.length,q=T?B:-1;(T?q--:++q<B)&&d(f[q],q,f););return y?rn(f,T?0:q,T?q+1:B):rn(f,T?q+1:0,T?B:q)}function xb(f,d){var y=f;return y instanceof dr&&(y=y.value()),tf(d,function(T,B){return B.func.apply(B.thisArg,aa([T],B.args))},y)}function Pf(f,d,y){var T=f.length;if(T<2)return T?ua(f[0]):[];for(var B=-1,q=ce(T);++B<T;)for(var K=f[B],Q=-1;++Q<T;)Q!=B&&(q[B]=xo(q[B]||K,f[Q],d,y));return ua(ft(q,1),d,y)}function Eb(f,d,y){for(var T=-1,B=f.length,q=d.length,K={};++T<B;){var Q=T<q?d[T]:t;y(K,f[T],Q)}return K}function Df(f){return Gr(f)?f:[]}function If(f){return typeof f=="function"?f:Lt}function la(f,d){return Je(f)?f:zf(f,d)?[f]:Xb(wr(f))}var JI=sr;function fa(f,d,y){var T=f.length;return y=y===t?T:y,!d&&y>=T?f:rn(f,d,y)}var _b=zD||function(f){return lt.clearTimeout(f)};function Cb(f,d){if(d)return f.slice();var y=f.length,T=U0?U0(y):new f.constructor(y);return f.copy(T),T}function Bf(f){var d=new f.constructor(f.byteLength);return new Ls(d).set(new Ls(f)),d}function eB(f,d){var y=d?Bf(f.buffer):f.buffer;return new f.constructor(y,f.byteOffset,f.byteLength)}function rB(f){var d=new f.constructor(f.source,ut.exec(f));return d.lastIndex=f.lastIndex,d}function tB(f){return bo?Cr(bo.call(f)):{}}function Sb(f,d){var y=d?Bf(f.buffer):f.buffer;return new f.constructor(y,f.byteOffset,f.length)}function Tb(f,d){if(f!==d){var y=f!==t,T=f===null,B=f===f,q=Ut(f),K=d!==t,Q=d===null,ae=d===d,we=Ut(d);if(!Q&&!we&&!q&&f>d||q&&K&&ae&&!Q&&!we||T&&K&&ae||!y&&ae||!B)return 1;if(!T&&!q&&!we&&f<d||we&&y&&B&&!T&&!q||Q&&y&&B||!K&&B||!ae)return-1}return 0}function nB(f,d,y){for(var T=-1,B=f.criteria,q=d.criteria,K=B.length,Q=y.length;++T<K;){var ae=Tb(B[T],q[T]);if(ae){if(T>=Q)return ae;var we=y[T];return ae*(we=="desc"?-1:1)}}return f.index-d.index}function Rb(f,d,y,T){for(var B=-1,q=f.length,K=y.length,Q=-1,ae=d.length,we=Xr(q-K,0),xe=ce(ae+we),Ce=!T;++Q<ae;)xe[Q]=d[Q];for(;++B<K;)(Ce||B<q)&&(xe[y[B]]=f[B]);for(;we--;)xe[Q++]=f[B++];return xe}function Ab(f,d,y,T){for(var B=-1,q=f.length,K=-1,Q=y.length,ae=-1,we=d.length,xe=Xr(q-Q,0),Ce=ce(xe+we),Be=!T;++B<xe;)Ce[B]=f[B];for(var Ve=B;++ae<we;)Ce[Ve+ae]=d[ae];for(;++K<Q;)(Be||B<q)&&(Ce[Ve+y[K]]=f[B++]);return Ce}function Ot(f,d){var y=-1,T=f.length;for(d||(d=ce(T));++y<T;)d[y]=f[y];return d}function Cn(f,d,y,T){var B=!y;y||(y={});for(var q=-1,K=d.length;++q<K;){var Q=d[q],ae=T?T(y[Q],f[Q],Q,y,f):t;ae===t&&(ae=f[Q]),B?Nn(y,Q,ae):wo(y,Q,ae)}return y}function aB(f,d){return Cn(f,Ff(f),d)}function iB(f,d){return Cn(f,$b(f),d)}function Xs(f,d){return function(y,T){var B=Je(y)?fD:RI,q=d?d():{};return B(y,f,Ke(T,2),q)}}function Pi(f){return sr(function(d,y){var T=-1,B=y.length,q=B>1?y[B-1]:t,K=B>2?y[2]:t;for(q=f.length>3&&typeof q=="function"?(B--,q):t,K&&Tt(y[0],y[1],K)&&(q=B<3?t:q,B=1),d=Cr(d);++T<B;){var Q=y[T];Q&&f(d,Q,T,q)}return d})}function Pb(f,d){return function(y,T){if(y==null)return y;if(!Mt(y))return f(y,T);for(var B=y.length,q=d?B:-1,K=Cr(y);(d?q--:++q<B)&&T(K[q],q,K)!==!1;);return y}}function Db(f){return function(d,y,T){for(var B=-1,q=Cr(d),K=T(d),Q=K.length;Q--;){var ae=K[f?Q:++B];if(y(q[ae],ae,q)===!1)break}return d}}function oB(f,d,y){var T=d&m,B=So(f);function q(){var K=this&&this!==lt&&this instanceof q?B:f;return K.apply(T?y:this,arguments)}return q}function Ib(f){return function(d){d=wr(d);var y=Ei(d)?vn(d):t,T=y?y[0]:d.charAt(0),B=y?fa(y,1).join(""):d.slice(1);return T[f]()+B}}function Di(f){return function(d){return tf(P1(A1(d).replace(ZP,"")),f,"")}}function So(f){return function(){var d=arguments;switch(d.length){case 0:return new f;case 1:return new f(d[0]);case 2:return new f(d[0],d[1]);case 3:return new f(d[0],d[1],d[2]);case 4:return new f(d[0],d[1],d[2],d[3]);case 5:return new f(d[0],d[1],d[2],d[3],d[4]);case 6:return new f(d[0],d[1],d[2],d[3],d[4],d[5]);case 7:return new f(d[0],d[1],d[2],d[3],d[4],d[5],d[6])}var y=Ai(f.prototype),T=f.apply(y,d);return qr(T)?T:y}}function sB(f,d,y){var T=So(f);function B(){for(var q=arguments.length,K=ce(q),Q=q,ae=Ii(B);Q--;)K[Q]=arguments[Q];var we=q<3&&K[0]!==ae&&K[q-1]!==ae?[]:ia(K,ae);if(q-=we.length,q<y)return Lb(f,d,Qs,B.placeholder,t,K,we,t,t,y-q);var xe=this&&this!==lt&&this instanceof B?T:f;return Vt(xe,this,K)}return B}function Bb(f){return function(d,y,T){var B=Cr(d);if(!Mt(d)){var q=Ke(y,3);d=nt(d),y=function(Q){return q(B[Q],Q,B)}}var K=f(d,y,T);return K>-1?B[q?d[K]:K]:t}}function Ob(f){return zn(function(d){var y=d.length,T=y,B=Jt.prototype.thru;for(f&&d.reverse();T--;){var q=d[T];if(typeof q!="function")throw new Qt(o);if(B&&!K&&tu(q)=="wrapper")var K=new Jt([],!0)}for(T=K?T:y;++T<y;){q=d[T];var Q=tu(q),ae=Q=="wrapper"?qf(q):t;ae&&$f(ae[0])&&ae[1]==(S|x|C|A)&&!ae[4].length&&ae[9]==1?K=K[tu(ae[0])].apply(K,ae[3]):K=q.length==1&&$f(q)?K[Q]():K.thru(q)}return function(){var we=arguments,xe=we[0];if(K&&we.length==1&&Je(xe))return K.plant(xe).value();for(var Ce=0,Be=y?d[Ce].apply(this,we):xe;++Ce<y;)Be=d[Ce].call(this,Be);return Be}})}function Qs(f,d,y,T,B,q,K,Q,ae,we){var xe=d&S,Ce=d&m,Be=d&b,Ve=d&(x|_),Ye=d&P,ar=Be?t:So(f);function Ze(){for(var cr=arguments.length,vr=ce(cr),Ht=cr;Ht--;)vr[Ht]=arguments[Ht];if(Ve)var Rt=Ii(Ze),Kt=bD(vr,Rt);if(T&&(vr=Rb(vr,T,B,Ve)),q&&(vr=Ab(vr,q,K,Ve)),cr-=Kt,Ve&&cr<we){var Wr=ia(vr,Rt);return Lb(f,d,Qs,Ze.placeholder,y,vr,Wr,Q,ae,we-cr)}var pn=Ce?y:this,Wn=Be?pn[f]:f;return cr=vr.length,Q?vr=RB(vr,Q):Ye&&cr>1&&vr.reverse(),xe&&ae<cr&&(vr.length=ae),this&&this!==lt&&this instanceof Ze&&(Wn=ar||So(Wn)),Wn.apply(pn,vr)}return Ze}function Mb(f,d){return function(y,T){return kI(y,f,d(T),{})}}function Js(f,d){return function(y,T){var B;if(y===t&&T===t)return d;if(y!==t&&(B=y),T!==t){if(B===t)return T;typeof y=="string"||typeof T=="string"?(y=Wt(y),T=Wt(T)):(y=bb(y),T=bb(T)),B=f(y,T)}return B}}function Of(f){return zn(function(d){return d=Or(d,Gt(Ke())),sr(function(y){var T=this;return f(d,function(B){return Vt(B,T,y)})})})}function eu(f,d){d=d===t?" ":Wt(d);var y=d.length;if(y<2)return y?Tf(d,f):d;var T=Tf(d,zs(f/_i(d)));return Ei(d)?fa(vn(T),0,f).join(""):T.slice(0,f)}function uB(f,d,y,T){var B=d&m,q=So(f);function K(){for(var Q=-1,ae=arguments.length,we=-1,xe=T.length,Ce=ce(xe+ae),Be=this&&this!==lt&&this instanceof K?q:f;++we<xe;)Ce[we]=T[we];for(;ae--;)Ce[we++]=arguments[++Q];return Vt(Be,B?y:this,Ce)}return K}function kb(f){return function(d,y,T){return T&&typeof T!="number"&&Tt(d,y,T)&&(y=T=t),d=Gn(d),y===t?(y=d,d=0):y=Gn(y),T=T===t?d<y?1:-1:Gn(T),KI(d,y,T,f)}}function ru(f){return function(d,y){return typeof d=="string"&&typeof y=="string"||(d=nn(d),y=nn(y)),f(d,y)}}function Lb(f,d,y,T,B,q,K,Q,ae,we){var xe=d&x,Ce=xe?K:t,Be=xe?t:K,Ve=xe?q:t,Ye=xe?t:q;d|=xe?C:R,d&=~(xe?R:C),d&w||(d&=-4);var ar=[f,d,B,Ve,Ce,Ye,Be,Q,ae,we],Ze=y.apply(t,ar);return $f(f)&&jb(Ze,ar),Ze.placeholder=T,Yb(Ze,f,d)}function Mf(f){var d=Zr[f];return function(y,T){if(y=nn(y),T=T==null?0:yt(tr(T),292),T&&Y0(y)){var B=(wr(y)+"e").split("e"),q=d(B[0]+"e"+(+B[1]+T));return B=(wr(q)+"e").split("e"),+(B[0]+"e"+(+B[1]-T))}return d(y)}}var lB=Ti&&1/Ds(new Ti([,-0]))[1]==G?function(f){return new Ti(f)}:tc;function qb(f){return function(d){var y=mt(d);return y==he?ff(d):y==Pe?TD(d):mD(d,f(d))}}function Fn(f,d,y,T,B,q,K,Q){var ae=d&b;if(!ae&&typeof f!="function")throw new Qt(o);var we=T?T.length:0;if(we||(d&=-97,T=B=t),K=K===t?K:Xr(tr(K),0),Q=Q===t?Q:tr(Q),we-=B?B.length:0,d&R){var xe=T,Ce=B;T=B=t}var Be=ae?t:qf(f),Ve=[f,d,y,T,B,xe,Ce,q,K,Q];if(Be&&CB(Ve,Be),f=Ve[0],d=Ve[1],y=Ve[2],T=Ve[3],B=Ve[4],Q=Ve[9]=Ve[9]===t?ae?0:f.length:Xr(Ve[9]-we,0),!Q&&d&(x|_)&&(d&=-25),!d||d==m)var Ye=oB(f,d,y);else d==x||d==_?Ye=sB(f,d,Q):(d==C||d==(m|C))&&!B.length?Ye=uB(f,d,y,T):Ye=Qs.apply(t,Ve);var ar=Be?yb:jb;return Yb(ar(Ye,Ve),f,d)}function Nb(f,d,y,T){return f===t||gn(f,Si[y])&&!br.call(T,y)?d:f}function Fb(f,d,y,T,B,q){return qr(f)&&qr(d)&&(q.set(d,f),js(f,d,t,Fb,q),q.delete(d)),f}function fB(f){return Ao(f)?t:f}function zb(f,d,y,T,B,q){var K=y&p,Q=f.length,ae=d.length;if(Q!=ae&&!(K&&ae>Q))return!1;var we=q.get(f),xe=q.get(d);if(we&&xe)return we==d&&xe==f;var Ce=-1,Be=!0,Ve=y&E?new $a:t;for(q.set(f,d),q.set(d,f);++Ce<Q;){var Ye=f[Ce],ar=d[Ce];if(T)var Ze=K?T(ar,Ye,Ce,d,f,q):T(Ye,ar,Ce,f,d,q);if(Ze!==t){if(Ze)continue;Be=!1;break}if(Ve){if(!nf(d,function(cr,vr){if(!ho(Ve,vr)&&(Ye===cr||B(Ye,cr,y,T,q)))return Ve.push(vr)})){Be=!1;break}}else if(!(Ye===ar||B(Ye,ar,y,T,q))){Be=!1;break}}return q.delete(f),q.delete(d),Be}function cB(f,d,y,T,B,q,K){switch(y){case Xe:if(f.byteLength!=d.byteLength||f.byteOffset!=d.byteOffset)return!1;f=f.buffer,d=d.buffer;case ir:return!(f.byteLength!=d.byteLength||!q(new Ls(f),new Ls(d)));case ie:case oe:case be:return gn(+f,+d);case X:return f.name==d.name&&f.message==d.message;case Te:case Ie:return f==d+"";case he:var Q=ff;case Pe:var ae=T&p;if(Q||(Q=Ds),f.size!=d.size&&!ae)return!1;var we=K.get(f);if(we)return we==d;T|=E,K.set(f,d);var xe=zb(Q(f),Q(d),T,B,q,K);return K.delete(f),xe;case Le:if(bo)return bo.call(f)==bo.call(d)}return!1}function dB(f,d,y,T,B,q){var K=y&p,Q=kf(f),ae=Q.length,we=kf(d),xe=we.length;if(ae!=xe&&!K)return!1;for(var Ce=ae;Ce--;){var Be=Q[Ce];if(!(K?Be in d:br.call(d,Be)))return!1}var Ve=q.get(f),Ye=q.get(d);if(Ve&&Ye)return Ve==d&&Ye==f;var ar=!0;q.set(f,d),q.set(d,f);for(var Ze=K;++Ce<ae;){Be=Q[Ce];var cr=f[Be],vr=d[Be];if(T)var Ht=K?T(vr,cr,Be,d,f,q):T(cr,vr,Be,f,d,q);if(!(Ht===t?cr===vr||B(cr,vr,y,T,q):Ht)){ar=!1;break}Ze||(Ze=Be=="constructor")}if(ar&&!Ze){var Rt=f.constructor,Kt=d.constructor;Rt!=Kt&&"constructor"in f&&"constructor"in d&&!(typeof Rt=="function"&&Rt instanceof Rt&&typeof Kt=="function"&&Kt instanceof Kt)&&(ar=!1)}return q.delete(f),q.delete(d),ar}function zn(f){return Gf(Hb(f,t,r1),f+"")}function kf(f){return ob(f,nt,Ff)}function Lf(f){return ob(f,kt,$b)}var qf=Vs?function(f){return Vs.get(f)}:tc;function tu(f){for(var d=f.name+"",y=Ri[d],T=br.call(Ri,d)?y.length:0;T--;){var B=y[T],q=B.func;if(q==null||q==f)return B.name}return d}function Ii(f){var d=br.call(k,"placeholder")?k:f;return d.placeholder}function Ke(){var f=k.iteratee||ec;return f=f===ec?lb:f,arguments.length?f(arguments[0],arguments[1]):f}function nu(f,d){var y=f.__data__;return wB(d)?y[typeof d=="string"?"string":"hash"]:y.map}function Nf(f){for(var d=nt(f),y=d.length;y--;){var T=d[y],B=f[T];d[y]=[T,B,Wb(B)]}return d}function Wa(f,d){var y=_D(f,d);return ub(y)?y:t}function vB(f){var d=br.call(f,Fa),y=f[Fa];try{f[Fa]=t;var T=!0}catch{}var B=Ms.call(f);return T&&(d?f[Fa]=y:delete f[Fa]),B}var Ff=df?function(f){return f==null?[]:(f=Cr(f),na(df(f),function(d){return K0.call(f,d)}))}:nc,$b=df?function(f){for(var d=[];f;)aa(d,Ff(f)),f=qs(f);return d}:nc,mt=St;(vf&&mt(new vf(new ArrayBuffer(1)))!=Xe||po&&mt(new po)!=he||hf&&mt(hf.resolve())!=Se||Ti&&mt(new Ti)!=Pe||yo&&mt(new yo)!=je)&&(mt=function(f){var d=St(f),y=d==ue?f.constructor:t,T=y?Ua(y):"";if(T)switch(T){case YD:return Xe;case ZD:return he;case XD:return Se;case QD:return Pe;case JD:return je}return d});function hB(f,d,y){for(var T=-1,B=y.length;++T<B;){var q=y[T],K=q.size;switch(q.type){case"drop":f+=K;break;case"dropRight":d-=K;break;case"take":d=yt(d,f+K);break;case"takeRight":f=Xr(f,d-K);break}}return{start:f,end:d}}function gB(f){var d=f.match(Fr);return d?d[1].split(cn):[]}function Vb(f,d,y){d=la(d,f);for(var T=-1,B=d.length,q=!1;++T<B;){var K=Sn(d[T]);if(!(q=f!=null&&y(f,K)))break;f=f[K]}return q||++T!=B?q:(B=f==null?0:f.length,!!B&&fu(B)&&$n(K,B)&&(Je(f)||Ha(f)))}function pB(f){var d=f.length,y=new f.constructor(d);return d&&typeof f[0]=="string"&&br.call(f,"index")&&(y.index=f.index,y.input=f.input),y}function Gb(f){return typeof f.constructor=="function"&&!To(f)?Ai(qs(f)):{}}function yB(f,d,y){var T=f.constructor;switch(d){case ir:return Bf(f);case ie:case oe:return new T(+f);case Xe:return eB(f,y);case fr:case Ue:case Oe:case ge:case L:case se:case de:case ve:case ye:return Sb(f,y);case he:return new T;case be:case Ie:return new T(f);case Te:return rB(f);case Pe:return new T;case Le:return tB(f)}}function mB(f,d){var y=d.length;if(!y)return f;var T=y-1;return d[T]=(y>1?"& ":"")+d[T],d=d.join(y>2?", ":" "),f.replace(En,`{
|
|
339
|
-
/* [wrapped with `+
|
|
340
|
-
`)}function bB(f){return Je(f)||Ha(f)||!!(j0&&f&&f[j0])}function $n(f,d){var y=typeof f;return d=d??U,!!d&&(y=="number"||y!="symbol"&&Ss.test(f))&&f>-1&&f%1==0&&f<d}function Tt(f,d,y){if(!qr(y))return!1;var T=typeof d;return(T=="number"?Mt(y)&&$n(d,y.length):T=="string"&&d in y)?gn(y[d],f):!1}function zf(f,d){if(Je(f))return!1;var y=typeof f;return y=="number"||y=="symbol"||y=="boolean"||f==null||Ut(f)?!0:Ir.test(f)||!Vr.test(f)||d!=null&&f in Cr(d)}function wB(f){var d=typeof f;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?f!=="__proto__":f===null}function $f(f){var d=tu(f),y=k[d];if(typeof y!="function"||!(d in dr.prototype))return!1;if(f===y)return!0;var T=qf(y);return!!T&&f===T[0]}function xB(f){return!!W0&&W0 in f}var EB=Bs?Vn:ac;function To(f){var d=f&&f.constructor,y=typeof d=="function"&&d.prototype||Si;return f===y}function Wb(f){return f===f&&!qr(f)}function Ub(f,d){return function(y){return y==null?!1:y[f]===d&&(d!==t||f in Cr(y))}}function _B(f){var d=uu(f,function(T){return y.size===l&&y.clear(),T}),y=d.cache;return d}function CB(f,d){var y=f[1],T=d[1],B=y|T,q=B<(m|b|S),K=T==S&&y==x||T==S&&y==A&&f[7].length<=d[8]||T==(S|A)&&d[7].length<=d[8]&&y==x;if(!(q||K))return f;T&m&&(f[2]=d[2],B|=y&m?0:w);var Q=d[3];if(Q){var ae=f[3];f[3]=ae?Rb(ae,Q,d[4]):Q,f[4]=ae?ia(f[3],c):d[4]}return Q=d[5],Q&&(ae=f[5],f[5]=ae?Ab(ae,Q,d[6]):Q,f[6]=ae?ia(f[5],c):d[6]),Q=d[7],Q&&(f[7]=Q),T&S&&(f[8]=f[8]==null?d[8]:yt(f[8],d[8])),f[9]==null&&(f[9]=d[9]),f[0]=d[0],f[1]=B,f}function SB(f){var d=[];if(f!=null)for(var y in Cr(f))d.push(y);return d}function TB(f){return Ms.call(f)}function Hb(f,d,y){return d=Xr(d===t?f.length-1:d,0),function(){for(var T=arguments,B=-1,q=Xr(T.length-d,0),K=ce(q);++B<q;)K[B]=T[d+B];B=-1;for(var Q=ce(d+1);++B<d;)Q[B]=T[B];return Q[d]=y(K),Vt(f,this,Q)}}function Kb(f,d){return d.length<2?f:Ga(f,rn(d,0,-1))}function RB(f,d){for(var y=f.length,T=yt(d.length,y),B=Ot(f);T--;){var q=d[T];f[T]=$n(q,y)?B[q]:t}return f}function Vf(f,d){if(!(d==="constructor"&&typeof f[d]=="function")&&d!="__proto__")return f[d]}var jb=Zb(yb),Ro=VD||function(f,d){return lt.setTimeout(f,d)},Gf=Zb(ZI);function Yb(f,d,y){var T=d+"";return Gf(f,mB(T,AB(gB(T),y)))}function Zb(f){var d=0,y=0;return function(){var T=HD(),B=O-(T-y);if(y=T,B>0){if(++d>=M)return arguments[0]}else d=0;return f.apply(t,arguments)}}function au(f,d){var y=-1,T=f.length,B=T-1;for(d=d===t?T:d;++y<d;){var q=Sf(y,B),K=f[q];f[q]=f[y],f[y]=K}return f.length=d,f}var Xb=_B(function(f){var d=[];return f.charCodeAt(0)===46&&d.push(""),f.replace(st,function(y,T,B,q){d.push(B?q.replace(hi,"$1"):T||y)}),d});function Sn(f){if(typeof f=="string"||Ut(f))return f;var d=f+"";return d=="0"&&1/f==-G?"-0":d}function Ua(f){if(f!=null){try{return Os.call(f)}catch{}try{return f+""}catch{}}return""}function AB(f,d){return Xt(F,function(y){var T="_."+y[0];d&y[1]&&!As(f,T)&&f.push(T)}),f.sort()}function Qb(f){if(f instanceof dr)return f.clone();var d=new Jt(f.__wrapped__,f.__chain__);return d.__actions__=Ot(f.__actions__),d.__index__=f.__index__,d.__values__=f.__values__,d}function PB(f,d,y){(y?Tt(f,d,y):d===t)?d=1:d=Xr(tr(d),0);var T=f==null?0:f.length;if(!T||d<1)return[];for(var B=0,q=0,K=ce(zs(T/d));B<T;)K[q++]=rn(f,B,B+=d);return K}function DB(f){for(var d=-1,y=f==null?0:f.length,T=0,B=[];++d<y;){var q=f[d];q&&(B[T++]=q)}return B}function IB(){var f=arguments.length;if(!f)return[];for(var d=ce(f-1),y=arguments[0],T=f;T--;)d[T-1]=arguments[T];return aa(Je(y)?Ot(y):[y],ft(d,1))}var BB=sr(function(f,d){return Gr(f)?xo(f,ft(d,1,Gr,!0)):[]}),OB=sr(function(f,d){var y=tn(d);return Gr(y)&&(y=t),Gr(f)?xo(f,ft(d,1,Gr,!0),Ke(y,2)):[]}),MB=sr(function(f,d){var y=tn(d);return Gr(y)&&(y=t),Gr(f)?xo(f,ft(d,1,Gr,!0),t,y):[]});function kB(f,d,y){var T=f==null?0:f.length;return T?(d=y||d===t?1:tr(d),rn(f,d<0?0:d,T)):[]}function LB(f,d,y){var T=f==null?0:f.length;return T?(d=y||d===t?1:tr(d),d=T-d,rn(f,0,d<0?0:d)):[]}function qB(f,d){return f&&f.length?Zs(f,Ke(d,3),!0,!0):[]}function NB(f,d){return f&&f.length?Zs(f,Ke(d,3),!0):[]}function FB(f,d,y,T){var B=f==null?0:f.length;return B?(y&&typeof y!="number"&&Tt(f,d,y)&&(y=0,T=B),II(f,d,y,T)):[]}function Jb(f,d,y){var T=f==null?0:f.length;if(!T)return-1;var B=y==null?0:tr(y);return B<0&&(B=Xr(T+B,0)),Ps(f,Ke(d,3),B)}function e1(f,d,y){var T=f==null?0:f.length;if(!T)return-1;var B=T-1;return y!==t&&(B=tr(y),B=y<0?Xr(T+B,0):yt(B,T-1)),Ps(f,Ke(d,3),B,!0)}function r1(f){var d=f==null?0:f.length;return d?ft(f,1):[]}function zB(f){var d=f==null?0:f.length;return d?ft(f,G):[]}function $B(f,d){var y=f==null?0:f.length;return y?(d=d===t?1:tr(d),ft(f,d)):[]}function VB(f){for(var d=-1,y=f==null?0:f.length,T={};++d<y;){var B=f[d];T[B[0]]=B[1]}return T}function t1(f){return f&&f.length?f[0]:t}function GB(f,d,y){var T=f==null?0:f.length;if(!T)return-1;var B=y==null?0:tr(y);return B<0&&(B=Xr(T+B,0)),xi(f,d,B)}function WB(f){var d=f==null?0:f.length;return d?rn(f,0,-1):[]}var UB=sr(function(f){var d=Or(f,Df);return d.length&&d[0]===f[0]?wf(d):[]}),HB=sr(function(f){var d=tn(f),y=Or(f,Df);return d===tn(y)?d=t:y.pop(),y.length&&y[0]===f[0]?wf(y,Ke(d,2)):[]}),KB=sr(function(f){var d=tn(f),y=Or(f,Df);return d=typeof d=="function"?d:t,d&&y.pop(),y.length&&y[0]===f[0]?wf(y,t,d):[]});function jB(f,d){return f==null?"":WD.call(f,d)}function tn(f){var d=f==null?0:f.length;return d?f[d-1]:t}function YB(f,d,y){var T=f==null?0:f.length;if(!T)return-1;var B=T;return y!==t&&(B=tr(y),B=B<0?Xr(T+B,0):yt(B,T-1)),d===d?AD(f,d,B):Ps(f,L0,B,!0)}function ZB(f,d){return f&&f.length?vb(f,tr(d)):t}var XB=sr(n1);function n1(f,d){return f&&f.length&&d&&d.length?Cf(f,d):f}function QB(f,d,y){return f&&f.length&&d&&d.length?Cf(f,d,Ke(y,2)):f}function JB(f,d,y){return f&&f.length&&d&&d.length?Cf(f,d,t,y):f}var eO=zn(function(f,d){var y=f==null?0:f.length,T=pf(f,d);return pb(f,Or(d,function(B){return $n(B,y)?+B:B}).sort(Tb)),T});function rO(f,d){var y=[];if(!(f&&f.length))return y;var T=-1,B=[],q=f.length;for(d=Ke(d,3);++T<q;){var K=f[T];d(K,T,f)&&(y.push(K),B.push(T))}return pb(f,B),y}function Wf(f){return f==null?f:jD.call(f)}function tO(f,d,y){var T=f==null?0:f.length;return T?(y&&typeof y!="number"&&Tt(f,d,y)?(d=0,y=T):(d=d==null?0:tr(d),y=y===t?T:tr(y)),rn(f,d,y)):[]}function nO(f,d){return Ys(f,d)}function aO(f,d,y){return Rf(f,d,Ke(y,2))}function iO(f,d){var y=f==null?0:f.length;if(y){var T=Ys(f,d);if(T<y&&gn(f[T],d))return T}return-1}function oO(f,d){return Ys(f,d,!0)}function sO(f,d,y){return Rf(f,d,Ke(y,2),!0)}function uO(f,d){var y=f==null?0:f.length;if(y){var T=Ys(f,d,!0)-1;if(gn(f[T],d))return T}return-1}function lO(f){return f&&f.length?mb(f):[]}function fO(f,d){return f&&f.length?mb(f,Ke(d,2)):[]}function cO(f){var d=f==null?0:f.length;return d?rn(f,1,d):[]}function dO(f,d,y){return f&&f.length?(d=y||d===t?1:tr(d),rn(f,0,d<0?0:d)):[]}function vO(f,d,y){var T=f==null?0:f.length;return T?(d=y||d===t?1:tr(d),d=T-d,rn(f,d<0?0:d,T)):[]}function hO(f,d){return f&&f.length?Zs(f,Ke(d,3),!1,!0):[]}function gO(f,d){return f&&f.length?Zs(f,Ke(d,3)):[]}var pO=sr(function(f){return ua(ft(f,1,Gr,!0))}),yO=sr(function(f){var d=tn(f);return Gr(d)&&(d=t),ua(ft(f,1,Gr,!0),Ke(d,2))}),mO=sr(function(f){var d=tn(f);return d=typeof d=="function"?d:t,ua(ft(f,1,Gr,!0),t,d)});function bO(f){return f&&f.length?ua(f):[]}function wO(f,d){return f&&f.length?ua(f,Ke(d,2)):[]}function xO(f,d){return d=typeof d=="function"?d:t,f&&f.length?ua(f,t,d):[]}function Uf(f){if(!(f&&f.length))return[];var d=0;return f=na(f,function(y){if(Gr(y))return d=Xr(y.length,d),!0}),uf(d,function(y){return Or(f,af(y))})}function a1(f,d){if(!(f&&f.length))return[];var y=Uf(f);return d==null?y:Or(y,function(T){return Vt(d,t,T)})}var EO=sr(function(f,d){return Gr(f)?xo(f,d):[]}),_O=sr(function(f){return Pf(na(f,Gr))}),CO=sr(function(f){var d=tn(f);return Gr(d)&&(d=t),Pf(na(f,Gr),Ke(d,2))}),SO=sr(function(f){var d=tn(f);return d=typeof d=="function"?d:t,Pf(na(f,Gr),t,d)}),TO=sr(Uf);function RO(f,d){return Eb(f||[],d||[],wo)}function AO(f,d){return Eb(f||[],d||[],Co)}var PO=sr(function(f){var d=f.length,y=d>1?f[d-1]:t;return y=typeof y=="function"?(f.pop(),y):t,a1(f,y)});function i1(f){var d=k(f);return d.__chain__=!0,d}function DO(f,d){return d(f),f}function iu(f,d){return d(f)}var IO=zn(function(f){var d=f.length,y=d?f[0]:0,T=this.__wrapped__,B=function(q){return pf(q,f)};return d>1||this.__actions__.length||!(T instanceof dr)||!$n(y)?this.thru(B):(T=T.slice(y,+y+(d?1:0)),T.__actions__.push({func:iu,args:[B],thisArg:t}),new Jt(T,this.__chain__).thru(function(q){return d&&!q.length&&q.push(t),q}))});function BO(){return i1(this)}function OO(){return new Jt(this.value(),this.__chain__)}function MO(){this.__values__===t&&(this.__values__=b1(this.value()));var f=this.__index__>=this.__values__.length,d=f?t:this.__values__[this.__index__++];return{done:f,value:d}}function kO(){return this}function LO(f){for(var d,y=this;y instanceof Ws;){var T=Qb(y);T.__index__=0,T.__values__=t,d?B.__wrapped__=T:d=T;var B=T;y=y.__wrapped__}return B.__wrapped__=f,d}function qO(){var f=this.__wrapped__;if(f instanceof dr){var d=f;return this.__actions__.length&&(d=new dr(this)),d=d.reverse(),d.__actions__.push({func:iu,args:[Wf],thisArg:t}),new Jt(d,this.__chain__)}return this.thru(Wf)}function NO(){return xb(this.__wrapped__,this.__actions__)}var FO=Xs(function(f,d,y){br.call(f,y)?++f[y]:Nn(f,y,1)});function zO(f,d,y){var T=Je(f)?M0:DI;return y&&Tt(f,d,y)&&(d=t),T(f,Ke(d,3))}function $O(f,d){var y=Je(f)?na:ab;return y(f,Ke(d,3))}var VO=Bb(Jb),GO=Bb(e1);function WO(f,d){return ft(ou(f,d),1)}function UO(f,d){return ft(ou(f,d),G)}function HO(f,d,y){return y=y===t?1:tr(y),ft(ou(f,d),y)}function o1(f,d){var y=Je(f)?Xt:sa;return y(f,Ke(d,3))}function s1(f,d){var y=Je(f)?cD:nb;return y(f,Ke(d,3))}var KO=Xs(function(f,d,y){br.call(f,y)?f[y].push(d):Nn(f,y,[d])});function jO(f,d,y,T){f=Mt(f)?f:Oi(f),y=y&&!T?tr(y):0;var B=f.length;return y<0&&(y=Xr(B+y,0)),cu(f)?y<=B&&f.indexOf(d,y)>-1:!!B&&xi(f,d,y)>-1}var YO=sr(function(f,d,y){var T=-1,B=typeof d=="function",q=Mt(f)?ce(f.length):[];return sa(f,function(K){q[++T]=B?Vt(d,K,y):Eo(K,d,y)}),q}),ZO=Xs(function(f,d,y){Nn(f,y,d)});function ou(f,d){var y=Je(f)?Or:fb;return y(f,Ke(d,3))}function XO(f,d,y,T){return f==null?[]:(Je(d)||(d=d==null?[]:[d]),y=T?t:y,Je(y)||(y=y==null?[]:[y]),hb(f,d,y))}var QO=Xs(function(f,d,y){f[y?0:1].push(d)},function(){return[[],[]]});function JO(f,d,y){var T=Je(f)?tf:N0,B=arguments.length<3;return T(f,Ke(d,4),y,B,sa)}function eM(f,d,y){var T=Je(f)?dD:N0,B=arguments.length<3;return T(f,Ke(d,4),y,B,nb)}function rM(f,d){var y=Je(f)?na:ab;return y(f,lu(Ke(d,3)))}function tM(f){var d=Je(f)?J0:jI;return d(f)}function nM(f,d,y){(y?Tt(f,d,y):d===t)?d=1:d=tr(d);var T=Je(f)?SI:YI;return T(f,d)}function aM(f){var d=Je(f)?TI:XI;return d(f)}function iM(f){if(f==null)return 0;if(Mt(f))return cu(f)?_i(f):f.length;var d=mt(f);return d==he||d==Pe?f.size:Ef(f).length}function oM(f,d,y){var T=Je(f)?nf:QI;return y&&Tt(f,d,y)&&(d=t),T(f,Ke(d,3))}var sM=sr(function(f,d){if(f==null)return[];var y=d.length;return y>1&&Tt(f,d[0],d[1])?d=[]:y>2&&Tt(d[0],d[1],d[2])&&(d=[d[0]]),hb(f,ft(d,1),[])}),su=$D||function(){return lt.Date.now()};function uM(f,d){if(typeof d!="function")throw new Qt(o);return f=tr(f),function(){if(--f<1)return d.apply(this,arguments)}}function u1(f,d,y){return d=y?t:d,d=f&&d==null?f.length:d,Fn(f,S,t,t,t,t,d)}function l1(f,d){var y;if(typeof d!="function")throw new Qt(o);return f=tr(f),function(){return--f>0&&(y=d.apply(this,arguments)),f<=1&&(d=t),y}}var Hf=sr(function(f,d,y){var T=m;if(y.length){var B=ia(y,Ii(Hf));T|=C}return Fn(f,T,d,y,B)}),f1=sr(function(f,d,y){var T=m|b;if(y.length){var B=ia(y,Ii(f1));T|=C}return Fn(d,T,f,y,B)});function c1(f,d,y){d=y?t:d;var T=Fn(f,x,t,t,t,t,t,d);return T.placeholder=c1.placeholder,T}function d1(f,d,y){d=y?t:d;var T=Fn(f,_,t,t,t,t,t,d);return T.placeholder=d1.placeholder,T}function v1(f,d,y){var T,B,q,K,Q,ae,we=0,xe=!1,Ce=!1,Be=!0;if(typeof f!="function")throw new Qt(o);d=nn(d)||0,qr(y)&&(xe=!!y.leading,Ce="maxWait"in y,q=Ce?Xr(nn(y.maxWait)||0,d):q,Be="trailing"in y?!!y.trailing:Be);function Ve(Wr){var pn=T,Wn=B;return T=B=t,we=Wr,K=f.apply(Wn,pn),K}function Ye(Wr){return we=Wr,Q=Ro(cr,d),xe?Ve(Wr):K}function ar(Wr){var pn=Wr-ae,Wn=Wr-we,B1=d-pn;return Ce?yt(B1,q-Wn):B1}function Ze(Wr){var pn=Wr-ae,Wn=Wr-we;return ae===t||pn>=d||pn<0||Ce&&Wn>=q}function cr(){var Wr=su();if(Ze(Wr))return vr(Wr);Q=Ro(cr,ar(Wr))}function vr(Wr){return Q=t,Be&&T?Ve(Wr):(T=B=t,K)}function Ht(){Q!==t&&_b(Q),we=0,T=ae=B=Q=t}function Rt(){return Q===t?K:vr(su())}function Kt(){var Wr=su(),pn=Ze(Wr);if(T=arguments,B=this,ae=Wr,pn){if(Q===t)return Ye(ae);if(Ce)return _b(Q),Q=Ro(cr,d),Ve(ae)}return Q===t&&(Q=Ro(cr,d)),K}return Kt.cancel=Ht,Kt.flush=Rt,Kt}var lM=sr(function(f,d){return tb(f,1,d)}),fM=sr(function(f,d,y){return tb(f,nn(d)||0,y)});function cM(f){return Fn(f,P)}function uu(f,d){if(typeof f!="function"||d!=null&&typeof d!="function")throw new Qt(o);var y=function(){var T=arguments,B=d?d.apply(this,T):T[0],q=y.cache;if(q.has(B))return q.get(B);var K=f.apply(this,T);return y.cache=q.set(B,K)||q,K};return y.cache=new(uu.Cache||qn),y}uu.Cache=qn;function lu(f){if(typeof f!="function")throw new Qt(o);return function(){var d=arguments;switch(d.length){case 0:return!f.call(this);case 1:return!f.call(this,d[0]);case 2:return!f.call(this,d[0],d[1]);case 3:return!f.call(this,d[0],d[1],d[2])}return!f.apply(this,d)}}function dM(f){return l1(2,f)}var vM=JI(function(f,d){d=d.length==1&&Je(d[0])?Or(d[0],Gt(Ke())):Or(ft(d,1),Gt(Ke()));var y=d.length;return sr(function(T){for(var B=-1,q=yt(T.length,y);++B<q;)T[B]=d[B].call(this,T[B]);return Vt(f,this,T)})}),Kf=sr(function(f,d){var y=ia(d,Ii(Kf));return Fn(f,C,t,d,y)}),h1=sr(function(f,d){var y=ia(d,Ii(h1));return Fn(f,R,t,d,y)}),hM=zn(function(f,d){return Fn(f,A,t,t,t,d)});function gM(f,d){if(typeof f!="function")throw new Qt(o);return d=d===t?d:tr(d),sr(f,d)}function pM(f,d){if(typeof f!="function")throw new Qt(o);return d=d==null?0:Xr(tr(d),0),sr(function(y){var T=y[d],B=fa(y,0,d);return T&&aa(B,T),Vt(f,this,B)})}function yM(f,d,y){var T=!0,B=!0;if(typeof f!="function")throw new Qt(o);return qr(y)&&(T="leading"in y?!!y.leading:T,B="trailing"in y?!!y.trailing:B),v1(f,d,{leading:T,maxWait:d,trailing:B})}function mM(f){return u1(f,1)}function bM(f,d){return Kf(If(d),f)}function wM(){if(!arguments.length)return[];var f=arguments[0];return Je(f)?f:[f]}function xM(f){return en(f,g)}function EM(f,d){return d=typeof d=="function"?d:t,en(f,g,d)}function _M(f){return en(f,v|g)}function CM(f,d){return d=typeof d=="function"?d:t,en(f,v|g,d)}function SM(f,d){return d==null||rb(f,d,nt(d))}function gn(f,d){return f===d||f!==f&&d!==d}var TM=ru(bf),RM=ru(function(f,d){return f>=d}),Ha=sb((function(){return arguments})())?sb:function(f){return zr(f)&&br.call(f,"callee")&&!K0.call(f,"callee")},Je=ce.isArray,AM=A0?Gt(A0):LI;function Mt(f){return f!=null&&fu(f.length)&&!Vn(f)}function Gr(f){return zr(f)&&Mt(f)}function PM(f){return f===!0||f===!1||zr(f)&&St(f)==ie}var ca=GD||ac,DM=P0?Gt(P0):qI;function IM(f){return zr(f)&&f.nodeType===1&&!Ao(f)}function BM(f){if(f==null)return!0;if(Mt(f)&&(Je(f)||typeof f=="string"||typeof f.splice=="function"||ca(f)||Bi(f)||Ha(f)))return!f.length;var d=mt(f);if(d==he||d==Pe)return!f.size;if(To(f))return!Ef(f).length;for(var y in f)if(br.call(f,y))return!1;return!0}function OM(f,d){return _o(f,d)}function MM(f,d,y){y=typeof y=="function"?y:t;var T=y?y(f,d):t;return T===t?_o(f,d,t,y):!!T}function jf(f){if(!zr(f))return!1;var d=St(f);return d==X||d==Y||typeof f.message=="string"&&typeof f.name=="string"&&!Ao(f)}function kM(f){return typeof f=="number"&&Y0(f)}function Vn(f){if(!qr(f))return!1;var d=St(f);return d==re||d==le||d==ee||d==Ae}function g1(f){return typeof f=="number"&&f==tr(f)}function fu(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=U}function qr(f){var d=typeof f;return f!=null&&(d=="object"||d=="function")}function zr(f){return f!=null&&typeof f=="object"}var p1=D0?Gt(D0):FI;function LM(f,d){return f===d||xf(f,d,Nf(d))}function qM(f,d,y){return y=typeof y=="function"?y:t,xf(f,d,Nf(d),y)}function NM(f){return y1(f)&&f!=+f}function FM(f){if(EB(f))throw new Qe(i);return ub(f)}function zM(f){return f===null}function $M(f){return f==null}function y1(f){return typeof f=="number"||zr(f)&&St(f)==be}function Ao(f){if(!zr(f)||St(f)!=ue)return!1;var d=qs(f);if(d===null)return!0;var y=br.call(d,"constructor")&&d.constructor;return typeof y=="function"&&y instanceof y&&Os.call(y)==qD}var Yf=I0?Gt(I0):zI;function VM(f){return g1(f)&&f>=-U&&f<=U}var m1=B0?Gt(B0):$I;function cu(f){return typeof f=="string"||!Je(f)&&zr(f)&&St(f)==Ie}function Ut(f){return typeof f=="symbol"||zr(f)&&St(f)==Le}var Bi=O0?Gt(O0):VI;function GM(f){return f===t}function WM(f){return zr(f)&&mt(f)==je}function UM(f){return zr(f)&&St(f)==lr}var HM=ru(_f),KM=ru(function(f,d){return f<=d});function b1(f){if(!f)return[];if(Mt(f))return cu(f)?vn(f):Ot(f);if(go&&f[go])return SD(f[go]());var d=mt(f),y=d==he?ff:d==Pe?Ds:Oi;return y(f)}function Gn(f){if(!f)return f===0?f:0;if(f=nn(f),f===G||f===-G){var d=f<0?-1:1;return d*J}return f===f?f:0}function tr(f){var d=Gn(f),y=d%1;return d===d?y?d-y:d:0}function w1(f){return f?Va(tr(f),0,H):0}function nn(f){if(typeof f=="number")return f;if(Ut(f))return W;if(qr(f)){var d=typeof f.valueOf=="function"?f.valueOf():f;f=qr(d)?d+"":d}if(typeof f!="string")return f===0?f:+f;f=F0(f);var y=pt.test(f);return y||Bt.test(f)?uD(f.slice(2),y?2:8):tt.test(f)?W:+f}function x1(f){return Cn(f,kt(f))}function jM(f){return f?Va(tr(f),-U,U):f===0?f:0}function wr(f){return f==null?"":Wt(f)}var YM=Pi(function(f,d){if(To(d)||Mt(d)){Cn(d,nt(d),f);return}for(var y in d)br.call(d,y)&&wo(f,y,d[y])}),E1=Pi(function(f,d){Cn(d,kt(d),f)}),du=Pi(function(f,d,y,T){Cn(d,kt(d),f,T)}),ZM=Pi(function(f,d,y,T){Cn(d,nt(d),f,T)}),XM=zn(pf);function QM(f,d){var y=Ai(f);return d==null?y:eb(y,d)}var JM=sr(function(f,d){f=Cr(f);var y=-1,T=d.length,B=T>2?d[2]:t;for(B&&Tt(d[0],d[1],B)&&(T=1);++y<T;)for(var q=d[y],K=kt(q),Q=-1,ae=K.length;++Q<ae;){var we=K[Q],xe=f[we];(xe===t||gn(xe,Si[we])&&!br.call(f,we))&&(f[we]=q[we])}return f}),ek=sr(function(f){return f.push(t,Fb),Vt(_1,t,f)});function rk(f,d){return k0(f,Ke(d,3),_n)}function tk(f,d){return k0(f,Ke(d,3),mf)}function nk(f,d){return f==null?f:yf(f,Ke(d,3),kt)}function ak(f,d){return f==null?f:ib(f,Ke(d,3),kt)}function ik(f,d){return f&&_n(f,Ke(d,3))}function ok(f,d){return f&&mf(f,Ke(d,3))}function sk(f){return f==null?[]:Ks(f,nt(f))}function uk(f){return f==null?[]:Ks(f,kt(f))}function Zf(f,d,y){var T=f==null?t:Ga(f,d);return T===t?y:T}function lk(f,d){return f!=null&&Vb(f,d,BI)}function Xf(f,d){return f!=null&&Vb(f,d,OI)}var fk=Mb(function(f,d,y){d!=null&&typeof d.toString!="function"&&(d=Ms.call(d)),f[d]=y},Jf(Lt)),ck=Mb(function(f,d,y){d!=null&&typeof d.toString!="function"&&(d=Ms.call(d)),br.call(f,d)?f[d].push(y):f[d]=[y]},Ke),dk=sr(Eo);function nt(f){return Mt(f)?Q0(f):Ef(f)}function kt(f){return Mt(f)?Q0(f,!0):GI(f)}function vk(f,d){var y={};return d=Ke(d,3),_n(f,function(T,B,q){Nn(y,d(T,B,q),T)}),y}function hk(f,d){var y={};return d=Ke(d,3),_n(f,function(T,B,q){Nn(y,B,d(T,B,q))}),y}var gk=Pi(function(f,d,y){js(f,d,y)}),_1=Pi(function(f,d,y,T){js(f,d,y,T)}),pk=zn(function(f,d){var y={};if(f==null)return y;var T=!1;d=Or(d,function(q){return q=la(q,f),T||(T=q.length>1),q}),Cn(f,Lf(f),y),T&&(y=en(y,v|h|g,fB));for(var B=d.length;B--;)Af(y,d[B]);return y});function yk(f,d){return C1(f,lu(Ke(d)))}var mk=zn(function(f,d){return f==null?{}:UI(f,d)});function C1(f,d){if(f==null)return{};var y=Or(Lf(f),function(T){return[T]});return d=Ke(d),gb(f,y,function(T,B){return d(T,B[0])})}function bk(f,d,y){d=la(d,f);var T=-1,B=d.length;for(B||(B=1,f=t);++T<B;){var q=f==null?t:f[Sn(d[T])];q===t&&(T=B,q=y),f=Vn(q)?q.call(f):q}return f}function wk(f,d,y){return f==null?f:Co(f,d,y)}function xk(f,d,y,T){return T=typeof T=="function"?T:t,f==null?f:Co(f,d,y,T)}var S1=qb(nt),T1=qb(kt);function Ek(f,d,y){var T=Je(f),B=T||ca(f)||Bi(f);if(d=Ke(d,4),y==null){var q=f&&f.constructor;B?y=T?new q:[]:qr(f)?y=Vn(q)?Ai(qs(f)):{}:y={}}return(B?Xt:_n)(f,function(K,Q,ae){return d(y,K,Q,ae)}),y}function _k(f,d){return f==null?!0:Af(f,d)}function Ck(f,d,y){return f==null?f:wb(f,d,If(y))}function Sk(f,d,y,T){return T=typeof T=="function"?T:t,f==null?f:wb(f,d,If(y),T)}function Oi(f){return f==null?[]:lf(f,nt(f))}function Tk(f){return f==null?[]:lf(f,kt(f))}function Rk(f,d,y){return y===t&&(y=d,d=t),y!==t&&(y=nn(y),y=y===y?y:0),d!==t&&(d=nn(d),d=d===d?d:0),Va(nn(f),d,y)}function Ak(f,d,y){return d=Gn(d),y===t?(y=d,d=0):y=Gn(y),f=nn(f),MI(f,d,y)}function Pk(f,d,y){if(y&&typeof y!="boolean"&&Tt(f,d,y)&&(d=y=t),y===t&&(typeof d=="boolean"?(y=d,d=t):typeof f=="boolean"&&(y=f,f=t)),f===t&&d===t?(f=0,d=1):(f=Gn(f),d===t?(d=f,f=0):d=Gn(d)),f>d){var T=f;f=d,d=T}if(y||f%1||d%1){var B=Z0();return yt(f+B*(d-f+sD("1e-"+((B+"").length-1))),d)}return Sf(f,d)}var Dk=Di(function(f,d,y){return d=d.toLowerCase(),f+(y?R1(d):d)});function R1(f){return Qf(wr(f).toLowerCase())}function A1(f){return f=wr(f),f&&f.replace($l,wD).replace(XP,"")}function Ik(f,d,y){f=wr(f),d=Wt(d);var T=f.length;y=y===t?T:Va(tr(y),0,T);var B=y;return y-=d.length,y>=0&&f.slice(y,B)==d}function Bk(f){return f=wr(f),f&&er.test(f)?f.replace(We,xD):f}function Ok(f){return f=wr(f),f&&Ur.test(f)?f.replace(Br,"\\$&"):f}var Mk=Di(function(f,d,y){return f+(y?"-":"")+d.toLowerCase()}),kk=Di(function(f,d,y){return f+(y?" ":"")+d.toLowerCase()}),Lk=Ib("toLowerCase");function qk(f,d,y){f=wr(f),d=tr(d);var T=d?_i(f):0;if(!d||T>=d)return f;var B=(d-T)/2;return eu($s(B),y)+f+eu(zs(B),y)}function Nk(f,d,y){f=wr(f),d=tr(d);var T=d?_i(f):0;return d&&T<d?f+eu(d-T,y):f}function Fk(f,d,y){f=wr(f),d=tr(d);var T=d?_i(f):0;return d&&T<d?eu(d-T,y)+f:f}function zk(f,d,y){return y||d==null?d=0:d&&(d=+d),KD(wr(f).replace(Lr,""),d||0)}function $k(f,d,y){return(y?Tt(f,d,y):d===t)?d=1:d=tr(d),Tf(wr(f),d)}function Vk(){var f=arguments,d=wr(f[0]);return f.length<3?d:d.replace(f[1],f[2])}var Gk=Di(function(f,d,y){return f+(y?"_":"")+d.toLowerCase()});function Wk(f,d,y){return y&&typeof y!="number"&&Tt(f,d,y)&&(d=y=t),y=y===t?H:y>>>0,y?(f=wr(f),f&&(typeof d=="string"||d!=null&&!Yf(d))&&(d=Wt(d),!d&&Ei(f))?fa(vn(f),0,y):f.split(d,y)):[]}var Uk=Di(function(f,d,y){return f+(y?" ":"")+Qf(d)});function Hk(f,d,y){return f=wr(f),y=y==null?0:Va(tr(y),0,f.length),d=Wt(d),f.slice(y,y+d.length)==d}function Kk(f,d,y){var T=k.templateSettings;y&&Tt(f,d,y)&&(d=t),f=wr(f),d=du({},d,T,Nb);var B=du({},d.imports,T.imports,Nb),q=nt(B),K=lf(B,q),Q,ae,we=0,xe=d.interpolate||gi,Ce="__p += '",Be=cf((d.escape||gi).source+"|"+xe.source+"|"+(xe===rr?kn:gi).source+"|"+(d.evaluate||gi).source+"|$","g"),Ve="//# sourceURL="+(br.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tD+"]")+`
|
|
341
|
-
`;f.replace(
|
|
338
|
+
*/var wW=Go.exports,q2;function xW(){return q2||(q2=1,(function(r,e){(function(){var t,n="4.17.23",a=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,c="__lodash_placeholder__",d=1,h=2,g=4,p=1,E=2,y=1,b=2,w=4,x=8,C=16,T=32,S=64,_=128,A=256,P=512,I=30,D="...",k=800,M=16,N=1,z=2,$=3,q=1/0,V=9007199254740991,Z=17976931348623157e292,K=NaN,j=4294967295,ee=j-1,le=j>>>1,W=[["ary",_],["bind",y],["bindKey",b],["curry",x],["curryRight",C],["flip",P],["partial",T],["partialRight",S],["rearg",A]],G="[object Arguments]",Y="[object Array]",re="[object AsyncFunction]",de="[object Boolean]",se="[object Date]",X="[object DOMException]",Q="[object Error]",ae="[object Function]",te="[object GeneratorFunction]",ce="[object Map]",_e="[object Number]",ve="[object Null]",U="[object Object]",fe="[object Promise]",xe="[object Proxy]",ge="[object RegExp]",be="[object Set]",Ae="[object String]",De="[object Symbol]",Be="[object Undefined]",Le="[object WeakMap]",He="[object WeakSet]",Ve="[object ArrayBuffer]",Xe="[object DataView]",er="[object Float32Array]",$e="[object Float64Array]",ke="[object Int8Array]",ye="[object Int16Array]",O="[object Int32Array]",oe="[object Uint8Array]",me="[object Uint8ClampedArray]",we="[object Uint16Array]",Ce="[object Uint32Array]",qe=/\b__p \+= '';/g,Pe=/\b(__p \+=) '' \+/g,Ge=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fe=/&(?:amp|lt|gt|quot|#39);/g,je=/[&<>"']/g,or=RegExp(Fe.source),nr=RegExp(je.source),We=/<%-([\s\S]+?)%>/g,ur=/<%([\s\S]+?)%>/g,ar=/<%=([\s\S]+?)%>/g,Wr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mr=/^\w*$/,lt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kr=/[\\^$.*+?()[\]{}|]/g,Kr=RegExp(kr.source),Nr=/^\s+/,Xr=/\s/,Cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$r=/\{\n\/\* \[wrapped with (.+)\] \*/,dn=/,? & /,vn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ta=/[()=,{}\[\]\/\s]/,gi=/\\(\\)?/g,Ln=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,at=/^[-+]0x[0-9a-f]+$/i,bt=/^0b[01]+$/i,Na=/^\[object .+?Constructor\]$/,Mt=/^0o[0-7]+$/i,Ts=/^(?:0|[1-9]\d*)$/,Vl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pi=/($^)/,Gl=/['\n\r\u2028\u2029\\]/g,yi="\\ud800-\\udfff",Wl="\\u0300-\\u036f",Ul="\\ufe20-\\ufe2f",Hl="\\u20d0-\\u20ff",na=Wl+Ul+Hl,mi="\\u2700-\\u27bf",Fa="a-z\\xdf-\\xf6\\xf8-\\xff",Rs="\\xac\\xb1\\xd7\\xf7",As="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kl="\\u2000-\\u206f",Vt=" \\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",bi="A-Z\\xc0-\\xd6\\xd8-\\xde",ho="\\ufe0e\\ufe0f",aa=Rs+As+Kl+Vt,Tt="['’]",jl="["+yi+"]",Yl="["+aa+"]",wi="["+na+"]",p0="\\d+",XP="["+mi+"]",y0="["+Fa+"]",m0="[^"+yi+aa+p0+mi+Fa+bi+"]",Zl="\\ud83c[\\udffb-\\udfff]",QP="(?:"+wi+"|"+Zl+")",b0="[^"+yi+"]",Xl="(?:\\ud83c[\\udde6-\\uddff]){2}",Ql="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+bi+"]",w0="\\u200d",x0="(?:"+y0+"|"+m0+")",JP="(?:"+xi+"|"+m0+")",E0="(?:"+Tt+"(?:d|ll|m|re|s|t|ve))?",C0="(?:"+Tt+"(?:D|LL|M|RE|S|T|VE))?",_0=QP+"?",S0="["+ho+"]?",eI="(?:"+w0+"(?:"+[b0,Xl,Ql].join("|")+")"+S0+_0+")*",rI="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tI="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",T0=S0+_0+eI,nI="(?:"+[XP,Xl,Ql].join("|")+")"+T0,aI="(?:"+[b0+wi+"?",wi,Xl,Ql,jl].join("|")+")",iI=RegExp(Tt,"g"),oI=RegExp(wi,"g"),Jl=RegExp(Zl+"(?="+Zl+")|"+aI+T0,"g"),sI=RegExp([xi+"?"+y0+"+"+E0+"(?="+[Yl,xi,"$"].join("|")+")",JP+"+"+C0+"(?="+[Yl,xi+x0,"$"].join("|")+")",xi+"?"+x0+"+"+E0,xi+"+"+C0,tI,rI,p0,nI].join("|"),"g"),uI=RegExp("["+w0+yi+na+ho+"]"),lI=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fI=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],cI=-1,Ir={};Ir[er]=Ir[$e]=Ir[ke]=Ir[ye]=Ir[O]=Ir[oe]=Ir[me]=Ir[we]=Ir[Ce]=!0,Ir[G]=Ir[Y]=Ir[Ve]=Ir[de]=Ir[Xe]=Ir[se]=Ir[Q]=Ir[ae]=Ir[ce]=Ir[_e]=Ir[U]=Ir[ge]=Ir[be]=Ir[Ae]=Ir[Le]=!1;var Tr={};Tr[G]=Tr[Y]=Tr[Ve]=Tr[Xe]=Tr[de]=Tr[se]=Tr[er]=Tr[$e]=Tr[ke]=Tr[ye]=Tr[O]=Tr[ce]=Tr[_e]=Tr[U]=Tr[ge]=Tr[be]=Tr[Ae]=Tr[De]=Tr[oe]=Tr[me]=Tr[we]=Tr[Ce]=!0,Tr[Q]=Tr[ae]=Tr[Le]=!1;var dI={À:"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"},vI={"&":"&","<":"<",">":">",'"':""","'":"'"},hI={"&":"&","<":"<",">":">",""":'"',"'":"'"},gI={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pI=parseFloat,yI=parseInt,R0=typeof Et=="object"&&Et&&Et.Object===Object&&Et,mI=typeof self=="object"&&self&&self.Object===Object&&self,ct=R0||mI||Function("return this")(),ef=e&&!e.nodeType&&e,za=ef&&!0&&r&&!r.nodeType&&r,A0=za&&za.exports===ef,rf=A0&&R0.process,Xt=(function(){try{var ne=za&&za.require&&za.require("util").types;return ne||rf&&rf.binding&&rf.binding("util")}catch{}})(),P0=Xt&&Xt.isArrayBuffer,I0=Xt&&Xt.isDate,D0=Xt&&Xt.isMap,B0=Xt&&Xt.isRegExp,M0=Xt&&Xt.isSet,k0=Xt&&Xt.isTypedArray;function Gt(ne,Ee,he){switch(he.length){case 0:return ne.call(Ee);case 1:return ne.call(Ee,he[0]);case 2:return ne.call(Ee,he[0],he[1]);case 3:return ne.call(Ee,he[0],he[1],he[2])}return ne.apply(Ee,he)}function bI(ne,Ee,he,Ne){for(var rr=-1,mr=ne==null?0:ne.length;++rr<mr;){var Qr=ne[rr];Ee(Ne,Qr,he(Qr),ne)}return Ne}function Qt(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length;++he<Ne&&Ee(ne[he],he,ne)!==!1;);return ne}function wI(ne,Ee){for(var he=ne==null?0:ne.length;he--&&Ee(ne[he],he,ne)!==!1;);return ne}function O0(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length;++he<Ne;)if(!Ee(ne[he],he,ne))return!1;return!0}function ia(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length,rr=0,mr=[];++he<Ne;){var Qr=ne[he];Ee(Qr,he,ne)&&(mr[rr++]=Qr)}return mr}function Ps(ne,Ee){var he=ne==null?0:ne.length;return!!he&&Ei(ne,Ee,0)>-1}function tf(ne,Ee,he){for(var Ne=-1,rr=ne==null?0:ne.length;++Ne<rr;)if(he(Ee,ne[Ne]))return!0;return!1}function Or(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length,rr=Array(Ne);++he<Ne;)rr[he]=Ee(ne[he],he,ne);return rr}function oa(ne,Ee){for(var he=-1,Ne=Ee.length,rr=ne.length;++he<Ne;)ne[rr+he]=Ee[he];return ne}function nf(ne,Ee,he,Ne){var rr=-1,mr=ne==null?0:ne.length;for(Ne&&mr&&(he=ne[++rr]);++rr<mr;)he=Ee(he,ne[rr],rr,ne);return he}function xI(ne,Ee,he,Ne){var rr=ne==null?0:ne.length;for(Ne&&rr&&(he=ne[--rr]);rr--;)he=Ee(he,ne[rr],rr,ne);return he}function af(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length;++he<Ne;)if(Ee(ne[he],he,ne))return!0;return!1}var EI=of("length");function CI(ne){return ne.split("")}function _I(ne){return ne.match(vn)||[]}function L0(ne,Ee,he){var Ne;return he(ne,function(rr,mr,Qr){if(Ee(rr,mr,Qr))return Ne=mr,!1}),Ne}function Is(ne,Ee,he,Ne){for(var rr=ne.length,mr=he+(Ne?1:-1);Ne?mr--:++mr<rr;)if(Ee(ne[mr],mr,ne))return mr;return-1}function Ei(ne,Ee,he){return Ee===Ee?LI(ne,Ee,he):Is(ne,q0,he)}function SI(ne,Ee,he,Ne){for(var rr=he-1,mr=ne.length;++rr<mr;)if(Ne(ne[rr],Ee))return rr;return-1}function q0(ne){return ne!==ne}function N0(ne,Ee){var he=ne==null?0:ne.length;return he?uf(ne,Ee)/he:K}function of(ne){return function(Ee){return Ee==null?t:Ee[ne]}}function sf(ne){return function(Ee){return ne==null?t:ne[Ee]}}function F0(ne,Ee,he,Ne,rr){return rr(ne,function(mr,Qr,_r){he=Ne?(Ne=!1,mr):Ee(he,mr,Qr,_r)}),he}function TI(ne,Ee){var he=ne.length;for(ne.sort(Ee);he--;)ne[he]=ne[he].value;return ne}function uf(ne,Ee){for(var he,Ne=-1,rr=ne.length;++Ne<rr;){var mr=Ee(ne[Ne]);mr!==t&&(he=he===t?mr:he+mr)}return he}function lf(ne,Ee){for(var he=-1,Ne=Array(ne);++he<ne;)Ne[he]=Ee(he);return Ne}function RI(ne,Ee){return Or(Ee,function(he){return[he,ne[he]]})}function z0(ne){return ne&&ne.slice(0,W0(ne)+1).replace(Nr,"")}function Wt(ne){return function(Ee){return ne(Ee)}}function ff(ne,Ee){return Or(Ee,function(he){return ne[he]})}function go(ne,Ee){return ne.has(Ee)}function $0(ne,Ee){for(var he=-1,Ne=ne.length;++he<Ne&&Ei(Ee,ne[he],0)>-1;);return he}function V0(ne,Ee){for(var he=ne.length;he--&&Ei(Ee,ne[he],0)>-1;);return he}function AI(ne,Ee){for(var he=ne.length,Ne=0;he--;)ne[he]===Ee&&++Ne;return Ne}var PI=sf(dI),II=sf(vI);function DI(ne){return"\\"+gI[ne]}function BI(ne,Ee){return ne==null?t:ne[Ee]}function Ci(ne){return uI.test(ne)}function MI(ne){return lI.test(ne)}function kI(ne){for(var Ee,he=[];!(Ee=ne.next()).done;)he.push(Ee.value);return he}function cf(ne){var Ee=-1,he=Array(ne.size);return ne.forEach(function(Ne,rr){he[++Ee]=[rr,Ne]}),he}function G0(ne,Ee){return function(he){return ne(Ee(he))}}function sa(ne,Ee){for(var he=-1,Ne=ne.length,rr=0,mr=[];++he<Ne;){var Qr=ne[he];(Qr===Ee||Qr===c)&&(ne[he]=c,mr[rr++]=he)}return mr}function Ds(ne){var Ee=-1,he=Array(ne.size);return ne.forEach(function(Ne){he[++Ee]=Ne}),he}function OI(ne){var Ee=-1,he=Array(ne.size);return ne.forEach(function(Ne){he[++Ee]=[Ne,Ne]}),he}function LI(ne,Ee,he){for(var Ne=he-1,rr=ne.length;++Ne<rr;)if(ne[Ne]===Ee)return Ne;return-1}function qI(ne,Ee,he){for(var Ne=he+1;Ne--;)if(ne[Ne]===Ee)return Ne;return Ne}function _i(ne){return Ci(ne)?FI(ne):EI(ne)}function hn(ne){return Ci(ne)?zI(ne):CI(ne)}function W0(ne){for(var Ee=ne.length;Ee--&&Xr.test(ne.charAt(Ee)););return Ee}var NI=sf(hI);function FI(ne){for(var Ee=Jl.lastIndex=0;Jl.test(ne);)++Ee;return Ee}function zI(ne){return ne.match(Jl)||[]}function $I(ne){return ne.match(sI)||[]}var VI=(function ne(Ee){Ee=Ee==null?ct:Si.defaults(ct.Object(),Ee,Si.pick(ct,fI));var he=Ee.Array,Ne=Ee.Date,rr=Ee.Error,mr=Ee.Function,Qr=Ee.Math,_r=Ee.Object,df=Ee.RegExp,GI=Ee.String,Jt=Ee.TypeError,Bs=he.prototype,WI=mr.prototype,Ti=_r.prototype,Ms=Ee["__core-js_shared__"],ks=WI.toString,br=Ti.hasOwnProperty,UI=0,U0=(function(){var f=/[^.]+$/.exec(Ms&&Ms.keys&&Ms.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""})(),Os=Ti.toString,HI=ks.call(_r),KI=ct._,jI=df("^"+ks.call(br).replace(kr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ls=A0?Ee.Buffer:t,ua=Ee.Symbol,qs=Ee.Uint8Array,H0=Ls?Ls.allocUnsafe:t,Ns=G0(_r.getPrototypeOf,_r),K0=_r.create,j0=Ti.propertyIsEnumerable,Fs=Bs.splice,Y0=ua?ua.isConcatSpreadable:t,po=ua?ua.iterator:t,$a=ua?ua.toStringTag:t,zs=(function(){try{var f=Ha(_r,"defineProperty");return f({},"",{}),f}catch{}})(),YI=Ee.clearTimeout!==ct.clearTimeout&&Ee.clearTimeout,ZI=Ne&&Ne.now!==ct.Date.now&&Ne.now,XI=Ee.setTimeout!==ct.setTimeout&&Ee.setTimeout,$s=Qr.ceil,Vs=Qr.floor,vf=_r.getOwnPropertySymbols,QI=Ls?Ls.isBuffer:t,Z0=Ee.isFinite,JI=Bs.join,eD=G0(_r.keys,_r),Jr=Qr.max,wt=Qr.min,rD=Ne.now,tD=Ee.parseInt,X0=Qr.random,nD=Bs.reverse,hf=Ha(Ee,"DataView"),yo=Ha(Ee,"Map"),gf=Ha(Ee,"Promise"),Ri=Ha(Ee,"Set"),mo=Ha(Ee,"WeakMap"),bo=Ha(_r,"create"),Gs=mo&&new mo,Ai={},aD=Ka(hf),iD=Ka(yo),oD=Ka(gf),sD=Ka(Ri),uD=Ka(mo),Ws=ua?ua.prototype:t,wo=Ws?Ws.valueOf:t,Q0=Ws?Ws.toString:t;function L(f){if(Vr(f)&&!tr(f)&&!(f instanceof dr)){if(f instanceof en)return f;if(br.call(f,"__wrapped__"))return Jb(f)}return new en(f)}var Pi=(function(){function f(){}return function(v){if(!Fr(v))return{};if(K0)return K0(v);f.prototype=v;var m=new f;return f.prototype=t,m}})();function Us(){}function en(f,v){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!v,this.__index__=0,this.__values__=t}L.templateSettings={escape:We,evaluate:ur,interpolate:ar,variable:"",imports:{_:L}},L.prototype=Us.prototype,L.prototype.constructor=L,en.prototype=Pi(Us.prototype),en.prototype.constructor=en;function dr(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function lD(){var f=new dr(this.__wrapped__);return f.__actions__=kt(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=kt(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=kt(this.__views__),f}function fD(){if(this.__filtered__){var f=new dr(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function cD(){var f=this.__wrapped__.value(),v=this.__dir__,m=tr(f),R=v<0,B=m?f.length:0,F=CB(0,B,this.__views__),H=F.start,J=F.end,ie=J-H,Te=R?J:H-1,Re=this.__iteratees__,Ie=Re.length,Oe=0,Ue=wt(ie,this.__takeCount__);if(!m||!R&&B==ie&&Ue==ie)return Eb(f,this.__actions__);var Qe=[];e:for(;ie--&&Oe<Ue;){Te+=v;for(var sr=-1,Je=f[Te];++sr<Ie;){var cr=Re[sr],vr=cr.iteratee,Kt=cr.type,Pt=vr(Je);if(Kt==z)Je=Pt;else if(!Pt){if(Kt==N)continue e;break e}}Qe[Oe++]=Je}return Qe}dr.prototype=Pi(Us.prototype),dr.prototype.constructor=dr;function Va(f){var v=-1,m=f==null?0:f.length;for(this.clear();++v<m;){var R=f[v];this.set(R[0],R[1])}}function dD(){this.__data__=bo?bo(null):{},this.size=0}function vD(f){var v=this.has(f)&&delete this.__data__[f];return this.size-=v?1:0,v}function hD(f){var v=this.__data__;if(bo){var m=v[f];return m===l?t:m}return br.call(v,f)?v[f]:t}function gD(f){var v=this.__data__;return bo?v[f]!==t:br.call(v,f)}function pD(f,v){var m=this.__data__;return this.size+=this.has(f)?0:1,m[f]=bo&&v===t?l:v,this}Va.prototype.clear=dD,Va.prototype.delete=vD,Va.prototype.get=hD,Va.prototype.has=gD,Va.prototype.set=pD;function qn(f){var v=-1,m=f==null?0:f.length;for(this.clear();++v<m;){var R=f[v];this.set(R[0],R[1])}}function yD(){this.__data__=[],this.size=0}function mD(f){var v=this.__data__,m=Hs(v,f);if(m<0)return!1;var R=v.length-1;return m==R?v.pop():Fs.call(v,m,1),--this.size,!0}function bD(f){var v=this.__data__,m=Hs(v,f);return m<0?t:v[m][1]}function wD(f){return Hs(this.__data__,f)>-1}function xD(f,v){var m=this.__data__,R=Hs(m,f);return R<0?(++this.size,m.push([f,v])):m[R][1]=v,this}qn.prototype.clear=yD,qn.prototype.delete=mD,qn.prototype.get=bD,qn.prototype.has=wD,qn.prototype.set=xD;function Nn(f){var v=-1,m=f==null?0:f.length;for(this.clear();++v<m;){var R=f[v];this.set(R[0],R[1])}}function ED(){this.size=0,this.__data__={hash:new Va,map:new(yo||qn),string:new Va}}function CD(f){var v=au(this,f).delete(f);return this.size-=v?1:0,v}function _D(f){return au(this,f).get(f)}function SD(f){return au(this,f).has(f)}function TD(f,v){var m=au(this,f),R=m.size;return m.set(f,v),this.size+=m.size==R?0:1,this}Nn.prototype.clear=ED,Nn.prototype.delete=CD,Nn.prototype.get=_D,Nn.prototype.has=SD,Nn.prototype.set=TD;function Ga(f){var v=-1,m=f==null?0:f.length;for(this.__data__=new Nn;++v<m;)this.add(f[v])}function RD(f){return this.__data__.set(f,l),this}function AD(f){return this.__data__.has(f)}Ga.prototype.add=Ga.prototype.push=RD,Ga.prototype.has=AD;function gn(f){var v=this.__data__=new qn(f);this.size=v.size}function PD(){this.__data__=new qn,this.size=0}function ID(f){var v=this.__data__,m=v.delete(f);return this.size=v.size,m}function DD(f){return this.__data__.get(f)}function BD(f){return this.__data__.has(f)}function MD(f,v){var m=this.__data__;if(m instanceof qn){var R=m.__data__;if(!yo||R.length<a-1)return R.push([f,v]),this.size=++m.size,this;m=this.__data__=new Nn(R)}return m.set(f,v),this.size=m.size,this}gn.prototype.clear=PD,gn.prototype.delete=ID,gn.prototype.get=DD,gn.prototype.has=BD,gn.prototype.set=MD;function J0(f,v){var m=tr(f),R=!m&&ja(f),B=!m&&!R&&va(f),F=!m&&!R&&!B&&Mi(f),H=m||R||B||F,J=H?lf(f.length,GI):[],ie=J.length;for(var Te in f)(v||br.call(f,Te))&&!(H&&(Te=="length"||B&&(Te=="offset"||Te=="parent")||F&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||Vn(Te,ie)))&&J.push(Te);return J}function eb(f){var v=f.length;return v?f[Tf(0,v-1)]:t}function kD(f,v){return iu(kt(f),Wa(v,0,f.length))}function OD(f){return iu(kt(f))}function pf(f,v,m){(m!==t&&!pn(f[v],m)||m===t&&!(v in f))&&Fn(f,v,m)}function xo(f,v,m){var R=f[v];(!(br.call(f,v)&&pn(R,m))||m===t&&!(v in f))&&Fn(f,v,m)}function Hs(f,v){for(var m=f.length;m--;)if(pn(f[m][0],v))return m;return-1}function LD(f,v,m,R){return la(f,function(B,F,H){v(R,B,m(B),H)}),R}function rb(f,v){return f&&Sn(v,it(v),f)}function qD(f,v){return f&&Sn(v,Lt(v),f)}function Fn(f,v,m){v=="__proto__"&&zs?zs(f,v,{configurable:!0,enumerable:!0,value:m,writable:!0}):f[v]=m}function yf(f,v){for(var m=-1,R=v.length,B=he(R),F=f==null;++m<R;)B[m]=F?t:Xf(f,v[m]);return B}function Wa(f,v,m){return f===f&&(m!==t&&(f=f<=m?f:m),v!==t&&(f=f>=v?f:v)),f}function rn(f,v,m,R,B,F){var H,J=v&d,ie=v&h,Te=v&g;if(m&&(H=B?m(f,R,B,F):m(f)),H!==t)return H;if(!Fr(f))return f;var Re=tr(f);if(Re){if(H=SB(f),!J)return kt(f,H)}else{var Ie=xt(f),Oe=Ie==ae||Ie==te;if(va(f))return Sb(f,J);if(Ie==U||Ie==G||Oe&&!B){if(H=ie||Oe?{}:Wb(f),!J)return ie?hB(f,qD(H,f)):vB(f,rb(H,f))}else{if(!Tr[Ie])return B?f:{};H=TB(f,Ie,J)}}F||(F=new gn);var Ue=F.get(f);if(Ue)return Ue;F.set(f,H),b1(f)?f.forEach(function(Je){H.add(rn(Je,v,m,Je,f,F))}):y1(f)&&f.forEach(function(Je,cr){H.set(cr,rn(Je,v,m,cr,f,F))});var Qe=Te?ie?qf:Lf:ie?Lt:it,sr=Re?t:Qe(f);return Qt(sr||f,function(Je,cr){sr&&(cr=Je,Je=f[cr]),xo(H,cr,rn(Je,v,m,cr,f,F))}),H}function ND(f){var v=it(f);return function(m){return tb(m,f,v)}}function tb(f,v,m){var R=m.length;if(f==null)return!R;for(f=_r(f);R--;){var B=m[R],F=v[B],H=f[B];if(H===t&&!(B in f)||!F(H))return!1}return!0}function nb(f,v,m){if(typeof f!="function")throw new Jt(o);return Ao(function(){f.apply(t,m)},v)}function Eo(f,v,m,R){var B=-1,F=Ps,H=!0,J=f.length,ie=[],Te=v.length;if(!J)return ie;m&&(v=Or(v,Wt(m))),R?(F=tf,H=!1):v.length>=a&&(F=go,H=!1,v=new Ga(v));e:for(;++B<J;){var Re=f[B],Ie=m==null?Re:m(Re);if(Re=R||Re!==0?Re:0,H&&Ie===Ie){for(var Oe=Te;Oe--;)if(v[Oe]===Ie)continue e;ie.push(Re)}else F(v,Ie,R)||ie.push(Re)}return ie}var la=Ib(_n),ab=Ib(bf,!0);function FD(f,v){var m=!0;return la(f,function(R,B,F){return m=!!v(R,B,F),m}),m}function Ks(f,v,m){for(var R=-1,B=f.length;++R<B;){var F=f[R],H=v(F);if(H!=null&&(J===t?H===H&&!Ht(H):m(H,J)))var J=H,ie=F}return ie}function zD(f,v,m,R){var B=f.length;for(m=ir(m),m<0&&(m=-m>B?0:B+m),R=R===t||R>B?B:ir(R),R<0&&(R+=B),R=m>R?0:x1(R);m<R;)f[m++]=v;return f}function ib(f,v){var m=[];return la(f,function(R,B,F){v(R,B,F)&&m.push(R)}),m}function dt(f,v,m,R,B){var F=-1,H=f.length;for(m||(m=AB),B||(B=[]);++F<H;){var J=f[F];v>0&&m(J)?v>1?dt(J,v-1,m,R,B):oa(B,J):R||(B[B.length]=J)}return B}var mf=Db(),ob=Db(!0);function _n(f,v){return f&&mf(f,v,it)}function bf(f,v){return f&&ob(f,v,it)}function js(f,v){return ia(v,function(m){return Gn(f[m])})}function Ua(f,v){v=ca(v,f);for(var m=0,R=v.length;f!=null&&m<R;)f=f[Tn(v[m++])];return m&&m==R?f:t}function sb(f,v,m){var R=v(f);return tr(f)?R:oa(R,m(f))}function Rt(f){return f==null?f===t?Be:ve:$a&&$a in _r(f)?EB(f):OB(f)}function wf(f,v){return f>v}function $D(f,v){return f!=null&&br.call(f,v)}function VD(f,v){return f!=null&&v in _r(f)}function GD(f,v,m){return f>=wt(v,m)&&f<Jr(v,m)}function xf(f,v,m){for(var R=m?tf:Ps,B=f[0].length,F=f.length,H=F,J=he(F),ie=1/0,Te=[];H--;){var Re=f[H];H&&v&&(Re=Or(Re,Wt(v))),ie=wt(Re.length,ie),J[H]=!m&&(v||B>=120&&Re.length>=120)?new Ga(H&&Re):t}Re=f[0];var Ie=-1,Oe=J[0];e:for(;++Ie<B&&Te.length<ie;){var Ue=Re[Ie],Qe=v?v(Ue):Ue;if(Ue=m||Ue!==0?Ue:0,!(Oe?go(Oe,Qe):R(Te,Qe,m))){for(H=F;--H;){var sr=J[H];if(!(sr?go(sr,Qe):R(f[H],Qe,m)))continue e}Oe&&Oe.push(Qe),Te.push(Ue)}}return Te}function WD(f,v,m,R){return _n(f,function(B,F,H){v(R,m(B),F,H)}),R}function Co(f,v,m){v=ca(v,f),f=jb(f,v);var R=f==null?f:f[Tn(nn(v))];return R==null?t:Gt(R,f,m)}function ub(f){return Vr(f)&&Rt(f)==G}function UD(f){return Vr(f)&&Rt(f)==Ve}function HD(f){return Vr(f)&&Rt(f)==se}function _o(f,v,m,R,B){return f===v?!0:f==null||v==null||!Vr(f)&&!Vr(v)?f!==f&&v!==v:KD(f,v,m,R,_o,B)}function KD(f,v,m,R,B,F){var H=tr(f),J=tr(v),ie=H?Y:xt(f),Te=J?Y:xt(v);ie=ie==G?U:ie,Te=Te==G?U:Te;var Re=ie==U,Ie=Te==U,Oe=ie==Te;if(Oe&&va(f)){if(!va(v))return!1;H=!0,Re=!1}if(Oe&&!Re)return F||(F=new gn),H||Mi(f)?$b(f,v,m,R,B,F):wB(f,v,ie,m,R,B,F);if(!(m&p)){var Ue=Re&&br.call(f,"__wrapped__"),Qe=Ie&&br.call(v,"__wrapped__");if(Ue||Qe){var sr=Ue?f.value():f,Je=Qe?v.value():v;return F||(F=new gn),B(sr,Je,m,R,F)}}return Oe?(F||(F=new gn),xB(f,v,m,R,B,F)):!1}function jD(f){return Vr(f)&&xt(f)==ce}function Ef(f,v,m,R){var B=m.length,F=B,H=!R;if(f==null)return!F;for(f=_r(f);B--;){var J=m[B];if(H&&J[2]?J[1]!==f[J[0]]:!(J[0]in f))return!1}for(;++B<F;){J=m[B];var ie=J[0],Te=f[ie],Re=J[1];if(H&&J[2]){if(Te===t&&!(ie in f))return!1}else{var Ie=new gn;if(R)var Oe=R(Te,Re,ie,f,v,Ie);if(!(Oe===t?_o(Re,Te,p|E,R,Ie):Oe))return!1}}return!0}function lb(f){if(!Fr(f)||IB(f))return!1;var v=Gn(f)?jI:Na;return v.test(Ka(f))}function YD(f){return Vr(f)&&Rt(f)==ge}function ZD(f){return Vr(f)&&xt(f)==be}function XD(f){return Vr(f)&&cu(f.length)&&!!Ir[Rt(f)]}function fb(f){return typeof f=="function"?f:f==null?qt:typeof f=="object"?tr(f)?vb(f[0],f[1]):db(f):B1(f)}function Cf(f){if(!Ro(f))return eD(f);var v=[];for(var m in _r(f))br.call(f,m)&&m!="constructor"&&v.push(m);return v}function QD(f){if(!Fr(f))return kB(f);var v=Ro(f),m=[];for(var R in f)R=="constructor"&&(v||!br.call(f,R))||m.push(R);return m}function _f(f,v){return f<v}function cb(f,v){var m=-1,R=Ot(f)?he(f.length):[];return la(f,function(B,F,H){R[++m]=v(B,F,H)}),R}function db(f){var v=Ff(f);return v.length==1&&v[0][2]?Hb(v[0][0],v[0][1]):function(m){return m===f||Ef(m,f,v)}}function vb(f,v){return $f(f)&&Ub(v)?Hb(Tn(f),v):function(m){var R=Xf(m,f);return R===t&&R===v?Qf(m,f):_o(v,R,p|E)}}function Ys(f,v,m,R,B){f!==v&&mf(v,function(F,H){if(B||(B=new gn),Fr(F))JD(f,v,H,m,Ys,R,B);else{var J=R?R(Gf(f,H),F,H+"",f,v,B):t;J===t&&(J=F),pf(f,H,J)}},Lt)}function JD(f,v,m,R,B,F,H){var J=Gf(f,m),ie=Gf(v,m),Te=H.get(ie);if(Te){pf(f,m,Te);return}var Re=F?F(J,ie,m+"",f,v,H):t,Ie=Re===t;if(Ie){var Oe=tr(ie),Ue=!Oe&&va(ie),Qe=!Oe&&!Ue&&Mi(ie);Re=ie,Oe||Ue||Qe?tr(J)?Re=J:Ur(J)?Re=kt(J):Ue?(Ie=!1,Re=Sb(ie,!0)):Qe?(Ie=!1,Re=Tb(ie,!0)):Re=[]:Po(ie)||ja(ie)?(Re=J,ja(J)?Re=E1(J):(!Fr(J)||Gn(J))&&(Re=Wb(ie))):Ie=!1}Ie&&(H.set(ie,Re),B(Re,ie,R,F,H),H.delete(ie)),pf(f,m,Re)}function hb(f,v){var m=f.length;if(m)return v+=v<0?m:0,Vn(v,m)?f[v]:t}function gb(f,v,m){v.length?v=Or(v,function(F){return tr(F)?function(H){return Ua(H,F.length===1?F[0]:F)}:F}):v=[qt];var R=-1;v=Or(v,Wt(Ze()));var B=cb(f,function(F,H,J){var ie=Or(v,function(Te){return Te(F)});return{criteria:ie,index:++R,value:F}});return TI(B,function(F,H){return dB(F,H,m)})}function eB(f,v){return pb(f,v,function(m,R){return Qf(f,R)})}function pb(f,v,m){for(var R=-1,B=v.length,F={};++R<B;){var H=v[R],J=Ua(f,H);m(J,H)&&So(F,ca(H,f),J)}return F}function rB(f){return function(v){return Ua(v,f)}}function Sf(f,v,m,R){var B=R?SI:Ei,F=-1,H=v.length,J=f;for(f===v&&(v=kt(v)),m&&(J=Or(f,Wt(m)));++F<H;)for(var ie=0,Te=v[F],Re=m?m(Te):Te;(ie=B(J,Re,ie,R))>-1;)J!==f&&Fs.call(J,ie,1),Fs.call(f,ie,1);return f}function yb(f,v){for(var m=f?v.length:0,R=m-1;m--;){var B=v[m];if(m==R||B!==F){var F=B;Vn(B)?Fs.call(f,B,1):Pf(f,B)}}return f}function Tf(f,v){return f+Vs(X0()*(v-f+1))}function tB(f,v,m,R){for(var B=-1,F=Jr($s((v-f)/(m||1)),0),H=he(F);F--;)H[R?F:++B]=f,f+=m;return H}function Rf(f,v){var m="";if(!f||v<1||v>V)return m;do v%2&&(m+=f),v=Vs(v/2),v&&(f+=f);while(v);return m}function lr(f,v){return Wf(Kb(f,v,qt),f+"")}function nB(f){return eb(ki(f))}function aB(f,v){var m=ki(f);return iu(m,Wa(v,0,m.length))}function So(f,v,m,R){if(!Fr(f))return f;v=ca(v,f);for(var B=-1,F=v.length,H=F-1,J=f;J!=null&&++B<F;){var ie=Tn(v[B]),Te=m;if(ie==="__proto__"||ie==="constructor"||ie==="prototype")return f;if(B!=H){var Re=J[ie];Te=R?R(Re,ie,J):t,Te===t&&(Te=Fr(Re)?Re:Vn(v[B+1])?[]:{})}xo(J,ie,Te),J=J[ie]}return f}var mb=Gs?function(f,v){return Gs.set(f,v),f}:qt,iB=zs?function(f,v){return zs(f,"toString",{configurable:!0,enumerable:!1,value:ec(v),writable:!0})}:qt;function oB(f){return iu(ki(f))}function tn(f,v,m){var R=-1,B=f.length;v<0&&(v=-v>B?0:B+v),m=m>B?B:m,m<0&&(m+=B),B=v>m?0:m-v>>>0,v>>>=0;for(var F=he(B);++R<B;)F[R]=f[R+v];return F}function sB(f,v){var m;return la(f,function(R,B,F){return m=v(R,B,F),!m}),!!m}function Zs(f,v,m){var R=0,B=f==null?R:f.length;if(typeof v=="number"&&v===v&&B<=le){for(;R<B;){var F=R+B>>>1,H=f[F];H!==null&&!Ht(H)&&(m?H<=v:H<v)?R=F+1:B=F}return B}return Af(f,v,qt,m)}function Af(f,v,m,R){var B=0,F=f==null?0:f.length;if(F===0)return 0;v=m(v);for(var H=v!==v,J=v===null,ie=Ht(v),Te=v===t;B<F;){var Re=Vs((B+F)/2),Ie=m(f[Re]),Oe=Ie!==t,Ue=Ie===null,Qe=Ie===Ie,sr=Ht(Ie);if(H)var Je=R||Qe;else Te?Je=Qe&&(R||Oe):J?Je=Qe&&Oe&&(R||!Ue):ie?Je=Qe&&Oe&&!Ue&&(R||!sr):Ue||sr?Je=!1:Je=R?Ie<=v:Ie<v;Je?B=Re+1:F=Re}return wt(F,ee)}function bb(f,v){for(var m=-1,R=f.length,B=0,F=[];++m<R;){var H=f[m],J=v?v(H):H;if(!m||!pn(J,ie)){var ie=J;F[B++]=H===0?0:H}}return F}function wb(f){return typeof f=="number"?f:Ht(f)?K:+f}function Ut(f){if(typeof f=="string")return f;if(tr(f))return Or(f,Ut)+"";if(Ht(f))return Q0?Q0.call(f):"";var v=f+"";return v=="0"&&1/f==-q?"-0":v}function fa(f,v,m){var R=-1,B=Ps,F=f.length,H=!0,J=[],ie=J;if(m)H=!1,B=tf;else if(F>=a){var Te=v?null:mB(f);if(Te)return Ds(Te);H=!1,B=go,ie=new Ga}else ie=v?[]:J;e:for(;++R<F;){var Re=f[R],Ie=v?v(Re):Re;if(Re=m||Re!==0?Re:0,H&&Ie===Ie){for(var Oe=ie.length;Oe--;)if(ie[Oe]===Ie)continue e;v&&ie.push(Ie),J.push(Re)}else B(ie,Ie,m)||(ie!==J&&ie.push(Ie),J.push(Re))}return J}function Pf(f,v){v=ca(v,f);var m=-1,R=v.length;if(!R)return!0;for(var B=f==null||typeof f!="object"&&typeof f!="function";++m<R;){var F=v[m];if(typeof F=="string"){if(F==="__proto__"&&!br.call(f,"__proto__"))return!1;if(F==="constructor"&&m+1<R&&typeof v[m+1]=="string"&&v[m+1]==="prototype"){if(B&&m===0)continue;return!1}}}var H=jb(f,v);return H==null||delete H[Tn(nn(v))]}function xb(f,v,m,R){return So(f,v,m(Ua(f,v)),R)}function Xs(f,v,m,R){for(var B=f.length,F=R?B:-1;(R?F--:++F<B)&&v(f[F],F,f););return m?tn(f,R?0:F,R?F+1:B):tn(f,R?F+1:0,R?B:F)}function Eb(f,v){var m=f;return m instanceof dr&&(m=m.value()),nf(v,function(R,B){return B.func.apply(B.thisArg,oa([R],B.args))},m)}function If(f,v,m){var R=f.length;if(R<2)return R?fa(f[0]):[];for(var B=-1,F=he(R);++B<R;)for(var H=f[B],J=-1;++J<R;)J!=B&&(F[B]=Eo(F[B]||H,f[J],v,m));return fa(dt(F,1),v,m)}function Cb(f,v,m){for(var R=-1,B=f.length,F=v.length,H={};++R<B;){var J=R<F?v[R]:t;m(H,f[R],J)}return H}function Df(f){return Ur(f)?f:[]}function Bf(f){return typeof f=="function"?f:qt}function ca(f,v){return tr(f)?f:$f(f,v)?[f]:Qb(wr(f))}var uB=lr;function da(f,v,m){var R=f.length;return m=m===t?R:m,!v&&m>=R?f:tn(f,v,m)}var _b=YI||function(f){return ct.clearTimeout(f)};function Sb(f,v){if(v)return f.slice();var m=f.length,R=H0?H0(m):new f.constructor(m);return f.copy(R),R}function Mf(f){var v=new f.constructor(f.byteLength);return new qs(v).set(new qs(f)),v}function lB(f,v){var m=v?Mf(f.buffer):f.buffer;return new f.constructor(m,f.byteOffset,f.byteLength)}function fB(f){var v=new f.constructor(f.source,ft.exec(f));return v.lastIndex=f.lastIndex,v}function cB(f){return wo?_r(wo.call(f)):{}}function Tb(f,v){var m=v?Mf(f.buffer):f.buffer;return new f.constructor(m,f.byteOffset,f.length)}function Rb(f,v){if(f!==v){var m=f!==t,R=f===null,B=f===f,F=Ht(f),H=v!==t,J=v===null,ie=v===v,Te=Ht(v);if(!J&&!Te&&!F&&f>v||F&&H&&ie&&!J&&!Te||R&&H&&ie||!m&&ie||!B)return 1;if(!R&&!F&&!Te&&f<v||Te&&m&&B&&!R&&!F||J&&m&&B||!H&&B||!ie)return-1}return 0}function dB(f,v,m){for(var R=-1,B=f.criteria,F=v.criteria,H=B.length,J=m.length;++R<H;){var ie=Rb(B[R],F[R]);if(ie){if(R>=J)return ie;var Te=m[R];return ie*(Te=="desc"?-1:1)}}return f.index-v.index}function Ab(f,v,m,R){for(var B=-1,F=f.length,H=m.length,J=-1,ie=v.length,Te=Jr(F-H,0),Re=he(ie+Te),Ie=!R;++J<ie;)Re[J]=v[J];for(;++B<H;)(Ie||B<F)&&(Re[m[B]]=f[B]);for(;Te--;)Re[J++]=f[B++];return Re}function Pb(f,v,m,R){for(var B=-1,F=f.length,H=-1,J=m.length,ie=-1,Te=v.length,Re=Jr(F-J,0),Ie=he(Re+Te),Oe=!R;++B<Re;)Ie[B]=f[B];for(var Ue=B;++ie<Te;)Ie[Ue+ie]=v[ie];for(;++H<J;)(Oe||B<F)&&(Ie[Ue+m[H]]=f[B++]);return Ie}function kt(f,v){var m=-1,R=f.length;for(v||(v=he(R));++m<R;)v[m]=f[m];return v}function Sn(f,v,m,R){var B=!m;m||(m={});for(var F=-1,H=v.length;++F<H;){var J=v[F],ie=R?R(m[J],f[J],J,m,f):t;ie===t&&(ie=f[J]),B?Fn(m,J,ie):xo(m,J,ie)}return m}function vB(f,v){return Sn(f,zf(f),v)}function hB(f,v){return Sn(f,Vb(f),v)}function Qs(f,v){return function(m,R){var B=tr(m)?bI:LD,F=v?v():{};return B(m,f,Ze(R,2),F)}}function Ii(f){return lr(function(v,m){var R=-1,B=m.length,F=B>1?m[B-1]:t,H=B>2?m[2]:t;for(F=f.length>3&&typeof F=="function"?(B--,F):t,H&&At(m[0],m[1],H)&&(F=B<3?t:F,B=1),v=_r(v);++R<B;){var J=m[R];J&&f(v,J,R,F)}return v})}function Ib(f,v){return function(m,R){if(m==null)return m;if(!Ot(m))return f(m,R);for(var B=m.length,F=v?B:-1,H=_r(m);(v?F--:++F<B)&&R(H[F],F,H)!==!1;);return m}}function Db(f){return function(v,m,R){for(var B=-1,F=_r(v),H=R(v),J=H.length;J--;){var ie=H[f?J:++B];if(m(F[ie],ie,F)===!1)break}return v}}function gB(f,v,m){var R=v&y,B=To(f);function F(){var H=this&&this!==ct&&this instanceof F?B:f;return H.apply(R?m:this,arguments)}return F}function Bb(f){return function(v){v=wr(v);var m=Ci(v)?hn(v):t,R=m?m[0]:v.charAt(0),B=m?da(m,1).join(""):v.slice(1);return R[f]()+B}}function Di(f){return function(v){return nf(I1(P1(v).replace(iI,"")),f,"")}}function To(f){return function(){var v=arguments;switch(v.length){case 0:return new f;case 1:return new f(v[0]);case 2:return new f(v[0],v[1]);case 3:return new f(v[0],v[1],v[2]);case 4:return new f(v[0],v[1],v[2],v[3]);case 5:return new f(v[0],v[1],v[2],v[3],v[4]);case 6:return new f(v[0],v[1],v[2],v[3],v[4],v[5]);case 7:return new f(v[0],v[1],v[2],v[3],v[4],v[5],v[6])}var m=Pi(f.prototype),R=f.apply(m,v);return Fr(R)?R:m}}function pB(f,v,m){var R=To(f);function B(){for(var F=arguments.length,H=he(F),J=F,ie=Bi(B);J--;)H[J]=arguments[J];var Te=F<3&&H[0]!==ie&&H[F-1]!==ie?[]:sa(H,ie);if(F-=Te.length,F<m)return qb(f,v,Js,B.placeholder,t,H,Te,t,t,m-F);var Re=this&&this!==ct&&this instanceof B?R:f;return Gt(Re,this,H)}return B}function Mb(f){return function(v,m,R){var B=_r(v);if(!Ot(v)){var F=Ze(m,3);v=it(v),m=function(J){return F(B[J],J,B)}}var H=f(v,m,R);return H>-1?B[F?v[H]:H]:t}}function kb(f){return $n(function(v){var m=v.length,R=m,B=en.prototype.thru;for(f&&v.reverse();R--;){var F=v[R];if(typeof F!="function")throw new Jt(o);if(B&&!H&&nu(F)=="wrapper")var H=new en([],!0)}for(R=H?R:m;++R<m;){F=v[R];var J=nu(F),ie=J=="wrapper"?Nf(F):t;ie&&Vf(ie[0])&&ie[1]==(_|x|T|A)&&!ie[4].length&&ie[9]==1?H=H[nu(ie[0])].apply(H,ie[3]):H=F.length==1&&Vf(F)?H[J]():H.thru(F)}return function(){var Te=arguments,Re=Te[0];if(H&&Te.length==1&&tr(Re))return H.plant(Re).value();for(var Ie=0,Oe=m?v[Ie].apply(this,Te):Re;++Ie<m;)Oe=v[Ie].call(this,Oe);return Oe}})}function Js(f,v,m,R,B,F,H,J,ie,Te){var Re=v&_,Ie=v&y,Oe=v&b,Ue=v&(x|C),Qe=v&P,sr=Oe?t:To(f);function Je(){for(var cr=arguments.length,vr=he(cr),Kt=cr;Kt--;)vr[Kt]=arguments[Kt];if(Ue)var Pt=Bi(Je),jt=AI(vr,Pt);if(R&&(vr=Ab(vr,R,B,Ue)),F&&(vr=Pb(vr,F,H,Ue)),cr-=jt,Ue&&cr<Te){var Hr=sa(vr,Pt);return qb(f,v,Js,Je.placeholder,m,vr,Hr,J,ie,Te-cr)}var yn=Ie?m:this,Un=Oe?yn[f]:f;return cr=vr.length,J?vr=LB(vr,J):Qe&&cr>1&&vr.reverse(),Re&&ie<cr&&(vr.length=ie),this&&this!==ct&&this instanceof Je&&(Un=sr||To(Un)),Un.apply(yn,vr)}return Je}function Ob(f,v){return function(m,R){return WD(m,f,v(R),{})}}function eu(f,v){return function(m,R){var B;if(m===t&&R===t)return v;if(m!==t&&(B=m),R!==t){if(B===t)return R;typeof m=="string"||typeof R=="string"?(m=Ut(m),R=Ut(R)):(m=wb(m),R=wb(R)),B=f(m,R)}return B}}function kf(f){return $n(function(v){return v=Or(v,Wt(Ze())),lr(function(m){var R=this;return f(v,function(B){return Gt(B,R,m)})})})}function ru(f,v){v=v===t?" ":Ut(v);var m=v.length;if(m<2)return m?Rf(v,f):v;var R=Rf(v,$s(f/_i(v)));return Ci(v)?da(hn(R),0,f).join(""):R.slice(0,f)}function yB(f,v,m,R){var B=v&y,F=To(f);function H(){for(var J=-1,ie=arguments.length,Te=-1,Re=R.length,Ie=he(Re+ie),Oe=this&&this!==ct&&this instanceof H?F:f;++Te<Re;)Ie[Te]=R[Te];for(;ie--;)Ie[Te++]=arguments[++J];return Gt(Oe,B?m:this,Ie)}return H}function Lb(f){return function(v,m,R){return R&&typeof R!="number"&&At(v,m,R)&&(m=R=t),v=Wn(v),m===t?(m=v,v=0):m=Wn(m),R=R===t?v<m?1:-1:Wn(R),tB(v,m,R,f)}}function tu(f){return function(v,m){return typeof v=="string"&&typeof m=="string"||(v=an(v),m=an(m)),f(v,m)}}function qb(f,v,m,R,B,F,H,J,ie,Te){var Re=v&x,Ie=Re?H:t,Oe=Re?t:H,Ue=Re?F:t,Qe=Re?t:F;v|=Re?T:S,v&=~(Re?S:T),v&w||(v&=-4);var sr=[f,v,B,Ue,Ie,Qe,Oe,J,ie,Te],Je=m.apply(t,sr);return Vf(f)&&Yb(Je,sr),Je.placeholder=R,Zb(Je,f,v)}function Of(f){var v=Qr[f];return function(m,R){if(m=an(m),R=R==null?0:wt(ir(R),292),R&&Z0(m)){var B=(wr(m)+"e").split("e"),F=v(B[0]+"e"+(+B[1]+R));return B=(wr(F)+"e").split("e"),+(B[0]+"e"+(+B[1]-R))}return v(m)}}var mB=Ri&&1/Ds(new Ri([,-0]))[1]==q?function(f){return new Ri(f)}:nc;function Nb(f){return function(v){var m=xt(v);return m==ce?cf(v):m==be?OI(v):RI(v,f(v))}}function zn(f,v,m,R,B,F,H,J){var ie=v&b;if(!ie&&typeof f!="function")throw new Jt(o);var Te=R?R.length:0;if(Te||(v&=-97,R=B=t),H=H===t?H:Jr(ir(H),0),J=J===t?J:ir(J),Te-=B?B.length:0,v&S){var Re=R,Ie=B;R=B=t}var Oe=ie?t:Nf(f),Ue=[f,v,m,R,B,Re,Ie,F,H,J];if(Oe&&MB(Ue,Oe),f=Ue[0],v=Ue[1],m=Ue[2],R=Ue[3],B=Ue[4],J=Ue[9]=Ue[9]===t?ie?0:f.length:Jr(Ue[9]-Te,0),!J&&v&(x|C)&&(v&=-25),!v||v==y)var Qe=gB(f,v,m);else v==x||v==C?Qe=pB(f,v,J):(v==T||v==(y|T))&&!B.length?Qe=yB(f,v,m,R):Qe=Js.apply(t,Ue);var sr=Oe?mb:Yb;return Zb(sr(Qe,Ue),f,v)}function Fb(f,v,m,R){return f===t||pn(f,Ti[m])&&!br.call(R,m)?v:f}function zb(f,v,m,R,B,F){return Fr(f)&&Fr(v)&&(F.set(v,f),Ys(f,v,t,zb,F),F.delete(v)),f}function bB(f){return Po(f)?t:f}function $b(f,v,m,R,B,F){var H=m&p,J=f.length,ie=v.length;if(J!=ie&&!(H&&ie>J))return!1;var Te=F.get(f),Re=F.get(v);if(Te&&Re)return Te==v&&Re==f;var Ie=-1,Oe=!0,Ue=m&E?new Ga:t;for(F.set(f,v),F.set(v,f);++Ie<J;){var Qe=f[Ie],sr=v[Ie];if(R)var Je=H?R(sr,Qe,Ie,v,f,F):R(Qe,sr,Ie,f,v,F);if(Je!==t){if(Je)continue;Oe=!1;break}if(Ue){if(!af(v,function(cr,vr){if(!go(Ue,vr)&&(Qe===cr||B(Qe,cr,m,R,F)))return Ue.push(vr)})){Oe=!1;break}}else if(!(Qe===sr||B(Qe,sr,m,R,F))){Oe=!1;break}}return F.delete(f),F.delete(v),Oe}function wB(f,v,m,R,B,F,H){switch(m){case Xe:if(f.byteLength!=v.byteLength||f.byteOffset!=v.byteOffset)return!1;f=f.buffer,v=v.buffer;case Ve:return!(f.byteLength!=v.byteLength||!F(new qs(f),new qs(v)));case de:case se:case _e:return pn(+f,+v);case Q:return f.name==v.name&&f.message==v.message;case ge:case Ae:return f==v+"";case ce:var J=cf;case be:var ie=R&p;if(J||(J=Ds),f.size!=v.size&&!ie)return!1;var Te=H.get(f);if(Te)return Te==v;R|=E,H.set(f,v);var Re=$b(J(f),J(v),R,B,F,H);return H.delete(f),Re;case De:if(wo)return wo.call(f)==wo.call(v)}return!1}function xB(f,v,m,R,B,F){var H=m&p,J=Lf(f),ie=J.length,Te=Lf(v),Re=Te.length;if(ie!=Re&&!H)return!1;for(var Ie=ie;Ie--;){var Oe=J[Ie];if(!(H?Oe in v:br.call(v,Oe)))return!1}var Ue=F.get(f),Qe=F.get(v);if(Ue&&Qe)return Ue==v&&Qe==f;var sr=!0;F.set(f,v),F.set(v,f);for(var Je=H;++Ie<ie;){Oe=J[Ie];var cr=f[Oe],vr=v[Oe];if(R)var Kt=H?R(vr,cr,Oe,v,f,F):R(cr,vr,Oe,f,v,F);if(!(Kt===t?cr===vr||B(cr,vr,m,R,F):Kt)){sr=!1;break}Je||(Je=Oe=="constructor")}if(sr&&!Je){var Pt=f.constructor,jt=v.constructor;Pt!=jt&&"constructor"in f&&"constructor"in v&&!(typeof Pt=="function"&&Pt instanceof Pt&&typeof jt=="function"&&jt instanceof jt)&&(sr=!1)}return F.delete(f),F.delete(v),sr}function $n(f){return Wf(Kb(f,t,t1),f+"")}function Lf(f){return sb(f,it,zf)}function qf(f){return sb(f,Lt,Vb)}var Nf=Gs?function(f){return Gs.get(f)}:nc;function nu(f){for(var v=f.name+"",m=Ai[v],R=br.call(Ai,v)?m.length:0;R--;){var B=m[R],F=B.func;if(F==null||F==f)return B.name}return v}function Bi(f){var v=br.call(L,"placeholder")?L:f;return v.placeholder}function Ze(){var f=L.iteratee||rc;return f=f===rc?fb:f,arguments.length?f(arguments[0],arguments[1]):f}function au(f,v){var m=f.__data__;return PB(v)?m[typeof v=="string"?"string":"hash"]:m.map}function Ff(f){for(var v=it(f),m=v.length;m--;){var R=v[m],B=f[R];v[m]=[R,B,Ub(B)]}return v}function Ha(f,v){var m=BI(f,v);return lb(m)?m:t}function EB(f){var v=br.call(f,$a),m=f[$a];try{f[$a]=t;var R=!0}catch{}var B=Os.call(f);return R&&(v?f[$a]=m:delete f[$a]),B}var zf=vf?function(f){return f==null?[]:(f=_r(f),ia(vf(f),function(v){return j0.call(f,v)}))}:ac,Vb=vf?function(f){for(var v=[];f;)oa(v,zf(f)),f=Ns(f);return v}:ac,xt=Rt;(hf&&xt(new hf(new ArrayBuffer(1)))!=Xe||yo&&xt(new yo)!=ce||gf&&xt(gf.resolve())!=fe||Ri&&xt(new Ri)!=be||mo&&xt(new mo)!=Le)&&(xt=function(f){var v=Rt(f),m=v==U?f.constructor:t,R=m?Ka(m):"";if(R)switch(R){case aD:return Xe;case iD:return ce;case oD:return fe;case sD:return be;case uD:return Le}return v});function CB(f,v,m){for(var R=-1,B=m.length;++R<B;){var F=m[R],H=F.size;switch(F.type){case"drop":f+=H;break;case"dropRight":v-=H;break;case"take":v=wt(v,f+H);break;case"takeRight":f=Jr(f,v-H);break}}return{start:f,end:v}}function _B(f){var v=f.match($r);return v?v[1].split(dn):[]}function Gb(f,v,m){v=ca(v,f);for(var R=-1,B=v.length,F=!1;++R<B;){var H=Tn(v[R]);if(!(F=f!=null&&m(f,H)))break;f=f[H]}return F||++R!=B?F:(B=f==null?0:f.length,!!B&&cu(B)&&Vn(H,B)&&(tr(f)||ja(f)))}function SB(f){var v=f.length,m=new f.constructor(v);return v&&typeof f[0]=="string"&&br.call(f,"index")&&(m.index=f.index,m.input=f.input),m}function Wb(f){return typeof f.constructor=="function"&&!Ro(f)?Pi(Ns(f)):{}}function TB(f,v,m){var R=f.constructor;switch(v){case Ve:return Mf(f);case de:case se:return new R(+f);case Xe:return lB(f,m);case er:case $e:case ke:case ye:case O:case oe:case me:case we:case Ce:return Tb(f,m);case ce:return new R;case _e:case Ae:return new R(f);case ge:return fB(f);case be:return new R;case De:return cB(f)}}function RB(f,v){var m=v.length;if(!m)return f;var R=m-1;return v[R]=(m>1?"& ":"")+v[R],v=v.join(m>2?", ":" "),f.replace(Cn,`{
|
|
339
|
+
/* [wrapped with `+v+`] */
|
|
340
|
+
`)}function AB(f){return tr(f)||ja(f)||!!(Y0&&f&&f[Y0])}function Vn(f,v){var m=typeof f;return v=v??V,!!v&&(m=="number"||m!="symbol"&&Ts.test(f))&&f>-1&&f%1==0&&f<v}function At(f,v,m){if(!Fr(m))return!1;var R=typeof v;return(R=="number"?Ot(m)&&Vn(v,m.length):R=="string"&&v in m)?pn(m[v],f):!1}function $f(f,v){if(tr(f))return!1;var m=typeof f;return m=="number"||m=="symbol"||m=="boolean"||f==null||Ht(f)?!0:Mr.test(f)||!Wr.test(f)||v!=null&&f in _r(v)}function PB(f){var v=typeof f;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?f!=="__proto__":f===null}function Vf(f){var v=nu(f),m=L[v];if(typeof m!="function"||!(v in dr.prototype))return!1;if(f===m)return!0;var R=Nf(m);return!!R&&f===R[0]}function IB(f){return!!U0&&U0 in f}var DB=Ms?Gn:ic;function Ro(f){var v=f&&f.constructor,m=typeof v=="function"&&v.prototype||Ti;return f===m}function Ub(f){return f===f&&!Fr(f)}function Hb(f,v){return function(m){return m==null?!1:m[f]===v&&(v!==t||f in _r(m))}}function BB(f){var v=lu(f,function(R){return m.size===u&&m.clear(),R}),m=v.cache;return v}function MB(f,v){var m=f[1],R=v[1],B=m|R,F=B<(y|b|_),H=R==_&&m==x||R==_&&m==A&&f[7].length<=v[8]||R==(_|A)&&v[7].length<=v[8]&&m==x;if(!(F||H))return f;R&y&&(f[2]=v[2],B|=m&y?0:w);var J=v[3];if(J){var ie=f[3];f[3]=ie?Ab(ie,J,v[4]):J,f[4]=ie?sa(f[3],c):v[4]}return J=v[5],J&&(ie=f[5],f[5]=ie?Pb(ie,J,v[6]):J,f[6]=ie?sa(f[5],c):v[6]),J=v[7],J&&(f[7]=J),R&_&&(f[8]=f[8]==null?v[8]:wt(f[8],v[8])),f[9]==null&&(f[9]=v[9]),f[0]=v[0],f[1]=B,f}function kB(f){var v=[];if(f!=null)for(var m in _r(f))v.push(m);return v}function OB(f){return Os.call(f)}function Kb(f,v,m){return v=Jr(v===t?f.length-1:v,0),function(){for(var R=arguments,B=-1,F=Jr(R.length-v,0),H=he(F);++B<F;)H[B]=R[v+B];B=-1;for(var J=he(v+1);++B<v;)J[B]=R[B];return J[v]=m(H),Gt(f,this,J)}}function jb(f,v){return v.length<2?f:Ua(f,tn(v,0,-1))}function LB(f,v){for(var m=f.length,R=wt(v.length,m),B=kt(f);R--;){var F=v[R];f[R]=Vn(F,m)?B[F]:t}return f}function Gf(f,v){if(!(v==="constructor"&&typeof f[v]=="function")&&v!="__proto__")return f[v]}var Yb=Xb(mb),Ao=XI||function(f,v){return ct.setTimeout(f,v)},Wf=Xb(iB);function Zb(f,v,m){var R=v+"";return Wf(f,RB(R,qB(_B(R),m)))}function Xb(f){var v=0,m=0;return function(){var R=rD(),B=M-(R-m);if(m=R,B>0){if(++v>=k)return arguments[0]}else v=0;return f.apply(t,arguments)}}function iu(f,v){var m=-1,R=f.length,B=R-1;for(v=v===t?R:v;++m<v;){var F=Tf(m,B),H=f[F];f[F]=f[m],f[m]=H}return f.length=v,f}var Qb=BB(function(f){var v=[];return f.charCodeAt(0)===46&&v.push(""),f.replace(lt,function(m,R,B,F){v.push(B?F.replace(gi,"$1"):R||m)}),v});function Tn(f){if(typeof f=="string"||Ht(f))return f;var v=f+"";return v=="0"&&1/f==-q?"-0":v}function Ka(f){if(f!=null){try{return ks.call(f)}catch{}try{return f+""}catch{}}return""}function qB(f,v){return Qt(W,function(m){var R="_."+m[0];v&m[1]&&!Ps(f,R)&&f.push(R)}),f.sort()}function Jb(f){if(f instanceof dr)return f.clone();var v=new en(f.__wrapped__,f.__chain__);return v.__actions__=kt(f.__actions__),v.__index__=f.__index__,v.__values__=f.__values__,v}function NB(f,v,m){(m?At(f,v,m):v===t)?v=1:v=Jr(ir(v),0);var R=f==null?0:f.length;if(!R||v<1)return[];for(var B=0,F=0,H=he($s(R/v));B<R;)H[F++]=tn(f,B,B+=v);return H}function FB(f){for(var v=-1,m=f==null?0:f.length,R=0,B=[];++v<m;){var F=f[v];F&&(B[R++]=F)}return B}function zB(){var f=arguments.length;if(!f)return[];for(var v=he(f-1),m=arguments[0],R=f;R--;)v[R-1]=arguments[R];return oa(tr(m)?kt(m):[m],dt(v,1))}var $B=lr(function(f,v){return Ur(f)?Eo(f,dt(v,1,Ur,!0)):[]}),VB=lr(function(f,v){var m=nn(v);return Ur(m)&&(m=t),Ur(f)?Eo(f,dt(v,1,Ur,!0),Ze(m,2)):[]}),GB=lr(function(f,v){var m=nn(v);return Ur(m)&&(m=t),Ur(f)?Eo(f,dt(v,1,Ur,!0),t,m):[]});function WB(f,v,m){var R=f==null?0:f.length;return R?(v=m||v===t?1:ir(v),tn(f,v<0?0:v,R)):[]}function UB(f,v,m){var R=f==null?0:f.length;return R?(v=m||v===t?1:ir(v),v=R-v,tn(f,0,v<0?0:v)):[]}function HB(f,v){return f&&f.length?Xs(f,Ze(v,3),!0,!0):[]}function KB(f,v){return f&&f.length?Xs(f,Ze(v,3),!0):[]}function jB(f,v,m,R){var B=f==null?0:f.length;return B?(m&&typeof m!="number"&&At(f,v,m)&&(m=0,R=B),zD(f,v,m,R)):[]}function e1(f,v,m){var R=f==null?0:f.length;if(!R)return-1;var B=m==null?0:ir(m);return B<0&&(B=Jr(R+B,0)),Is(f,Ze(v,3),B)}function r1(f,v,m){var R=f==null?0:f.length;if(!R)return-1;var B=R-1;return m!==t&&(B=ir(m),B=m<0?Jr(R+B,0):wt(B,R-1)),Is(f,Ze(v,3),B,!0)}function t1(f){var v=f==null?0:f.length;return v?dt(f,1):[]}function YB(f){var v=f==null?0:f.length;return v?dt(f,q):[]}function ZB(f,v){var m=f==null?0:f.length;return m?(v=v===t?1:ir(v),dt(f,v)):[]}function XB(f){for(var v=-1,m=f==null?0:f.length,R={};++v<m;){var B=f[v];R[B[0]]=B[1]}return R}function n1(f){return f&&f.length?f[0]:t}function QB(f,v,m){var R=f==null?0:f.length;if(!R)return-1;var B=m==null?0:ir(m);return B<0&&(B=Jr(R+B,0)),Ei(f,v,B)}function JB(f){var v=f==null?0:f.length;return v?tn(f,0,-1):[]}var eM=lr(function(f){var v=Or(f,Df);return v.length&&v[0]===f[0]?xf(v):[]}),rM=lr(function(f){var v=nn(f),m=Or(f,Df);return v===nn(m)?v=t:m.pop(),m.length&&m[0]===f[0]?xf(m,Ze(v,2)):[]}),tM=lr(function(f){var v=nn(f),m=Or(f,Df);return v=typeof v=="function"?v:t,v&&m.pop(),m.length&&m[0]===f[0]?xf(m,t,v):[]});function nM(f,v){return f==null?"":JI.call(f,v)}function nn(f){var v=f==null?0:f.length;return v?f[v-1]:t}function aM(f,v,m){var R=f==null?0:f.length;if(!R)return-1;var B=R;return m!==t&&(B=ir(m),B=B<0?Jr(R+B,0):wt(B,R-1)),v===v?qI(f,v,B):Is(f,q0,B,!0)}function iM(f,v){return f&&f.length?hb(f,ir(v)):t}var oM=lr(a1);function a1(f,v){return f&&f.length&&v&&v.length?Sf(f,v):f}function sM(f,v,m){return f&&f.length&&v&&v.length?Sf(f,v,Ze(m,2)):f}function uM(f,v,m){return f&&f.length&&v&&v.length?Sf(f,v,t,m):f}var lM=$n(function(f,v){var m=f==null?0:f.length,R=yf(f,v);return yb(f,Or(v,function(B){return Vn(B,m)?+B:B}).sort(Rb)),R});function fM(f,v){var m=[];if(!(f&&f.length))return m;var R=-1,B=[],F=f.length;for(v=Ze(v,3);++R<F;){var H=f[R];v(H,R,f)&&(m.push(H),B.push(R))}return yb(f,B),m}function Uf(f){return f==null?f:nD.call(f)}function cM(f,v,m){var R=f==null?0:f.length;return R?(m&&typeof m!="number"&&At(f,v,m)?(v=0,m=R):(v=v==null?0:ir(v),m=m===t?R:ir(m)),tn(f,v,m)):[]}function dM(f,v){return Zs(f,v)}function vM(f,v,m){return Af(f,v,Ze(m,2))}function hM(f,v){var m=f==null?0:f.length;if(m){var R=Zs(f,v);if(R<m&&pn(f[R],v))return R}return-1}function gM(f,v){return Zs(f,v,!0)}function pM(f,v,m){return Af(f,v,Ze(m,2),!0)}function yM(f,v){var m=f==null?0:f.length;if(m){var R=Zs(f,v,!0)-1;if(pn(f[R],v))return R}return-1}function mM(f){return f&&f.length?bb(f):[]}function bM(f,v){return f&&f.length?bb(f,Ze(v,2)):[]}function wM(f){var v=f==null?0:f.length;return v?tn(f,1,v):[]}function xM(f,v,m){return f&&f.length?(v=m||v===t?1:ir(v),tn(f,0,v<0?0:v)):[]}function EM(f,v,m){var R=f==null?0:f.length;return R?(v=m||v===t?1:ir(v),v=R-v,tn(f,v<0?0:v,R)):[]}function CM(f,v){return f&&f.length?Xs(f,Ze(v,3),!1,!0):[]}function _M(f,v){return f&&f.length?Xs(f,Ze(v,3)):[]}var SM=lr(function(f){return fa(dt(f,1,Ur,!0))}),TM=lr(function(f){var v=nn(f);return Ur(v)&&(v=t),fa(dt(f,1,Ur,!0),Ze(v,2))}),RM=lr(function(f){var v=nn(f);return v=typeof v=="function"?v:t,fa(dt(f,1,Ur,!0),t,v)});function AM(f){return f&&f.length?fa(f):[]}function PM(f,v){return f&&f.length?fa(f,Ze(v,2)):[]}function IM(f,v){return v=typeof v=="function"?v:t,f&&f.length?fa(f,t,v):[]}function Hf(f){if(!(f&&f.length))return[];var v=0;return f=ia(f,function(m){if(Ur(m))return v=Jr(m.length,v),!0}),lf(v,function(m){return Or(f,of(m))})}function i1(f,v){if(!(f&&f.length))return[];var m=Hf(f);return v==null?m:Or(m,function(R){return Gt(v,t,R)})}var DM=lr(function(f,v){return Ur(f)?Eo(f,v):[]}),BM=lr(function(f){return If(ia(f,Ur))}),MM=lr(function(f){var v=nn(f);return Ur(v)&&(v=t),If(ia(f,Ur),Ze(v,2))}),kM=lr(function(f){var v=nn(f);return v=typeof v=="function"?v:t,If(ia(f,Ur),t,v)}),OM=lr(Hf);function LM(f,v){return Cb(f||[],v||[],xo)}function qM(f,v){return Cb(f||[],v||[],So)}var NM=lr(function(f){var v=f.length,m=v>1?f[v-1]:t;return m=typeof m=="function"?(f.pop(),m):t,i1(f,m)});function o1(f){var v=L(f);return v.__chain__=!0,v}function FM(f,v){return v(f),f}function ou(f,v){return v(f)}var zM=$n(function(f){var v=f.length,m=v?f[0]:0,R=this.__wrapped__,B=function(F){return yf(F,f)};return v>1||this.__actions__.length||!(R instanceof dr)||!Vn(m)?this.thru(B):(R=R.slice(m,+m+(v?1:0)),R.__actions__.push({func:ou,args:[B],thisArg:t}),new en(R,this.__chain__).thru(function(F){return v&&!F.length&&F.push(t),F}))});function $M(){return o1(this)}function VM(){return new en(this.value(),this.__chain__)}function GM(){this.__values__===t&&(this.__values__=w1(this.value()));var f=this.__index__>=this.__values__.length,v=f?t:this.__values__[this.__index__++];return{done:f,value:v}}function WM(){return this}function UM(f){for(var v,m=this;m instanceof Us;){var R=Jb(m);R.__index__=0,R.__values__=t,v?B.__wrapped__=R:v=R;var B=R;m=m.__wrapped__}return B.__wrapped__=f,v}function HM(){var f=this.__wrapped__;if(f instanceof dr){var v=f;return this.__actions__.length&&(v=new dr(this)),v=v.reverse(),v.__actions__.push({func:ou,args:[Uf],thisArg:t}),new en(v,this.__chain__)}return this.thru(Uf)}function KM(){return Eb(this.__wrapped__,this.__actions__)}var jM=Qs(function(f,v,m){br.call(f,m)?++f[m]:Fn(f,m,1)});function YM(f,v,m){var R=tr(f)?O0:FD;return m&&At(f,v,m)&&(v=t),R(f,Ze(v,3))}function ZM(f,v){var m=tr(f)?ia:ib;return m(f,Ze(v,3))}var XM=Mb(e1),QM=Mb(r1);function JM(f,v){return dt(su(f,v),1)}function ek(f,v){return dt(su(f,v),q)}function rk(f,v,m){return m=m===t?1:ir(m),dt(su(f,v),m)}function s1(f,v){var m=tr(f)?Qt:la;return m(f,Ze(v,3))}function u1(f,v){var m=tr(f)?wI:ab;return m(f,Ze(v,3))}var tk=Qs(function(f,v,m){br.call(f,m)?f[m].push(v):Fn(f,m,[v])});function nk(f,v,m,R){f=Ot(f)?f:ki(f),m=m&&!R?ir(m):0;var B=f.length;return m<0&&(m=Jr(B+m,0)),du(f)?m<=B&&f.indexOf(v,m)>-1:!!B&&Ei(f,v,m)>-1}var ak=lr(function(f,v,m){var R=-1,B=typeof v=="function",F=Ot(f)?he(f.length):[];return la(f,function(H){F[++R]=B?Gt(v,H,m):Co(H,v,m)}),F}),ik=Qs(function(f,v,m){Fn(f,m,v)});function su(f,v){var m=tr(f)?Or:cb;return m(f,Ze(v,3))}function ok(f,v,m,R){return f==null?[]:(tr(v)||(v=v==null?[]:[v]),m=R?t:m,tr(m)||(m=m==null?[]:[m]),gb(f,v,m))}var sk=Qs(function(f,v,m){f[m?0:1].push(v)},function(){return[[],[]]});function uk(f,v,m){var R=tr(f)?nf:F0,B=arguments.length<3;return R(f,Ze(v,4),m,B,la)}function lk(f,v,m){var R=tr(f)?xI:F0,B=arguments.length<3;return R(f,Ze(v,4),m,B,ab)}function fk(f,v){var m=tr(f)?ia:ib;return m(f,fu(Ze(v,3)))}function ck(f){var v=tr(f)?eb:nB;return v(f)}function dk(f,v,m){(m?At(f,v,m):v===t)?v=1:v=ir(v);var R=tr(f)?kD:aB;return R(f,v)}function vk(f){var v=tr(f)?OD:oB;return v(f)}function hk(f){if(f==null)return 0;if(Ot(f))return du(f)?_i(f):f.length;var v=xt(f);return v==ce||v==be?f.size:Cf(f).length}function gk(f,v,m){var R=tr(f)?af:sB;return m&&At(f,v,m)&&(v=t),R(f,Ze(v,3))}var pk=lr(function(f,v){if(f==null)return[];var m=v.length;return m>1&&At(f,v[0],v[1])?v=[]:m>2&&At(v[0],v[1],v[2])&&(v=[v[0]]),gb(f,dt(v,1),[])}),uu=ZI||function(){return ct.Date.now()};function yk(f,v){if(typeof v!="function")throw new Jt(o);return f=ir(f),function(){if(--f<1)return v.apply(this,arguments)}}function l1(f,v,m){return v=m?t:v,v=f&&v==null?f.length:v,zn(f,_,t,t,t,t,v)}function f1(f,v){var m;if(typeof v!="function")throw new Jt(o);return f=ir(f),function(){return--f>0&&(m=v.apply(this,arguments)),f<=1&&(v=t),m}}var Kf=lr(function(f,v,m){var R=y;if(m.length){var B=sa(m,Bi(Kf));R|=T}return zn(f,R,v,m,B)}),c1=lr(function(f,v,m){var R=y|b;if(m.length){var B=sa(m,Bi(c1));R|=T}return zn(v,R,f,m,B)});function d1(f,v,m){v=m?t:v;var R=zn(f,x,t,t,t,t,t,v);return R.placeholder=d1.placeholder,R}function v1(f,v,m){v=m?t:v;var R=zn(f,C,t,t,t,t,t,v);return R.placeholder=v1.placeholder,R}function h1(f,v,m){var R,B,F,H,J,ie,Te=0,Re=!1,Ie=!1,Oe=!0;if(typeof f!="function")throw new Jt(o);v=an(v)||0,Fr(m)&&(Re=!!m.leading,Ie="maxWait"in m,F=Ie?Jr(an(m.maxWait)||0,v):F,Oe="trailing"in m?!!m.trailing:Oe);function Ue(Hr){var yn=R,Un=B;return R=B=t,Te=Hr,H=f.apply(Un,yn),H}function Qe(Hr){return Te=Hr,J=Ao(cr,v),Re?Ue(Hr):H}function sr(Hr){var yn=Hr-ie,Un=Hr-Te,M1=v-yn;return Ie?wt(M1,F-Un):M1}function Je(Hr){var yn=Hr-ie,Un=Hr-Te;return ie===t||yn>=v||yn<0||Ie&&Un>=F}function cr(){var Hr=uu();if(Je(Hr))return vr(Hr);J=Ao(cr,sr(Hr))}function vr(Hr){return J=t,Oe&&R?Ue(Hr):(R=B=t,H)}function Kt(){J!==t&&_b(J),Te=0,R=ie=B=J=t}function Pt(){return J===t?H:vr(uu())}function jt(){var Hr=uu(),yn=Je(Hr);if(R=arguments,B=this,ie=Hr,yn){if(J===t)return Qe(ie);if(Ie)return _b(J),J=Ao(cr,v),Ue(ie)}return J===t&&(J=Ao(cr,v)),H}return jt.cancel=Kt,jt.flush=Pt,jt}var mk=lr(function(f,v){return nb(f,1,v)}),bk=lr(function(f,v,m){return nb(f,an(v)||0,m)});function wk(f){return zn(f,P)}function lu(f,v){if(typeof f!="function"||v!=null&&typeof v!="function")throw new Jt(o);var m=function(){var R=arguments,B=v?v.apply(this,R):R[0],F=m.cache;if(F.has(B))return F.get(B);var H=f.apply(this,R);return m.cache=F.set(B,H)||F,H};return m.cache=new(lu.Cache||Nn),m}lu.Cache=Nn;function fu(f){if(typeof f!="function")throw new Jt(o);return function(){var v=arguments;switch(v.length){case 0:return!f.call(this);case 1:return!f.call(this,v[0]);case 2:return!f.call(this,v[0],v[1]);case 3:return!f.call(this,v[0],v[1],v[2])}return!f.apply(this,v)}}function xk(f){return f1(2,f)}var Ek=uB(function(f,v){v=v.length==1&&tr(v[0])?Or(v[0],Wt(Ze())):Or(dt(v,1),Wt(Ze()));var m=v.length;return lr(function(R){for(var B=-1,F=wt(R.length,m);++B<F;)R[B]=v[B].call(this,R[B]);return Gt(f,this,R)})}),jf=lr(function(f,v){var m=sa(v,Bi(jf));return zn(f,T,t,v,m)}),g1=lr(function(f,v){var m=sa(v,Bi(g1));return zn(f,S,t,v,m)}),Ck=$n(function(f,v){return zn(f,A,t,t,t,v)});function _k(f,v){if(typeof f!="function")throw new Jt(o);return v=v===t?v:ir(v),lr(f,v)}function Sk(f,v){if(typeof f!="function")throw new Jt(o);return v=v==null?0:Jr(ir(v),0),lr(function(m){var R=m[v],B=da(m,0,v);return R&&oa(B,R),Gt(f,this,B)})}function Tk(f,v,m){var R=!0,B=!0;if(typeof f!="function")throw new Jt(o);return Fr(m)&&(R="leading"in m?!!m.leading:R,B="trailing"in m?!!m.trailing:B),h1(f,v,{leading:R,maxWait:v,trailing:B})}function Rk(f){return l1(f,1)}function Ak(f,v){return jf(Bf(v),f)}function Pk(){if(!arguments.length)return[];var f=arguments[0];return tr(f)?f:[f]}function Ik(f){return rn(f,g)}function Dk(f,v){return v=typeof v=="function"?v:t,rn(f,g,v)}function Bk(f){return rn(f,d|g)}function Mk(f,v){return v=typeof v=="function"?v:t,rn(f,d|g,v)}function kk(f,v){return v==null||tb(f,v,it(v))}function pn(f,v){return f===v||f!==f&&v!==v}var Ok=tu(wf),Lk=tu(function(f,v){return f>=v}),ja=ub((function(){return arguments})())?ub:function(f){return Vr(f)&&br.call(f,"callee")&&!j0.call(f,"callee")},tr=he.isArray,qk=P0?Wt(P0):UD;function Ot(f){return f!=null&&cu(f.length)&&!Gn(f)}function Ur(f){return Vr(f)&&Ot(f)}function Nk(f){return f===!0||f===!1||Vr(f)&&Rt(f)==de}var va=QI||ic,Fk=I0?Wt(I0):HD;function zk(f){return Vr(f)&&f.nodeType===1&&!Po(f)}function $k(f){if(f==null)return!0;if(Ot(f)&&(tr(f)||typeof f=="string"||typeof f.splice=="function"||va(f)||Mi(f)||ja(f)))return!f.length;var v=xt(f);if(v==ce||v==be)return!f.size;if(Ro(f))return!Cf(f).length;for(var m in f)if(br.call(f,m))return!1;return!0}function Vk(f,v){return _o(f,v)}function Gk(f,v,m){m=typeof m=="function"?m:t;var R=m?m(f,v):t;return R===t?_o(f,v,t,m):!!R}function Yf(f){if(!Vr(f))return!1;var v=Rt(f);return v==Q||v==X||typeof f.message=="string"&&typeof f.name=="string"&&!Po(f)}function Wk(f){return typeof f=="number"&&Z0(f)}function Gn(f){if(!Fr(f))return!1;var v=Rt(f);return v==ae||v==te||v==re||v==xe}function p1(f){return typeof f=="number"&&f==ir(f)}function cu(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=V}function Fr(f){var v=typeof f;return f!=null&&(v=="object"||v=="function")}function Vr(f){return f!=null&&typeof f=="object"}var y1=D0?Wt(D0):jD;function Uk(f,v){return f===v||Ef(f,v,Ff(v))}function Hk(f,v,m){return m=typeof m=="function"?m:t,Ef(f,v,Ff(v),m)}function Kk(f){return m1(f)&&f!=+f}function jk(f){if(DB(f))throw new rr(i);return lb(f)}function Yk(f){return f===null}function Zk(f){return f==null}function m1(f){return typeof f=="number"||Vr(f)&&Rt(f)==_e}function Po(f){if(!Vr(f)||Rt(f)!=U)return!1;var v=Ns(f);if(v===null)return!0;var m=br.call(v,"constructor")&&v.constructor;return typeof m=="function"&&m instanceof m&&ks.call(m)==HI}var Zf=B0?Wt(B0):YD;function Xk(f){return p1(f)&&f>=-V&&f<=V}var b1=M0?Wt(M0):ZD;function du(f){return typeof f=="string"||!tr(f)&&Vr(f)&&Rt(f)==Ae}function Ht(f){return typeof f=="symbol"||Vr(f)&&Rt(f)==De}var Mi=k0?Wt(k0):XD;function Qk(f){return f===t}function Jk(f){return Vr(f)&&xt(f)==Le}function eO(f){return Vr(f)&&Rt(f)==He}var rO=tu(_f),tO=tu(function(f,v){return f<=v});function w1(f){if(!f)return[];if(Ot(f))return du(f)?hn(f):kt(f);if(po&&f[po])return kI(f[po]());var v=xt(f),m=v==ce?cf:v==be?Ds:ki;return m(f)}function Wn(f){if(!f)return f===0?f:0;if(f=an(f),f===q||f===-q){var v=f<0?-1:1;return v*Z}return f===f?f:0}function ir(f){var v=Wn(f),m=v%1;return v===v?m?v-m:v:0}function x1(f){return f?Wa(ir(f),0,j):0}function an(f){if(typeof f=="number")return f;if(Ht(f))return K;if(Fr(f)){var v=typeof f.valueOf=="function"?f.valueOf():f;f=Fr(v)?v+"":v}if(typeof f!="string")return f===0?f:+f;f=z0(f);var m=bt.test(f);return m||Mt.test(f)?yI(f.slice(2),m?2:8):at.test(f)?K:+f}function E1(f){return Sn(f,Lt(f))}function nO(f){return f?Wa(ir(f),-V,V):f===0?f:0}function wr(f){return f==null?"":Ut(f)}var aO=Ii(function(f,v){if(Ro(v)||Ot(v)){Sn(v,it(v),f);return}for(var m in v)br.call(v,m)&&xo(f,m,v[m])}),C1=Ii(function(f,v){Sn(v,Lt(v),f)}),vu=Ii(function(f,v,m,R){Sn(v,Lt(v),f,R)}),iO=Ii(function(f,v,m,R){Sn(v,it(v),f,R)}),oO=$n(yf);function sO(f,v){var m=Pi(f);return v==null?m:rb(m,v)}var uO=lr(function(f,v){f=_r(f);var m=-1,R=v.length,B=R>2?v[2]:t;for(B&&At(v[0],v[1],B)&&(R=1);++m<R;)for(var F=v[m],H=Lt(F),J=-1,ie=H.length;++J<ie;){var Te=H[J],Re=f[Te];(Re===t||pn(Re,Ti[Te])&&!br.call(f,Te))&&(f[Te]=F[Te])}return f}),lO=lr(function(f){return f.push(t,zb),Gt(_1,t,f)});function fO(f,v){return L0(f,Ze(v,3),_n)}function cO(f,v){return L0(f,Ze(v,3),bf)}function dO(f,v){return f==null?f:mf(f,Ze(v,3),Lt)}function vO(f,v){return f==null?f:ob(f,Ze(v,3),Lt)}function hO(f,v){return f&&_n(f,Ze(v,3))}function gO(f,v){return f&&bf(f,Ze(v,3))}function pO(f){return f==null?[]:js(f,it(f))}function yO(f){return f==null?[]:js(f,Lt(f))}function Xf(f,v,m){var R=f==null?t:Ua(f,v);return R===t?m:R}function mO(f,v){return f!=null&&Gb(f,v,$D)}function Qf(f,v){return f!=null&&Gb(f,v,VD)}var bO=Ob(function(f,v,m){v!=null&&typeof v.toString!="function"&&(v=Os.call(v)),f[v]=m},ec(qt)),wO=Ob(function(f,v,m){v!=null&&typeof v.toString!="function"&&(v=Os.call(v)),br.call(f,v)?f[v].push(m):f[v]=[m]},Ze),xO=lr(Co);function it(f){return Ot(f)?J0(f):Cf(f)}function Lt(f){return Ot(f)?J0(f,!0):QD(f)}function EO(f,v){var m={};return v=Ze(v,3),_n(f,function(R,B,F){Fn(m,v(R,B,F),R)}),m}function CO(f,v){var m={};return v=Ze(v,3),_n(f,function(R,B,F){Fn(m,B,v(R,B,F))}),m}var _O=Ii(function(f,v,m){Ys(f,v,m)}),_1=Ii(function(f,v,m,R){Ys(f,v,m,R)}),SO=$n(function(f,v){var m={};if(f==null)return m;var R=!1;v=Or(v,function(F){return F=ca(F,f),R||(R=F.length>1),F}),Sn(f,qf(f),m),R&&(m=rn(m,d|h|g,bB));for(var B=v.length;B--;)Pf(m,v[B]);return m});function TO(f,v){return S1(f,fu(Ze(v)))}var RO=$n(function(f,v){return f==null?{}:eB(f,v)});function S1(f,v){if(f==null)return{};var m=Or(qf(f),function(R){return[R]});return v=Ze(v),pb(f,m,function(R,B){return v(R,B[0])})}function AO(f,v,m){v=ca(v,f);var R=-1,B=v.length;for(B||(B=1,f=t);++R<B;){var F=f==null?t:f[Tn(v[R])];F===t&&(R=B,F=m),f=Gn(F)?F.call(f):F}return f}function PO(f,v,m){return f==null?f:So(f,v,m)}function IO(f,v,m,R){return R=typeof R=="function"?R:t,f==null?f:So(f,v,m,R)}var T1=Nb(it),R1=Nb(Lt);function DO(f,v,m){var R=tr(f),B=R||va(f)||Mi(f);if(v=Ze(v,4),m==null){var F=f&&f.constructor;B?m=R?new F:[]:Fr(f)?m=Gn(F)?Pi(Ns(f)):{}:m={}}return(B?Qt:_n)(f,function(H,J,ie){return v(m,H,J,ie)}),m}function BO(f,v){return f==null?!0:Pf(f,v)}function MO(f,v,m){return f==null?f:xb(f,v,Bf(m))}function kO(f,v,m,R){return R=typeof R=="function"?R:t,f==null?f:xb(f,v,Bf(m),R)}function ki(f){return f==null?[]:ff(f,it(f))}function OO(f){return f==null?[]:ff(f,Lt(f))}function LO(f,v,m){return m===t&&(m=v,v=t),m!==t&&(m=an(m),m=m===m?m:0),v!==t&&(v=an(v),v=v===v?v:0),Wa(an(f),v,m)}function qO(f,v,m){return v=Wn(v),m===t?(m=v,v=0):m=Wn(m),f=an(f),GD(f,v,m)}function NO(f,v,m){if(m&&typeof m!="boolean"&&At(f,v,m)&&(v=m=t),m===t&&(typeof v=="boolean"?(m=v,v=t):typeof f=="boolean"&&(m=f,f=t)),f===t&&v===t?(f=0,v=1):(f=Wn(f),v===t?(v=f,f=0):v=Wn(v)),f>v){var R=f;f=v,v=R}if(m||f%1||v%1){var B=X0();return wt(f+B*(v-f+pI("1e-"+((B+"").length-1))),v)}return Tf(f,v)}var FO=Di(function(f,v,m){return v=v.toLowerCase(),f+(m?A1(v):v)});function A1(f){return Jf(wr(f).toLowerCase())}function P1(f){return f=wr(f),f&&f.replace(Vl,PI).replace(oI,"")}function zO(f,v,m){f=wr(f),v=Ut(v);var R=f.length;m=m===t?R:Wa(ir(m),0,R);var B=m;return m-=v.length,m>=0&&f.slice(m,B)==v}function $O(f){return f=wr(f),f&&nr.test(f)?f.replace(je,II):f}function VO(f){return f=wr(f),f&&Kr.test(f)?f.replace(kr,"\\$&"):f}var GO=Di(function(f,v,m){return f+(m?"-":"")+v.toLowerCase()}),WO=Di(function(f,v,m){return f+(m?" ":"")+v.toLowerCase()}),UO=Bb("toLowerCase");function HO(f,v,m){f=wr(f),v=ir(v);var R=v?_i(f):0;if(!v||R>=v)return f;var B=(v-R)/2;return ru(Vs(B),m)+f+ru($s(B),m)}function KO(f,v,m){f=wr(f),v=ir(v);var R=v?_i(f):0;return v&&R<v?f+ru(v-R,m):f}function jO(f,v,m){f=wr(f),v=ir(v);var R=v?_i(f):0;return v&&R<v?ru(v-R,m)+f:f}function YO(f,v,m){return m||v==null?v=0:v&&(v=+v),tD(wr(f).replace(Nr,""),v||0)}function ZO(f,v,m){return(m?At(f,v,m):v===t)?v=1:v=ir(v),Rf(wr(f),v)}function XO(){var f=arguments,v=wr(f[0]);return f.length<3?v:v.replace(f[1],f[2])}var QO=Di(function(f,v,m){return f+(m?"_":"")+v.toLowerCase()});function JO(f,v,m){return m&&typeof m!="number"&&At(f,v,m)&&(v=m=t),m=m===t?j:m>>>0,m?(f=wr(f),f&&(typeof v=="string"||v!=null&&!Zf(v))&&(v=Ut(v),!v&&Ci(f))?da(hn(f),0,m):f.split(v,m)):[]}var eL=Di(function(f,v,m){return f+(m?" ":"")+Jf(v)});function rL(f,v,m){return f=wr(f),m=m==null?0:Wa(ir(m),0,f.length),v=Ut(v),f.slice(m,m+v.length)==v}function tL(f,v,m){var R=L.templateSettings;m&&At(f,v,m)&&(v=t),f=wr(f),v=vu({},v,R,Fb);var B=vu({},v.imports,R.imports,Fb),F=it(B),H=ff(B,F),J,ie,Te=0,Re=v.interpolate||pi,Ie="__p += '",Oe=df((v.escape||pi).source+"|"+Re.source+"|"+(Re===ar?Ln:pi).source+"|"+(v.evaluate||pi).source+"|$","g"),Ue="//# sourceURL="+(br.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++cI+"]")+`
|
|
341
|
+
`;f.replace(Oe,function(Je,cr,vr,Kt,Pt,jt){return vr||(vr=Kt),Ie+=f.slice(Te,jt).replace(Gl,DI),cr&&(J=!0,Ie+=`' +
|
|
342
342
|
__e(`+cr+`) +
|
|
343
|
-
'`),
|
|
344
|
-
`+
|
|
345
|
-
__p += '`),vr&&(
|
|
343
|
+
'`),Pt&&(ie=!0,Ie+=`';
|
|
344
|
+
`+Pt+`;
|
|
345
|
+
__p += '`),vr&&(Ie+=`' +
|
|
346
346
|
((__t = (`+vr+`)) == null ? '' : __t) +
|
|
347
|
-
'`),
|
|
348
|
-
`;var
|
|
349
|
-
`+
|
|
347
|
+
'`),Te=jt+Je.length,Je}),Ie+=`';
|
|
348
|
+
`;var Qe=br.call(v,"variable")&&v.variable;if(!Qe)Ie=`with (obj) {
|
|
349
|
+
`+Ie+`
|
|
350
350
|
}
|
|
351
|
-
`;else if(
|
|
352
|
-
`+(
|
|
353
|
-
`)+"var __t, __p = ''"+(
|
|
351
|
+
`;else if(ta.test(Qe))throw new rr(s);Ie=(ie?Ie.replace(qe,""):Ie).replace(Pe,"$1").replace(Ge,"$1;"),Ie="function("+(Qe||"obj")+`) {
|
|
352
|
+
`+(Qe?"":`obj || (obj = {});
|
|
353
|
+
`)+"var __t, __p = ''"+(J?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join;
|
|
354
354
|
function print() { __p += __j.call(arguments, '') }
|
|
355
355
|
`:`;
|
|
356
|
-
`)+
|
|
357
|
-
}`;var ar=D1(function(){return mr(q,Ve+"return "+Ce).apply(t,K)});if(ar.source=Ce,jf(ar))throw ar;return ar}function jk(f){return wr(f).toLowerCase()}function Yk(f){return wr(f).toUpperCase()}function Zk(f,d,y){if(f=wr(f),f&&(y||d===t))return F0(f);if(!f||!(d=Wt(d)))return f;var T=vn(f),B=vn(d),q=z0(T,B),K=$0(T,B)+1;return fa(T,q,K).join("")}function Xk(f,d,y){if(f=wr(f),f&&(y||d===t))return f.slice(0,G0(f)+1);if(!f||!(d=Wt(d)))return f;var T=vn(f),B=$0(T,vn(d))+1;return fa(T,0,B).join("")}function Qk(f,d,y){if(f=wr(f),f&&(y||d===t))return f.replace(Lr,"");if(!f||!(d=Wt(d)))return f;var T=vn(f),B=z0(T,vn(d));return fa(T,B).join("")}function Jk(f,d){var y=I,T=D;if(qr(d)){var B="separator"in d?d.separator:B;y="length"in d?tr(d.length):y,T="omission"in d?Wt(d.omission):T}f=wr(f);var q=f.length;if(Ei(f)){var K=vn(f);q=K.length}if(y>=q)return f;var Q=y-_i(T);if(Q<1)return T;var ae=K?fa(K,0,Q).join(""):f.slice(0,Q);if(B===t)return ae+T;if(K&&(Q+=ae.length-Q),Yf(B)){if(f.slice(Q).search(B)){var we,xe=ae;for(B.global||(B=cf(B.source,wr(ut.exec(B))+"g")),B.lastIndex=0;we=B.exec(xe);)var Ce=we.index;ae=ae.slice(0,Ce===t?Q:Ce)}}else if(f.indexOf(Wt(B),Q)!=Q){var Be=ae.lastIndexOf(B);Be>-1&&(ae=ae.slice(0,Be))}return ae+T}function eL(f){return f=wr(f),f&&nr.test(f)?f.replace(qe,PD):f}var rL=Di(function(f,d,y){return f+(y?" ":"")+d.toUpperCase()}),Qf=Ib("toUpperCase");function P1(f,d,y){return f=wr(f),d=y?t:d,d===t?CD(f)?BD(f):gD(f):f.match(d)||[]}var D1=sr(function(f,d){try{return Vt(f,t,d)}catch(y){return jf(y)?y:new Qe(y)}}),tL=zn(function(f,d){return Xt(d,function(y){y=Sn(y),Nn(f,y,Hf(f[y],f))}),f});function nL(f){var d=f==null?0:f.length,y=Ke();return f=d?Or(f,function(T){if(typeof T[1]!="function")throw new Qt(o);return[y(T[0]),T[1]]}):[],sr(function(T){for(var B=-1;++B<d;){var q=f[B];if(Vt(q[0],this,T))return Vt(q[1],this,T)}})}function aL(f){return PI(en(f,v))}function Jf(f){return function(){return f}}function iL(f,d){return f==null||f!==f?d:f}var oL=Ob(),sL=Ob(!0);function Lt(f){return f}function ec(f){return lb(typeof f=="function"?f:en(f,v))}function uL(f){return cb(en(f,v))}function lL(f,d){return db(f,en(d,v))}var fL=sr(function(f,d){return function(y){return Eo(y,f,d)}}),cL=sr(function(f,d){return function(y){return Eo(f,y,d)}});function rc(f,d,y){var T=nt(d),B=Ks(d,T);y==null&&!(qr(d)&&(B.length||!T.length))&&(y=d,d=f,f=this,B=Ks(d,nt(d)));var q=!(qr(y)&&"chain"in y)||!!y.chain,K=Vn(f);return Xt(B,function(Q){var ae=d[Q];f[Q]=ae,K&&(f.prototype[Q]=function(){var we=this.__chain__;if(q||we){var xe=f(this.__wrapped__),Ce=xe.__actions__=Ot(this.__actions__);return Ce.push({func:ae,args:arguments,thisArg:f}),xe.__chain__=we,xe}return ae.apply(f,aa([this.value()],arguments))})}),f}function dL(){return lt._===this&&(lt._=ND),this}function tc(){}function vL(f){return f=tr(f),sr(function(d){return vb(d,f)})}var hL=Of(Or),gL=Of(M0),pL=Of(nf);function I1(f){return zf(f)?af(Sn(f)):HI(f)}function yL(f){return function(d){return f==null?t:Ga(f,d)}}var mL=kb(),bL=kb(!0);function nc(){return[]}function ac(){return!1}function wL(){return{}}function xL(){return""}function EL(){return!0}function _L(f,d){if(f=tr(f),f<1||f>U)return[];var y=H,T=yt(f,H);d=Ke(d),f-=H;for(var B=uf(T,d);++y<f;)d(y);return B}function CL(f){return Je(f)?Or(f,Sn):Ut(f)?[f]:Ot(Xb(wr(f)))}function SL(f){var d=++LD;return wr(f)+d}var TL=Js(function(f,d){return f+d},0),RL=Mf("ceil"),AL=Js(function(f,d){return f/d},1),PL=Mf("floor");function DL(f){return f&&f.length?Hs(f,Lt,bf):t}function IL(f,d){return f&&f.length?Hs(f,Ke(d,2),bf):t}function BL(f){return q0(f,Lt)}function OL(f,d){return q0(f,Ke(d,2))}function ML(f){return f&&f.length?Hs(f,Lt,_f):t}function kL(f,d){return f&&f.length?Hs(f,Ke(d,2),_f):t}var LL=Js(function(f,d){return f*d},1),qL=Mf("round"),NL=Js(function(f,d){return f-d},0);function FL(f){return f&&f.length?sf(f,Lt):0}function zL(f,d){return f&&f.length?sf(f,Ke(d,2)):0}return k.after=uM,k.ary=u1,k.assign=YM,k.assignIn=E1,k.assignInWith=du,k.assignWith=ZM,k.at=XM,k.before=l1,k.bind=Hf,k.bindAll=tL,k.bindKey=f1,k.castArray=wM,k.chain=i1,k.chunk=PB,k.compact=DB,k.concat=IB,k.cond=nL,k.conforms=aL,k.constant=Jf,k.countBy=FO,k.create=QM,k.curry=c1,k.curryRight=d1,k.debounce=v1,k.defaults=JM,k.defaultsDeep=ek,k.defer=lM,k.delay=fM,k.difference=BB,k.differenceBy=OB,k.differenceWith=MB,k.drop=kB,k.dropRight=LB,k.dropRightWhile=qB,k.dropWhile=NB,k.fill=FB,k.filter=$O,k.flatMap=WO,k.flatMapDeep=UO,k.flatMapDepth=HO,k.flatten=r1,k.flattenDeep=zB,k.flattenDepth=$B,k.flip=cM,k.flow=oL,k.flowRight=sL,k.fromPairs=VB,k.functions=sk,k.functionsIn=uk,k.groupBy=KO,k.initial=WB,k.intersection=UB,k.intersectionBy=HB,k.intersectionWith=KB,k.invert=fk,k.invertBy=ck,k.invokeMap=YO,k.iteratee=ec,k.keyBy=ZO,k.keys=nt,k.keysIn=kt,k.map=ou,k.mapKeys=vk,k.mapValues=hk,k.matches=uL,k.matchesProperty=lL,k.memoize=uu,k.merge=gk,k.mergeWith=_1,k.method=fL,k.methodOf=cL,k.mixin=rc,k.negate=lu,k.nthArg=vL,k.omit=pk,k.omitBy=yk,k.once=dM,k.orderBy=XO,k.over=hL,k.overArgs=vM,k.overEvery=gL,k.overSome=pL,k.partial=Kf,k.partialRight=h1,k.partition=QO,k.pick=mk,k.pickBy=C1,k.property=I1,k.propertyOf=yL,k.pull=XB,k.pullAll=n1,k.pullAllBy=QB,k.pullAllWith=JB,k.pullAt=eO,k.range=mL,k.rangeRight=bL,k.rearg=hM,k.reject=rM,k.remove=rO,k.rest=gM,k.reverse=Wf,k.sampleSize=nM,k.set=wk,k.setWith=xk,k.shuffle=aM,k.slice=tO,k.sortBy=sM,k.sortedUniq=lO,k.sortedUniqBy=fO,k.split=Wk,k.spread=pM,k.tail=cO,k.take=dO,k.takeRight=vO,k.takeRightWhile=hO,k.takeWhile=gO,k.tap=DO,k.throttle=yM,k.thru=iu,k.toArray=b1,k.toPairs=S1,k.toPairsIn=T1,k.toPath=CL,k.toPlainObject=x1,k.transform=Ek,k.unary=mM,k.union=pO,k.unionBy=yO,k.unionWith=mO,k.uniq=bO,k.uniqBy=wO,k.uniqWith=xO,k.unset=_k,k.unzip=Uf,k.unzipWith=a1,k.update=Ck,k.updateWith=Sk,k.values=Oi,k.valuesIn=Tk,k.without=EO,k.words=P1,k.wrap=bM,k.xor=_O,k.xorBy=CO,k.xorWith=SO,k.zip=TO,k.zipObject=RO,k.zipObjectDeep=AO,k.zipWith=PO,k.entries=S1,k.entriesIn=T1,k.extend=E1,k.extendWith=du,rc(k,k),k.add=TL,k.attempt=D1,k.camelCase=Dk,k.capitalize=R1,k.ceil=RL,k.clamp=Rk,k.clone=xM,k.cloneDeep=_M,k.cloneDeepWith=CM,k.cloneWith=EM,k.conformsTo=SM,k.deburr=A1,k.defaultTo=iL,k.divide=AL,k.endsWith=Ik,k.eq=gn,k.escape=Bk,k.escapeRegExp=Ok,k.every=zO,k.find=VO,k.findIndex=Jb,k.findKey=rk,k.findLast=GO,k.findLastIndex=e1,k.findLastKey=tk,k.floor=PL,k.forEach=o1,k.forEachRight=s1,k.forIn=nk,k.forInRight=ak,k.forOwn=ik,k.forOwnRight=ok,k.get=Zf,k.gt=TM,k.gte=RM,k.has=lk,k.hasIn=Xf,k.head=t1,k.identity=Lt,k.includes=jO,k.indexOf=GB,k.inRange=Ak,k.invoke=dk,k.isArguments=Ha,k.isArray=Je,k.isArrayBuffer=AM,k.isArrayLike=Mt,k.isArrayLikeObject=Gr,k.isBoolean=PM,k.isBuffer=ca,k.isDate=DM,k.isElement=IM,k.isEmpty=BM,k.isEqual=OM,k.isEqualWith=MM,k.isError=jf,k.isFinite=kM,k.isFunction=Vn,k.isInteger=g1,k.isLength=fu,k.isMap=p1,k.isMatch=LM,k.isMatchWith=qM,k.isNaN=NM,k.isNative=FM,k.isNil=$M,k.isNull=zM,k.isNumber=y1,k.isObject=qr,k.isObjectLike=zr,k.isPlainObject=Ao,k.isRegExp=Yf,k.isSafeInteger=VM,k.isSet=m1,k.isString=cu,k.isSymbol=Ut,k.isTypedArray=Bi,k.isUndefined=GM,k.isWeakMap=WM,k.isWeakSet=UM,k.join=jB,k.kebabCase=Mk,k.last=tn,k.lastIndexOf=YB,k.lowerCase=kk,k.lowerFirst=Lk,k.lt=HM,k.lte=KM,k.max=DL,k.maxBy=IL,k.mean=BL,k.meanBy=OL,k.min=ML,k.minBy=kL,k.stubArray=nc,k.stubFalse=ac,k.stubObject=wL,k.stubString=xL,k.stubTrue=EL,k.multiply=LL,k.nth=ZB,k.noConflict=dL,k.noop=tc,k.now=su,k.pad=qk,k.padEnd=Nk,k.padStart=Fk,k.parseInt=zk,k.random=Pk,k.reduce=JO,k.reduceRight=eM,k.repeat=$k,k.replace=Vk,k.result=bk,k.round=qL,k.runInContext=te,k.sample=tM,k.size=iM,k.snakeCase=Gk,k.some=oM,k.sortedIndex=nO,k.sortedIndexBy=aO,k.sortedIndexOf=iO,k.sortedLastIndex=oO,k.sortedLastIndexBy=sO,k.sortedLastIndexOf=uO,k.startCase=Uk,k.startsWith=Hk,k.subtract=NL,k.sum=FL,k.sumBy=zL,k.template=Kk,k.times=_L,k.toFinite=Gn,k.toInteger=tr,k.toLength=w1,k.toLower=jk,k.toNumber=nn,k.toSafeInteger=jM,k.toString=wr,k.toUpper=Yk,k.trim=Zk,k.trimEnd=Xk,k.trimStart=Qk,k.truncate=Jk,k.unescape=eL,k.uniqueId=SL,k.upperCase=rL,k.upperFirst=Qf,k.each=o1,k.eachRight=s1,k.first=t1,rc(k,(function(){var f={};return _n(k,function(d,y){br.call(k.prototype,y)||(f[y]=d)}),f})(),{chain:!1}),k.VERSION=n,Xt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){k[f].placeholder=k}),Xt(["drop","take"],function(f,d){dr.prototype[f]=function(y){y=y===t?1:Xr(tr(y),0);var T=this.__filtered__&&!d?new dr(this):this.clone();return T.__filtered__?T.__takeCount__=yt(y,T.__takeCount__):T.__views__.push({size:yt(y,H),type:f+(T.__dir__<0?"Right":"")}),T},dr.prototype[f+"Right"]=function(y){return this.reverse()[f](y).reverse()}}),Xt(["filter","map","takeWhile"],function(f,d){var y=d+1,T=y==N||y==$;dr.prototype[f]=function(B){var q=this.clone();return q.__iteratees__.push({iteratee:Ke(B,3),type:y}),q.__filtered__=q.__filtered__||T,q}}),Xt(["head","last"],function(f,d){var y="take"+(d?"Right":"");dr.prototype[f]=function(){return this[y](1).value()[0]}}),Xt(["initial","tail"],function(f,d){var y="drop"+(d?"":"Right");dr.prototype[f]=function(){return this.__filtered__?new dr(this):this[y](1)}}),dr.prototype.compact=function(){return this.filter(Lt)},dr.prototype.find=function(f){return this.filter(f).head()},dr.prototype.findLast=function(f){return this.reverse().find(f)},dr.prototype.invokeMap=sr(function(f,d){return typeof f=="function"?new dr(this):this.map(function(y){return Eo(y,f,d)})}),dr.prototype.reject=function(f){return this.filter(lu(Ke(f)))},dr.prototype.slice=function(f,d){f=tr(f);var y=this;return y.__filtered__&&(f>0||d<0)?new dr(y):(f<0?y=y.takeRight(-f):f&&(y=y.drop(f)),d!==t&&(d=tr(d),y=d<0?y.dropRight(-d):y.take(d-f)),y)},dr.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},dr.prototype.toArray=function(){return this.take(H)},_n(dr.prototype,function(f,d){var y=/^(?:filter|find|map|reject)|While$/.test(d),T=/^(?:head|last)$/.test(d),B=k[T?"take"+(d=="last"?"Right":""):d],q=T||/^find/.test(d);B&&(k.prototype[d]=function(){var K=this.__wrapped__,Q=T?[1]:arguments,ae=K instanceof dr,we=Q[0],xe=ae||Je(K),Ce=function(cr){var vr=B.apply(k,aa([cr],Q));return T&&Be?vr[0]:vr};xe&&y&&typeof we=="function"&&we.length!=1&&(ae=xe=!1);var Be=this.__chain__,Ve=!!this.__actions__.length,Ye=q&&!Be,ar=ae&&!Ve;if(!q&&xe){K=ar?K:new dr(this);var Ze=f.apply(K,Q);return Ze.__actions__.push({func:iu,args:[Ce],thisArg:t}),new Jt(Ze,Be)}return Ye&&ar?f.apply(this,Q):(Ze=this.thru(Ce),Ye?T?Ze.value()[0]:Ze.value():Ze)})}),Xt(["pop","push","shift","sort","splice","unshift"],function(f){var d=Is[f],y=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",T=/^(?:pop|shift)$/.test(f);k.prototype[f]=function(){var B=arguments;if(T&&!this.__chain__){var q=this.value();return d.apply(Je(q)?q:[],B)}return this[y](function(K){return d.apply(Je(K)?K:[],B)})}}),_n(dr.prototype,function(f,d){var y=k[d];if(y){var T=y.name+"";br.call(Ri,T)||(Ri[T]=[]),Ri[T].push({name:d,func:y})}}),Ri[Qs(t,b).name]=[{name:"wrapper",func:t}],dr.prototype.clone=eI,dr.prototype.reverse=rI,dr.prototype.value=tI,k.prototype.at=IO,k.prototype.chain=BO,k.prototype.commit=OO,k.prototype.next=MO,k.prototype.plant=LO,k.prototype.reverse=qO,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=NO,k.prototype.first=k.prototype.head,go&&(k.prototype[go]=kO),k}),Ci=OD();Na?((Na.exports=Ci)._=Ci,Jl._=Ci):lt._=Ci}).call(iW)})(Vo,Vo.exports)),Vo.exports}var gr=oW();const MR=El(gr);function sW({cyParams:r,cyInst:e,layoutParams:t,layoutDebounce:n=50,children:a,init:i=()=>{},onCyInit:o}){const[s,u]=Re.useState(!1),l=Re.useRef(null),c=Re.useRef(null),v=Re.useRef(null),h=Re.useRef(!0),g=Re.useCallback(()=>{var m;v.current!==null&&v.current.stop(),c.current&&(v.current=c.current.layout(t),(m=v.current)==null||m.run())},[t]),p=MR.debounce(g,n);Re.useEffect(()=>{if(!l.current)return;const m=sn({container:l.current,...r}),b=l.current.querySelector(".cytoscape-react-nodes-and-edges");if(b&&m.domNode({dom_container:b}),c.current=e||m,l.current&&(l.current.cy=c.current),o==null||o(c.current),i(m),l.current&&c.current){const x=l.current.parentElement;let _=0,C=0;x&&(_=x.clientHeight,C=x.clientWidth,_===0&&(_=window.innerHeight-x.getBoundingClientRect().top-100),C===0&&(C=window.innerWidth)),_>0&&C>0&&(l.current.style.width=`${C}px`,l.current.style.height=`${_}px`),c.current.resize(),r.zoom&&r.pan&&c.current.viewport({zoom:r.zoom,pan:r.pan})}u(!0);const w=new ResizeObserver(MR.debounce(()=>{if(l.current&&c.current){const x=l.current.parentElement;let _=0,C=0;x&&(_=x.clientHeight,C=x.clientWidth,_===0&&(_=window.innerHeight-x.getBoundingClientRect().top-100),C===0&&(C=window.innerWidth),_>0&&C>0&&(l.current.style.width=`${C}px`,l.current.style.height=`${_}px`));const R=c.current.zoom()!==void 0?{zoom:c.current.zoom(),pan:c.current.pan()}:null;c.current.resize(),R&&c.current.viewport(R)}},50));return l.current&&w.observe(l.current),()=>{w.disconnect();try{m.destroy()}catch{}c.current=null,u(!1)}},[]),Re.useEffect(()=>{h.current?(h.current=!1,g()):p()},[s,t,p,g]);const E=Re.useMemo(()=>{var m;return c.current!==null?((m=Re.Children.map(a,b=>{var w;return b?Re.cloneElement(b,{key:(w=b==null?void 0:b.props)==null?void 0:w.id,cytoInstance:c.current,layout:p}):null}))==null?void 0:m.filter(Boolean))||[]:[]},[a,s,p]);return me.jsx("div",{ref:l,className:"cytoscape-react-cy-container",style:{width:"100%",height:"100%",position:"relative"},children:me.jsx("div",{className:"cytoscape-react-nodes-and-edges",style:{pointerEvents:"none",position:"absolute",top:0,left:0,transformOrigin:"0 0",zIndex:10},children:E})})}function uW({cytoInstance:r,id:e,parent:t,label:n,children:a,layout:i,classes:o,styleCallback:s}){const u=Re.useRef(null);function l(h){if(s){const g=s(h);h.isParent()&&(h.style("shape","roundrectangle"),h.style(g))}}Re.useEffect(()=>{try{if(u.current){const h={id:e,dom:u.current};t&&(h.parent=t),n&&(h.label=n);const g=r.add({data:h,classes:o});l(g)}}catch{}return()=>{r.getElementById(e).remove()}},[u,t,n]),Re.useEffect(()=>{i();const h=r.getElementById(e);h&&h.isParent()&&l(h)},[e,a]);function c(h){return Re.cloneElement(h,{cytoInstance:r,layout:i})}const v=Re.Children.map(a,c);return me.jsx("div",{ref:u,className:"cytoscape-react-node",children:v})}const lW={name:"dagre",rankDir:"LR",fit:!1,padding:20,spacingFactor:1.3,animate:!1,nodeDimensionsIncludeLabels:!0,ranker:"network-simplex",rankSep:10,nodeSep:5,edgeSep:10,avoidOverlap:!0,edgeWeight:function(r){return 1},minLen:function(r){return 1},useSimpleEdgeFunction:!0,edgeRouting:!0,controlPoints:!0},qP={padding:20,motionBlur:!1,compound:!0,pixelRatio:"auto",zoomingEnabled:!0,userZoomingEnabled:!0,dragpan:!0,avoidOverlap:!0,panningEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,selectionType:"additive",minZoom:.01,maxZoom:1.5,autoungrabify:!0,styleEnabled:!0,hideEdgesOnViewport:!1,hideLabelsOnViewport:!0,headless:!1,touchTapThreshold:8,desktopTapThreshold:4,touchHoldDuration:500,desktopHoldDuration:1e3,autolock:!1,autounselectify:!1,wheelPanEnabled:!0,wheelPanThreshold:1,wheelPanDebounce:10,wheelAction:"pan"},fW={...qP,pixelRatio:1,motionBlur:!0,textureOnViewport:!0,wheelPanDebounce:20},cW=({nodes:r,edges:e})=>{const{themeColor:t,direction:n,cyRef:a,callbacks:i,config:o,isZoomMode:s,setIsZoomMode:u,isMultiSelectMode:l,setIsMultiSelectMode:c,isDragMode:v,setIsDragMode:h,isEdgeHandlesEnabled:g}=si(),p=Re.useRef(null),E=Re.useRef(null),{edgeSep:m,rankSep:b}=Re.useMemo(()=>JL(r.length),[r.length]),{bgColor:w}=os(t),{background:x,borderSecondary:_}=ss(),C=Re.useCallback(W=>{if(W!=null&&W.includes("gray"))return"whitesmoke";if(!W)return Pt(t);switch(W){case"dark":return Pt(x);case"light":return Pt(_);default:return Pt(W)}},[t,x,_]),R=o.colorMode==="dark",S=Re.useMemo(()=>R?C(w):"dark",[R,w,C]),A=o.edgeColor?C(o.edgeColor):S,P=Re.useMemo(()=>QL(C),[C]),I=o.initialViewport||{pan:{x:0,y:0},zoom:.01},D=Re.useMemo(()=>({...r.length>100?fW:qP,style:P,zoom:I.zoom,pan:I.pan,minZoom:o.minZoom??.01,maxZoom:o.maxZoom??1.5,userZoomingEnabled:!1,userPanningEnabled:!1}),[P,I,r.length,o.minZoom,o.maxZoom]),M=Re.useMemo(()=>({...lW,...n&&{rankDir:n},edgeSep:m,rankSep:b,stop:()=>{a.current&&setTimeout(()=>{var W;(W=a.current)==null||W.fit(void 0,50)},100)}}),[n,m,b,a]),O=Re.useCallback(()=>({"corner-radius":50,"background-color":A,color:A,"border-color":A}),[A]),N=Re.useCallback((W,H,Z,ne)=>{let F={};return ne!=null&&ne.isInverted&&(ne==null?void 0:ne.source)===H&&(F["target-arrow-shape"]="none",F["source-arrow-shape"]="triangle"),ne!=null&&ne.isEdgeAnimated&&(F["line-style"]="dashed",F["line-dash-pattern"]=[32,18],F["line-dash-offset"]=0),ne!=null&&ne.isEdgeDashed&&(F["line-style"]="dashed"),n==="TB"&&(F["taxi-direction"]="downward"),n==="BT"&&(F["taxi-direction"]="upward"),n==="LR"&&(F["taxi-direction"]="rightward"),n==="RL"&&(F["taxi-direction"]="leftward"),F["line-color"]=A,F.color=A,F["target-arrow-color"]=A,F["source-arrow-color"]=A,F},[A,n]);Re.useEffect(()=>{if(a.current){const W=a.current;W.nodes().forEach(H=>{H.isParent()&&H.style(O())}),W.edges().forEach(H=>{const Z=H.data();H.style(N(H,Z.source,Z.target,Z))})}},[A,O,N]);const V=Re.useRef(o);V.current=o;const $=Re.useRef(s);$.current=s;const G=Re.useRef(g);G.current=g,Re.useEffect(()=>{if(!a.current||!a.current.container)return;const W=a.current,H=p.current;if(!H)return;let Z=null,ne=null,F=0,z=0,j=0,ee=0,ie=0;const oe=Y=>{Y.preventDefault(),Y.stopPropagation(),$.current||Y.metaKey||Y.ctrlKey?(j+=Y.deltaY,ee=Y.clientX,ie=Y.clientY,ne===null&&(ne=requestAnimationFrame(()=>{ne=null;const re=V.current,le=W.zoom(),he=j;j=0;let be=le-he*.05/100;be=Math.max(re.minZoom??.01,Math.min(re.maxZoom??1.5,be));const fe=H.getBoundingClientRect();W.zoom({level:be,renderedPosition:{x:ee-fe.left,y:ie-fe.top}})}))):(F+=Y.deltaX,z+=Y.deltaY,Z===null&&(Z=requestAnimationFrame(()=>{Z=null;const re=W.pan(),le=W.zoom(),he=.35,be=F,fe=z;F=0,z=0,W.pan({x:re.x+-be*he/le,y:re.y+-fe*he/le})})))};return H.addEventListener("wheel",oe,{passive:!1}),()=>{H.removeEventListener("wheel",oe),Z!==null&&cancelAnimationFrame(Z),ne!==null&&cancelAnimationFrame(ne)}},[a.current]),Re.useEffect(()=>{a.current&&a.current.userPanningEnabled(v)},[v]),Re.useEffect(()=>{if(!a.current)return;const W=a.current;W.boxSelectionEnabled(!!l),W.selectionType(l?"additive":"single"),W.userPanningEnabled(!l&&v)},[l,v]),Re.useEffect(()=>{E.current&&(g?E.current.enableDrawMode():E.current.disableDrawMode())},[g]),Re.useEffect(()=>{const W=H=>{const Z=H.target;Z.tagName==="INPUT"||Z.tagName==="TEXTAREA"||((H.key==="z"||H.key==="Z")&&u(!$.current),(H.key==="m"||H.key==="M")&&c(!l),(H.key==="d"||H.key==="D")&&h(!v))};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[l,v,u,c,h]),Re.useEffect(()=>()=>{if(a.current)try{a.current.removeAllListeners()}catch{}},[]);const U=Re.useMemo(()=>r.length>50?150:r.length>20?100:50,[r.length]),J=o.backgroundPattern||"dot";return me.jsx(UL,{pattern:J,children:me.jsx(Ee.Box,{ref:p,padding:0,width:"100%",height:"100%",flex:1,position:"relative",children:me.jsxs(sW,{cyParams:D,layoutParams:M,layoutDebounce:U,onCyInit:W=>{var Z;a.current=W,(Z=i.onCyInit)==null||Z.call(i,W);let H=null;if(W.on("zoom pan",()=>{H===null&&(H=requestAnimationFrame(()=>{var ne;H=null,(ne=i.onViewportChange)==null||ne.call(i,{zoom:W.zoom(),pan:W.pan()})}))}),W.on("select","edge",ne=>{var z;const F=ne.target;(z=i.onEdgeSelect)==null||z.call(i,F.id(),F.data())}),W.on("unselect","edge",()=>{var ne;(ne=i.onEdgeDeselect)==null||ne.call(i)}),W.on("remove","edge",ne=>{var z;const F=ne.target;(z=i.onEdgeRemove)==null||z.call(i,F.id(),F.data())}),o.edgeHandles!==!1){const ne={canConnect:(ee,ie)=>!ee.same(ie),edgeParams:(ee,ie)=>({data:{source:ee.id(),target:ie.id(),label:""}}),loopAllowed:()=>!1,hoverDelay:500,snap:!1,snapThreshold:10,snapFrequency:5,noEdgeEventsInDraw:!0,disableBrowserGestures:!0,handlePosition:"left",handleNodes:"node",handleSize:20,handleColor:t||"#0ea5e9",handleOutlineColor:"#B92020FF",handleOutlineWidth:2,handleLineType:"ghost",handleLineWidth:2,preview:!0,ghostEdgeParams:()=>({}),edgeType:()=>"flat",nodeParams:()=>({})},F=W.edgehandles(ne);E.current=F,G.current&&F.enableDrawMode();let z=null,j=null;W.on("ehstart",(ee,ie)=>{j=ie,z=ie.renderedPosition()}),W.on("ehcancel",ee=>{if(!z||!j)return;const ie=ee.originalEvent||window.event,oe=ie==null?void 0:ie.clientX,Y=ie==null?void 0:ie.clientY;if(oe&&Y&&i.onNodeCreate){const X=W.renderer().projectIntoViewport(oe,Y);i.onNodeCreate({type:"text",sourceNodeId:j.id(),position:{x:X[0],y:X[1]}})}z=null,j=null}),W.on("ehcomplete",(ee,ie,oe)=>{var Y;(Y=i.onEdgeCreate)==null||Y.call(i,ie.id(),oe.id())}),W.on("ehstop",()=>{z=null,j=null})}},children:[(r||[]).map(W=>{var j,ee,ie,oe,Y,X;const H=r.filter(re=>{var le,he;return((le=re.data)==null?void 0:le.parent)===((he=W.data)==null?void 0:he.id)}),Z=H.length>0&&!((j=W.data)!=null&&j.parent),ne=Z?((ee=W.data)==null?void 0:ee.label)||((ie=W.data)==null?void 0:ie.headerTitle)||"Container":void 0,F=Z?ic.parentContainer:ic[W==null?void 0:W.data.type]||ic.text,{data:z}=e.find(re=>{var le;return((le=re.data)==null?void 0:le.source)===(W==null?void 0:W.data.id)})||{};return me.jsx(uW,{id:(oe=W.data)==null?void 0:oe.id,parent:(Y=W.data)==null?void 0:Y.parent,label:ne,styleCallback:O,children:me.jsx(F,{...W,isInverted:z==null?void 0:z.isInverted,isParent:Z,childNodes:H})},(X=W.data)==null?void 0:X.id)}),(e||[]).map(({data:W})=>me.jsx(eq,{id:W==null?void 0:W.id,source:W==null?void 0:W.source,target:W==null?void 0:W.target,label:W==null?void 0:W.label,styleCallback:(H,Z,ne)=>N(H,Z,ne,W)},W==null?void 0:W.id))]})})})},dW=Re.memo(cW);var Go=(r=>(r.TOP_DOWN="TB",r.BOTTOM_UP="BT",r.LEFT_RIGHT="LR",r.RIGHT_LEFT="RL",r.CENTER="C",r))(Go||{});const vW=[{value:"BT",label:"Bottom to Up",icon:bt.PiArrowUpLight,flowType:Go.BOTTOM_UP},{value:"TB",label:"Top to Bottom",icon:bt.PiArrowDownLight,flowType:Go.TOP_DOWN},{value:"LR",label:"Left to Right",icon:bt.PiArrowArcRightLight,flowType:Go.LEFT_RIGHT},{value:"RL",label:"Right to Left",icon:bt.PiArrowArcLeftLight,flowType:Go.RIGHT_LEFT}],NP=()=>{const{cyRef:r,themeColor:e,direction:t,selectedNodeIds:n,setSelectedNodeIds:a,isZoomMode:i,setIsZoomMode:o,isMultiSelectMode:s,setIsMultiSelectMode:u,isDragMode:l,setIsDragMode:c,isEdgeHandlesEnabled:v,setIsEdgeHandlesEnabled:h,isArrayNodeMode:g,setIsArrayNodeMode:p,isPinned:E,setIsPinned:m,callbacks:b,config:w}=si(),x=w.colorMode==="dark",{background:_,border:C,colorInactive:R,colorText:S,colorActive:A,darkBackgroundSecondary:P}=ss(),[I,D]=Re.useState(!0),[M,O]=Re.useState(!1),[N,V]=Re.useState(!0),[$,G]=Re.useState(!1);Re.useEffect(()=>{const F=()=>V(window.innerWidth>=768);return F(),window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[]),Re.useEffect(()=>{if(!N){D(!0);return}if(!E){D(!1);return}const F=j=>{D(window.innerHeight-j.clientY<=250)},z=()=>D(!1);return window.addEventListener("mousemove",F),window.addEventListener("mouseleave",z),()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseleave",z)}},[N,E]);const U=Re.useCallback(F=>{const z=r.current;if(!z)return;const j=w.minZoom??.01,ee=w.maxZoom??1.5,ie=.02,oe=z.zoomingEnabled(),Y=z.userZoomingEnabled();z.zoomingEnabled(!0),z.userZoomingEnabled(!0);let X=z.zoom();switch(F){case"increase":X=Math.min(ee,X+ie),z.zoom(X),z.center();break;case"decrease":X=Math.max(j,X-ie),z.zoom(X),z.center();break;case"reset":z.fit(void 0,50);break}z.zoomingEnabled(oe),z.userZoomingEnabled(Y)},[r,w.minZoom,w.maxZoom]),J=I||M,W=w.renderSelectedNodeToolbar,H=n.length>0&&!!W,Z=Re.useMemo(()=>{if(!H)return[];const F=r.current;return F?n.map(z=>{const j=F.getElementById(z);return j!=null&&j.length?j.data():{id:z}}):[]},[H,n,r]),ne=Re.useCallback(()=>{var F;a([]),(F=b.onNodeDeselect)==null||F.call(b)},[a,b]);return me.jsxs(me.Fragment,{children:[H&&me.jsx(Ee.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:W({selectedNodeIds:n,selectedNodeData:Z,onDeselect:ne})}),!E&&me.jsx(Ee.Box,{position:"absolute",bottom:5,left:0,zIndex:101,w:3,children:me.jsx(Ee.Tooltip,{label:"Show Bottom Bar",placement:"top",fontSize:"xs",children:me.jsx(Ee.Flex,{align:"center",bg:_,borderColor:C,borderWidth:1,py:6,px:0,w:4,h:50,borderRadius:"15px",borderLeftRadius:0,onMouseEnter:()=>{O(!0),D(!0)},onMouseLeave:()=>O(!1),_hover:{bg:P},children:me.jsx(Ee.Icon,{ml:-1,as:bt.PiLineVerticalBold,boxSize:5,color:C})})})}),me.jsx(Ee.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",transition:"opacity 0.3s ease-in, transform 0.3s ease",transform:J?"translateY(0)":"translateY(100%)",pointerEvents:J?"auto":"none",opacity:J?1:0,onMouseEnter:()=>{E||D(!0)},onMouseLeave:()=>{E||(D(!1),O(!1))},children:me.jsxs(Ee.Flex,{w:"100%",px:5,position:"absolute",bottom:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[me.jsx(Ee.Box,{bg:_,alignContent:"center",h:50,borderColor:C,borderWidth:1,borderRadius:"15px",children:me.jsxs(Ee.HStack,{px:4,spacing:5,children:[me.jsx(Ee.Tooltip,{label:E?"Unpin":"Pin",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Pin",icon:me.jsx(Ee.Icon,{as:E?bt.PiPushPinFill:bt.PiPushPin,boxSize:5}),size:"sm",variant:"ghost",color:E?e:R,onClick:()=>{const F=!E;m(F),D(F)}})}),me.jsx(Ee.Icon,{mx:-4,as:bt.PiLineVerticalThin,boxSize:5,color:C}),me.jsx(Ee.Tooltip,{label:"Zoom Out",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Zoom out",icon:me.jsx(Ee.Icon,{as:$L.HiMinus,boxSize:5}),size:"sm",variant:"ghost",color:S,onClick:()=>U("decrease")})}),me.jsx(Ee.Tooltip,{label:"Zoom In",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Zoom in",icon:me.jsx(Ee.Icon,{as:vu.VscAdd,boxSize:5}),size:"sm",variant:"ghost",color:S,onClick:()=>U("increase")})}),me.jsx(Ee.Tooltip,{label:"Reset Zoom",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Reset zoom",icon:me.jsx(Ee.Icon,{as:VL.GrPowerReset,boxSize:5}),size:"sm",variant:"ghost",color:S,onClick:()=>U("reset")})}),me.jsx(Ee.Icon,{mx:-4,as:bt.PiLineVerticalThin,boxSize:5,color:C}),me.jsx(Ee.Tooltip,{label:i?"Zoom Mode (z)":"Pan Mode (z)",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Toggle zoom mode",icon:me.jsx(Ee.Icon,{as:i?vu.VscZoomIn:vu.VscMove,boxSize:5}),size:"sm",variant:"ghost",color:i?e:R,onClick:()=>o(!i)})}),me.jsx(Ee.Icon,{mx:-4,as:bt.PiLineVerticalThin,boxSize:5,color:C}),me.jsx(Ee.Tooltip,{label:s?"Multi-Select On (m)":"Multi-Select Off (m)",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Toggle multi-select",icon:me.jsx(Ee.Icon,{as:vu.VscGroupByRefType,boxSize:5}),size:"sm",variant:"ghost",color:s?e:R,onClick:()=>u(!s)})}),me.jsx(Ee.Icon,{mx:-4,as:bt.PiLineVerticalThin,boxSize:5,color:C}),me.jsx(Ee.Tooltip,{label:l?"Drag Mode On (d)":"Drag Mode Off (d)",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Toggle drag mode",icon:me.jsx(Ee.Icon,{as:bt.PiHandGrabbing,boxSize:5}),size:"sm",variant:"ghost",color:l?e:R,onClick:()=>c(!l)})}),w.edgeHandles!==!1&&me.jsxs(me.Fragment,{children:[me.jsx(Ee.Icon,{mx:-4,as:bt.PiLineVerticalThin,boxSize:5,color:C}),me.jsx(Ee.Tooltip,{label:v?"Draw Mode On":"Draw Mode Off",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Toggle draw mode",icon:me.jsx(Ee.Icon,{as:bt.PiPencilSimpleLine,boxSize:5}),size:"sm",variant:"ghost",color:v?e:R,onClick:()=>h(!v)})})]}),me.jsx(Ee.Icon,{mx:-4,as:bt.PiLineVerticalThin,boxSize:5,color:C}),me.jsx(Ee.Tooltip,{label:g?"List mode":"Set mode",placement:"top",fontSize:"xs",children:me.jsx(Ee.Flex,{cursor:"pointer",align:"center",onClick:()=>{var z;const F=!g;p(F),(z=b.onArrayModeChange)==null||z.call(b,F)},_hover:{color:e},children:me.jsx(Ee.Text,{fontSize:"23px",color:g?e:R,children:g?"[]":"{}"})})})]})}),me.jsxs(Ee.Box,{position:"relative",ml:"auto",children:[me.jsx(Ee.Box,{bg:_,borderWidth:1,borderColor:C,borderRadius:"15px",h:50,px:3,children:me.jsxs(Ee.Flex,{align:"center",h:"100%",children:[me.jsx(Ee.Tooltip,{label:"Flow Direction",placement:"top",fontSize:"xs",children:me.jsx(Ee.IconButton,{"aria-label":"Direction",icon:me.jsx(Ee.Icon,{as:bt.PiCaretUp,boxSize:4}),size:"sm",variant:"ghost",color:R,onClick:()=>G(!$)})}),me.jsx(Ee.Text,{fontSize:"xs",color:R,ml:1,children:t})]})}),$&&me.jsxs(Ee.Box,{position:"absolute",bottom:"60px",right:0,bg:_,borderWidth:1,borderColor:C,borderRadius:"15px",p:2,zIndex:200,minW:"180px",shadow:"lg",onMouseLeave:()=>G(!1),children:[vW.map(F=>me.jsxs(Ee.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:x?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var z;(z=b.onDirectionChange)==null||z.call(b,F.value),G(!1)},children:[me.jsx(Ee.Icon,{as:F.icon,boxSize:5,color:S}),me.jsx(Ee.Text,{fontSize:"sm",color:S,flex:1,children:F.label}),t===F.value&&me.jsx(Ee.Icon,{as:O1.IoCheckmark,boxSize:4,color:A})]},F.value)),me.jsxs(Ee.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:x?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var F;(F=b.onDirectionChange)==null||F.call(b,"LR"),G(!1)},children:[me.jsx(Ee.Icon,{as:GL.TbAlignCenter,boxSize:5,color:S}),me.jsx(Ee.Text,{fontSize:"sm",color:S,flex:1,children:"Center"}),t==="C"&&me.jsx(Ee.Icon,{as:O1.IoCheckmark,boxSize:4,color:A})]})]})]})]})})]})};NP.displayName="BottomBar";const hW=Re.memo(NP),zl={label:"Untitled",description:"",isTask:!1,isLocked:!1},v0={id:null,type:"text",data:{...zl,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",borderColor:"transparent",borderRadius:25,borderWidth:0,boxShadow:"none",textOverflow:"ellipsis",fontWeight:"bold",textColor:"gray.800",textAlign:"center"}}},kR={id:null,type:"objectView",data:{...zl,headerTitle:null,viewProps:{width:"100%",borderWidth:2,borderRadius:25,height:"100%",justifyContent:"space-between",flexDirection:"row",textColor:"gray.900"}}},gW={id:null,type:"arrayView",data:{...zl,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",textAlign:"center",borderRadius:25,fontSize:"5xl",borderWidth:2,textOverflow:"ellipsis",wordBreak:"keep-all",fontWeight:"bold",textColor:"gray.900",placeholder:"Start Typing"}}},LR={id:null,type:"workflowStep",data:{...zl,viewProps:{width:"max-content !important",maxWidth:350,minWidth:280,height:"100%",borderRadius:15,borderWidth:3}}};let Ru;const pW=new Uint8Array(16);function yW(){if(!Ru&&(Ru=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ru))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ru(pW)}const ct=[];for(let r=0;r<256;++r)ct.push((r+256).toString(16).slice(1));function mW(r,e=0){return ct[r[e+0]]+ct[r[e+1]]+ct[r[e+2]]+ct[r[e+3]]+"-"+ct[r[e+4]]+ct[r[e+5]]+"-"+ct[r[e+6]]+ct[r[e+7]]+"-"+ct[r[e+8]]+ct[r[e+9]]+"-"+ct[r[e+10]]+ct[r[e+11]]+ct[r[e+12]]+ct[r[e+13]]+ct[r[e+14]]+ct[r[e+15]]}const bW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qR={randomUUID:bW};function wW(r,e,t){if(qR.randomUUID&&!r)return qR.randomUUID();r=r||{};const n=r.random||(r.rng||yW)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,mW(n)}const Yt=r=>typeof r=="object",FP=r=>Array.isArray(r),xW=["order","position","selected","locked","grabbed","grabbable","scratch"],Ra=r=>Object.entries(r).reduce((e,[t,n])=>(!Yt(n)&&!t.startsWith("$")&&(e[t]=n),e),{}),h0=(r,e)=>typeof r=="string"&&r.startsWith("$")?nm(r,e):Yt(r)&&!FP(r)?Object.entries(r).reduce((t,[n,a])=>(typeof a=="string"&&a.startsWith("$")&&n==="..."?(delete t["..."],t[n]={...nm(a,e),...r}):typeof a=="string"&&a.startsWith("$")?t[n]=nm(a,e):t[n]=a,t),{}):r,Aa=r=>Object.entries(r).reduce((e,[t,n])=>(Yt(n)&&t&&n&&!t.startsWith("$")&&(xW.includes(t)&&(t=t+"#"),e[t]=n),e),{}),Ja=(r,e,{label:t,parent:n=void 0},a,i=null)=>(i!==null&&(Yt(i)||FP(i))&&(i=JSON.stringify(i,null,2)),{data:{parent:n,...r.data,id:e,text:t||"",label:t,code:i||null,type:r.type,description:a}}),ma=(r,e,t=null,n=null,a=null,i=!1,o=null)=>({data:{id:wW(),source:a?e:r,target:a?r:e,label:n||"",isInverted:a,isEdgeAnimated:i,parent:o}}),Pa=(r,e=[])=>{const t={},n={};let a=[];if(r)for(const[i,o]of Object.entries(r))i.startsWith("$")&&i!=="$"?t[i.slice(1)]=o:i!=="$"?n[i]=o:i==="$"&&(a=o);return{newConfig:t,updatedObject:n,arrayObject:a}},Hi=(r,e)=>{let t=kR;const{view:n,borderColor:a,borderRadius:i,bgColor:o,textColor:s,fontSize:u,stepType:l}=e;r=n||r,l?t={...LR}:r==="object"?t=kR:r==="text"?t=v0:r==="array"?t=gW:r==="workflowStep"&&(t={...LR});const c=t.data.viewProps;return t.data.viewProps={...c,borderRadius:i||(l?15:50),bgColor:o,borderColor:a,textColor:s,fontSize:u},t.data.config=e,{config:t}},is=(r,e)=>(r=e.find(n=>{var a;return((a=n.data)==null?void 0:a.id)===r||n===r})?`${r}.#`:r,r),nm=(r,{ids:e,jsnObjct:t})=>{if(typeof r=="string"&&(r!=null&&r.startsWith("$"))){const n=r.replace("$","").replace("*","");r==null||r.endsWith("*");const a=e.find(s=>s.split(".").slice(-1)[0]===n||n===s);if(!a)return r;const i=EW(a,t);return JSON.stringify(i).includes(r)?r:i||r}return r},EW=(r,e)=>{let t=r.split(".").splice(1);return t=t[t.length-1]==="#"||t[t.length-1].includes("{")?t.slice(0,-2):t,(i=>t.reduce((o,s)=>{s=s.replace("[","").replace("]","");const{arrayObject:u}=Pa(o);return o=u.length?u:o,o[s]},i))(e)};function Xi(r,e="root",t=[]){try{const{arrayObject:n}=Pa(r);n.length&&(r=n);const a=Ra(r),i=Aa(r);return Yt(r)?(gr.isArray(r)||gr.isArray(r)&&e==="root"||!gr.isArray(r)&&Object.keys(a).length||e==="root")&&t.push(e):t.push(e),Object.keys(i).length&&!gr.isArray(r)?Ko({chldPth:null,itrblObjct:i,nodes:t,path:e}):gr.isArray(r)&&r.forEach((o,s)=>{const u=Ra(o),l=Aa(o),{newConfig:c,arrayObject:v}=Pa(o);let h=`${e}.${s}`;Yt(o)?Object.keys(u).length?(Xi(u,h,t),Object.keys(l).length&&!gr.isArray(o)&&Ko({chldPth:h,itrblObjct:l,nodes:t,path:e})):Object.keys(l).length&&!gr.isArray(o)?Ko({chldPth:h,itrblObjct:l,nodes:t,path:e}):gr.isArray(o)&&zP({chldPth:h,item:o,nodes:t,path:e}):t.push(h)}),{nodes:t}}catch{return{nodes:t}}}const Ko=({chldPth:r,itrblObjct:e,nodes:t,path:n})=>Object.entries(e).forEach(([a,i],o)=>{const s=Ra(i),u=Aa(i),{newConfig:l,arrayObject:c}=Pa(i);c.length&&(i=c);let v=r?`${r}.${a}`:`${n}.${a}`;if(Yt(i)&&!gr.isArray(i)){const h=Object.keys(s).length===0;if(h&&(Hi("array",l),t.push(v)),Object.keys(s).length){const g=gr.isArray(i)?`${i.length||""}`:`{${Object.keys(i).length||""}}`;let p=v;h&&(p=`${v}.${g}`),Xi(i,p,t)}else Object.keys(u).length&&!gr.isArray(i)?Ko({chldPth:v,itrblObjct:u,path:v,nodes:t}):Xi(i,v,t)}else gr.isArray(i)&&Xi(i,v,t)}),zP=({chldPth:r,item:e,nodes:t,path:n})=>e.forEach((a,i)=>{let o=`${r}.${i}`;const s=Aa(a),u=Ra(a);Yt(a)?!gr.isArray(a)&&Object.keys(u).length?Xi(a,o,t):Object.keys(s).length&&!gr.isArray(a)?Ko({chldPth:o,itrblObjct:s,path:n,nodes:t}):gr.isArray(a)&&zP({chldPth:o,item:a,nodes:t,path:n}):t.push(o)});function ri(r,e="root",t=[],n=[],a="untitled",i={hideDefaultObject:!1,sprtObjctKy:!1,isCntr:!1},o={},s){if(s||(s={invrtdRtPths:[],initalObjIds:null}),!r||typeof r!="object")return{nodes:t,edges:n};const u=r;if(!s.initalObjIds){const{nodes:v}=Xi(r);s.initalObjIds={ids:v,jsnObjct:r}}let{hideDefaultObject:l,sprtObjctKy:c}=i;try{e=is(e,t);const{newConfig:v,arrayObject:h}=Pa(r),g=Object.keys(o).length>0?o:v;h.length&&(r=h);const p=Ra(r),E=Aa(r),{label:m,collapsed:b,parent:w}=g;if(!Yt(r))t.push(Ja(v0,e,{label:m||e,parent:w},r,u));else if(gr.isArray(r)||gr.isArray(r)&&e==="root"){const{config:x}=Hi("array",g),_=gr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,C=e==="root"?a:`${a} ${_}`;t.push(Ja(x,e,{label:m||C,parent:w},r,gr.isArray(u)?{[a]:u}:u))}else if(!gr.isArray(r)&&Object.keys(p).length||e==="root"){const{config:x}=Hi(null,g),_=e.split("."),C=_[_.length-1];let R=isNaN(Number(C))?null:Number(C)+1;const S=isNaN(Number(C))?C:_[_.length-2]+" "+R,A=e==="root"?a:S,P=r;if(m){const{config:I}=Hi("object",g);I.data.headerTitle=m,t.push(Ja(I,e,{label:m||`${m} ${Object.keys(r).length}`,parent:w},p,P))}else x.data.headerTitle=A,t.push(Ja(x,e,{label:m,parent:w},p,P))}return b||(Object.keys(E).length&&!gr.isArray(r)?jo({flowConfig:i,chldPth:null,edges:n,isInverted:null,itrblObjct:E,nodes:t,path:e,newConfig:g,ctx:s}):gr.isArray(r)&&r.forEach((x,_)=>{x=h0(x,s.initalObjIds);const C=x,R=Ra(x),S=Aa(x),{newConfig:A,arrayObject:P}=Pa(x);P.length&&(x=P);const{config:I}=Hi(typeof x=="string"?"text":"array",A),{hideConfig:D,sourceLabel:M,label:O,isEdgeAnimated:N,parent:V}=A;l=l||D;const $=e==="root"&&i.isCntr,G=e.split(".").slice(0,2).join("."),U=s.invrtdRtPths.includes(G),J=i.isCntr&&U||_%2===0&&$;let W=`${e}.${_}`;W=is(W,t),J&&s.invrtdRtPths.push(W),Yt(x)?Object.keys(R).length&&!gr.isArray(x)?(n.push(ma(e,W,null,M,J,N)),ri(x,W,t,n,O||_,i,A,s)):Object.keys(S).length&&!gr.isArray(x)?jo({flowConfig:i,chldPth:W,isInverted:J,edges:n,itrblObjct:S,nodes:t,path:e,newConfig:A,forceIsInverted:!0,ctx:s}):gr.isArray(x)?$P({flowConfig:i,chldPth:W,edges:n,isInverted:J,item:x,nodes:t,path:e,ctx:s}):Yt(x)&&jo({flowConfig:i,chldPth:W,isInverted:J,edges:n,itrblObjct:[x],nodes:t,path:e,newConfig:A,ctx:s}):(n.push(ma(e,W,null,M,J,N)),t.push(Ja(I,W,{label:O||String(x),parent:V},x,C)))})),{nodes:t,edges:n}}catch{return{nodes:t,edges:n}}}const jo=({chldPth:r,flowConfig:e,edges:t,itrblObjct:n,nodes:a,isInverted:i,path:o,newConfig:s,forceIsInverted:u=!1,ctx:l})=>{let{hideDefaultObject:c,sprtObjctKy:v}=e;return Object.entries(n).forEach(([h,g],p)=>{g=h0(g,l.initalObjIds);const E=g,m=Ra(g),b=Aa(g),{newConfig:w,arrayObject:x}=Pa(g);x.length&&(g=x);const{hideConfig:_,sourceLabel:C,label:R,content:S,target:A,targetLabel:P,collapsed:I,isEdgeAnimated:D,parent:M}=w;c=c||_;const O=o==="root"&&e.isCntr,N=o.split(".").slice(0,2).join("."),V=l.invrtdRtPths.includes(N);u||(i=e.isCntr&&V||p%2===0&&O);let $=r?`${r}.${h}`:`${o}.${h}`;if($=is($,a),i&&l.invrtdRtPths.push($),A&&t.push(ma($,A,null,P,i,D)),Yt(g)&&!gr.isArray(g)){t.push(ma(o,$,null,C,i,D));const G=v||Object.keys(m).length===0;if(G){const U=S?"object":"array",{config:J}=Hi(U,w);J.data.headerTitle=S?R:null,a.push(Ja(J,$,{label:R||h,parent:M},g,E))}if(Object.keys(m).length&&!c){let U=$;if(G){const J=gr.isArray(g)?` ${g.length||""}`:`{${Object.keys(g).length||""}}`;U=`${$}.${J}`,U=is(U,a),t.push(ma($,U,null,C,i,D))}ri(g,U,a,t,R||h,e,w,l)}else Object.keys(b).length&&!gr.isArray(g)&&!I?jo({chldPth:$,flowConfig:e,itrblObjct:b,path:$,edges:t,nodes:a,newConfig:w,isInverted:i,ctx:l}):ri(g,$,a,t,h,e,w,l)}else gr.isArray(g)&&(t.push(ma(o,$,null,C,i,D)),ri(g,$,a,t,h,e,w,l))})},$P=({flowConfig:r,chldPth:e,edges:t,isInverted:n,item:a,nodes:i,path:o,ctx:s})=>a.forEach((u,l)=>{let c=`${e}.${l}`;c=is(c,i);const v=u;u=h0(u,s.initalObjIds);const h=Aa(u),g=Ra(u),{newConfig:p}=Pa(u),{collapsed:E,label:m,parent:b,sourceLabel:w,isEdgeAnimated:x,content:_}=p;Yt(u)?!gr.isArray(u)&&Object.keys(g).length?(t.push(ma(o,c,null,w,n,x)),ri(u,c,i,t,l,r,p,s)):Object.keys(h).length&&!gr.isArray(u)&&!E?jo({chldPth:c,flowConfig:r,itrblObjct:h,path:o,edges:t,nodes:i,isInverted:n,newConfig:p,ctx:s}):gr.isArray(u)&&$P({flowConfig:r,chldPth:c,edges:t,isInverted:n,item:u,nodes:i,path:o,ctx:s}):(t.push(ma(o,c,null,w,n,x)),i.push(Ja(v0,c,{label:m||String(u),parent:b},u,v)))}),_W=".cytoscape-react-nodes-and-edges{position:absolute!important;top:0!important;left:0!important;z-index:10!important;pointer-events:none!important;overflow:visible!important;transform-origin:0 0!important}.cytoscape-react-node{z-index:0!important;overflow:visible!important;pointer-events:auto!important;position:absolute!important;transform-origin:0 0!important}.cytoscape-react-node input,.cytoscape-react-node textarea{pointer-events:auto!important;user-select:text!important;cursor:text!important}.cytoscape-react-edge{overflow:visible!important;pointer-events:none!important}.cytoscape-react-cy-container{width:100%!important;height:100%!important;overflow:visible!important;position:relative!important}.cytoscape-react-cy-container canvas{display:inline!important;vertical-align:baseline!important;overflow:visible!important}.cytoscape-react-cy-container>div{overflow:visible!important}";let NR=!1;function CW(){if(NR||typeof document>"u")return;const r=document.createElement("style");r.setAttribute("data-flow-sdk",""),r.textContent=_W,document.head.appendChild(r),NR=!0}function SW({json:r,title:e="untitled",nodes:t,edges:n,config:a={},callbacks:i={},className:o,style:s,showBottomBar:u=!0}){CW();const l=a.direction==="C",{nodes:c,edges:v}=Re.useMemo(()=>{if(t&&n)return{nodes:t,edges:n};if(r){const h=typeof r=="string"?JSON.parse(r):r;return ri(h,"root",[],[],e,{hideDefaultObject:!1,sprtObjctKy:!1,isCntr:l})}return{nodes:[],edges:[]}},[r,e,t,n,l]);return me.jsx(WL,{config:a,callbacks:i,children:me.jsxs(Ee.Box,{className:o,style:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",children:[me.jsx(dW,{nodes:c,edges:v}),u&&me.jsx(hW,{})]})})}exports.FlowDiagram=SW;exports.contentObjTheme=Pn;exports.createFlowDiagram=ri;exports.getChakraColorHex=Pt;exports.getColorVariant=zR;exports.getDarkerHexColor=$u;exports.useCustomColors=ss;exports.useThemeContentColors=os;
|
|
356
|
+
`)+Ie+`return __p
|
|
357
|
+
}`;var sr=D1(function(){return mr(F,Ue+"return "+Ie).apply(t,H)});if(sr.source=Ie,Yf(sr))throw sr;return sr}function nL(f){return wr(f).toLowerCase()}function aL(f){return wr(f).toUpperCase()}function iL(f,v,m){if(f=wr(f),f&&(m||v===t))return z0(f);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=hn(v),F=$0(R,B),H=V0(R,B)+1;return da(R,F,H).join("")}function oL(f,v,m){if(f=wr(f),f&&(m||v===t))return f.slice(0,W0(f)+1);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=V0(R,hn(v))+1;return da(R,0,B).join("")}function sL(f,v,m){if(f=wr(f),f&&(m||v===t))return f.replace(Nr,"");if(!f||!(v=Ut(v)))return f;var R=hn(f),B=$0(R,hn(v));return da(R,B).join("")}function uL(f,v){var m=I,R=D;if(Fr(v)){var B="separator"in v?v.separator:B;m="length"in v?ir(v.length):m,R="omission"in v?Ut(v.omission):R}f=wr(f);var F=f.length;if(Ci(f)){var H=hn(f);F=H.length}if(m>=F)return f;var J=m-_i(R);if(J<1)return R;var ie=H?da(H,0,J).join(""):f.slice(0,J);if(B===t)return ie+R;if(H&&(J+=ie.length-J),Zf(B)){if(f.slice(J).search(B)){var Te,Re=ie;for(B.global||(B=df(B.source,wr(ft.exec(B))+"g")),B.lastIndex=0;Te=B.exec(Re);)var Ie=Te.index;ie=ie.slice(0,Ie===t?J:Ie)}}else if(f.indexOf(Ut(B),J)!=J){var Oe=ie.lastIndexOf(B);Oe>-1&&(ie=ie.slice(0,Oe))}return ie+R}function lL(f){return f=wr(f),f&&or.test(f)?f.replace(Fe,NI):f}var fL=Di(function(f,v,m){return f+(m?" ":"")+v.toUpperCase()}),Jf=Bb("toUpperCase");function I1(f,v,m){return f=wr(f),v=m?t:v,v===t?MI(f)?$I(f):_I(f):f.match(v)||[]}var D1=lr(function(f,v){try{return Gt(f,t,v)}catch(m){return Yf(m)?m:new rr(m)}}),cL=$n(function(f,v){return Qt(v,function(m){m=Tn(m),Fn(f,m,Kf(f[m],f))}),f});function dL(f){var v=f==null?0:f.length,m=Ze();return f=v?Or(f,function(R){if(typeof R[1]!="function")throw new Jt(o);return[m(R[0]),R[1]]}):[],lr(function(R){for(var B=-1;++B<v;){var F=f[B];if(Gt(F[0],this,R))return Gt(F[1],this,R)}})}function vL(f){return ND(rn(f,d))}function ec(f){return function(){return f}}function hL(f,v){return f==null||f!==f?v:f}var gL=kb(),pL=kb(!0);function qt(f){return f}function rc(f){return fb(typeof f=="function"?f:rn(f,d))}function yL(f){return db(rn(f,d))}function mL(f,v){return vb(f,rn(v,d))}var bL=lr(function(f,v){return function(m){return Co(m,f,v)}}),wL=lr(function(f,v){return function(m){return Co(f,m,v)}});function tc(f,v,m){var R=it(v),B=js(v,R);m==null&&!(Fr(v)&&(B.length||!R.length))&&(m=v,v=f,f=this,B=js(v,it(v)));var F=!(Fr(m)&&"chain"in m)||!!m.chain,H=Gn(f);return Qt(B,function(J){var ie=v[J];f[J]=ie,H&&(f.prototype[J]=function(){var Te=this.__chain__;if(F||Te){var Re=f(this.__wrapped__),Ie=Re.__actions__=kt(this.__actions__);return Ie.push({func:ie,args:arguments,thisArg:f}),Re.__chain__=Te,Re}return ie.apply(f,oa([this.value()],arguments))})}),f}function xL(){return ct._===this&&(ct._=KI),this}function nc(){}function EL(f){return f=ir(f),lr(function(v){return hb(v,f)})}var CL=kf(Or),_L=kf(O0),SL=kf(af);function B1(f){return $f(f)?of(Tn(f)):rB(f)}function TL(f){return function(v){return f==null?t:Ua(f,v)}}var RL=Lb(),AL=Lb(!0);function ac(){return[]}function ic(){return!1}function PL(){return{}}function IL(){return""}function DL(){return!0}function BL(f,v){if(f=ir(f),f<1||f>V)return[];var m=j,R=wt(f,j);v=Ze(v),f-=j;for(var B=lf(R,v);++m<f;)v(m);return B}function ML(f){return tr(f)?Or(f,Tn):Ht(f)?[f]:kt(Qb(wr(f)))}function kL(f){var v=++UI;return wr(f)+v}var OL=eu(function(f,v){return f+v},0),LL=Of("ceil"),qL=eu(function(f,v){return f/v},1),NL=Of("floor");function FL(f){return f&&f.length?Ks(f,qt,wf):t}function zL(f,v){return f&&f.length?Ks(f,Ze(v,2),wf):t}function $L(f){return N0(f,qt)}function VL(f,v){return N0(f,Ze(v,2))}function GL(f){return f&&f.length?Ks(f,qt,_f):t}function WL(f,v){return f&&f.length?Ks(f,Ze(v,2),_f):t}var UL=eu(function(f,v){return f*v},1),HL=Of("round"),KL=eu(function(f,v){return f-v},0);function jL(f){return f&&f.length?uf(f,qt):0}function YL(f,v){return f&&f.length?uf(f,Ze(v,2)):0}return L.after=yk,L.ary=l1,L.assign=aO,L.assignIn=C1,L.assignInWith=vu,L.assignWith=iO,L.at=oO,L.before=f1,L.bind=Kf,L.bindAll=cL,L.bindKey=c1,L.castArray=Pk,L.chain=o1,L.chunk=NB,L.compact=FB,L.concat=zB,L.cond=dL,L.conforms=vL,L.constant=ec,L.countBy=jM,L.create=sO,L.curry=d1,L.curryRight=v1,L.debounce=h1,L.defaults=uO,L.defaultsDeep=lO,L.defer=mk,L.delay=bk,L.difference=$B,L.differenceBy=VB,L.differenceWith=GB,L.drop=WB,L.dropRight=UB,L.dropRightWhile=HB,L.dropWhile=KB,L.fill=jB,L.filter=ZM,L.flatMap=JM,L.flatMapDeep=ek,L.flatMapDepth=rk,L.flatten=t1,L.flattenDeep=YB,L.flattenDepth=ZB,L.flip=wk,L.flow=gL,L.flowRight=pL,L.fromPairs=XB,L.functions=pO,L.functionsIn=yO,L.groupBy=tk,L.initial=JB,L.intersection=eM,L.intersectionBy=rM,L.intersectionWith=tM,L.invert=bO,L.invertBy=wO,L.invokeMap=ak,L.iteratee=rc,L.keyBy=ik,L.keys=it,L.keysIn=Lt,L.map=su,L.mapKeys=EO,L.mapValues=CO,L.matches=yL,L.matchesProperty=mL,L.memoize=lu,L.merge=_O,L.mergeWith=_1,L.method=bL,L.methodOf=wL,L.mixin=tc,L.negate=fu,L.nthArg=EL,L.omit=SO,L.omitBy=TO,L.once=xk,L.orderBy=ok,L.over=CL,L.overArgs=Ek,L.overEvery=_L,L.overSome=SL,L.partial=jf,L.partialRight=g1,L.partition=sk,L.pick=RO,L.pickBy=S1,L.property=B1,L.propertyOf=TL,L.pull=oM,L.pullAll=a1,L.pullAllBy=sM,L.pullAllWith=uM,L.pullAt=lM,L.range=RL,L.rangeRight=AL,L.rearg=Ck,L.reject=fk,L.remove=fM,L.rest=_k,L.reverse=Uf,L.sampleSize=dk,L.set=PO,L.setWith=IO,L.shuffle=vk,L.slice=cM,L.sortBy=pk,L.sortedUniq=mM,L.sortedUniqBy=bM,L.split=JO,L.spread=Sk,L.tail=wM,L.take=xM,L.takeRight=EM,L.takeRightWhile=CM,L.takeWhile=_M,L.tap=FM,L.throttle=Tk,L.thru=ou,L.toArray=w1,L.toPairs=T1,L.toPairsIn=R1,L.toPath=ML,L.toPlainObject=E1,L.transform=DO,L.unary=Rk,L.union=SM,L.unionBy=TM,L.unionWith=RM,L.uniq=AM,L.uniqBy=PM,L.uniqWith=IM,L.unset=BO,L.unzip=Hf,L.unzipWith=i1,L.update=MO,L.updateWith=kO,L.values=ki,L.valuesIn=OO,L.without=DM,L.words=I1,L.wrap=Ak,L.xor=BM,L.xorBy=MM,L.xorWith=kM,L.zip=OM,L.zipObject=LM,L.zipObjectDeep=qM,L.zipWith=NM,L.entries=T1,L.entriesIn=R1,L.extend=C1,L.extendWith=vu,tc(L,L),L.add=OL,L.attempt=D1,L.camelCase=FO,L.capitalize=A1,L.ceil=LL,L.clamp=LO,L.clone=Ik,L.cloneDeep=Bk,L.cloneDeepWith=Mk,L.cloneWith=Dk,L.conformsTo=kk,L.deburr=P1,L.defaultTo=hL,L.divide=qL,L.endsWith=zO,L.eq=pn,L.escape=$O,L.escapeRegExp=VO,L.every=YM,L.find=XM,L.findIndex=e1,L.findKey=fO,L.findLast=QM,L.findLastIndex=r1,L.findLastKey=cO,L.floor=NL,L.forEach=s1,L.forEachRight=u1,L.forIn=dO,L.forInRight=vO,L.forOwn=hO,L.forOwnRight=gO,L.get=Xf,L.gt=Ok,L.gte=Lk,L.has=mO,L.hasIn=Qf,L.head=n1,L.identity=qt,L.includes=nk,L.indexOf=QB,L.inRange=qO,L.invoke=xO,L.isArguments=ja,L.isArray=tr,L.isArrayBuffer=qk,L.isArrayLike=Ot,L.isArrayLikeObject=Ur,L.isBoolean=Nk,L.isBuffer=va,L.isDate=Fk,L.isElement=zk,L.isEmpty=$k,L.isEqual=Vk,L.isEqualWith=Gk,L.isError=Yf,L.isFinite=Wk,L.isFunction=Gn,L.isInteger=p1,L.isLength=cu,L.isMap=y1,L.isMatch=Uk,L.isMatchWith=Hk,L.isNaN=Kk,L.isNative=jk,L.isNil=Zk,L.isNull=Yk,L.isNumber=m1,L.isObject=Fr,L.isObjectLike=Vr,L.isPlainObject=Po,L.isRegExp=Zf,L.isSafeInteger=Xk,L.isSet=b1,L.isString=du,L.isSymbol=Ht,L.isTypedArray=Mi,L.isUndefined=Qk,L.isWeakMap=Jk,L.isWeakSet=eO,L.join=nM,L.kebabCase=GO,L.last=nn,L.lastIndexOf=aM,L.lowerCase=WO,L.lowerFirst=UO,L.lt=rO,L.lte=tO,L.max=FL,L.maxBy=zL,L.mean=$L,L.meanBy=VL,L.min=GL,L.minBy=WL,L.stubArray=ac,L.stubFalse=ic,L.stubObject=PL,L.stubString=IL,L.stubTrue=DL,L.multiply=UL,L.nth=iM,L.noConflict=xL,L.noop=nc,L.now=uu,L.pad=HO,L.padEnd=KO,L.padStart=jO,L.parseInt=YO,L.random=NO,L.reduce=uk,L.reduceRight=lk,L.repeat=ZO,L.replace=XO,L.result=AO,L.round=HL,L.runInContext=ne,L.sample=ck,L.size=hk,L.snakeCase=QO,L.some=gk,L.sortedIndex=dM,L.sortedIndexBy=vM,L.sortedIndexOf=hM,L.sortedLastIndex=gM,L.sortedLastIndexBy=pM,L.sortedLastIndexOf=yM,L.startCase=eL,L.startsWith=rL,L.subtract=KL,L.sum=jL,L.sumBy=YL,L.template=tL,L.times=BL,L.toFinite=Wn,L.toInteger=ir,L.toLength=x1,L.toLower=nL,L.toNumber=an,L.toSafeInteger=nO,L.toString=wr,L.toUpper=aL,L.trim=iL,L.trimEnd=oL,L.trimStart=sL,L.truncate=uL,L.unescape=lL,L.uniqueId=kL,L.upperCase=fL,L.upperFirst=Jf,L.each=s1,L.eachRight=u1,L.first=n1,tc(L,(function(){var f={};return _n(L,function(v,m){br.call(L.prototype,m)||(f[m]=v)}),f})(),{chain:!1}),L.VERSION=n,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){L[f].placeholder=L}),Qt(["drop","take"],function(f,v){dr.prototype[f]=function(m){m=m===t?1:Jr(ir(m),0);var R=this.__filtered__&&!v?new dr(this):this.clone();return R.__filtered__?R.__takeCount__=wt(m,R.__takeCount__):R.__views__.push({size:wt(m,j),type:f+(R.__dir__<0?"Right":"")}),R},dr.prototype[f+"Right"]=function(m){return this.reverse()[f](m).reverse()}}),Qt(["filter","map","takeWhile"],function(f,v){var m=v+1,R=m==N||m==$;dr.prototype[f]=function(B){var F=this.clone();return F.__iteratees__.push({iteratee:Ze(B,3),type:m}),F.__filtered__=F.__filtered__||R,F}}),Qt(["head","last"],function(f,v){var m="take"+(v?"Right":"");dr.prototype[f]=function(){return this[m](1).value()[0]}}),Qt(["initial","tail"],function(f,v){var m="drop"+(v?"":"Right");dr.prototype[f]=function(){return this.__filtered__?new dr(this):this[m](1)}}),dr.prototype.compact=function(){return this.filter(qt)},dr.prototype.find=function(f){return this.filter(f).head()},dr.prototype.findLast=function(f){return this.reverse().find(f)},dr.prototype.invokeMap=lr(function(f,v){return typeof f=="function"?new dr(this):this.map(function(m){return Co(m,f,v)})}),dr.prototype.reject=function(f){return this.filter(fu(Ze(f)))},dr.prototype.slice=function(f,v){f=ir(f);var m=this;return m.__filtered__&&(f>0||v<0)?new dr(m):(f<0?m=m.takeRight(-f):f&&(m=m.drop(f)),v!==t&&(v=ir(v),m=v<0?m.dropRight(-v):m.take(v-f)),m)},dr.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},dr.prototype.toArray=function(){return this.take(j)},_n(dr.prototype,function(f,v){var m=/^(?:filter|find|map|reject)|While$/.test(v),R=/^(?:head|last)$/.test(v),B=L[R?"take"+(v=="last"?"Right":""):v],F=R||/^find/.test(v);B&&(L.prototype[v]=function(){var H=this.__wrapped__,J=R?[1]:arguments,ie=H instanceof dr,Te=J[0],Re=ie||tr(H),Ie=function(cr){var vr=B.apply(L,oa([cr],J));return R&&Oe?vr[0]:vr};Re&&m&&typeof Te=="function"&&Te.length!=1&&(ie=Re=!1);var Oe=this.__chain__,Ue=!!this.__actions__.length,Qe=F&&!Oe,sr=ie&&!Ue;if(!F&&Re){H=sr?H:new dr(this);var Je=f.apply(H,J);return Je.__actions__.push({func:ou,args:[Ie],thisArg:t}),new en(Je,Oe)}return Qe&&sr?f.apply(this,J):(Je=this.thru(Ie),Qe?R?Je.value()[0]:Je.value():Je)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(f){var v=Bs[f],m=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",R=/^(?:pop|shift)$/.test(f);L.prototype[f]=function(){var B=arguments;if(R&&!this.__chain__){var F=this.value();return v.apply(tr(F)?F:[],B)}return this[m](function(H){return v.apply(tr(H)?H:[],B)})}}),_n(dr.prototype,function(f,v){var m=L[v];if(m){var R=m.name+"";br.call(Ai,R)||(Ai[R]=[]),Ai[R].push({name:v,func:m})}}),Ai[Js(t,b).name]=[{name:"wrapper",func:t}],dr.prototype.clone=lD,dr.prototype.reverse=fD,dr.prototype.value=cD,L.prototype.at=zM,L.prototype.chain=$M,L.prototype.commit=VM,L.prototype.next=GM,L.prototype.plant=UM,L.prototype.reverse=HM,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=KM,L.prototype.first=L.prototype.head,po&&(L.prototype[po]=WM),L}),Si=VI();za?((za.exports=Si)._=Si,ef._=Si):ct._=Si}).call(wW)})(Go,Go.exports)),Go.exports}var hr=xW();const N2=Cl(hr);function EW({cyParams:r,cyInst:e,layoutParams:t,layoutDebounce:n=50,children:a,init:i=()=>{},onCyInit:o}){const[s,l]=Se.useState(!1),u=Se.useRef(null),c=Se.useRef(null),d=Se.useRef(null),h=Se.useRef(!0),g=Se.useCallback(()=>{var y;d.current!==null&&d.current.stop(),c.current&&(d.current=c.current.layout(t),(y=d.current)==null||y.run())},[t]),p=N2.debounce(g,n);Se.useEffect(()=>{if(!u.current)return;const y=un({container:u.current,...r}),b=u.current.querySelector(".cytoscape-react-nodes-and-edges");if(b&&y.domNode({dom_container:b}),c.current=e||y,u.current&&(u.current.cy=c.current),o==null||o(c.current),i(y),u.current&&c.current){const x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth)),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`),c.current.resize(),r.zoom&&r.pan&&c.current.viewport({zoom:r.zoom,pan:r.pan})}l(!0);const w=new ResizeObserver(N2.debounce(()=>{if(u.current&&c.current){const x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`));const S=c.current.zoom()!==void 0?{zoom:c.current.zoom(),pan:c.current.pan()}:null;c.current.resize(),S&&c.current.viewport(S)}},50));return u.current&&w.observe(u.current),()=>{w.disconnect();try{y.destroy()}catch{}c.current=null,l(!1)}},[]),Se.useEffect(()=>{h.current?(h.current=!1,g()):p()},[s,t,p,g]);const E=Se.useMemo(()=>{var y;return c.current!==null?((y=Se.Children.map(a,b=>{var w;return b?Se.cloneElement(b,{key:(w=b==null?void 0:b.props)==null?void 0:w.id,cytoInstance:c.current,layout:p}):null}))==null?void 0:y.filter(Boolean))||[]:[]},[a,s,p]);return ue.jsx("div",{ref:u,className:"cytoscape-react-cy-container",style:{width:"100%",height:"100%",position:"relative",background:"transparent"},children:ue.jsx("div",{className:"cytoscape-react-nodes-and-edges",style:{pointerEvents:"none",position:"absolute",top:0,left:0,transformOrigin:"0 0",zIndex:10},children:E})})}function CW({cytoInstance:r,id:e,parent:t,label:n,children:a,layout:i,classes:o,styleCallback:s}){const l=Se.useRef(null);function u(h){if(s){const g=s(h);h.isParent()&&(h.style("shape","roundrectangle"),h.style(g))}}Se.useEffect(()=>{try{if(l.current){const h={id:e,dom:l.current};t&&(h.parent=t),n&&(h.label=n);const g=r.add({data:h,classes:o});u(g)}}catch{}return()=>{r.getElementById(e).remove()}},[l,t,n]),Se.useEffect(()=>{i();const h=r.getElementById(e);h&&h.isParent()&&u(h)},[e,a]),Se.useEffect(()=>{if(!s)return;const h=r.getElementById(e);h&&h.isParent()&&u(h)},[s]);function c(h){return Se.cloneElement(h,{cytoInstance:r,layout:i})}const d=Se.Children.map(a,c);return ue.jsx("div",{ref:l,className:"cytoscape-react-node",children:d})}const _W={name:"dagre",rankDir:"LR",fit:!1,padding:20,spacingFactor:1.3,animate:!1,nodeDimensionsIncludeLabels:!0,ranker:"network-simplex",rankSep:10,nodeSep:5,edgeSep:10,avoidOverlap:!0,edgeWeight:function(r){return 1},minLen:function(r){return 1},useSimpleEdgeFunction:!0,edgeRouting:!0,controlPoints:!0},GP={padding:20,motionBlur:!1,compound:!0,pixelRatio:"auto",zoomingEnabled:!0,userZoomingEnabled:!0,dragpan:!0,avoidOverlap:!0,panningEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,selectionType:"additive",minZoom:.01,maxZoom:1.5,autoungrabify:!0,styleEnabled:!0,hideEdgesOnViewport:!1,hideLabelsOnViewport:!0,headless:!1,touchTapThreshold:8,desktopTapThreshold:4,touchHoldDuration:500,desktopHoldDuration:1e3,autolock:!1,autounselectify:!1,wheelPanEnabled:!0,wheelPanThreshold:1,wheelPanDebounce:10,wheelAction:"pan"},WP={...GP,pixelRatio:1,motionBlur:!0,textureOnViewport:!0,wheelPanDebounce:20},SW={...WP,hideEdgesOnViewport:!0,hideLabelsOnViewport:!0},TW=({nodes:r,edges:e})=>{const{themeColor:t,edgeColor:n,direction:a,cyRef:i,callbacks:o,config:s,selectedNodeIds:l,setSelectedNodeIds:u,setSelectedEdgeId:c,setIsPerformanceMode:d,isZoomMode:h,setIsZoomMode:g,isMultiSelectMode:p,setIsMultiSelectMode:E,isDragMode:y,setIsDragMode:b,isEdgeHandlesEnabled:w,isArrayNodeMode:x}=Da(),C=Se.useRef(null),T=Se.useRef(null),S=Se.useRef(x),_=r.length>200;Se.useEffect(()=>{d(_)},[_,d]);const{edgeSep:A,rankSep:P}=Se.useMemo(()=>hq(r.length),[r.length]),{bgColor:I}=ss(t),{background:D,borderSecondary:k}=us(),M=s.backgroundColor||D,N=Se.useCallback(U=>{if(U!=null&&U.includes("gray"))return"whitesmoke";if(!U)return ht(t);switch(U){case"dark":return ht(M);case"light":return ht(k);default:return ht(U)}},[t,M,k]),z=s.colorMode==="dark",$=Se.useMemo(()=>z?N(I):"dark",[z,I,N]),q=n?N(n):$,V=Se.useMemo(()=>vq(N),[N]),Z=s.initialViewport||{pan:{x:0,y:0},zoom:.01},K=Se.useMemo(()=>({..._?SW:r.length>100?WP:GP,style:V,zoom:Z.zoom,pan:Z.pan,minZoom:s.minZoom??.01,maxZoom:s.maxZoom??1.5}),[V,Z,r.length,s.minZoom,s.maxZoom]),j=Se.useRef(!1),ee=Se.useRef();Se.useEffect(()=>()=>{clearTimeout(ee.current)},[]);const le=Se.useMemo(()=>({..._W,...a&&{rankDir:a},edgeSep:A,rankSep:P,get animate(){return j.current&&!_},animationDuration:300,animationEasing:"ease-in-out-cubic",stop:()=>{i.current&&(j.current||setTimeout(()=>{var U;(U=i.current)==null||U.fit(void 0,50)},100),clearTimeout(ee.current),ee.current=setTimeout(()=>{j.current=!0},500))}}),[a,A,P,i,_]),W=Se.useCallback(U=>{const fe=N(U||t);return{"corner-radius":50,"background-color":fe,color:fe,"border-color":fe}},[t,N]),G=Se.useCallback((U,fe,xe,ge)=>{let be={};return ge!=null&&ge.isInverted&&(ge==null?void 0:ge.source)===fe&&(be["target-arrow-shape"]="none",be["source-arrow-shape"]="triangle"),ge!=null&&ge.isEdgeAnimated?(be["line-style"]="dashed",be["line-dash-pattern"]=[32,18],be["line-dash-offset"]=0):ge!=null&&ge.isEdgeDashed?(be["line-style"]="dashed",be["line-dash-pattern"]=[],be["line-dash-offset"]=0):(be["line-style"]="solid",be["line-dash-pattern"]=[],be["line-dash-offset"]=0),a==="TB"&&(be["taxi-direction"]="downward"),a==="BT"&&(be["taxi-direction"]="upward"),a==="LR"&&(be["taxi-direction"]="rightward"),a==="RL"&&(be["taxi-direction"]="leftward"),be["line-color"]=q,be.color=q,be["target-arrow-color"]=q,be["source-arrow-color"]=q,be},[q,a]),Y=Se.useRef(r);Y.current=r;const re=Se.useRef(W);re.current=W;const de=Se.useRef(G);de.current=G,Se.useEffect(()=>{if(!i.current)return;const U=i.current,fe=()=>{U.nodes().forEach(xe=>{var ge,be;if(xe.isParent()){const Ae=Y.current.find(De=>{var Be;return((Be=De.data)==null?void 0:Be.id)===xe.id()});xe.style(re.current((be=(ge=Ae==null?void 0:Ae.data)==null?void 0:ge.viewProps)==null?void 0:be.bgColor))}})};return U.on("add",fe),()=>{U.off("add",fe)}},[]),Se.useEffect(()=>{if(!i.current)return;const U=i.current;U.nodes().forEach(fe=>{var xe,ge;if(fe.isParent()){const be=r.find(Ae=>{var De;return((De=Ae.data)==null?void 0:De.id)===fe.id()});fe.style(W((ge=(xe=be==null?void 0:be.data)==null?void 0:xe.viewProps)==null?void 0:ge.bgColor))}}),e.forEach(({data:fe})=>{const xe=U.getElementById(fe.id);xe!=null&&xe.length&&(xe.data({isEdgeAnimated:fe.isEdgeAnimated,isEdgeDashed:fe.isEdgeDashed}),xe.style(G(xe,fe.source,fe.target,fe)))})},[r,e,q,W,G]);const se=Se.useRef(s);se.current=s;const X=Se.useRef(h);X.current=h;const Q=Se.useRef(w);Q.current=w,S.current=x,Se.useEffect(()=>{if(!i.current||!i.current.container)return;const U=i.current,fe=C.current;if(!fe)return;let xe=null,ge=null,be=0,Ae=0,De=0,Be=0,Le=0;const He=Ve=>{Ve.preventDefault(),Ve.stopPropagation(),X.current||Ve.metaKey||Ve.ctrlKey?(De+=Ve.deltaY,Be=Ve.clientX,Le=Ve.clientY,ge===null&&(ge=requestAnimationFrame(()=>{ge=null;const er=se.current,$e=U.zoom(),ke=De;De=0;let ye=$e-ke*.05/100;ye=Math.max(er.minZoom??.01,Math.min(er.maxZoom??1.5,ye));const O=fe.getBoundingClientRect();U.zoom({level:ye,renderedPosition:{x:Be-O.left,y:Le-O.top}})}))):(be+=Ve.deltaX,Ae+=Ve.deltaY,xe===null&&(xe=requestAnimationFrame(()=>{xe=null;const er=U.pan(),$e=U.zoom(),ke=.35,ye=be,O=Ae;be=0,Ae=0,U.pan({x:er.x+-ye*ke/$e,y:er.y+-O*ke/$e})})))};return fe.addEventListener("wheel",He,{passive:!1}),()=>{fe.removeEventListener("wheel",He),xe!==null&&cancelAnimationFrame(xe),ge!==null&&cancelAnimationFrame(ge)}},[i.current]),Se.useEffect(()=>{i.current&&i.current.userPanningEnabled(y)},[y]),Se.useEffect(()=>{if(!i.current)return;const U=i.current;U.boxSelectionEnabled(!!p),U.selectionType(p?"additive":"single"),U.userPanningEnabled(!p&&y)},[p,y]),Se.useEffect(()=>{T.current&&(w?T.current.enableDrawMode():T.current.disableDrawMode())},[w]);const ae=Se.useRef(l);ae.current=l,Se.useEffect(()=>{if(s.disableKeyboardShortcuts)return;const U=fe=>{var ge,be;const xe=fe.target;if(!(xe.tagName==="INPUT"||xe.tagName==="TEXTAREA"||xe.isContentEditable)&&((fe.key==="z"||fe.key==="Z")&&g(!X.current),(fe.key==="m"||fe.key==="M")&&E(!p),(fe.key==="d"||fe.key==="D")&&b(!y),(fe.key==="Delete"||fe.key==="Backspace")&&ae.current.length>0)){fe.preventDefault();const Ae=ae.current.filter(Be=>Be!=="root");if(Ae.length===0)return;const De=i.current;for(const Be of Ae){const Le=(ge=De==null?void 0:De.getElementById(Be))==null?void 0:ge.data();(be=o.onNodeDelete)==null||be.call(o,Be,Le||{})}u([])}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[p,y,g,E,b,s.disableKeyboardShortcuts,o,u,i]),Se.useEffect(()=>()=>{if(i.current)try{i.current.removeAllListeners()}catch{}},[]);const te=Se.useMemo(()=>_?300:r.length>50?150:r.length>20?100:50,[r.length,_]),ce=Se.useMemo(()=>{var fe;const U=new Set;for(const xe of r)(fe=xe.data)!=null&&fe.parent&&U.add(xe.data.parent);return U},[r]),_e=Se.useMemo(()=>{var fe;const U=new Map;for(const xe of e)(fe=xe.data)!=null&&fe.source&&!U.has(xe.data.source)&&U.set(xe.data.source,xe.data);return U},[e]),ve=s.backgroundPattern||"dot";return ue.jsx(oq,{pattern:ve,backgroundColor:s.backgroundColor,children:ue.jsx(pe.Box,{ref:C,padding:0,width:"100%",height:"100%",flex:1,position:"relative",children:ue.jsxs(EW,{cyParams:K,layoutParams:le,layoutDebounce:te,onCyInit:U=>{var xe;i.current=U,(xe=o.onCyInit)==null||xe.call(o,U);let fe=null;if(U.on("zoom pan",()=>{fe===null&&(fe=requestAnimationFrame(()=>{var ge;fe=null,(ge=o.onViewportChange)==null||ge.call(o,{zoom:U.zoom(),pan:U.pan()})}))}),U.on("select","edge",ge=>{var Ae;const be=ge.target;c(be.id()),(Ae=o.onEdgeSelect)==null||Ae.call(o,be.id(),be.data())}),U.on("unselect","edge",()=>{var ge;c(null),(ge=o.onEdgeDeselect)==null||ge.call(o)}),U.on("remove","edge",ge=>{var Ae;const be=ge.target;(Ae=o.onEdgeRemove)==null||Ae.call(o,be.id(),be.data())}),U.on("tap",":parent",ge=>{var Ae;const be=ge.target;u([be.id()]),(Ae=o.onNodeSelect)==null||Ae.call(o,be.id(),be.data())}),s.edgeHandles!==!1){const ge={canConnect:(Be,Le)=>!Be.same(Le),edgeParams:(Be,Le)=>({data:{source:Be.id(),target:Le.id(),label:""}}),loopAllowed:()=>!1,hoverDelay:500,snap:!1,snapThreshold:10,snapFrequency:5,noEdgeEventsInDraw:!0,disableBrowserGestures:!0,handlePosition:"left",handleNodes:"node",handleSize:20,handleColor:t||"#0ea5e9",handleOutlineColor:"#B92020FF",handleOutlineWidth:2,handleLineType:"ghost",handleLineWidth:2,preview:!0,ghostEdgeParams:()=>({}),edgeType:()=>"flat",nodeParams:()=>({})},be=U.edgehandles(ge);T.current=be,Q.current&&be.enableDrawMode();let Ae=null,De=null;U.on("ehstart",(Be,Le)=>{De=Le;const He=Be.originalEvent||window.event;if(He!=null&&He.clientX&&(He!=null&&He.clientY))Ae={x:He.clientX,y:He.clientY};else{const Ve=Le.renderedPosition();Ae={x:Ve.x,y:Ve.y}}}),U.on("ehcancel",Be=>{if(!Ae||!De)return;const Le=Be.originalEvent||window.event,He=Le==null?void 0:Le.clientX,Ve=Le==null?void 0:Le.clientY;if(He&&Ve&&o.onNodeCreate){const Xe=Math.abs(He-Ae.x),er=Math.abs(Ve-Ae.y);if(Math.max(Xe,er)>30){const $e=U.renderer().projectIntoViewport(He,Ve);o.onNodeCreate({type:"text",sourceNodeId:De.id(),position:{x:$e[0],y:$e[1]},isArrayMode:S.current})}}Ae=null,De=null}),U.on("ehcomplete",(Be,Le,He)=>{var Ve;(Ve=o.onEdgeCreate)==null||Ve.call(o,Le.id(),He.id())}),U.on("ehstop",()=>{Ae=null,De=null})}},children:[(r||[]).map(U=>{var De,Be,Le,He,Ve,Xe,er,$e,ke;const fe=s.customViews||dq,xe=ce.has((De=U.data)==null?void 0:De.id)&&!((Be=U.data)!=null&&Be.parent),ge=xe?((Le=U.data)==null?void 0:Le.label)||((He=U.data)==null?void 0:He.headerTitle)||"Container":void 0,be=xe?fe.parentContainer:fe[U==null?void 0:U.data.type]||fe.text,Ae=_e.get((Ve=U.data)==null?void 0:Ve.id);return ue.jsx(CW,{id:(Xe=U.data)==null?void 0:Xe.id,parent:(er=U.data)==null?void 0:er.parent,label:ge,styleCallback:()=>{var ye,O;return W((O=(ye=U.data)==null?void 0:ye.viewProps)==null?void 0:O.bgColor)},children:Se.createElement(be,{...U,isInverted:Ae==null?void 0:Ae.isInverted,isParent:xe,key:`${($e=U.data)==null?void 0:$e.id}-${t}`})},(ke=U.data)==null?void 0:ke.id)}),(e||[]).map(({data:U})=>ue.jsx(gq,{id:U==null?void 0:U.id,source:U==null?void 0:U.source,target:U==null?void 0:U.target,label:U==null?void 0:U.label,isPerformanceMode:_,styleCallback:(fe,xe,ge)=>G(fe,xe,ge,U)},U==null?void 0:U.id))]})})})},RW=Se.memo(TW);var Wo=(r=>(r.TOP_DOWN="TB",r.BOTTOM_UP="BT",r.LEFT_RIGHT="LR",r.RIGHT_LEFT="RL",r.CENTER="C",r))(Wo||{});const AW=[{value:"BT",label:"Bottom to Up",icon:Dr.PiArrowUpLight,flowType:Wo.BOTTOM_UP},{value:"TB",label:"Top to Bottom",icon:Dr.PiArrowDownLight,flowType:Wo.TOP_DOWN},{value:"LR",label:"Left to Right",icon:Dr.PiArrowArcRightLight,flowType:Wo.LEFT_RIGHT},{value:"RL",label:"Right to Left",icon:Dr.PiArrowArcLeftLight,flowType:Wo.RIGHT_LEFT}],UP=()=>{const{cyRef:r,themeColor:e,direction:t,selectedNodeIds:n,setSelectedNodeIds:a,selectedEdgeId:i,setSelectedEdgeId:o,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:y,isPinned:b,setIsPinned:w,callbacks:x,config:C}=Da(),T=C.colorMode==="dark",{background:S,border:_,colorInactive:A,colorText:P,colorActive:I,darkBackgroundSecondary:D}=us(),[k,M]=Se.useState(!0),[N,z]=Se.useState(!1),[$,q]=Se.useState(!0),[V,Z]=Se.useState(!1),[K,j]=Se.useState(!1);Se.useEffect(()=>{const te=()=>q(window.innerWidth>=768);return te(),window.addEventListener("resize",te),()=>window.removeEventListener("resize",te)},[]),Se.useEffect(()=>{if(!$){M(!0);return}if(!b){M(!1);return}const te=_e=>{M(window.innerHeight-_e.clientY<=250)},ce=()=>M(!1);return window.addEventListener("mousemove",te),window.addEventListener("mouseleave",ce),()=>{window.removeEventListener("mousemove",te),window.removeEventListener("mouseleave",ce)}},[$,b]);const ee=Se.useCallback(te=>{const ce=r.current;if(!ce)return;const _e=C.minZoom??.01,ve=C.maxZoom??1.5,U=.02,fe=ce.zoomingEnabled(),xe=ce.userZoomingEnabled();ce.zoomingEnabled(!0),ce.userZoomingEnabled(!0);let ge=ce.zoom();switch(te){case"increase":ge=Math.min(ve,ge+U),ce.zoom(ge),ce.center();break;case"decrease":ge=Math.max(_e,ge-U),ce.zoom(ge),ce.center();break;case"reset":ce.fit(void 0,50);break}ce.zoomingEnabled(fe),ce.userZoomingEnabled(xe)},[r,C.minZoom,C.maxZoom]),le=k||N,W=C.renderSelectedNodeToolbar,G=n.length>0&&!!W,Y=Se.useMemo(()=>{if(!G)return[];const te=r.current;return te?n.map(ce=>{const _e=te.getElementById(ce);return _e!=null&&_e.length?{..._e.data(),isParent:_e.isParent()}:{id:ce}}):[]},[G,n,r]),re=Se.useCallback(()=>{var te;a([]),(te=x.onNodeDeselect)==null||te.call(x)},[a,x]),de=C.renderSelectedEdgeToolbar,se=!!i&&!!de,X=Se.useMemo(()=>{if(!se||!i)return null;const te=r.current;if(!te)return{id:i};const ce=te.getElementById(i);return ce!=null&&ce.length?ce.data():{id:i}},[se,i,r]),Q=Se.useCallback(()=>{var ce;o(null);const te=r.current;te&&te.edges().unselect(),(ce=x.onEdgeDeselect)==null||ce.call(x)},[o,r,x]),ae=C.renderBottomBar;return ae?ue.jsxs(ue.Fragment,{children:[G&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:W({selectedNodeIds:n,selectedNodeData:Y,onDeselect:re})}),se&&X&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:X,onDeselect:Q})}),ue.jsx(pe.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",children:ae({zoomIn:()=>ee("increase"),zoomOut:()=>ee("decrease"),resetZoom:()=>ee("reset"),direction:t,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:y,selectedNodeIds:n,selectedNodeData:Y,selectedEdgeId:i,selectedEdgeData:X,onNodeDeselect:re,onEdgeDeselect:Q,callbacks:x})})]}):ue.jsxs(ue.Fragment,{children:[G&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:W({selectedNodeIds:n,selectedNodeData:Y,onDeselect:re})}),se&&X&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:X,onDeselect:Q})}),!b&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:0,zIndex:101,w:3,children:ue.jsx(pe.Tooltip,{label:"Show Bottom Bar",placement:"top",fontSize:"xs",children:ue.jsx(pe.Flex,{align:"center",bg:S,borderColor:_,borderWidth:1,py:6,px:0,w:4,h:50,borderRadius:"15px",borderLeftRadius:0,onMouseEnter:()=>{z(!0),M(!0)},onMouseLeave:()=>z(!1),_hover:{bg:D},children:ue.jsx(pe.Icon,{ml:-1,as:Dr.PiLineVerticalBold,boxSize:5,color:_})})})}),ue.jsx(pe.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",transition:"opacity 0.3s ease-in, transform 0.3s ease",transform:le?"translateY(0)":"translateY(100%)",pointerEvents:le?"auto":"none",opacity:le?1:0,onMouseEnter:()=>{b||M(!0)},onMouseLeave:()=>{b||(M(!1),z(!1))},children:ue.jsxs(pe.Flex,{w:"100%",px:5,position:"absolute",bottom:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[ue.jsx(pe.Box,{bg:S,alignContent:"center",h:50,borderColor:_,borderWidth:1,borderRadius:"15px",children:ue.jsxs(pe.HStack,{px:2,spacing:1,children:[ue.jsx(pe.Tooltip,{label:b?"Unpin":"Pin",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Pin",icon:ue.jsx(pe.Icon,{as:b?Dr.PiPushPinFill:Dr.PiPushPin,boxSize:5}),size:"sm",variant:"ghost",color:b?e:A,onClick:()=>{const te=!b;w(te),M(te)}})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:"Zoom Out",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Zoom out",icon:ue.jsx(pe.Icon,{as:tq.HiMinus,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("decrease")})}),ue.jsx(pe.Tooltip,{label:"Zoom In",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Zoom in",icon:ue.jsx(pe.Icon,{as:hu.VscAdd,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("increase")})}),ue.jsx(pe.Tooltip,{label:"Reset Zoom",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Reset zoom",icon:ue.jsx(pe.Icon,{as:nq.GrPowerReset,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("reset")})}),!K&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:s?"Zoom Mode (z)":"Pan Mode (z)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle zoom mode",icon:ue.jsx(pe.Icon,{as:s?hu.VscZoomIn:hu.VscMove,boxSize:5}),size:"sm",variant:"ghost",color:s?e:A,onClick:()=>l(!s)})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:u?"Multi-Select On (m)":"Multi-Select Off (m)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle multi-select",icon:ue.jsx(pe.Icon,{as:hu.VscGroupByRefType,boxSize:5}),size:"sm",variant:"ghost",color:u?e:A,onClick:()=>c(!u)})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:d?"Drag Mode On (d)":"Drag Mode Off (d)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle drag mode",icon:ue.jsx(pe.Icon,{as:Dr.PiHandGrabbing,boxSize:5}),size:"sm",variant:"ghost",color:d?e:A,onClick:()=>h(!d)})}),C.edgeHandles!==!1&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:g?"Draw Mode On":"Draw Mode Off",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle draw mode",icon:ue.jsx(pe.Icon,{as:Dr.PiPencilSimpleLine,boxSize:5}),size:"sm",variant:"ghost",color:g?e:A,onClick:()=>p(!g)})})]}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:E?"List mode":"Set mode",placement:"top",fontSize:"xs",children:ue.jsx(pe.Flex,{cursor:"pointer",align:"center",onClick:()=>{var ce;const te=!E;y(te),(ce=x.onArrayModeChange)==null||ce.call(x,te)},_hover:{color:e},children:ue.jsx(pe.Text,{fontSize:"23px",color:E?e:A,children:E?"[]":"{}"})})})]}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:K?"Expand toolbar":"Collapse toolbar",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle toolbar collapse",icon:ue.jsx(pe.Icon,{as:K?Dr.PiCaretRight:Dr.PiCaretLeft,boxSize:5}),size:"sm",variant:"ghost",color:A,onClick:()=>j(!K)})})]})}),ue.jsxs(pe.Box,{position:"relative",ml:"auto",children:[ue.jsx(pe.Box,{bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",h:50,px:3,cursor:"pointer",onClick:()=>Z(!V),children:ue.jsxs(pe.Flex,{align:"center",h:"100%",children:[ue.jsx(pe.Tooltip,{label:"Flow Direction",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Direction",icon:ue.jsx(pe.Icon,{as:Dr.PiCaretUp,boxSize:4}),size:"sm",variant:"ghost",color:A})}),ue.jsx(pe.Text,{fontSize:"xs",color:T?"whiteAlpha.600":"blackAlpha.500",ml:1,children:t})]})}),V&&ue.jsxs(pe.Box,{position:"absolute",bottom:"60px",right:0,bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",p:2,zIndex:200,minW:"180px",shadow:"lg",onMouseLeave:()=>Z(!1),children:[AW.map(te=>ue.jsxs(pe.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var ce;(ce=x.onDirectionChange)==null||ce.call(x,te.value),Z(!1)},children:[ue.jsx(pe.Icon,{as:te.icon,boxSize:5,color:P}),ue.jsx(pe.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:te.label}),t===te.value&&ue.jsx(pe.Icon,{as:O1.IoCheckmark,boxSize:4,color:I})]},te.value)),ue.jsxs(pe.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var te;(te=x.onDirectionChange)==null||te.call(x,"LR"),Z(!1)},children:[ue.jsx(pe.Icon,{as:aq.TbAlignCenter,boxSize:5,color:P}),ue.jsx(pe.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:"Center"}),t==="C"&&ue.jsx(pe.Icon,{as:O1.IoCheckmark,boxSize:4,color:I})]})]})]})]})})]})};UP.displayName="BottomBar";const PW=Se.memo(UP),$l={label:"Untitled",description:"",isTask:!1,isLocked:!1},h0={id:null,type:"text",data:{...$l,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",borderColor:"transparent",borderRadius:25,borderWidth:0,boxShadow:"none",textOverflow:"ellipsis",fontWeight:"bold",textColor:"gray.800",textAlign:"center"}}},F2={id:null,type:"objectView",data:{...$l,headerTitle:null,viewProps:{width:"100%",borderWidth:2,borderRadius:25,height:"100%",justifyContent:"space-between",flexDirection:"row",textColor:"gray.900"}}},IW={id:null,type:"arrayView",data:{...$l,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",textAlign:"center",borderRadius:25,fontSize:"5xl",borderWidth:2,textOverflow:"ellipsis",wordBreak:"keep-all",fontWeight:"bold",textColor:"gray.900",placeholder:"Start Typing"}}},z2={id:null,type:"workflowStep",data:{...$l,viewProps:{width:"max-content !important",maxWidth:350,minWidth:280,height:"100%",borderRadius:15,borderWidth:3}}};let Au;const DW=new Uint8Array(16);function BW(){if(!Au&&(Au=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Au))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Au(DW)}const vt=[];for(let r=0;r<256;++r)vt.push((r+256).toString(16).slice(1));function MW(r,e=0){return vt[r[e+0]]+vt[r[e+1]]+vt[r[e+2]]+vt[r[e+3]]+"-"+vt[r[e+4]]+vt[r[e+5]]+"-"+vt[r[e+6]]+vt[r[e+7]]+"-"+vt[r[e+8]]+vt[r[e+9]]+"-"+vt[r[e+10]]+vt[r[e+11]]+vt[r[e+12]]+vt[r[e+13]]+vt[r[e+14]]+vt[r[e+15]]}const kW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$2={randomUUID:kW};function OW(r,e,t){if($2.randomUUID&&!r)return $2.randomUUID();r=r||{};const n=r.random||(r.rng||BW)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,MW(n)}const Zt=r=>typeof r=="object",HP=r=>Array.isArray(r),LW=["order","position","selected","locked","grabbed","grabbable","scratch"],Pa=r=>Object.entries(r).reduce((e,[t,n])=>(!Zt(n)&&!t.startsWith("$")&&(e[t]=n),e),{}),g0=(r,e)=>typeof r=="string"&&r.startsWith("$")?nm(r,e):Zt(r)&&!HP(r)?Object.entries(r).reduce((t,[n,a])=>(typeof a=="string"&&a.startsWith("$")&&n==="..."?(delete t["..."],t[n]={...nm(a,e),...r}):typeof a=="string"&&a.startsWith("$")?t[n]=nm(a,e):t[n]=a,t),{}):r,Xn=r=>Object.entries(r).reduce((e,[t,n])=>(Zt(n)&&t&&n&&!t.startsWith("$")&&(LW.includes(t)&&(t=t+"#"),e[t]=n),e),{}),ri=(r,e,{label:t,parent:n=void 0},a,i=null)=>(i!==null&&(Zt(i)||HP(i))&&(i=JSON.stringify(i,null,2)),{data:{parent:n,...r.data,id:e,text:t||"",label:t,code:i||null,type:r.type,description:a}}),wa=(r,e,t=null,n=null,a=null,i=!1,o=null)=>({data:{id:OW(),source:a?e:r,target:a?r:e,label:n||"",isInverted:a,isEdgeAnimated:i,parent:o}}),Ia=(r,e=[])=>{const t={},n={};let a=[];if(r)for(const[i,o]of Object.entries(r))i.startsWith("$")&&i!=="$"?t[i.slice(1)]=o:i!=="$"?n[i]=o:i==="$"&&(a=o);return{newConfig:t,updatedObject:n,arrayObject:a}},Ki=(r,e)=>{let t=F2;const{view:n,borderColor:a,borderRadius:i,bgColor:o,textColor:s,fontSize:l,stepType:u}=e;r=n||r,u?t={...z2}:r==="object"?t=F2:r==="text"?t=h0:r==="array"?t=IW:r==="workflowStep"&&(t={...z2});const c=t.data.viewProps;return t.data.viewProps={...c,borderRadius:i||(u?15:50),bgColor:o,borderColor:a,textColor:s,fontSize:l},t.data.config=e,{config:t}},os=(r,e)=>(r=e.find(n=>{var a;return((a=n.data)==null?void 0:a.id)===r||n===r})?`${r}.#`:r,r),nm=(r,{ids:e,jsnObjct:t})=>{if(typeof r=="string"&&(r!=null&&r.startsWith("$"))){const n=r.replace("$","").replace("*","");r==null||r.endsWith("*");const a=e.find(s=>s.split(".").slice(-1)[0]===n||n===s);if(!a)return r;const i=qW(a,t);return JSON.stringify(i).includes(r)?r:i||r}return r},qW=(r,e)=>{let t=r.split(".").splice(1);return t=t[t.length-1]==="#"||t[t.length-1].includes("{")?t.slice(0,-2):t,(i=>t.reduce((o,s)=>{s=s.replace("[","").replace("]","");const{arrayObject:l}=Ia(o);return o=l.length?l:o,o[s]},i))(e)};function Qi(r,e="root",t=[]){try{const{arrayObject:n}=Ia(r);n.length&&(r=n);const a=Pa(r),i=Xn(r);return Zt(r)?(hr.isArray(r)||hr.isArray(r)&&e==="root"||!hr.isArray(r)&&Object.keys(a).length||e==="root")&&t.push(e):t.push(e),Object.keys(i).length&&!hr.isArray(r)?jo({chldPth:null,itrblObjct:i,nodes:t,path:e}):hr.isArray(r)&&r.forEach((o,s)=>{const l=Pa(o),u=Xn(o),{newConfig:c,arrayObject:d}=Ia(o);let h=`${e}.${s}`;Zt(o)?Object.keys(l).length?(Qi(l,h,t),Object.keys(u).length&&!hr.isArray(o)&&jo({chldPth:h,itrblObjct:u,nodes:t,path:e})):Object.keys(u).length&&!hr.isArray(o)?jo({chldPth:h,itrblObjct:u,nodes:t,path:e}):hr.isArray(o)&&KP({chldPth:h,item:o,nodes:t,path:e}):t.push(h)}),{nodes:t}}catch{return{nodes:t}}}const jo=({chldPth:r,itrblObjct:e,nodes:t,path:n})=>Object.entries(e).forEach(([a,i],o)=>{const s=Pa(i),l=Xn(i),{newConfig:u,arrayObject:c}=Ia(i);c.length&&(i=c);let d=r?`${r}.${a}`:`${n}.${a}`;if(Zt(i)&&!hr.isArray(i)){const h=Object.keys(s).length===0;if(h&&(Ki("array",u),t.push(d)),Object.keys(s).length){const g=hr.isArray(i)?`${i.length||""}`:`{${Object.keys(i).length||""}}`;let p=d;h&&(p=`${d}.${g}`),Qi(i,p,t)}else Object.keys(l).length&&!hr.isArray(i)?jo({chldPth:d,itrblObjct:l,path:d,nodes:t}):Qi(i,d,t)}else hr.isArray(i)&&Qi(i,d,t)}),KP=({chldPth:r,item:e,nodes:t,path:n})=>e.forEach((a,i)=>{let o=`${r}.${i}`;const s=Xn(a),l=Pa(a);Zt(a)?!hr.isArray(a)&&Object.keys(l).length?Qi(a,o,t):Object.keys(s).length&&!hr.isArray(a)?jo({chldPth:o,itrblObjct:s,path:n,nodes:t}):hr.isArray(a)&&KP({chldPth:o,item:a,nodes:t,path:n}):t.push(o)});function ni(r,e="root",t=[],n=[],a="untitled",i={hideDefaultObject:!1,sprtObjctKy:!1,isCntr:!1},o={},s){if(s||(s={invrtdRtPths:[],initalObjIds:null}),!r||typeof r!="object")return{nodes:t,edges:n};const l=r;if(!s.initalObjIds){const{nodes:d}=Qi(r);s.initalObjIds={ids:d,jsnObjct:r}}let{hideDefaultObject:u,sprtObjctKy:c}=i;try{e=os(e,t);const{newConfig:d,arrayObject:h}=Ia(r),g=Object.keys(o).length>0?o:d;h.length&&(r=h);const p=Pa(r),E=Xn(r);g.collapsed===void 0&&(Object.keys(E).length>0||hr.isArray(r))&&(g.collapsed=!1);const{label:y,collapsed:b,parent:w}=g;if(!Zt(r))t.push(ri(h0,e,{label:y||e,parent:w},r,l));else if(hr.isArray(r)||hr.isArray(r)&&e==="root"){const{config:x}=Ki("array",g),C=hr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,T=e==="root"?a:`${a} ${C}`;t.push(ri(x,e,{label:y||T,parent:w},r,hr.isArray(l)?{[a]:l}:l))}else if(!hr.isArray(r)&&Object.keys(p).length||e==="root"){const{config:x}=Ki(null,g),C=e.split("."),T=C[C.length-1];let S=isNaN(Number(T))?null:Number(T)+1;const _=isNaN(Number(T))?T:C[C.length-2]+" "+S,A=e==="root"?a:_,P=r;if(y){const{config:I}=Ki("object",g);I.data.headerTitle=y,t.push(ri(I,e,{label:y||`${y} ${Object.keys(r).length}`,parent:w},p,P))}else x.data.headerTitle=A,t.push(ri(x,e,{label:y,parent:w},p,P))}return b||(Object.keys(E).length&&!hr.isArray(r)?Yo({flowConfig:i,chldPth:null,edges:n,isInverted:null,itrblObjct:E,nodes:t,path:e,newConfig:g,ctx:s}):hr.isArray(r)&&r.forEach((x,C)=>{x=g0(x,s.initalObjIds);const T=x,S=Pa(x),_=Xn(x),{newConfig:A,arrayObject:P}=Ia(x);P.length&&(x=P);const{config:I}=Ki(typeof x=="string"?"text":"array",A),{hideConfig:D,sourceLabel:k,label:M,isEdgeAnimated:N,parent:z}=A;u=u||D;const $=e==="root"&&i.isCntr,q=e.split(".").slice(0,2).join("."),V=s.invrtdRtPths.includes(q),Z=i.isCntr&&V||C%2===0&&$;let K=`${e}.${C}`;K=os(K,t),Z&&s.invrtdRtPths.push(K),Zt(x)?Object.keys(S).length&&!hr.isArray(x)?(n.push(wa(e,K,null,k,Z,N)),ni(x,K,t,n,M||C,i,A,s)):Object.keys(_).length&&!hr.isArray(x)?Yo({flowConfig:i,chldPth:K,isInverted:Z,edges:n,itrblObjct:_,nodes:t,path:e,newConfig:A,forceIsInverted:!0,ctx:s}):hr.isArray(x)?jP({flowConfig:i,chldPth:K,edges:n,isInverted:Z,item:x,nodes:t,path:e,ctx:s}):Zt(x)&&Yo({flowConfig:i,chldPth:K,isInverted:Z,edges:n,itrblObjct:[x],nodes:t,path:e,newConfig:A,ctx:s}):(n.push(wa(e,K,null,k,Z,N)),t.push(ri(I,K,{label:M||String(x),parent:z},x,T)))})),{nodes:t,edges:n}}catch{return{nodes:t,edges:n}}}const Yo=({chldPth:r,flowConfig:e,edges:t,itrblObjct:n,nodes:a,isInverted:i,path:o,newConfig:s,forceIsInverted:l=!1,ctx:u})=>{let{hideDefaultObject:c,sprtObjctKy:d}=e;return Object.entries(n).forEach(([h,g],p)=>{g=g0(g,u.initalObjIds);const E=g,y=Pa(g),b=Xn(g),{newConfig:w,arrayObject:x}=Ia(g);x.length&&(g=x),w.collapsed===void 0&&(Object.keys(b).length>0||hr.isArray(g))&&(w.collapsed=!1);const{hideConfig:C,sourceLabel:T,label:S,content:_,target:A,targetLabel:P,collapsed:I,isEdgeAnimated:D,parent:k}=w;c=c||C;const M=o==="root"&&e.isCntr,N=o.split(".").slice(0,2).join("."),z=u.invrtdRtPths.includes(N);l||(i=e.isCntr&&z||p%2===0&&M);let $=r?`${r}.${h}`:`${o}.${h}`;if($=os($,a),i&&u.invrtdRtPths.push($),A&&t.push(wa($,A,null,P,i,D)),Zt(g)&&!hr.isArray(g)){t.push(wa(o,$,null,T,i,D));const q=d||Object.keys(y).length===0;if(q){const V=_?"object":"array",{config:Z}=Ki(V,w);Z.data.headerTitle=_?S:null,a.push(ri(Z,$,{label:S||h,parent:k},y,E))}if(Object.keys(y).length&&!c&&!I){let V=$;if(q){const Z=hr.isArray(g)?` ${g.length||""}`:`{${Object.keys(g).length||""}}`;V=`${$}.${Z}`,V=os(V,a),t.push(wa($,V,null,T,i,D))}ni(g,V,a,t,S||h,e,{},u)}else Object.keys(b).length&&!hr.isArray(g)&&!I?Yo({chldPth:$,flowConfig:e,itrblObjct:b,path:$,edges:t,nodes:a,newConfig:{},isInverted:i,ctx:u}):I||ni(g,$,a,t,h,e,{},u)}else hr.isArray(g)&&!I&&(t.push(wa(o,$,null,T,i,D)),ni(g,$,a,t,h,e,{},u))})},jP=({flowConfig:r,chldPth:e,edges:t,isInverted:n,item:a,nodes:i,path:o,ctx:s})=>a.forEach((l,u)=>{let c=`${e}.${u}`;c=os(c,i);const d=l;l=g0(l,s.initalObjIds);const h=Xn(l),g=Pa(l),{newConfig:p}=Ia(l),{collapsed:E,label:y,parent:b,sourceLabel:w,isEdgeAnimated:x,content:C}=p;Zt(l)?!hr.isArray(l)&&Object.keys(g).length&&!E?(t.push(wa(o,c,null,w,n,x)),ni(l,c,i,t,u,r,p,s)):Object.keys(h).length&&!hr.isArray(l)&&!E?Yo({chldPth:c,flowConfig:r,itrblObjct:h,path:o,edges:t,nodes:i,isInverted:n,newConfig:p,ctx:s}):hr.isArray(l)&&!E&&jP({flowConfig:r,chldPth:c,edges:t,isInverted:n,item:l,nodes:i,path:o,ctx:s}):(t.push(wa(o,c,null,w,n,x)),i.push(ri(h0,c,{label:y||String(l),parent:b},l,d)))});function YP(r){let e=0,t=0,n=0;const a=(i,o)=>{if(t=Math.max(t,o),e++,i&&typeof i=="object"){const s=Array.isArray(i)?i.length:Object.keys(i).length;if(n+=s+2,Array.isArray(i))for(const l of i)a(l,o+1);else for(const l in i)i.hasOwnProperty(l)&&a(i[l],o+1)}else n+=1};return a(r,0),{lines:n,depth:t,nodes:e}}function ZP(r,e){const t=(n,a,i=null,o="")=>{if(a>0&&a%e===0&&n&&typeof n=="object")if(Array.isArray(n)){i&&o!==""&&n.length>0&&(i[o]={$:n,$collapsed:!0});return}else{if(n.$collapsed===!1)return;const s=Xn(n);if(Object.keys(s).length>0){n.$collapsed=!0;return}}if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]&&typeof n[s]=="object"&&t(n[s],a+1,n,s);else for(const s in n)n.hasOwnProperty(s)&&!s.startsWith("$")&&n[s]&&typeof n[s]=="object"&&t(n[s],a+1,n,s)};if(e>0&&r&&typeof r=="object")if(Array.isArray(r))for(let n=0;n<r.length;n++)r[n]&&typeof r[n]=="object"&&t(r[n],1,r,n);else for(const n in r)r.hasOwnProperty(n)&&!n.startsWith("$")&&r[n]&&typeof r[n]=="object"&&t(r[n],1,r,n);return r}const NW=".cytoscape-react-nodes-and-edges{position:absolute!important;top:0!important;left:0!important;z-index:10!important;pointer-events:none!important;overflow:visible!important;transform-origin:0 0!important}.cytoscape-react-node{z-index:0!important;overflow:visible!important;pointer-events:auto!important;position:absolute!important;transform-origin:0 0!important}.cytoscape-react-node input,.cytoscape-react-node textarea{pointer-events:auto!important;user-select:text!important;cursor:text!important}.cytoscape-react-edge{overflow:visible!important;pointer-events:none!important}.cytoscape-react-cy-container{width:100%!important;height:100%!important;overflow:visible!important;position:relative!important;background:transparent!important}.cytoscape-react-cy-container canvas{display:inline!important;vertical-align:baseline!important;overflow:visible!important}.cytoscape-react-cy-container>div{overflow:visible!important}";let V2=!1;function FW(){if(V2||typeof document>"u")return;const r=document.createElement("style");r.setAttribute("data-flow-sdk",""),r.textContent=NW,document.head.appendChild(r),V2=!0}const zW={nodes:[],edges:[]};function $W({json:r,title:e="untitled",nodes:t,edges:n,config:a={},callbacks:i={},className:o,style:s,showBottomBar:l=!0}){FW();const u=a.direction==="C",c=!!(t&&n),[d,h]=Se.useState(null),g=Se.useRef(e);g.current=e,Se.useEffect(()=>{if(c)return;if(!r){h(zW);return}h(null);const y=requestAnimationFrame(()=>{let b=typeof r=="string"?JSON.parse(r):r;if(a.autoCollapse){const x={minLines:800,minDepth:5,collapseEveryNLevels:3},C=a.autoCollapse===!0?x:{...x,...a.autoCollapse},{lines:T,depth:S}=YP(b);T>C.minLines&&S>C.minDepth&&(b=ZP(JSON.parse(JSON.stringify(b)),C.collapseEveryNLevels))}const w=ni(b,"root",[],[],g.current,{hideDefaultObject:!1,sprtObjctKy:!1,isCntr:u});h(w)});return()=>cancelAnimationFrame(y)},[r,e,u,a.autoCollapse]);const p=c?t:d==null?void 0:d.nodes,E=c?n:d==null?void 0:d.edges;return ue.jsx(iq,{config:a,callbacks:i,children:ue.jsx(pe.Box,{className:o,style:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",children:p?ue.jsxs(ue.Fragment,{children:[ue.jsx(RW,{nodes:p,edges:E}),l&&ue.jsx(PW,{})]}):ue.jsxs(pe.Flex,{width:"100%",height:"100%",align:"center",justify:"center",direction:"column",gap:3,children:[ue.jsx(pe.Spinner,{size:"lg",color:a.themeColor||"blue.500",speed:"0.8s"}),ue.jsx(pe.Text,{fontSize:"sm",opacity:.5,children:"Loading diagram..."})]})})})}exports.DynamicIcon=_m;exports.FlowDiagram=$W;exports.applyAutoCollapse=ZP;exports.contentObjTheme=In;exports.createFlowDiagram=ni;exports.getChakraColorHex=ht;exports.getColorVariant=W2;exports.getDarkerHexColor=Vu;exports.getJsonSize=YP;exports.useCustomColors=us;exports.useStopPropagation=U2;exports.useThemeContentColors=ss;
|
|
358
358
|
//# sourceMappingURL=index.cjs.map
|