@reventlessdev/reventless-host-shell 3.0.0-alpha.79 → 3.0.0-alpha.81

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.
@@ -1,7 +1,7 @@
1
- import{m as t,b as o,l as c,I as d,F as i,e as m,g as s,n as u,$ as f,v as p,K as g}from"./index-B9vMLj1R.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-C8lRAcSv.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-CfkhEoF5.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Bp_g55i_.js";let h=`query Geocode($text: String!) {
1
+ import{m as t,b as o,l as c,K as d,H as i,e as m,g as s,n as u,$ as f,v as p,N as g}from"./index-BlYH8sRy.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-C8lRAcSv.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-CfkhEoF5.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Bp_g55i_.js";let h=`query Geocode($text: String!) {
2
2
  geocode(text: $text) {
3
3
  label
4
4
  lat
5
5
  lng
6
6
  }
7
- }`;function $(r){return t(i(r),e=>{let n=t(o(e,"label"),c),a=t(o(e,"lat"),d),l=t(o(e,"lng"),d);if(n!==void 0&&a!==void 0&&l!==void 0)return{label:n,lat:a,lng:l}})}function b(r){return m(s(t(t(i(r),e=>o(e,"geocode")),u),[]),$)}function q(){return{search:r=>{let e=g.contents;return e!==void 0?f(e(h,p([["text",r]])).then(b),n=>Promise.resolve([])):Promise.resolve([])}}}export{$ as decodeResult,b as decodeResults,q as fromShell,h as geocodeQuery};
7
+ }`;function $(r){return t(i(r),e=>{let n=t(o(e,"label"),c),a=t(o(e,"lat"),d),l=t(o(e,"lng"),d);if(n!==void 0&&a!==void 0&&l!==void 0)return{label:n,lat:a,lng:l}})}function b(r){return m(s(t(t(i(r),e=>o(e,"geocode")),u),[]),$)}function j(){return{search:r=>{let e=g.contents;return e!==void 0?f(e(h,p([["text",r]])).then(b),n=>Promise.resolve([])):Promise.resolve([])}}}export{$ as decodeResult,b as decodeResults,j as fromShell,h as geocodeQuery};
@@ -1 +1 @@
1
- import{p as l,o as p,w as d,f as m,r as f}from"./index-B9vMLj1R.js";import{_ as c,a as t}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import{b as u,m as g,g as h}from"./GraphView.res-D01bDRV1.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-C8lRAcSv.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-CfkhEoF5.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Bp_g55i_.js";let y="dagre",i={contents:y},w=t("span",{children:"◈","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});function n(a){let o=a.source,e=l(o),r=u(o);return c("div",{children:[t(g,{nodes:r.nodes,edges:r.edges,onOpenNode:s=>p(o,e,s),layout:i.contents}),t("span",{children:d([o],void 0,"row"),style:{fontSize:"11px",opacity:"0.7"}})],style:{display:"flex",flexDirection:"column",gap:"8px"}})}let N={make:n};function V(a,o){m(a,e=>{i.contents=e}),f({id:"graph",label:"Graph",icon:w,arity:"Single",isCapable:(e,r)=>h(e),render:e=>{let r=e[0];return r!==void 0?t(n,{source:r}):null},capability:"entity-ref fields — one or more *Id/*Ids foreign keys drawn as a node-link diagram (self-referential fields form trees)"})}export{N as ModeView,y as defaultLayout,w as graphIcon,V as init,i as layoutRef};
1
+ import{p as l,o as p,w as d,f as m,r as f}from"./index-BlYH8sRy.js";import{_ as c,a as t}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import{b as u,m as g,g as h}from"./GraphView.res-z2K5bHPd.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-C8lRAcSv.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-CfkhEoF5.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Bp_g55i_.js";let y="dagre",i={contents:y},w=t("span",{children:"◈","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});function n(a){let o=a.source,e=l(o),r=u(o);return c("div",{children:[t(g,{nodes:r.nodes,edges:r.edges,onOpenNode:s=>p(o,e,s),layout:i.contents}),t("span",{children:d([o],void 0,"row"),style:{fontSize:"11px",opacity:"0.7"}})],style:{display:"flex",flexDirection:"column",gap:"8px"}})}let N={make:n};function V(a,o){m(a,e=>{i.contents=e}),f({id:"graph",label:"Graph",icon:w,arity:"Single",isCapable:(e,r)=>h(e),render:e=>{let r=e[0];return r!==void 0?t(n,{source:r}):null},capability:"entity-ref fields — one or more *Id/*Ids foreign keys drawn as a node-link diagram (self-referential fields form trees)"})}export{N as ModeView,y as defaultLayout,w as graphIcon,V as init,i as layoutRef};
@@ -1,4 +1,4 @@
1
- import{h as Pa,b as ki}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import{p as td,t as Tu,b as Nh,h as Cu,d as vi,e as on,i as rd,j as ad,k as nd,l as id,g as Hr,m as od,n as sd,q as ud,u as ld,v as fd,x as hd,f as cd,y as Su,z as Du,A as xn,B as vd,D as Gr,R as dd,S as gd,T as pd}from"./index-B9vMLj1R.js";function yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{a as Au}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";function Mh(t){return on(nd(t),e=>{let r=e[1],a=e[0],n=rd(r),i=ad(a,r,n);if(typeof i=="object")switch(i.TAG){case"KEntityId":return[a,i._0,!1];case"KArrayOfEntityIds":return[a,i._0,!0];default:return}})}function ex(t){return Mh(t).length!==0}function Lu(t,e,r){return r?on(Hr(od(Nh(t.dict,e),sd),[]),id):ud(ld(t.dict,e),[],a=>[a])}function tx(t){let e=Mh(t.schema),r=td(t),a={};r.forEach(l=>{a[l.key]=Tu(t,l)});let n=l=>l.length>8?l.slice(0,8)+"…":l,i=r.map(l=>({id:l.key,label:Tu(t,l),group:t.readModelName})),o=r.flatMap(l=>e.flatMap(f=>{let h=f[1];return Lu(l,f[0],f[2]).map(v=>{let c=Nh(a,v);return c!==void 0?{id:v,label:c,group:t.readModelName}:{id:v,label:n(v),group:Cu(h)}})})),s=vi(i.concat(o),[],(l,f)=>l.some(h=>h.id===f.id)?l:l.concat([f])),u=r.flatMap(l=>e.flatMap(f=>{let h=f[0];return Lu(l,h,f[2]).map(v=>({from:l.key,to_:v,label:Cu(h)}))}));return{nodes:s,edges:u}}function md(t){return vi(t,[],(e,r)=>{let a=r.group;return a!==void 0&&!e.includes(a)?e.concat([a]):e})}function xs(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function bd(t){if(Array.isArray(t))return t}function wd(t){if(Array.isArray(t))return xs(t)}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ed(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Oh(a.key),a)}}function Ar(t,e,r){return e&&Ed(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_s(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ import{h as Pa,b as ki}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import{p as td,t as Tu,b as Nh,h as Cu,d as vi,e as on,i as rd,j as ad,k as nd,l as id,g as Hr,m as od,n as sd,q as ud,u as ld,v as fd,x as hd,f as cd,y as Su,z as Du,A as xn,B as vd,D as Gr,R as dd,E as gd,F as pd}from"./index-BlYH8sRy.js";function yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{a as Au}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";function Mh(t){return on(nd(t),e=>{let r=e[1],a=e[0],n=rd(r),i=ad(a,r,n);if(typeof i=="object")switch(i.TAG){case"KEntityId":return[a,i._0,!1];case"KArrayOfEntityIds":return[a,i._0,!0];default:return}})}function ex(t){return Mh(t).length!==0}function Lu(t,e,r){return r?on(Hr(od(Nh(t.dict,e),sd),[]),id):ud(ld(t.dict,e),[],a=>[a])}function tx(t){let e=Mh(t.schema),r=td(t),a={};r.forEach(l=>{a[l.key]=Tu(t,l)});let n=l=>l.length>8?l.slice(0,8)+"…":l,i=r.map(l=>({id:l.key,label:Tu(t,l),group:t.readModelName})),o=r.flatMap(l=>e.flatMap(f=>{let h=f[1];return Lu(l,f[0],f[2]).map(v=>{let c=Nh(a,v);return c!==void 0?{id:v,label:c,group:t.readModelName}:{id:v,label:n(v),group:Cu(h)}})})),s=vi(i.concat(o),[],(l,f)=>l.some(h=>h.id===f.id)?l:l.concat([f])),u=r.flatMap(l=>e.flatMap(f=>{let h=f[0];return Lu(l,h,f[2]).map(v=>({from:l.key,to_:v,label:Cu(h)}))}));return{nodes:s,edges:u}}function md(t){return vi(t,[],(e,r)=>{let a=r.group;return a!==void 0&&!e.includes(a)?e.concat([a]):e})}function xs(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function bd(t){if(Array.isArray(t))return t}function wd(t){if(Array.isArray(t))return xs(t)}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ed(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Oh(a.key),a)}}function Ar(t,e,r){return e&&Ed(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_s(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw i}}}}function Rh(t,e,r){return(e=Oh(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xd(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Td(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,n,i,o,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(a=i.call(r)).done)&&(s.push(a.value),s.length!==e);u=!0);}catch(f){l=!0,n=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw n}}return s}}function Cd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(t,e){return bd(t)||Td(t,e)||_s(t,e)||Cd()}function Zn(t){return wd(t)||xd(t)||_s(t)||Sd()}function Dd(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Oh(t){var e=Dd(t,"string");return typeof e=="symbol"?e:e+""}function dt(t){"@babel/helpers - typeof";return dt=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},dt(t)}function _s(t,e){if(t){if(typeof t=="string")return xs(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xs(t,e):void 0}}var ct=typeof window>"u"?null:window,Nu=ct?ct.navigator:null;ct&&ct.document;var Ad=dt(""),Ph=dt({}),Ld=dt(function(){}),Nd=typeof HTMLElement>"u"?"undefined":dt(HTMLElement),sn=function(e){return e&&e.instanceString&&it(e.instanceString)?e.instanceString():null},Me=function(e){return e!=null&&dt(e)==Ad},it=function(e){return e!=null&&dt(e)===Ld},Je=function(e){return!Bt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},_e=function(e){return e!=null&&dt(e)===Ph&&!Je(e)&&e.constructor===Object},Md=function(e){return e!=null&&dt(e)===Ph},be=function(e){return e!=null&&dt(e)===dt(1)&&!isNaN(e)},Rd=function(e){return be(e)&&Math.floor(e)===e},Qn=function(e){if(Nd!=="undefined")return e!=null&&e instanceof HTMLElement},Bt=function(e){return un(e)||Ih(e)},un=function(e){return sn(e)==="collection"&&e._private.single},Ih=function(e){return sn(e)==="collection"&&!e._private.single},Ws=function(e){return sn(e)==="core"},kh=function(e){return sn(e)==="stylesheet"},Od=function(e){return sn(e)==="event"},br=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Pd=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Id=function(e){return _e(e)&&be(e.x1)&&be(e.x2)&&be(e.y1)&&be(e.y2)},kd=function(e){return Md(e)&&it(e.then)},Bd=function(){return Nu&&Nu.userAgent.match(/msie|trident|edge/i)},pa=function(e,r){r||(r=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 a=function(){var i=this,o=arguments,s,u=r.apply(i,o),l=a.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return a.cache={},a},Xs=pa(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),di=pa(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Bh=pa(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Mu=function(e){return br(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},dr=function(e,r){return e.slice(-1*r.length)===r},vt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Fd="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",zd="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",Vd="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",Gd="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",Ud="\\#[0-9a-fA-F]{3}",Hd="\\#[0-9a-fA-F]{6}",Fh=function(e,r){return e<r?-1:e>r?1:0},Yd=function(e,r){return-1*Fh(e,r)},Ie=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];t[o]=a[o]}}return t},qd=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,o=16;return r?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},_d=function(e){var r,a,n,i,o,s,u,l;function f(d,p,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?d+(p-d)*6*y:y<1/2?p:y<2/3?d+(p-d)*(2/3-y)*6:d}var h=new RegExp("^"+Vd+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,o=h[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=u=l=Math.round(i*255);else{var v=i<.5?i*(1+n):i+n-i*n,c=2*i-v;s=Math.round(255*f(c,v,a+1/3)),u=Math.round(255*f(c,v,a)),l=Math.round(255*f(c,v,a-1/3))}r=[s,u,l,o]}return r},Wd=function(e){var r,a=new RegExp("^"+Fd+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(s&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},Xd=function(e){return $d[e.toLowerCase()]},zh=function(e){return(Je(e)?e:null)||Xd(e)||qd(e)||Wd(e)||_d(e)},$d={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]},Vh=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(_e(o))throw Error("Tried to set map with object key");i<a.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},Gh=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(_e(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r},Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bi,Ru;function fn(){if(Ru)return Bi;Ru=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Bi=t,Bi}var Fi,Ou;function Kd(){if(Ou)return Fi;Ou=1;var t=typeof Tn=="object"&&Tn&&Tn.Object===Object&&Tn;return Fi=t,Fi}var zi,Pu;function gi(){if(Pu)return zi;Pu=1;var t=Kd(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return zi=r,zi}var Vi,Iu;function Zd(){if(Iu)return Vi;Iu=1;var t=gi(),e=function(){return t.Date.now()};return Vi=e,Vi}var Gi,ku;function Qd(){if(ku)return Gi;ku=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return Gi=e,Gi}var Ui,Bu;function Jd(){if(Bu)return Ui;Bu=1;var t=Qd(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return Ui=r,Ui}var Hi,Fu;function $s(){if(Fu)return Hi;Fu=1;var t=gi(),e=t.Symbol;return Hi=e,Hi}var Yi,zu;function jd(){if(zu)return Yi;zu=1;var t=$s(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,n=t?t.toStringTag:void 0;function i(o){var s=r.call(o,n),u=o[n];try{o[n]=void 0;var l=!0}catch{}var f=a.call(o);return l&&(s?o[n]=u:delete o[n]),f}return Yi=i,Yi}var qi,Vu;function eg(){if(Vu)return qi;Vu=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return qi=r,qi}var _i,Gu;function Uh(){if(Gu)return _i;Gu=1;var t=$s(),e=jd(),r=eg(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):r(s)}return _i=o,_i}var Wi,Uu;function tg(){if(Uu)return Wi;Uu=1;function t(e){return e!=null&&typeof e=="object"}return Wi=t,Wi}var Xi,Hu;function hn(){if(Hu)return Xi;Hu=1;var t=Uh(),e=tg(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return Xi=a,Xi}var $i,Yu;function rg(){if(Yu)return $i;Yu=1;var t=Jd(),e=fn(),r=hn(),a=NaN,n=/^[-+]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(r(l))return a;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=t(l);var h=i.test(l);return h||o.test(l)?s(l.slice(2),h?2:8):n.test(l)?a:+l}return $i=u,$i}var Ki,qu;function ag(){if(qu)return Ki;qu=1;var t=fn(),e=Zd(),r=rg(),a="Expected a function",n=Math.max,i=Math.min;function o(s,u,l){var f,h,v,c,d,p,y=0,g=!1,b=!1,m=!0;if(typeof s!="function")throw new TypeError(a);u=r(u)||0,t(l)&&(g=!!l.leading,b="maxWait"in l,v=b?n(r(l.maxWait)||0,u):v,m="trailing"in l?!!l.trailing:m);function w(I){var E=f,A=h;return f=h=void 0,y=I,c=s.apply(A,E),c}function T(I){return y=I,d=setTimeout(N,u),g?w(I):c}function D(I){var E=I-p,A=I-y,C=u-E;return b?i(C,v-A):C}function x(I){var E=I-p,A=I-y;return p===void 0||E>=u||E<0||b&&A>=v}function N(){var I=e();if(x(I))return O(I);d=setTimeout(N,D(I))}function O(I){return d=void 0,m&&f?w(I):(f=h=void 0,c)}function R(){d!==void 0&&clearTimeout(d),y=0,f=p=h=d=void 0}function P(){return d===void 0?c:O(e())}function M(){var I=e(),E=x(I);if(f=arguments,h=this,p=I,E){if(d===void 0)return T(p);if(b)return clearTimeout(d),d=setTimeout(N,u),w(p)}return d===void 0&&(d=setTimeout(N,u)),c}return M.cancel=R,M.flush=P,M}return Ki=o,Ki}var ng=ag(),cn=ln(ng),Zi=ct?ct.performance:null,Hh=Zi&&Zi.now?function(){return Zi.now()}:function(){return Date.now()},ig=(function(){if(ct){if(ct.requestAnimationFrame)return function(t){ct.requestAnimationFrame(t)};if(ct.mozRequestAnimationFrame)return function(t){ct.mozRequestAnimationFrame(t)};if(ct.webkitRequestAnimationFrame)return function(t){ct.webkitRequestAnimationFrame(t)};if(ct.msRequestAnimationFrame)return function(t){ct.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Hh())},1e3/60)}})(),Jn=function(e){return ig(e)},ir=Hh,Fr=9261,Yh=65599,sa=5381,qh=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr,a=r,n;n=e.next(),!n.done;)a=a*Yh+n.value|0;return a},$a=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Yh+e|0},Ka=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sa;return(r<<5)+r+e|0},og=function(e,r){return e*2097152+r},hr=function(e){return e[0]*2097152+e[1]},Cn=function(e,r){return[$a(e[0],r[0]),Ka(e[1],r[1])]},_u=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return qh(o,r)},Yr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return qh(o,r)},_h=function(){return sg(arguments)},sg=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Yr(n):r=Yr(n,r)}return r};function ug(t,e,r,a,n){var i=n*Math.PI/180,o=Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,s=Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a;return{x:o,y:s}}var lg=function(e,r,a,n,i,o){return{x:(e-a)*i+a,y:(r-n)*o+n}};function fg(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=ug(t.x,t.y,a,n,r),u=lg(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}var Wu=!0,hg=console.warn!=null,cg=console.trace!=null,Ks=Number.MAX_SAFE_INTEGER||9007199254740991,Wh=function(){return!0},jn=function(){return!1},Xu=function(){return 0},Zs=function(){},nt=function(e){throw new Error(e)},Xh=function(e){if(e!==void 0)Wu=!!e;else return Wu},Ke=function(e){Xh()&&(hg?console.warn(e):(console.log(e),cg&&console.trace()))},vg=function(e){return Ie({},e)},Qt=function(e){return e==null?e:Je(e)?e.slice():_e(e)?vg(e):e},dg=function(e){return e.slice()},$h=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},gg={},Kh=function(){return gg},Tt=function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var o=r[i],s=a?.[o];n[o]=s===void 0?e[o]:s}return n}},wr=function(e,r,a){for(var n=e.length-1;n>=0;n--)e[n]===r&&e.splice(n,1)},Qs=function(e){e.splice(0,e.length)},pg=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Mt=function(e,r,a){return a&&(r=Bh(a,r)),e[r]},Zt=function(e,r,a,n){a&&(r=Bh(a,r)),e[r]=n},yg=(function(){function t(){Dr(this,t),this._obj={}}return Ar(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])})(),nr=typeof Map<"u"?Map:yg,mg="undefined",bg=(function(){function t(e){if(Dr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Ar(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}])})(),Ta=(typeof Set>"u"?"undefined":dt(Set))!==mg?Set:bg,pi=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ws(e)){nt("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){nt("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new Ta,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.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),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Je(r.classes)?l=r.classes:Me(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,h=l.length;f<h;f++){var v=l[f];!v||v===""||i.classes.add(v)}this.createEmitter(),(a===void 0||a)&&this.restore();var c=r.style||r.css;c&&(Ke("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(c))},$u=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var o;_e(a)&&!Bt(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!it(n)?n:i,n=it(n)?n:function(){};for(var s=this._private.cy,u=a=Me(a)?this.filter(a):a,l=[],f=[],h={},v={},c={},d=0,p,y=this.byGroup(),g=y.nodes,b=y.edges,m=0;m<u.length;m++){var w=u[m],T=w.id();w.isNode()&&(l.unshift(w),e.bfs&&(c[T]=!0,f.push(w)),v[T]=0)}for(var D=function(){var I=e.bfs?l.shift():l.pop(),E=I.id();if(e.dfs){if(c[E])return 0;c[E]=!0,f.push(I)}var A=v[E],C=h[E],S=C!=null?C.source():null,L=C!=null?C.target():null,V=C==null?void 0:I.same(S)?L[0]:S[0],F;if(F=n(I,C,V,d++,A),F===!0)return p=I,1;if(F===!1)return 1;for(var B=I.connectedEdges().filter(function(K){return(!i||K.source().same(I))&&b.has(K)}),Y=0;Y<B.length;Y++){var q=B[Y],Q=q.connectedNodes().filter(function(K){return!K.same(I)&&g.has(K)}),$=Q.id();Q.length!==0&&!c[$]&&(Q=Q[0],l.push(Q),e.bfs&&(c[$]=!0,f.push(Q)),h[$]=q,v[$]=v[E]+1)}},x;l.length!==0&&(x=D(),!(x!==0&&x===1)););for(var N=s.collection(),O=0;O<f.length;O++){var R=f[O],P=h[R.id()];P!=null&&N.push(P),N.push(R)}return{path:s.collection(N),found:s.collection(p)}}},Za={breadthFirstSearch:$u({bfs:!0}),depthFirstSearch:$u({dfs:!0})};Za.bfs=Za.breadthFirstSearch;Za.dfs=Za.depthFirstSearch;var Fn={exports:{}},wg=Fn.exports,Ku;function Eg(){return Ku||(Ku=1,(function(t,e){(function(){var r,a,n,i,o,s,u,l,f,h,v,c,d,p,y;n=Math.floor,h=Math.min,a=function(g,b){return g<b?-1:g>b?1:0},f=function(g,b,m,w,T){var D;if(m==null&&(m=0),T==null&&(T=a),m<0)throw new Error("lo must be non-negative");for(w==null&&(w=g.length);m<w;)D=n((m+w)/2),T(b,g[D])<0?w=D:m=D+1;return[].splice.apply(g,[m,m-m].concat(b)),b},s=function(g,b,m){return m==null&&(m=a),g.push(b),p(g,0,g.length-1,m)},o=function(g,b){var m,w;return b==null&&(b=a),m=g.pop(),g.length?(w=g[0],g[0]=m,y(g,0,b)):w=m,w},l=function(g,b,m){var w;return m==null&&(m=a),w=g[0],g[0]=b,y(g,0,m),w},u=function(g,b,m){var w;return m==null&&(m=a),g.length&&m(g[0],b)<0&&(w=[g[0],b],b=w[0],g[0]=w[1],y(g,0,m)),b},i=function(g,b){var m,w,T,D,x,N;for(b==null&&(b=a),D=(function(){N=[];for(var O=0,R=n(g.length/2);0<=R?O<R:O>R;0<=R?O++:O--)N.push(O);return N}).apply(this).reverse(),x=[],w=0,T=D.length;w<T;w++)m=D[w],x.push(y(g,m,b));return x},d=function(g,b,m){var w;if(m==null&&(m=a),w=g.indexOf(b),w!==-1)return p(g,0,w,m),y(g,w,m)},v=function(g,b,m){var w,T,D,x,N;if(m==null&&(m=a),T=g.slice(0,b),!T.length)return T;for(i(T,m),N=g.slice(b),D=0,x=N.length;D<x;D++)w=N[D],u(T,w,m);return T.sort(m).reverse()},c=function(g,b,m){var w,T,D,x,N,O,R,P,M;if(m==null&&(m=a),b*10<=g.length){if(D=g.slice(0,b).sort(m),!D.length)return D;for(T=D[D.length-1],R=g.slice(b),x=0,O=R.length;x<O;x++)w=R[x],m(w,T)<0&&(f(D,w,0,null,m),D.pop(),T=D[D.length-1]);return D}for(i(g,m),M=[],N=0,P=h(b,g.length);0<=P?N<P:N>P;0<=P?++N:--N)M.push(o(g,m));return M},p=function(g,b,m,w){var T,D,x;for(w==null&&(w=a),T=g[m];m>b;){if(x=m-1>>1,D=g[x],w(T,D)<0){g[m]=D,m=x;continue}break}return g[m]=T},y=function(g,b,m){var w,T,D,x,N;for(m==null&&(m=a),T=g.length,N=b,D=g[b],w=2*b+1;w<T;)x=w+1,x<T&&!(m(g[w],g[x])<0)&&(w=x),g[b]=g[w],b=w,w=2*b+1;return g[b]=D,p(g,N,b,m)},r=(function(){g.push=s,g.pop=o,g.replace=l,g.pushpop=u,g.heapify=i,g.updateItem=d,g.nlargest=v,g.nsmallest=c;function g(b){this.cmp=b??a,this.nodes=[]}return g.prototype.push=function(b){return s(this.nodes,b,this.cmp)},g.prototype.pop=function(){return o(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},g.prototype.replace=function(b){return l(this.nodes,b,this.cmp)},g.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(b){return d(this.nodes,b,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var b;return b=new g,b.nodes=this.nodes.slice(0),b},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g})(),(function(g,b){return t.exports=b()})(this,function(){return r})}).call(wg)})(Fn)),Fn.exports}var Qi,Zu;function xg(){return Zu||(Zu=1,Qi=Eg()),Qi}var Tg=xg(),vn=ln(Tg),Cg=Tt({root:null,weight:function(e){return 1},directed:!1}),Sg={dijkstra:function(e){if(!_e(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=Cg(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=Me(n)?this.filter(n)[0]:n[0],f={},h={},v={},c=this.byGroup(),d=c.nodes,p=c.edges;p.unmergeBy(function(A){return A.isLoop()});for(var y=function(C){return f[C.id()]},g=function(C,S){f[C.id()]=S,b.updateItem(C)},b=new vn(function(A,C){return y(A)-y(C)}),m=0;m<d.length;m++){var w=d[m];f[w.id()]=w.same(l)?0:1/0,b.push(w)}for(var T=function(C,S){for(var L=(o?C.edgesTo(S):C.edgesWith(S)).intersect(p),V=1/0,F,B=0;B<L.length;B++){var Y=L[B],q=u(Y);(q<V||!F)&&(V=q,F=Y)}return{edge:F,dist:V}};b.size()>0;){var D=b.pop(),x=y(D),N=D.id();if(v[N]=x,x!==1/0)for(var O=D.neighborhood().intersect(d),R=0;R<O.length;R++){var P=O[R],M=P.id(),I=T(D,P),E=x+I.dist;E<y(P)&&(g(P,E),h[M]={node:D,edge:I.edge})}}return{distanceTo:function(C){var S=Me(C)?d.filter(C)[0]:C[0];return v[S.id()]},pathTo:function(C){var S=Me(C)?d.filter(C)[0]:C[0],L=[],V=S,F=V.id();if(S.length>0)for(L.unshift(S);h[F];){var B=h[F];L.unshift(B.edge),L.unshift(B.node),V=B.node,F=V.id()}return s.spawn(L)}}}},Dg={kruskal:function(e){e=e||function(m){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,o=new Array(i),s=a,u=function(w){for(var T=0;T<o.length;T++){var D=o[T];if(D.has(w))return T}},l=0;l<i;l++)o[l]=this.spawn(a[l]);for(var f=n.sort(function(m,w){return e(m)-e(w)}),h=0;h<f.length;h++){var v=f[h],c=v.source()[0],d=v.target()[0],p=u(c),y=u(d),g=o[p],b=o[y];p!==y&&(s.merge(v),g.merge(b),o.splice(y,1))}return s}},Ag=Tt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Lg={aStar:function(e){var r=this.cy(),a=Ag(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,u=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var l=n.id(),f=i.id(),h={},v={},c={},d=new vn(function(F,B){return v[F.id()]-v[B.id()]}),p=new Ta,y={},g={},b=function(B,Y){d.push(B),p.add(Y)},m,w,T=function(){m=d.pop(),w=m.id(),p.delete(w)},D=function(B){return p.has(B)};b(n,l),h[l]=0,v[l]=o(n);for(var x=0;d.size()>0;){if(T(),x++,w===f){for(var N=[],O=i,R=f,P=g[R];N.unshift(O),P!=null&&N.unshift(P),O=y[R],O!=null;)R=O.id(),P=g[R];return{found:!0,distance:h[w],path:this.spawn(N),steps:x}}c[w]=!0;for(var M=m._private.edges,I=0;I<M.length;I++){var E=M[I];if(this.hasElementWithId(E.id())&&!(s&&E.data("source")!==w)){var A=E.source(),C=E.target(),S=A.id()!==w?A:C,L=S.id();if(this.hasElementWithId(L)&&!c[L]){var V=h[w]+u(E);if(!D(L)){h[L]=V,v[L]=V+o(S),b(S,L),y[L]=m,g[L]=E;continue}V<h[L]&&(h[L]=V,v[L]=V+o(S),y[L]=m,g[L]=E)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},Ng=Tt({weight:function(e){return 1},directed:!1}),Mg={floydWarshall:function(e){for(var r=this.cy(),a=Ng(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),u=s.nodes,l=s.edges,f=u.length,h=f*f,v=function(q){return u.indexOf(q)},c=function(q){return u[q]},d=new Array(h),p=0;p<h;p++){var y=p%f,g=(p-y)/f;g===y?d[p]=0:d[p]=1/0}for(var b=new Array(h),m=new Array(h),w=0;w<l.length;w++){var T=l[w],D=T.source()[0],x=T.target()[0];if(D!==x){var N=v(D),O=v(x),R=N*f+O,P=o(T);if(d[R]>P&&(d[R]=P,b[R]=O,m[R]=T),!i){var M=O*f+N;!i&&d[M]>P&&(d[M]=P,b[M]=N,m[M]=T)}}}for(var I=0;I<f;I++)for(var E=0;E<f;E++)for(var A=E*f+I,C=0;C<f;C++){var S=E*f+C,L=I*f+C;d[A]+d[L]<d[S]&&(d[S]=d[A]+d[L],b[S]=b[A])}var V=function(q){return(Me(q)?r.filter(q):q)[0]},F=function(q){return v(V(q))},B={distance:function(q,Q){var $=F(q),K=F(Q);return d[$*f+K]},path:function(q,Q){var $=F(q),K=F(Q),j=c($);if($===K)return j.collection();if(b[$*f+K]==null)return r.collection();var re=r.collection(),U=$,H;for(re.merge(j);$!==K;)U=$,$=b[$*f+K],H=m[U*f+$],re.merge(H),re.merge(c($));return re}};return B}},Rg=Tt({weight:function(e){return 1},directed:!1,root:null}),Og={bellmanFord:function(e){var r=this,a=Rg(e),n=a.weight,i=a.directed,o=a.root,s=n,u=this,l=this.cy(),f=this.byGroup(),h=f.edges,v=f.nodes,c=v.length,d=new nr,p=!1,y=[];o=l.collection(o)[0],h.unmergeBy(function(ge){return ge.isLoop()});for(var g=h.length,b=function(le){var he=d.get(le.id());return he||(he={},d.set(le.id(),he)),he},m=function(le){return(Me(le)?l.$(le):le)[0]},w=function(le){return b(m(le)).dist},T=function(le){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,fe=m(le),ve=[],ye=fe;;){if(ye==null)return r.spawn();var me=b(ye),xe=me.edge,Le=me.pred;if(ve.unshift(ye[0]),ye.same(he)&&ve.length>0)break;xe!=null&&ve.unshift(xe),ye=Le}return u.spawn(ve)},D=0;D<c;D++){var x=v[D],N=b(x);x.same(o)?N.dist=0:N.dist=1/0,N.pred=null,N.edge=null}for(var O=!1,R=function(le,he,fe,ve,ye,me){var xe=ve.dist+me;xe<ye.dist&&!fe.same(ve.edge)&&(ye.dist=xe,ye.pred=le,ye.edge=fe,O=!0)},P=1;P<c;P++){O=!1;for(var M=0;M<g;M++){var I=h[M],E=I.source(),A=I.target(),C=s(I),S=b(E),L=b(A);R(E,A,I,S,L,C),i||R(A,E,I,L,S,C)}if(!O)break}if(O)for(var V=[],F=0;F<g;F++){var B=h[F],Y=B.source(),q=B.target(),Q=s(B),$=b(Y).dist,K=b(q).dist;if($+Q<K||!i&&K+Q<$)if(p||(Ke("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var j=[];$+Q<K&&j.push(Y),!i&&K+Q<$&&j.push(q);for(var re=j.length,U=0;U<re;U++){var H=j[U],_=[H];_.push(b(H).edge);for(var W=b(H).pred;_.indexOf(W)===-1;)_.push(W),_.push(b(W).edge),W=b(W).pred;_=_.slice(_.indexOf(W));for(var J=_[0].id(),te=0,de=2;de<_.length;de+=2)_[de].id()<J&&(J=_[de].id(),te=de);_=_.slice(te).concat(_.slice(0,te)),_.push(_[0]);var Te=_.map(function(ge){return ge.id()}).join(",");V.indexOf(Te)===-1&&(y.push(u.spawn(_)),V.push(Te))}}else break}return{distanceTo:w,pathTo:T,hasNegativeWeightCycle:p,negativeWeightCycles:y}}},Pg=Math.sqrt(2),Ig=function(e,r,a){a.length===0&&nt("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=r[i],u=r[o],l=a,f=l.length-1;f>=0;f--){var h=l[f],v=h[1],c=h[2];(r[v]===s&&r[c]===u||r[v]===u&&r[c]===s)&&l.splice(f,1)}for(var d=0;d<l.length;d++){var p=l[d];p[1]===u?(l[d]=p.slice(),l[d][1]=s):p[2]===u&&(l[d]=p.slice(),l[d][2]=s)}for(var y=0;y<r.length;y++)r[y]===u&&(r[y]=s);return l},Ji=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=Ig(i,e,r),a--}return r},kg={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(L){return L.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/Pg);if(i<2){nt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<o;f++){var h=n[f];l.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var v=1/0,c=[],d=new Array(i),p=new Array(i),y=new Array(i),g=function(V,F){for(var B=0;B<i;B++)F[B]=V[B]},b=0;b<=s;b++){for(var m=0;m<i;m++)p[m]=m;var w=Ji(p,l.slice(),i,u),T=w.slice();g(p,y);var D=Ji(p,w,u,2),x=Ji(y,T,u,2);D.length<=x.length&&D.length<v?(v=D.length,c=D,g(p,d)):x.length<=D.length&&x.length<v&&(v=x.length,c=x,g(y,d))}for(var N=this.spawn(c.map(function(L){return n[L[0]]})),O=this.spawn(),R=this.spawn(),P=d[0],M=0;M<d.length;M++){var I=d[M],E=a[M];I===P?O.merge(E):R.merge(E)}var A=function(V){var F=e.spawn();return V.forEach(function(B){F.merge(B),B.connectedEdges().forEach(function(Y){e.contains(Y)&&!N.contains(Y)&&F.merge(Y)})}),F},C=[A(O),A(R)],S={cut:N,components:C,partition1:O,partition2:R};return S}},ji,Bg=function(e){return{x:e.x,y:e.y}},yi=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},Zh=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},ua=function(e){return{x:e[0],y:e[1]}},Fg=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},zg=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},Vg=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,o=r;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},Gg=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=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;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));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(v,c){return v-c});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+s]:(e[h-1+s]+e[h+s])/2},Ug=function(e){return Math.PI*e/180},Sn=function(e,r){return Math.atan2(r,e)-Math.PI/2},Js=Math.log2||function(t){return Math.log(t)/Math.log(2)},js=function(e){return e>0?1:e<0?-1:0},qr=function(e,r){return Math.sqrt(kr(e,r))},kr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},Hg=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},mt=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},ha=function(e,r,a,n){return{x:mt(e.x,r.x,a.x,n),y:mt(e.y,r.y,a.y,n)}},Yg=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=qr(e,r),s={x:i.x/o,y:i.y/o};return a=a??0,n=n??a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},Qa=function(e,r,a){return Math.max(e,Math.min(a,r))},Rt=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}}},qg=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},_g=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Wg=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},Qh=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},zn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Vn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(r.length===1)a=n=i=o=r[0];else if(r.length===2)a=i=r[0],o=n=r[1];else if(r.length===4){var s=ft(r,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Qu=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},eu=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},gr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},Ju=function(e,r){return gr(e,r.x,r.y)},Jh=function(e,r){return gr(e,r.x1,r.y1)&&gr(e,r.x2,r.y2)},Xg=(ji=Math.hypot)!==null&&ji!==void 0?ji:function(t,e){return Math.sqrt(t*t+e*e)};function $g(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(N,O){return{x:N.x+O.x,y:N.y+O.y}},a=function(N,O){return{x:N.x-O.x,y:N.y-O.y}},n=function(N,O){return{x:N.x*O,y:N.y*O}},i=function(N,O){return N.x*O.y-N.y*O.x},o=function(N){var O=Xg(N.x,N.y);return O===0?{x:0,y:0}:{x:N.x/O,y:N.y/O}},s=function(N){for(var O=0,R=0;R<N.length;R++){var P=N[R],M=N[(R+1)%N.length];O+=P.x*M.y-M.x*P.y}return O/2},u=function(N,O,R,P){var M=a(O,N),I=a(P,R),E=i(M,I);if(Math.abs(E)<1e-9)return r(N,n(M,.5));var A=i(a(R,N),I)/E;return r(N,n(M,A))},l=t.map(function(x){return{x:x.x,y:x.y}});s(l)<0&&l.reverse();for(var f=l.length,h=[],v=0;v<f;v++){var c=l[v],d=l[(v+1)%f],p=a(d,c),y=o({x:p.y,y:-p.x});h.push(y)}for(var g=h.map(function(x,N){var O=r(l[N],n(x,e)),R=r(l[(N+1)%f],n(x,e));return{p1:O,p2:R}}),b=[],m=0;m<f;m++){var w=g[(m-1+f)%f],T=g[m],D=u(w.p1,w.p2,T.p1,T.p2);b.push(D)}return b}function Kg(t,e,r,a,n,i){var o=np(t,e,r,a,n),s=$g(o,i),u=Rt();return s.forEach(function(l){return Qh(u,l.x,l.y)}),u}var jh=function(e,r,a,n,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?Er(i,o):u,f=i/2,h=o/2;l=Math.min(l,f,h);var v=l!==f,c=l!==h,d;if(v){var p=a-f+l-s,y=n-h-s,g=a+f-l+s,b=y;if(d=pr(e,r,a,n,p,y,g,b,!1),d.length>0)return d}if(c){var m=a+f+s,w=n-h+l-s,T=m,D=n+h-l+s;if(d=pr(e,r,a,n,m,w,T,D,!1),d.length>0)return d}if(v){var x=a-f+l-s,N=n+h+s,O=a+f-l+s,R=N;if(d=pr(e,r,a,n,x,N,O,R,!1),d.length>0)return d}if(c){var P=a-f-s,M=n-h+l-s,I=P,E=n+h-l+s;if(d=pr(e,r,a,n,P,M,I,E,!1),d.length>0)return d}var A;{var C=a-f+l,S=n-h+l;if(A=Ua(e,r,a,n,C,S,l+s),A.length>0&&A[0]<=C&&A[1]<=S)return[A[0],A[1]]}{var L=a+f-l,V=n-h+l;if(A=Ua(e,r,a,n,L,V,l+s),A.length>0&&A[0]>=L&&A[1]<=V)return[A[0],A[1]]}{var F=a+f-l,B=n+h-l;if(A=Ua(e,r,a,n,F,B,l+s),A.length>0&&A[0]>=F&&A[1]>=B)return[A[0],A[1]]}{var Y=a-f+l,q=n+h-l;if(A=Ua(e,r,a,n,Y,q,l+s),A.length>0&&A[0]<=Y&&A[1]>=q)return[A[0],A[1]]}return[]},Zg=function(e,r,a,n,i,o,s){var u=s,l=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,o),v=Math.max(n,o);return l-u<=e&&e<=f+u&&h-u<=r&&r<=v+u},Qg=function(e,r,a,n,i,o,s,u,l){var f={x1:Math.min(a,s,i)-l,x2:Math.max(a,s,i)+l,y1:Math.min(n,u,o)-l,y2:Math.max(n,u,o)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},Jg=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-r+o)/s,l=(-r-o)/s;return[u,l]},jg=function(e,r,a,n,i){var o=1e-5;e===0&&(e=o),r/=e,a/=e,n/=e;var s,u,l,f,h,v,c,d;if(u=(3*a-r*r)/9,l=-(27*n)+r*(9*a-2*(r*r)),l/=54,s=u*u*u+l*l,i[1]=0,c=r/3,s>0){h=l+Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),v=l-Math.sqrt(s),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),i[0]=-c+h+v,c+=(h+v)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-v+h)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,s===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),d=2*Math.sqrt(u),i[0]=-c+d*Math.cos(f/3),i[2]=-c+d*Math.cos((f+2*Math.PI)/3),i[4]=-c+d*Math.cos((f+4*Math.PI)/3)},ep=function(e,r,a,n,i,o,s,u){var l=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*u+4*o*o-4*o*u+u*u,f=9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*u-6*o*o+3*o*u,h=3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*u-n*r+2*o*o+2*o*r-u*r,v=1*a*i-a*a+a*e-i*e+n*o-n*n+n*r-o*r,c=[];jg(l,f,h,v,c);for(var d=1e-7,p=[],y=0;y<6;y+=2)Math.abs(c[y+1])<d&&c[y]>=0&&c[y]<=1&&p.push(c[y]);p.push(1),p.push(0);for(var g=-1,b,m,w,T=0;T<p.length;T++)b=Math.pow(1-p[T],2)*a+2*(1-p[T])*p[T]*i+p[T]*p[T]*s,m=Math.pow(1-p[T],2)*n+2*(1-p[T])*p[T]*o+p[T]*p[T]*u,w=Math.pow(b-e,2)+Math.pow(m-r,2),g>=0?w<g&&(g=w):g=w;return g},tp=function(e,r,a,n,i,o){var s=[e-a,r-n],u=[i-a,o-n],l=u[0]*u[0]+u[1]*u[1],f=s[0]*s[0]+s[1]*s[1],h=s[0]*u[0]+s[1]*u[1],v=h*h/l;return h<0?f:v>l?(e-i)*(e-i)+(r-o)*(r-o):f-v},It=function(e,r,a){for(var n,i,o,s,u,l=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(o=a[(f+1)*2],s=a[(f+1)*2+1]):(o=a[(f+1-a.length/2)*2],s=a[(f+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)u=(e-n)/(o-n)*(s-i)+i,u>r&&l++;else continue;return l%2!==0},or=function(e,r,a,n,i,o,s,u,l){var f=new Array(a.length),h;u[0]!=null?(h=Math.atan(u[1]/u[0]),u[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=u;for(var v=Math.cos(-h),c=Math.sin(-h),d=0;d<f.length/2;d++)f[d*2]=o/2*(a[d*2]*v-a[d*2+1]*c),f[d*2+1]=s/2*(a[d*2+1]*v+a[d*2]*c),f[d*2]+=n,f[d*2+1]+=i;var p;if(l>0){var y=ti(f,-l);p=ei(y)}else p=f;return It(e,r,p)},rp=function(e,r,a,n,i,o,s,u){for(var l=new Array(a.length*2),f=0;f<u.length;f++){var h=u[f];l[f*4+0]=h.startX,l[f*4+1]=h.startY,l[f*4+2]=h.stopX,l[f*4+3]=h.stopY;var v=Math.pow(h.cx-e,2)+Math.pow(h.cy-r,2);if(v<=Math.pow(h.radius,2))return!0}return It(e,r,l)},ei=function(e){for(var r=new Array(e.length/2),a,n,i,o,s,u,l,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],i=e[h*4+2],o=e[h*4+3],h<e.length/4-1?(s=e[(h+1)*4],u=e[(h+1)*4+1],l=e[(h+1)*4+2],f=e[(h+1)*4+3]):(s=e[0],u=e[1],l=e[2],f=e[3]);var v=pr(a,n,i,o,s,u,l,f,!0);r[h*2]=v[0],r[h*2+1]=v[1]}return r},ti=function(e,r){for(var a=new Array(e.length*2),n,i,o,s,u=0;u<e.length/2;u++){n=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,f=-(o-n),h=Math.sqrt(l*l+f*f),v=l/h,c=f/h;a[u*4]=n+v*r,a[u*4+1]=i+c*r,a[u*4+2]=o+v*r,a[u*4+3]=s+c*r}return a},ap=function(e,r,a,n,i,o){var s=a-e,u=n-r;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),f=l-1;if(f<0)return[];var h=f/l;return[(a-e)*h+e,(n-r)*h+r]},Ur=function(e,r,a,n,i,o,s){return e-=i,r-=o,e/=a/2+s,r/=n/2+s,e*e+r*r<=1},Ua=function(e,r,a,n,i,o,s){var u=[a-e,n-r],l=[e-i,r-o],f=u[0]*u[0]+u[1]*u[1],h=2*(l[0]*u[0]+l[1]*u[1]),v=l[0]*l[0]+l[1]*l[1]-s*s,c=h*h-4*f*v;if(c<0)return[];var d=(-h+Math.sqrt(c))/(2*f),p=(-h-Math.sqrt(c))/(2*f),y=Math.min(d,p),g=Math.max(d,p),b=[];if(y>=0&&y<=1&&b.push(y),g>=0&&g<=1&&b.push(g),b.length===0)return[];var m=b[0]*u[0]+e,w=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[m,w];var T=b[1]*u[0]+e,D=b[1]*u[1]+r;return[m,w,T,D]}else return[m,w]},eo=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},pr=function(e,r,a,n,i,o,s,u,l){var f=e-i,h=a-e,v=s-i,c=r-o,d=n-r,p=u-o,y=v*c-p*f,g=h*c-d*f,b=p*h-v*d;if(b!==0){var m=y/b,w=g/b,T=.001,D=0-T,x=1+T;return D<=m&&m<=x&&D<=w&&w<=x?[e+m*h,r+m*d]:l?[e+m*h,r+m*d]:[]}else return y===0||g===0?eo(e,a,s)===s?[s,u]:eo(e,a,i)===i?[i,o]:eo(i,s,a)===a?[a,n]:[]:[]},np=function(e,r,a,n,i){var o=[],s=n/2,u=i/2,l=r,f=a;o.push({x:l+s*e[0],y:f+u*e[1]});for(var h=1;h<e.length/2;h++)o.push({x:l+s*e[h*2],y:f+u*e[h*2+1]});return o},Ja=function(e,r,a,n,i,o,s,u){var l=[],f,h=new Array(a.length),v=!0;o==null&&(v=!1);var c;if(v){for(var d=0;d<h.length/2;d++)h[d*2]=a[d*2]*o+n,h[d*2+1]=a[d*2+1]*s+i;if(u>0){var p=ti(h,-u);c=ei(p)}else c=h}else c=a;for(var y,g,b,m,w=0;w<c.length/2;w++)y=c[w*2],g=c[w*2+1],w<c.length/2-1?(b=c[(w+1)*2],m=c[(w+1)*2+1]):(b=c[0],m=c[1]),f=pr(e,r,n,i,y,g,b,m),f.length!==0&&l.push(f[0],f[1]);return l},ip=function(e,r,a,n,i,o,s,u,l){var f=[],h,v=new Array(a.length*2);l.forEach(function(b,m){m===0?(v[v.length-2]=b.startX,v[v.length-1]=b.startY):(v[m*4-2]=b.startX,v[m*4-1]=b.startY),v[m*4]=b.stopX,v[m*4+1]=b.stopY,h=Ua(e,r,n,i,b.cx,b.cy,b.radius),h.length!==0&&f.push(h[0],h[1])});for(var c=0;c<v.length/4;c++)h=pr(e,r,n,i,v[c*4],v[c*4+1],v[c*4+2],v[c*4+3],!1),h.length!==0&&f.push(h[0],h[1]);if(f.length>2){for(var d=[f[0],f[1]],p=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2),y=1;y<f.length/2;y++){var g=Math.pow(f[y*2]-e,2)+Math.pow(f[y*2+1]-r,2);g<=p&&(d[0]=f[y*2],d[1]=f[y*2+1],p=g)}return d}return f},Dn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),o=(i-a)/i;return o<0&&(o=1e-5),[r[0]+o*n[0],r[1]+o*n[1]]},Nt=function(e,r){var a=Ts(e,r);return a=ec(a),a},ec=function(e){for(var r,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<n;l++)r=e[2*l],a=e[2*l+1],i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);for(var f=2/(s-i),h=2/(u-o),v=0;v<n;v++)r=e[2*v]=e[2*v]*f,a=e[2*v+1]=e[2*v+1]*h,i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);if(o<-1)for(var c=0;c<n;c++)a=e[2*c+1]=e[2*c+1]+(-1-o);return e},Ts=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Er=function(e,r){return Math.min(e/4,r/4,8)},tc=function(e,r){return Math.min(e/10,r/10,8)},tu=function(){return 8},op=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Cs=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function to(t,e){function r(h){for(var v=[],c=0;c<h.length;c++){var d=h[c],p=h[(c+1)%h.length],y={x:p.x-d.x,y:p.y-d.y},g={x:-y.y,y:y.x},b=Math.sqrt(g.x*g.x+g.y*g.y);v.push({x:g.x/b,y:g.y/b})}return v}function a(h,v){var c=1/0,d=-1/0,p=kt(h),y;try{for(p.s();!(y=p.n()).done;){var g=y.value,b=g.x*v.x+g.y*v.y;c=Math.min(c,b),d=Math.max(d,b)}}catch(m){p.e(m)}finally{p.f()}return{min:c,max:d}}function n(h,v){return!(h.max<v.min||v.max<h.min)}var i=[].concat(Zn(r(t)),Zn(r(e))),o=kt(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=a(t,u),f=a(e,u);if(!n(l,f))return!1}}catch(h){o.e(h)}finally{o.f()}return!0}var sp=Tt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),up={pageRank:function(e){for(var r=sp(e),a=r.dampingFactor,n=r.precision,i=r.iterations,o=r.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,h=l.length,v=h*h,c=f.length,d=new Array(v),p=new Array(h),y=(1-a)/h,g=0;g<h;g++){for(var b=0;b<h;b++){var m=g*h+b;d[m]=0}p[g]=0}for(var w=0;w<c;w++){var T=f[w],D=T.data("source"),x=T.data("target");if(D!==x){var N=l.indexOfId(D),O=l.indexOfId(x),R=o(T),P=O*h+N;d[P]+=R,p[N]+=R}}for(var M=1/h+y,I=0;I<h;I++)if(p[I]===0)for(var E=0;E<h;E++){var A=E*h+I;d[A]=M}else for(var C=0;C<h;C++){var S=C*h+I;d[S]=d[S]/p[I]+y}for(var L=new Array(h),V=new Array(h),F,B=0;B<h;B++)L[B]=1;for(var Y=0;Y<i;Y++){for(var q=0;q<h;q++)V[q]=0;for(var Q=0;Q<h;Q++)for(var $=0;$<h;$++){var K=Q*h+$;V[Q]+=d[K]*L[$]}Hg(V),F=L,L=V,V=F;for(var j=0,re=0;re<h;re++){var U=F[re]-L[re];j+=U*U}if(j<n)break}var H={rank:function(W){return W=s.collection(W)[0],L[l.indexOf(W)]}};return H}},ju=Tt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ca={degreeCentralityNormalized:function(e){e=ju(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},v=0,c=0,d=0;d<n;d++){var p=a[d],y=p.id();e.root=p;var g=this.degreeCentrality(e);v<g.indegree&&(v=g.indegree),c<g.outdegree&&(c=g.outdegree),f[y]=g.indegree,h[y]=g.outdegree}return{indegree:function(m){return v==0?0:(Me(m)&&(m=r.filter(m)),f[m.id()]/v)},outdegree:function(m){return c===0?0:(Me(m)&&(m=r.filter(m)),h[m.id()]/c)}}}else{for(var i={},o=0,s=0;s<n;s++){var u=a[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(m){return o===0?0:(Me(m)&&(m=r.filter(m)),i[m.id()]/o)}}}},degreeCentrality:function(e){e=ju(e);var r=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,u=n.alpha;if(i=r.collection(i)[0],s){for(var c=i.connectedEdges(),d=c.filter(function(D){return D.target().same(i)&&a.has(D)}),p=c.filter(function(D){return D.source().same(i)&&a.has(D)}),y=d.length,g=p.length,b=0,m=0,w=0;w<d.length;w++)b+=o(d[w]);for(var T=0;T<p.length;T++)m+=o(p[T]);return{indegree:Math.pow(y,1-u)*Math.pow(b,u),outdegree:Math.pow(g,1-u)*Math.pow(m,u)}}else{for(var l=i.connectedEdges().intersection(a),f=l.length,h=0,v=0;v<l.length;v++)h+=o(l[v]);return{degree:Math.pow(f,1-u)*Math.pow(h,u)}}}};ca.dc=ca.degreeCentrality;ca.dcn=ca.degreeCentralityNormalised=ca.degreeCentralityNormalized;var el=Tt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),va={closenessCentralityNormalized:function(e){for(var r=el(e),a=r.harmonic,n=r.weight,i=r.directed,o=this.cy(),s={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),h=0;h<l.length;h++){for(var v=0,c=l[h],d=0;d<l.length;d++)if(h!==d){var p=f.distance(c,l[d]);a?v+=1/p:v+=p}a||(v=1/v),u<v&&(u=v),s[c.id()]=v}return{closeness:function(g){return u==0?0:(Me(g)?g=o.filter(g)[0].id():g=g.id(),s[g]/u)}}},closenessCentrality:function(e){var r=el(e),a=r.root,n=r.weight,i=r.directed,o=r.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var h=l[f];if(!h.same(a)){var v=s.distanceTo(h);o?u+=1/v:u+=v}}return o?u:1/u}};va.cc=va.closenessCentrality;va.ccn=va.closenessCentralityNormalised=va.closenessCentralityNormalized;var lp=Tt({weight:null,directed:!1}),Ss={betweennessCentrality:function(e){for(var r=lp(e),a=r.directed,n=r.weight,i=n!=null,o=this.cy(),s=this.nodes(),u={},l={},f=0,h={set:function(m,w){l[m]=w,w>f&&(f=w)},get:function(m){return l[m]}},v=0;v<s.length;v++){var c=s[v],d=c.id();a?u[d]=c.outgoers().nodes():u[d]=c.openNeighborhood().nodes(),h.set(d,0)}for(var p=function(){for(var m=s[y].id(),w=[],T={},D={},x={},N=new vn(function(Q,$){return x[Q]-x[$]}),O=0;O<s.length;O++){var R=s[O].id();T[R]=[],D[R]=0,x[R]=1/0}for(D[m]=1,x[m]=0,N.push(m);!N.empty();){var P=N.pop();if(w.push(P),i)for(var M=0;M<u[P].length;M++){var I=u[P][M],E=o.getElementById(P),A=void 0;E.edgesTo(I).length>0?A=E.edgesTo(I)[0]:A=I.edgesTo(E)[0];var C=n(A);I=I.id(),x[I]>x[P]+C&&(x[I]=x[P]+C,N.nodes.indexOf(I)<0?N.push(I):N.updateItem(I),D[I]=0,T[I]=[]),x[I]==x[P]+C&&(D[I]=D[I]+D[P],T[I].push(P))}else for(var S=0;S<u[P].length;S++){var L=u[P][S].id();x[L]==1/0&&(N.push(L),x[L]=x[P]+1),x[L]==x[P]+1&&(D[L]=D[L]+D[P],T[L].push(P))}}for(var V={},F=0;F<s.length;F++)V[s[F].id()]=0;for(;w.length>0;){for(var B=w.pop(),Y=0;Y<T[B].length;Y++){var q=T[B][Y];V[q]=V[q]+D[q]/D[B]*(1+V[B])}B!=s[y].id()&&h.set(B,h.get(B)+V[B])}},y=0;y<s.length;y++)p();var g={betweenness:function(m){var w=o.collection(m).id();return h.get(w)},betweennessNormalized:function(m){if(f==0)return 0;var w=o.collection(m).id();return h.get(w)/f}};return g.betweennessNormalised=g.betweennessNormalized,g}};Ss.bc=Ss.betweennessCentrality;var fp=Tt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),hp=function(e){return fp(e)},cp=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},vp=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},rc=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var o=0;o<r;o++)e[o*r+n]=e[o*r+n]/a}},dp=function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+s]*r[s*a+u]}return n},gp=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=dp(e,n,r);return e},pp=function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return rc(n,r),n},yp=function(e,r,a,n){for(var i=0;i<a;i++){var o=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(o!==s)return!1}return!0},mp=function(e,r,a,n){for(var i=[],o=0;o<r;o++){for(var s=[],u=0;u<r;u++)Math.round(e[o*r+u]*1e3)/1e3>0&&s.push(a[u]);s.length!==0&&i.push(n.collection(s))}return i},bp=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},wp=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&bp(e[r],e[a])&&e.splice(a,1);return e},tl=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=hp(e),o={},s=0;s<r.length;s++)o[r[s].id()]=s;for(var u=r.length,l=u*u,f=new Array(l),h,v=0;v<l;v++)f[v]=0;for(var c=0;c<a.length;c++){var d=a[c],p=o[d.source().id()],y=o[d.target().id()],g=cp(d,i.attributes);f[p*u+y]+=g,f[y*u+p]+=g}vp(f,u,i.multFactor),rc(f,u);for(var b=!0,m=0;b&&m<i.maxIterations;)b=!1,h=gp(f,u,i.expandFactor),f=pp(h,u,i.inflateFactor),yp(f,h,l,4)||(b=!0),m++;var w=mp(f,u,r,n);return w=wp(w),w},Ep={markovClustering:tl,mcl:tl},xp=function(e){return e},ac=function(e,r){return Math.abs(r-e)},rl=function(e,r,a){return e+ac(r,a)},al=function(e,r,a){return e+Math.pow(a-r,2)},Tp=function(e){return Math.sqrt(e)},Cp=function(e,r,a){return Math.max(e,ac(r,a))},Ia=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:xp,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},ya={euclidean:function(e,r,a){return e>=2?Ia(e,r,a,0,al,Tp):Ia(e,r,a,0,rl)},squaredEuclidean:function(e,r,a){return Ia(e,r,a,0,al)},manhattan:function(e,r,a){return Ia(e,r,a,0,rl)},max:function(e,r,a){return Ia(e,r,a,-1/0,Cp)}};ya["squared-euclidean"]=ya.squaredEuclidean;ya.squaredeuclidean=ya.squaredEuclidean;function mi(t,e,r,a,n,i){var o;return it(t)?o=t:o=ya[t]||ya.euclidean,e===0&&it(t)?o(n,i):o(e,r,a,n,i)}var Sp=Tt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ru=function(e){return Sp(e)},ri=function(e,r,a,n,i){var o=i!=="kMedoids",s=o?function(h){return a[h]}:function(h){return n[h](a)},u=function(v){return n[v](r)},l=a,f=r;return mi(e,n.length,s,u,l,f)},ro=function(e,r,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(r),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,o[l]=e.max(a[l]).value;for(var f=0;f<r;f++){u=[];for(var h=0;h<n;h++)u[h]=Math.random()*(o[h]-i[h])+i[h];s[f]=u}return s},nc=function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=ri(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},ic=function(e,r,a){for(var n=[],i=null,o=0;o<r.length;o++)i=r[o],a[i.id()]===e&&n.push(i);return n},Dp=function(e,r,a){return Math.abs(r-e)<=a},Ap=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var o=Math.abs(e[n][i]-r[n][i]);if(o>a)return!1}return!0},Lp=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},nl=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];Lp(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<r;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},il=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=ri("manhattan",r[i],e,a,"kMedoids");return n},Np=function(e){var r=this.cy(),a=this.nodes(),n=null,i=ru(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=ro(a,i.k,i.attributes)):dt(i.testCentroids)==="object"?u=i.testCentroids:u=ro(a,i.k,i.attributes):u=ro(a,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],s[n.id()]=nc(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var v=0;v<i.k;v++){var c=ic(v,a,s);if(c.length!==0){for(var d=i.attributes.length,p=u[v],y=new Array(d),g=new Array(d),b=0;b<d;b++){g[b]=0;for(var m=0;m<c.length;m++)n=c[m],g[b]+=i.attributes[b](n);y[b]=g[b]/c.length,Dp(y[b],p[b],i.sensitivityThreshold)||(l=!0)}u[v]=y,o[v]=r.collection(c)}}f++}return o},Mp=function(e){var r=this.cy(),a=this.nodes(),n=null,i=ru(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(dt(i.testCentroids)==="object"?s=i.testCentroids:s=nl(a,i.k)):s=nl(a,i.k);for(var h=!0,v=0;h&&v<i.maxIterations;){for(var c=0;c<a.length;c++)n=a[c],u[n.id()]=nc(n,s,i.distance,i.attributes,"kMedoids");h=!1;for(var d=0;d<s.length;d++){var p=ic(d,a,u);if(p.length!==0){f[d]=il(s[d],p,i.attributes);for(var y=0;y<p.length;y++)l=il(p[y],p,i.attributes),l<f[d]&&(f[d]=l,s[d]=p[y],h=!0);o[d]=r.collection(p)}}v++}return o},Rp=function(e,r,a,n,i){for(var o,s,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],i.m);for(var f=0;f<e.length;f++)for(var h=0;h<i.attributes.length;h++){o=0,s=0;for(var v=0;v<r.length;v++)o+=n[v][f]*i.attributes[h](r[v]),s+=n[v][f];e[f][h]=o/s}},Op=function(e,r,a,n,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var s,u,l,f=2/(i.m-1),h=0;h<a.length;h++)for(var v=0;v<n.length;v++){s=0;for(var c=0;c<a.length;c++)u=ri(i.distance,n[v],a[h],i.attributes,"cmeans"),l=ri(i.distance,n[v],a[c],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[v][h]=1/s}},Pp=function(e,r,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<r.length;l++){s=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>s&&(s=r[l][f],u=f);i[u].push(e[l])}for(var h=0;h<i.length;h++)i[h]=n.collection(i[h]);return i},ol=function(e){var r=this.cy(),a=this.nodes(),n=ru(e),i,o,s,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);s=new Array(a.length);for(var h=0;h<a.length;h++)s[h]=new Array(n.k);for(var v=0;v<a.length;v++){for(var c=0,d=0;d<n.k;d++)s[v][d]=Math.random(),c+=s[v][d];for(var p=0;p<n.k;p++)s[v][p]=s[v][p]/c}o=new Array(n.k);for(var y=0;y<n.k;y++)o[y]=new Array(n.attributes.length);l=new Array(a.length);for(var g=0;g<a.length;g++)l[g]=new Array(n.k);for(var b=!0,m=0;b&&m<n.maxIterations;)b=!1,Rp(o,a,s,l,n),Op(s,u,o,a,n),Ap(s,u,n.sensitivityThreshold)||(b=!0),m++;return i=Pp(a,s,n,r),{clusters:i,degreeOfMembership:s}},Ip={kMeans:Np,kMedoids:Mp,fuzzyCMeans:ol,fcm:ol},kp=Tt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Bp={single:"min",complete:"max"},Fp=function(e){var r=kp(e),a=Bp[r.linkage];return a!=null&&(r.linkage=a),r},sl=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(O,R){return mi(i.distance,l.length,function(P){return l[P](O)},function(P){return l[P](R)},O,R)},h=0;h<e.length;h++){var v=e[h].key,c=a[v][n[v]];c<s&&(o=v,s=c)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[o],p=r[n[o]],y;i.mode==="dendrogram"?y={left:d,right:p,key:d.key}:y={value:d.value.concat(p.value),key:d.key},e[d.index]=y,e.splice(p.index,1),r[d.key]=y;for(var g=0;g<e.length;g++){var b=e[g];d.key===b.key?u=1/0:i.linkage==="min"?(u=a[d.key][b.key],a[d.key][b.key]>a[p.key][b.key]&&(u=a[p.key][b.key])):i.linkage==="max"?(u=a[d.key][b.key],a[d.key][b.key]<a[p.key][b.key]&&(u=a[p.key][b.key])):i.linkage==="mean"?u=(a[d.key][b.key]*d.size+a[p.key][b.key]*p.size)/(d.size+p.size):i.mode==="dendrogram"?u=f(b.value,d.value):u=f(b.value[0],d.value[0]),a[d.key][b.key]=a[b.key][d.key]=u}for(var m=0;m<e.length;m++){var w=e[m].key;if(n[w]===d.key||n[w]===p.key){for(var T=w,D=0;D<e.length;D++){var x=e[D].key;a[w][x]<a[w][T]&&(T=x)}n[w]=T}e[m].index=m}return d.key=p.key=d.index=p.index=null,!0},la=function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&la(e.left,r),e.right&&la(e.right,r)))},Ds=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Ds(e.left,r),n=Ds(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},As=function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&la(e.left,n),e.right&&la(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&la(e.left,n),e.right&&la(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=As(e.left,r-1,a)),e.right&&(i=As(e.right,r-1,a)),n.concat(i))},ul=function(e){for(var r=this.cy(),a=this.nodes(),n=Fp(e),i=n.attributes,o=function(m,w){return mi(n.distance,i.length,function(T){return i[T](m)},function(T){return i[T](w)},m,w)},s=[],u=[],l=[],f=[],h=0;h<a.length;h++){var v={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};s[h]=v,f[h]=v,u[h]=[],l[h]=0}for(var c=0;c<s.length;c++)for(var d=0;d<=c;d++){var p=void 0;n.mode==="dendrogram"?p=c===d?1/0:o(s[c].value,s[d].value):p=c===d?1/0:o(s[c].value[0],s[d].value[0]),u[c][d]=p,u[d][c]=p,p<u[c][l[c]]&&(l[c]=d)}for(var y=sl(s,f,u,l,n);y;)y=sl(s,f,u,l,n);var g;return n.mode==="dendrogram"?(g=As(s[0],n.dendrogramDepth,r),n.addDendrogram&&Ds(s[0],r)):(g=new Array(s.length),s.forEach(function(b,m){b.key=b.index=null,g[m]=r.collection(b.value)})),g},zp={hierarchicalClustering:ul,hca:ul},Vp=Tt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Gp=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||nt("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||be(a)||nt("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),Vp(e)},Up=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-mi(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},Hp=function(e,r){var a=null;return r==="median"?a=Gg(e):r==="mean"?a=Vg(e):r==="min"?a=Fg(e):r==="max"?a=zg(e):a=r,a},Yp=function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},ll=function(e,r,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<a.length;u++){var l=a[u];r[i*e+l]>s&&(o=l,s=r[i*e+l])}o>0&&n.push(o)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},qp=function(e,r,a){for(var n=ll(e,r,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var u=-1,l=-1/0,f=0;f<o.length;f++){for(var h=0,v=0;v<o.length;v++)h+=r[o[v]*e+o[f]];h>l&&(u=f,l=h)}a[i]=o[u]}return n=ll(e,r,a),n},fl=function(e){for(var r=this.cy(),a=this.nodes(),n=Gp(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,u,l,f,h,v;s=a.length,u=s*s,l=new Array(u);for(var c=0;c<u;c++)l[c]=-1/0;for(var d=0;d<s;d++)for(var p=0;p<s;p++)d!==p&&(l[d*s+p]=Up(n.distance,a[d],a[p],n.attributes));f=Hp(l,n.preference);for(var y=0;y<s;y++)l[y*s+y]=f;h=new Array(u);for(var g=0;g<u;g++)h[g]=0;v=new Array(u);for(var b=0;b<u;b++)v[b]=0;for(var m=new Array(s),w=new Array(s),T=new Array(s),D=0;D<s;D++)m[D]=0,w[D]=0,T[D]=0;for(var x=new Array(s*n.minIterations),N=0;N<x.length;N++)x[N]=0;var O;for(O=0;O<n.maxIterations;O++){for(var R=0;R<s;R++){for(var P=-1/0,M=-1/0,I=-1,E=0,A=0;A<s;A++)m[A]=h[R*s+A],E=v[R*s+A]+l[R*s+A],E>=P?(M=P,P=E,I=A):E>M&&(M=E);for(var C=0;C<s;C++)h[R*s+C]=(1-n.damping)*(l[R*s+C]-P)+n.damping*m[C];h[R*s+I]=(1-n.damping)*(l[R*s+I]-M)+n.damping*m[I]}for(var S=0;S<s;S++){for(var L=0,V=0;V<s;V++)m[V]=v[V*s+S],w[V]=Math.max(0,h[V*s+S]),L+=w[V];L-=w[S],w[S]=h[S*s+S],L+=w[S];for(var F=0;F<s;F++)v[F*s+S]=(1-n.damping)*Math.min(0,L-w[F])+n.damping*m[F];v[S*s+S]=(1-n.damping)*(L-w[S])+n.damping*m[S]}for(var B=0,Y=0;Y<s;Y++){var q=v[Y*s+Y]+h[Y*s+Y]>0?1:0;x[O%n.minIterations*s+Y]=q,B+=q}if(B>0&&(O>=n.minIterations-1||O==n.maxIterations-1)){for(var Q=0,$=0;$<s;$++){T[$]=0;for(var K=0;K<n.minIterations;K++)T[$]+=x[K*s+$];(T[$]===0||T[$]===n.minIterations)&&Q++}if(Q===s)break}}for(var j=Yp(s,h,v),re=qp(s,l,j),U={},H=0;H<j.length;H++)U[j[H]]=[];for(var _=0;_<a.length;_++){var W=i[a[_].id()],J=re[W];J!=null&&U[J].push(a[_])}for(var te=new Array(j.length),de=0;de<j.length;de++)te[de]=r.collection(U[j[de]]);return te},_p={affinityPropagation:fl,ap:fl},Wp=Tt({root:void 0,directed:!1}),Xp={hierholzer:function(e){if(!_e(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Wp(e),n=a.root,i=a.directed,o=this,s=!1,u,l,f;n&&(f=Me(n)?this.filter(n)[0].id():n[0].id());var h={},v={};i?o.forEach(function(b){var m=b.id();if(b.isNode()){var w=b.indegree(!0),T=b.outdegree(!0),D=w-T,x=T-w;D==1?u?s=!0:u=m:x==1?l?s=!0:l=m:(x>1||D>1)&&(s=!0),h[m]=[],b.outgoers().forEach(function(N){N.isEdge()&&h[m].push(N.id())})}else v[m]=[void 0,b.target().id()]}):o.forEach(function(b){var m=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(u?l?s=!0:l=m:u=m),h[m]=[],b.connectedEdges().forEach(function(T){return h[m].push(T.id())})}else v[m]=[b.source().id(),b.target().id()]});var c={found:!1,trail:void 0};if(s)return c;if(l&&u)if(i){if(f&&l!=f)return c;f=l}else{if(f&&l!=f&&u!=f)return c;f||(f=l)}else f||(f=o[0].id());var d=function(m){for(var w=m,T=[m],D,x,N;h[w].length;)D=h[w].shift(),x=v[D][0],N=v[D][1],w!=N?(h[N]=h[N].filter(function(O){return O!=D}),w=N):!i&&w!=x&&(h[x]=h[x].filter(function(O){return O!=D}),w=x),T.unshift(D),T.unshift(w);return T},p=[],y=[];for(y=d(f);y.length!=1;)h[y[0]].length==0?(p.unshift(o.getElementById(y.shift())),p.unshift(o.getElementById(y.shift()))):y=d(y.shift()).concat(y);p.unshift(o.getElementById(y.shift()));for(var g in h)if(h[g].length)return c;return c.found=!0,c.trail=this.spawn(p,!0),c}},An=function(){var e=this,r={},a=0,n=0,i=[],o=[],s={},u=function(v,c){for(var d=o.length-1,p=[],y=e.spawn();o[d].x!=v||o[d].y!=c;)p.push(o.pop().edge),d--;p.push(o.pop().edge),p.forEach(function(g){var b=g.connectedNodes().intersection(e);y.merge(g),b.forEach(function(m){var w=m.id(),T=m.connectedEdges().intersection(e);y.merge(m),r[w].cutVertex?y.merge(T.filter(function(D){return D.isLoop()})):y.merge(T)})}),i.push(y)},l=function(v,c,d){v===d&&(n+=1),r[c]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(c).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(c)));else{var y,g,b,m;p.forEach(function(w){y=w.source().id(),g=w.target().id(),b=y===c?g:y,b!==d&&(m=w.id(),s[m]||(s[m]=!0,o.push({x:c,y:b,edge:w})),b in r?r[c].low=Math.min(r[c].low,r[b].id):(l(v,b,c),r[c].low=Math.min(r[c].low,r[b].low),r[c].id<=r[b].low&&(r[c].cutVertex=!0,u(c,b))))})}};e.forEach(function(h){if(h.isNode()){var v=h.id();v in r||(n=0,l(v,v),r[v].cutVertex=n>1)}});var f=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},$p={hopcroftTarjanBiconnected:An,htbc:An,htb:An,hopcroftTarjanBiconnectedComponents:An},Ln=function(){var e=this,r={},a=0,n=[],i=[],o=e.spawn(e),s=function(l){i.push(l),r[l]={index:a,low:a++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(p){var y=p.target().id();y!==l&&(y in r||s(y),r[y].explored||(r[l].low=Math.min(r[l].low,r[y].low)))}),r[l].index===r[l].low){for(var h=e.spawn();;){var v=i.pop();if(h.merge(e.getElementById(v)),r[v].low=r[l].index,r[v].explored=!0,v===l)break}var c=h.edgesWith(h),d=h.merge(c);n.push(d),o=o.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||s(l)}}),{cut:o,components:n}},Kp={tarjanStronglyConnected:Ln,tsc:Ln,tscc:Ln,tarjanStronglyConnectedComponents:Ln},oc={};[Za,Sg,Dg,Lg,Mg,Og,kg,up,ca,va,Ss,Ep,Ip,zp,_p,Xp,$p,Kp].forEach(function(t){Ie(oc,t)});/*!